Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class ConeSound

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Node
          extended by org.j3d.aviatrix3d.Leaf
              extended by org.j3d.aviatrix3d.Sound
                  extended by org.j3d.aviatrix3d.PointSound
                      extended by org.j3d.aviatrix3d.ConeSound
All Implemented Interfaces:
java.lang.Comparable, AudioUpdateListener, AudioRenderable, Cullable, LeafCullable, Renderable

public class ConeSound
extends PointSound

A ConeSound class which emits a conical sound in one direction.

By default this class is mimics a ConeSound. You must provide parameters for the direction and cone angles to make it directional. The sound will attenuate by distance based on the refDistance and maxDistance parameters.

Version:
$Revision: 1.11 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.PointSound
maxDistance, refDistance, rolloffFactor
 
Fields inherited from class org.j3d.aviatrix3d.Sound
buffer, dataChanged, enabled, format, freq, loop, paramsChanged, paused, pitch, playChanged, playing, seq, soundSource, values
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE
 
Constructor Summary
ConeSound()
          Creates a sound.
 
Method Summary
 int compareTo(ConeSound cs)
          Compares this object with the specified object for order.
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean equals(ConeSound cs)
          Compares this object with the specified object to check for equivalence.
 boolean equals(java.lang.Object o)
          Compare this object for equality to the given object.
 void getRefDistance(float[] dir)
          Retrieve the direction of the cone.
 void postRender(net.java.games.joal.AL al)
          This method is called after a node has been rendered.
 void render(net.java.games.joal.AL al, javax.vecmath.Matrix4f transform)
          This method is called to render this node.
 void setInnerAngle(float angle)
          Set the inner angle for the cone.
 void setOuterAngle(float angle)
          Set the outer angle for the cone.
 void setRefDistance(float[] dir)
          Set the direction the cone is facing.
 
Methods inherited from class org.j3d.aviatrix3d.PointSound
compareTo, equals, setMaxDistance, setRefDistance, setRolloffFactor
 
Methods inherited from class org.j3d.aviatrix3d.Sound
audioUpdated, compareTo, equals, getBounds, getCullableType, getRenderable, isEnabled, isPaused, isPlaying, isSpatialised, markBoundsDirty, paramsUpdated, pauseSound, recomputeBounds, setAudioSource, setEnabled, startSound, stopSound
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getParent, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConeSound

public ConeSound()
Creates a sound.

Method Detail

render

public void render(net.java.games.joal.AL al,
                   javax.vecmath.Matrix4f transform)
This method is called to render this node. All openGL commands needed to render the node should be executed. Any transformations needed should be added to the transformation stack premultiplied. This method must be re-entrant as it can be called from multiple places at once.

Specified by:
render in interface AudioRenderable
Overrides:
render in class PointSound
Parameters:
al - The OpenAL context to render with
transform - The transformation stack to this node

postRender

public void postRender(net.java.games.joal.AL al)
Description copied from interface: AudioRenderable
This method is called after a node has been rendered. This method must be re-entrant.

Specified by:
postRender in interface AudioRenderable
Overrides:
postRender in class PointSound
Parameters:
al - The al context to draw with

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class PointSound
Parameters:
o - The objec to be compared
Returns:
-1, 0 or 1 depending on order
Throws:
java.lang.ClassCastException - The specified object's type prevents it from being compared to this Object

equals

public boolean equals(java.lang.Object o)
Compare this object for equality to the given object.

Specified by:
equals in interface Renderable
Overrides:
equals in class PointSound
Parameters:
o - The object to be compared
Returns:
True if these represent the same values

setRefDistance

public void setRefDistance(float[] dir)
Set the direction the cone is facing.

Parameters:
dir - The direction to emit sound.

getRefDistance

public void getRefDistance(float[] dir)
Retrieve the direction of the cone.

Parameters:
dir - An array length 3 to copy the direction value into

setInnerAngle

public void setInnerAngle(float angle)
Set the inner angle for the cone.

Parameters:
angle - The inner angle

setOuterAngle

public void setOuterAngle(float angle)
Set the outer angle for the cone.

Parameters:
angle - The outer angle

compareTo

public int compareTo(ConeSound cs)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
cs - The argument instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(ConeSound cs)
Compares this object with the specified object to check for equivalence.

Parameters:
cs - The background instance to be compared
Returns:
true if the objects represent identical values

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org