osgAL::OccludeCallback Class Reference

Class to calculate occlusion between the listener and the soundsource. More...

List of all members.

Public Member Functions

 OccludeCallback (osg::Node *root)
 OccludeCallback ()
virtual osg::Object * cloneType () const
virtual osg::Object * clone (const osg::CopyOp &copyop) const
virtual const char * libraryName () const
virtual const char * className () const
float getEarDistance () const
 Returns the specified distance between the ears.
void setNearThreshold (float t)
 If the ray hit an object outstide this distance from the sound node, it is culled.
float getNearThreshold () const
void setOccludingNode (osg::Node *root)
 Set the node that will occlude the sound.
osg::Node * getOccludingNode ()
 Get the node that will occlude the sound.
const osg::Node * getOccludingNode () const
 Get in const the node that will occlude the sound.

Protected Member Functions

virtual void operator() (double distance, osg::Node *occluder, bool left_occluded, bool right_occluded)
SoundNodegetSoundNode ()

Friends

class SoundNode


Detailed Description

Class to calculate occlusion between the listener and the soundsource.

OccludeCallback is executed from a SoundNode during traversal of the scene containing the soundnode. By analyzing if the sight is free by shooting a ray from the listener towards the soundnode, a damping factor is applied to the gain of the soundstate for the current sound node.

Currently only one ray is shot from the center of the listener to the center of the soundsource, instead of one per ear.

The operator() method is executed both when the source is occluded as well as it is not. operator() implements the actually occlusion functionality.

The default one, interpolates the damping over a short timeperiod trying to avoid clicks...


Constructor & Destructor Documentation

osgAL::OccludeCallback::OccludeCallback ( osg::Node *  root  ) 

Constructor.

Parameters:
root - The intersection ray will be shot at root:s all childrens.

osgAL::OccludeCallback::OccludeCallback (  ) 

Constructor without args.


Member Function Documentation

virtual osg::Object* osgAL::OccludeCallback::cloneType (  )  const [inline, virtual]

virtual osg::Object* osgAL::OccludeCallback::clone ( const osg::CopyOp &  copyop  )  const [inline, virtual]

virtual const char* osgAL::OccludeCallback::libraryName (  )  const [inline, virtual]

virtual const char* osgAL::OccludeCallback::className (  )  const [inline, virtual]

float osgAL::OccludeCallback::getEarDistance (  )  const [inline]

Returns the specified distance between the ears.

void osgAL::OccludeCallback::setNearThreshold ( float  t  )  [inline]

If the ray hit an object outstide this distance from the sound node, it is culled.

float osgAL::OccludeCallback::getNearThreshold (  )  const [inline]

void osgAL::OccludeCallback::setOccludingNode ( osg::Node *  root  )  [inline]

Set the node that will occlude the sound.

osg::Node* osgAL::OccludeCallback::getOccludingNode (  )  [inline]

Get the node that will occlude the sound.

const osg::Node* osgAL::OccludeCallback::getOccludingNode (  )  const [inline]

Get in const the node that will occlude the sound.

virtual void osgAL::OccludeCallback::operator() ( double  distance,
osg::Node *  occluder,
bool  left_occluded,
bool  right_occluded 
) [protected, virtual]

SoundNode* osgAL::OccludeCallback::getSoundNode (  )  [inline, protected]


Friends And Related Function Documentation

friend class SoundNode [friend]


The documentation for this class was generated from the following file:
Generated on Mon Jan 22 17:11:46 2007 for osgAL by  doxygen 1.5.1