Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

osgAL::SoundNode Class Reference

A placeholder for a soundstate. The transformation is updated automatically during update traversal. More...

Collaboration diagram for osgAL::SoundNode:

Collaboration graph
[legend]
List of all members.

Public Methods

 SoundNode ()
 Default constructor. More...

 SoundNode (SoundState *sound_state)
 SoundNode (const SoundNode &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 Copy constructor. More...

virtual const char * libraryName () const
virtual const char * className () const
virtual bool isSameKindAs (const osg::Object *obj) const
virtual void accept (osg::NodeVisitor &nv)
void setSoundState (SoundState *sound_state)
 Associates a soundstate with this SoundNode. More...

SoundStategetSoundState ()
 Returns a reference to to the Soundstate associated with this SoundNode. More...

void traverse (osg::NodeVisitor &nv)
 Updates the transformation of the SoundState during Cull traversal. More...

void setOccludeCallback (OccludeCallback *cb)
OccludeCallbackgetOccludeCallback ()

Protected Methods

virtual ~SoundNode ()
 Destructor. More...

SoundNode & operator= (const SoundNode &node)
 Assignment operator. More...


Protected Attributes

SoundStatem_sound_state

Private Attributes

osg::ref_ptr< OccludeCallbackm_occlude_callback
double m_last_time
double m_first_run
osg::Vec3 m_last_pos
int m_last_traversal_number

Detailed Description

A placeholder for a soundstate. The transformation is updated automatically during update traversal.

This class implements a scenegraph node has a SoundState associated to it. During cull traversal the orientation and position in world coordinates is calculated for this node and fed to the SoundSystem. This ensures that the node follows any transformation above this node.


Constructor & Destructor Documentation

osgAL::SoundNode::SoundNode  
 

Default constructor.

osgAL::SoundNode::SoundNode SoundState   sound_state
 

Constructor that also associates a sound state to this node.

osgAL::SoundNode::SoundNode const SoundNode &    copy,
const osg::CopyOp &    copyop = osg::CopyOp::SHALLOW_COPY
 

Copy constructor.

virtual osgAL::SoundNode::~SoundNode   [inline, protected, virtual]
 

Destructor.


Member Function Documentation

virtual void osgAL::SoundNode::accept osg::NodeVisitor &    nv [inline, virtual]
 

virtual const char* osgAL::SoundNode::className   const [inline, virtual]
 

OccludeCallback* osgAL::SoundNode::getOccludeCallback   [inline]
 

SoundState* osgAL::SoundNode::getSoundState   [inline]
 

Returns a reference to to the Soundstate associated with this SoundNode.

virtual bool osgAL::SoundNode::isSameKindAs const osg::Object *    obj const [inline, virtual]
 

virtual const char* osgAL::SoundNode::libraryName   const [inline, virtual]
 

SoundNode& osgAL::SoundNode::operator= const SoundNode &    node [protected]
 

Assignment operator.

void osgAL::SoundNode::setOccludeCallback OccludeCallback   cb [inline]
 

void osgAL::SoundNode::setSoundState SoundState   sound_state [inline]
 

Associates a soundstate with this SoundNode.

void osgAL::SoundNode::traverse osg::NodeVisitor &    nv
 

Updates the transformation of the SoundState during Cull traversal.


Member Data Documentation

double osgAL::SoundNode::m_first_run [private]
 

osg::Vec3 osgAL::SoundNode::m_last_pos [private]
 

double osgAL::SoundNode::m_last_time [private]
 

int osgAL::SoundNode::m_last_traversal_number [private]
 

osg::ref_ptr<OccludeCallback> osgAL::SoundNode::m_occlude_callback [private]
 

SoundState* osgAL::SoundNode::m_sound_state [protected]
 

@Todo: The SoundState should be referenced with a ref_ptr, This currently causes problem, as the soundstate, and therefore any referenced soundsources are held, until this node is deleted. Which can be by OpenSceneGraph model cache. The time of this event can be late, outside the scope of main. This causes problems with OpenAL, which for some reason reports an invalid context during the deletion of that source. Therefore, just an ordinary pointer. Memory is properly deallocated by the SoundManager, so its not really a problem.


The documentation for this class was generated from the following file:
Generated on Mon Nov 22 09:27:17 2004 for OpenSceneGraphAudioLibrary(OsgAL) by doxygen1.2.15