Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 1 - SoundSprocket / SoundSprocket Reference
SoundSprocket Functions / Creating and Managing Listeners


SSpListener_SetVelocity

You can use the SSpListener_SetVelocity function to set the velocity of a listener.

OSStatus SSpListener_SetVelocity (
SSpListenerReference inListenerReference,
const TQ3Vector3D *inVelocity);
inListenerReference
A listener reference.
inVelocity
A vector indicating the desired velocity of the listener.
function result
A result code.
DESCRIPTION
The SSpListener_SetVelocity function sets the untransformed velocity vector of the listener specified by the inListenerReference parameter to the vector specified by the inVelocity parameter. The inVelocity parameter specifies the untransformed velocity of the listener (that is, the velocity of the listener before the listener's transform is applied). The actual velocity of the listener is calculated at the time you call the SSpSource_CalcLocalization function. If you call SSpSource_CalcLocalization and then change the location of the listener (either by calling SSpListener_SetPosition or SSpListener_SetTransform) without calling SSpListener_SetVelocity, SoundSprocket will compute a velocity vector for you automatically.

A velocity is specified in listener units per second, where a listener unit is either a meter or the unit specified in a call to the SSpListener_SetMetersPerUnit function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996