Class Soundscape
- java.lang.Object
-
- javax.media.j3d.SceneGraphObject
-
- javax.media.j3d.Node
-
- javax.media.j3d.Leaf
-
- javax.media.j3d.Soundscape
-
public class Soundscape extends Leaf
The Soundscape Leaf Node defines the attributes that characterize the listener's environment as it pertains to sound. This node defines an application region and an associated aural attribute component object that controls reverberation and atmospheric properties that affect sound source rendering. Multiple Soundscape nodes can be included in a single scene graph.The Soundscape application region, different from a Sound node's scheduling region, is used to select which Soundscape (and thus which aural attribute object) is to be applied to the sounds being rendered. This selection is based on the position of the ViewPlatform (i.e., the listener), not the position of the sound.
It will be common that multiple Soundscape regions are contained within a scene graph. For example, two Soundscape regions within a single space the listener can move about: a region with a large open area on the right, and a smaller more constricted, less reverberant area on the left. The rever- beration attributes for these two regions could be set to approximate their physical differences so that active sounds are rendered differently depending on which region the listener is in.
-
-
Field Summary
Fields Modifier and Type Field Description static intALLOW_APPLICATION_BOUNDS_READFor Soundscape component objects, specifies that this object allows read access to its application boundsstatic intALLOW_APPLICATION_BOUNDS_WRITEFor Soundscape component objects, specifies that this object allows write access to its application boundsstatic intALLOW_ATTRIBUTES_READFor Soundscape component objects, specifies that this object allows the reading of it's aural attributes informationstatic intALLOW_ATTRIBUTES_WRITEFor Soundscape component objects, specifies that this object allows the writing of it's aural attribute information-
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
-
Constructor Summary
Constructors Constructor Description Soundscape()Constructs and initializes a new Sound node using following defaults: application region: null (no active region) aural attributes: null (uses default aural attributes)Soundscape(Bounds region, AuralAttributes attributes)Constructs and initializes a new Sound node using specified parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodecloneNode(boolean forceDuplicate)Creates a new instance of the node.voidduplicateNode(Node originalNode, boolean forceDuplicate)Copies all node information fromoriginalNodeinto the current node.BoundingLeafgetApplicationBoundingLeaf()Retrieves the Soundscape node's application bounding leaf.BoundsgetApplicationBounds()Retrieves the Soundscape node's application bounds.AuralAttributesgetAuralAttributes()Retrieve reference of Aural AttributesvoidsetApplicationBoundingLeaf(BoundingLeaf region)Set the Soundscape's application region to the specified bounding leaf.voidsetApplicationBounds(Bounds region)Set the Soundscape's application region to the specified bounds specified in local coordinates of this leaf node.voidsetAuralAttributes(AuralAttributes attributes)Set a set of aural attributes for this SoundscapevoidupdateNodeReferences(NodeReferenceTable referenceTable)Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call tocloneTree.-
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
-
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
-
-
-
-
Field Detail
-
ALLOW_APPLICATION_BOUNDS_READ
public static final int ALLOW_APPLICATION_BOUNDS_READ
For Soundscape component objects, specifies that this object allows read access to its application bounds- See Also:
- Constant Field Values
-
ALLOW_APPLICATION_BOUNDS_WRITE
public static final int ALLOW_APPLICATION_BOUNDS_WRITE
For Soundscape component objects, specifies that this object allows write access to its application bounds- See Also:
- Constant Field Values
-
ALLOW_ATTRIBUTES_READ
public static final int ALLOW_ATTRIBUTES_READ
For Soundscape component objects, specifies that this object allows the reading of it's aural attributes information- See Also:
- Constant Field Values
-
ALLOW_ATTRIBUTES_WRITE
public static final int ALLOW_ATTRIBUTES_WRITE
For Soundscape component objects, specifies that this object allows the writing of it's aural attribute information- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Soundscape
public Soundscape()
Constructs and initializes a new Sound node using following defaults:- application region: null (no active region)
- aural attributes: null (uses default aural attributes)
-
Soundscape
public Soundscape(Bounds region, AuralAttributes attributes)
Constructs and initializes a new Sound node using specified parameters- Parameters:
region- application regionattributes- array of aural attribute component objects
-
-
Method Detail
-
setApplicationBounds
public void setApplicationBounds(Bounds region)
Set the Soundscape's application region to the specified bounds specified in local coordinates of this leaf node. The aural attributes associated with this Soundscape are used to render the active sounds when this application region intersects the ViewPlatform's activation volume. The getApplicationBounds method returns a new Bounds object. This region is used when the application bounding leaf is null.- Parameters:
region- the bounds that contains the Soundscape's new application region.- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getApplicationBounds
public Bounds getApplicationBounds()
Retrieves the Soundscape node's application bounds.- Returns:
- this Soundscape's application bounds information
- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setApplicationBoundingLeaf
public void setApplicationBoundingLeaf(BoundingLeaf region)
Set the Soundscape's application region to the specified bounding leaf. When set to a value other than null, this overrides the application bounds object.- Parameters:
region- the bounding leaf node used to specify the Soundscape node's new application region.- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getApplicationBoundingLeaf
public BoundingLeaf getApplicationBoundingLeaf()
Retrieves the Soundscape node's application bounding leaf.- Returns:
- this Soundscape's application bounding leaf information
- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setAuralAttributes
public void setAuralAttributes(AuralAttributes attributes)
Set a set of aural attributes for this Soundscape- Parameters:
attributes- aural attributes- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getAuralAttributes
public AuralAttributes getAuralAttributes()
Retrieve reference of Aural Attributes- Returns:
- reference to aural attributes
- Throws:
CapabilityNotSetException- if appropriate capability is not set and this object is part of live or compiled scene graph
-
cloneNode
public Node cloneNode(boolean forceDuplicate)
Creates a new instance of the node. This routine is called bycloneTreeto duplicate the current node.- Overrides:
cloneNodein classNode- Parameters:
forceDuplicate- when set totrue, causes theduplicateOnCloneTreeflag to be ignored. Whenfalse, the value of each node'sduplicateOnCloneTreevariable determines whether NodeComponent data is duplicated or copied.- See Also:
Node.cloneTree(),Node.cloneNode(boolean),Node.duplicateNode(javax.media.j3d.Node, boolean),NodeComponent.setDuplicateOnCloneTree(boolean)
-
duplicateNode
public void duplicateNode(Node originalNode, boolean forceDuplicate)
Copies all node information fromoriginalNodeinto the current node. This method is called from thecloneNodemethod which is, in turn, called by thecloneTreemethod.For any
NodeComponentobjects contained by the object being duplicated, eachNodeComponentobject'sduplicateOnCloneTreevalue is used to determine whether theNodeComponentshould be duplicated in the new node or if just a reference to the current node should be placed in the new node. This flag can be overridden by setting theforceDuplicateparameter in thecloneTreemethod totrue.
NOTE: Applications should not call this method directly. It should only be called by the cloneNode method.- Overrides:
duplicateNodein classNode- Parameters:
originalNode- the original node to duplicate.forceDuplicate- when set totrue, causes theduplicateOnCloneTreeflag to be ignored. Whenfalse, the value of each node'sduplicateOnCloneTreevariable determines whether NodeComponent data is duplicated or copied.- Throws:
java.lang.ClassCastException- if originalNode is not an instance ofSoundscape- See Also:
Node.cloneTree(),Node.cloneNode(boolean),NodeComponent.setDuplicateOnCloneTree(boolean)
-
updateNodeReferences
public void updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call tocloneTree. This method is called bycloneTreeafter all nodes in the sub-graph have been duplicated. The cloned Leaf node's method will be called and the Leaf node can then look up any object references by using thegetNewObjectReferencemethod found in theNodeReferenceTableobject. If a match is found, a reference to the corresponding object in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original object is returned depending on the value of theallowDanglingReferencesparameter passed in thecloneTreecall.NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.
- Overrides:
updateNodeReferencesin classSceneGraphObject- Parameters:
referenceTable- a NodeReferenceTableObject that contains thegetNewObjectReferencemethod needed to search for new object instances.- See Also:
NodeReferenceTable,Node.cloneTree(),DanglingReferenceException
-
-