Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::sound::acoustics::objects::SoundTransducer Class Reference

A class that represents a sound transducer in a virtual acoustic context. More...

#include <omSoundTransducer.h>

Inheritance diagram for om::sound::acoustics::objects::SoundTransducer:
om::sound::acoustics::objects::SoundSceneObject om::sound::acoustics::contexts::AcousticContextObject om::sound::acoustics::objects::SoundListener om::sound::acoustics::objects::SoundSource

Public Member Functions

 SoundTransducer ()
 Create a default sound transducer positioned at the origin. More...
 
 SoundTransducer (const Vector3f &newPosition, Float newRadius)
 Create a sound transducer with the specified position and radius. More...
 
const Vector3fgetPosition () const
 Return the position of this transducer. More...
 
void setPosition (const Vector3f &newPosition)
 Set the position of this transducer. More...
 
const Matrix3fgetOrientation () const
 Return the orientation of this transducer. More...
 
void setOrientation (const Matrix3f &newOrientation)
 Set the orientation of this transducer. More...
 
const Vector3fgetScale () const
 Return the scale of the transducer. More...
 
void setScale (Float newScale)
 Set the scale of the transducer uniformly for all dimensions. More...
 
void setScale (const Vector3f &newScale)
 Set the scale of the transducer. More...
 
const Transform3fgetTransform () const
 Return the transformation for this transducer between its local and parent coordinate frame. More...
 
void setTransform (const Transform3f &newTransform)
 Set the transformation for this transducer between its local and parent coordinate frame. More...
 
const Vector3fgetVelocity () const
 Return the world-space linear velocity of this tranducer in meters per second. More...
 
void setVelocity (const Vector3f &newVelocity)
 Set the world-space linear velocity of this tranducer in meters per second. More...
 
const Vector3fgetAngularVelocity () const
 Return the world-space angular velocity of this tranducer in radians per second. More...
 
void setAngularVelocity (const Vector3f &newAngularVelocity)
 Set the world-space angular velocity of this tranducer in radians per second. More...
 
Float getRadius () const
 Return the nominal radius of the transducer's spherical representation. More...
 
void setRadius (Float newRadius)
 Set the nominal radius of the transducer's spherical representation. More...
 
Size getShapeCount () const
 Return the number of shapes that this transducer has. More...
 
SoundShapegetShape (Index shapeIndex) const
 Return a pointer to the shape for this transducer at the specified index. More...
 
Bool addShape (SoundShape *newShape)
 Add a new shape to this transducer. More...
 
Bool setShape (Index shapeIndex, SoundShape *newShape)
 Set the shape for this transducer at the specified index. More...
 
Bool removeShape (Index shapeIndex)
 Remove the shape from this transducer at the specified index. More...
 
Bool removeShape (const SoundShape *shape)
 Remove the specified shape from this transducer. More...
 
void clearShapes ()
 Remove all shapes from this transducer. More...
 
Float getPriority () const
 Return a number indicating the priority for this sound transducer. More...
 
void setPriority (Float newPriority)
 Set a number indicating the priority for this sound transducer. More...
 
SampleRate getSampleRate () const
 Return the sample rate that should be used for this transducer. More...
 
void setSampleRate (SampleRate newSampleRate)
 Set the sample rate that should be used for this transducer. More...
 
DTFgetDTF () const
 Return a pointer to the optional directional transfer function for this sound source. More...
 
void setDTF (DTF *newDTF)
 Set a pointer to the optional directional transfer function for this sound transducer. More...
 
SoundTransducerFlagsgetFlags ()
 Return a reference to an object which contains boolean parameters of the sound transducer. More...
 
const SoundTransducerFlagsgetFlags () const
 Return an object which contains boolean parameters of the sound transducer. More...
 
void setFlags (const SoundTransducerFlags &newFlags)
 Set an object which contains boolean parameters of the sound transducer. More...
 
Bool flagIsSet (SoundTransducerFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this sound transducer. More...
 
void setFlag (SoundTransducerFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this sound transducer. More...
 
Bool getIsEnabled () const
 Return whether or not this source is enabled for sound propagation and rendering. More...
 
void setIsEnabled (Bool newIsEnabled)
 Set whether or not this source should be enabled for sound propagation and rendering. More...
 
- Public Member Functions inherited from om::sound::acoustics::objects::SoundSceneObject
virtual Bool addSceneObjects (SoundSceneID sceneID)
 Add internal context objects to the scene with the specified ID. More...
 
virtual Bool removeSceneObjects (SoundSceneID sceneID)
 Remove internal context objects from the scene with the specified ID. More...
 
- Public Member Functions inherited from om::sound::acoustics::contexts::AcousticContextObject
virtual ~AcousticContextObject ()
 Destory this acoustics context object. More...
 
AcousticContextgetContext () const
 Return a pointer to the acoustics context this context object is using to do simulation. More...
 
virtual Bool setContext (AcousticContext *newContext)
 Set a pointer to the acoustics context this context object should use to do simulation. More...
 
Bool clearContext ()
 Clear the previous context from this object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::sound::acoustics::contexts::AcousticContextObject
 AcousticContextObject ()
 Create a new acoustics context object that doesn't have an associated acoustics context. More...
 
 AcousticContextObject (AcousticContext *newContext)
 Create a new acoustics context object that uses the specified context for simulation. More...
 
- Protected Attributes inherited from om::sound::acoustics::contexts::AcousticContextObject
AcousticContextcontext
 A pointer to the acoustics context this object is using. More...
 

Detailed Description

A class that represents a sound transducer in a virtual acoustic context.

A transducer is an object that couples full-scale (e.g. [-1,1]) sound playback with an acoustic simulation.

Constructor & Destructor Documentation

om::sound::acoustics::objects::SoundTransducer::SoundTransducer ( )

Create a default sound transducer positioned at the origin.

om::sound::acoustics::objects::SoundTransducer::SoundTransducer ( const Vector3f newPosition,
Float  newRadius 
)

Create a sound transducer with the specified position and radius.

Member Function Documentation

const Vector3f& om::sound::acoustics::objects::SoundTransducer::getPosition ( ) const
inline

Return the position of this transducer.

This position is specifid relative to the origin of the enclosing coordinate space.

void om::sound::acoustics::objects::SoundTransducer::setPosition ( const Vector3f newPosition)
inline

Set the position of this transducer.

This position is specifid relative to the origin of the enclosing coordinate space.

const Matrix3f& om::sound::acoustics::objects::SoundTransducer::getOrientation ( ) const
inline

Return the orientation of this transducer.

void om::sound::acoustics::objects::SoundTransducer::setOrientation ( const Matrix3f newOrientation)

Set the orientation of this transducer.

const Vector3f& om::sound::acoustics::objects::SoundTransducer::getScale ( ) const
inline

Return the scale of the transducer.

void om::sound::acoustics::objects::SoundTransducer::setScale ( Float  newScale)
inline

Set the scale of the transducer uniformly for all dimensions.

void om::sound::acoustics::objects::SoundTransducer::setScale ( const Vector3f newScale)
inline

Set the scale of the transducer.

const Transform3f& om::sound::acoustics::objects::SoundTransducer::getTransform ( ) const
inline

Return the transformation for this transducer between its local and parent coordinate frame.

void om::sound::acoustics::objects::SoundTransducer::setTransform ( const Transform3f newTransform)

Set the transformation for this transducer between its local and parent coordinate frame.

This method ensures that the transducer's new orientation matrix is orthonormal.

const Vector3f& om::sound::acoustics::objects::SoundTransducer::getVelocity ( ) const
inline

Return the world-space linear velocity of this tranducer in meters per second.

void om::sound::acoustics::objects::SoundTransducer::setVelocity ( const Vector3f newVelocity)
inline

Set the world-space linear velocity of this tranducer in meters per second.

const Vector3f& om::sound::acoustics::objects::SoundTransducer::getAngularVelocity ( ) const
inline

Return the world-space angular velocity of this tranducer in radians per second.

void om::sound::acoustics::objects::SoundTransducer::setAngularVelocity ( const Vector3f newAngularVelocity)
inline

Set the world-space angular velocity of this tranducer in radians per second.

Float om::sound::acoustics::objects::SoundTransducer::getRadius ( ) const
inline

Return the nominal radius of the transducer's spherical representation.

The radius is used to indicate the best sphere that represents the tranducer. A spherical representation may be used to save computation in certain simulations.

void om::sound::acoustics::objects::SoundTransducer::setRadius ( Float  newRadius)
inline

Set the nominal radius of the transducer's spherical representation.

The radius is used to indicate the best sphere that represents the tranducer. A spherical representation may be used to save computation in certain simulations.

Size om::sound::acoustics::objects::SoundTransducer::getShapeCount ( ) const
inline

Return the number of shapes that this transducer has.

SoundShape* om::sound::acoustics::objects::SoundTransducer::getShape ( Index  shapeIndex) const
inline

Return a pointer to the shape for this transducer at the specified index.

Bool om::sound::acoustics::objects::SoundTransducer::addShape ( SoundShape newShape)

Add a new shape to this transducer.

The method fails if the new shape pointer is NULL.

Bool om::sound::acoustics::objects::SoundTransducer::setShape ( Index  shapeIndex,
SoundShape newShape 
)
inline

Set the shape for this transducer at the specified index.

The method returns whether or not the operation was successful. The method fails if the new shape pointer is NULL.

Bool om::sound::acoustics::objects::SoundTransducer::removeShape ( Index  shapeIndex)

Remove the shape from this transducer at the specified index.

The method returns whether or not the operation was successful. The method fails if the specified index is out of bounds.

Bool om::sound::acoustics::objects::SoundTransducer::removeShape ( const SoundShape shape)

Remove the specified shape from this transducer.

Returns
whether or not the shape was successfully found and removed.
void om::sound::acoustics::objects::SoundTransducer::clearShapes ( )

Remove all shapes from this transducer.

Float om::sound::acoustics::objects::SoundTransducer::getPriority ( ) const
inline

Return a number indicating the priority for this sound transducer.

The range of valid priorities is user defined. The sound propagation system can apply source level of detail approaches to the sources in a scene with the lowest priorities. The default priority is 0.

void om::sound::acoustics::objects::SoundTransducer::setPriority ( Float  newPriority)
inline

Set a number indicating the priority for this sound transducer.

The range of valid priorities is user defined. The sound propagation system can apply source level of detail approaches to the sources in a scene with the lowest priorities. The default priority is 0.

SampleRate om::sound::acoustics::objects::SoundTransducer::getSampleRate ( ) const
inline

Return the sample rate that should be used for this transducer.

This sample rate is only used if the transducer's flags enable it. Otherwise, the global sample rate is used.

void om::sound::acoustics::objects::SoundTransducer::setSampleRate ( SampleRate  newSampleRate)
inline

Set the sample rate that should be used for this transducer.

This sample rate is only used if the transducer's flags enable it. Otherwise, the global sample rate is used.

DTF* om::sound::acoustics::objects::SoundTransducer::getDTF ( ) const
inline

Return a pointer to the optional directional transfer function for this sound source.

Sound emitted or received by the transducer is affected by this transfer function in a directionally-dependent manner.

void om::sound::acoustics::objects::SoundTransducer::setDTF ( DTF newDTF)
inline

Set a pointer to the optional directional transfer function for this sound transducer.

Sound emitted or received by the transducer is affected by this transfer function in a directionally-dependent manner.

SoundTransducerFlags& om::sound::acoustics::objects::SoundTransducer::getFlags ( )
inline

Return a reference to an object which contains boolean parameters of the sound transducer.

const SoundTransducerFlags& om::sound::acoustics::objects::SoundTransducer::getFlags ( ) const
inline

Return an object which contains boolean parameters of the sound transducer.

void om::sound::acoustics::objects::SoundTransducer::setFlags ( const SoundTransducerFlags newFlags)
inline

Set an object which contains boolean parameters of the sound transducer.

Bool om::sound::acoustics::objects::SoundTransducer::flagIsSet ( SoundTransducerFlags::Flag  flag) const
inline

Return whether or not the specified boolan flag is set for this sound transducer.

void om::sound::acoustics::objects::SoundTransducer::setFlag ( SoundTransducerFlags::Flag  flag,
Bool  newIsSet = true 
)
inline

Set whether or not the specified boolan flag is set for this sound transducer.

Bool om::sound::acoustics::objects::SoundTransducer::getIsEnabled ( ) const
inline

Return whether or not this source is enabled for sound propagation and rendering.

Sources are enabled by default but can be disabled if no audio is being played for a source or if a source is not needed. This can increase the performance in scenes with large numbers of source that might not all be active at any given time.

void om::sound::acoustics::objects::SoundTransducer::setIsEnabled ( Bool  newIsEnabled)
inline

Set whether or not this source should be enabled for sound propagation and rendering.

Sources are enabled by default but can be disabled if no audio is being played for a source or if a source is not needed. This can increase the performance in scenes with large numbers of source that might not all be active at any given time.


The documentation for this class was generated from the following file: