Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 1 - SoundSprocket / SoundSprocket Reference
SoundSprocket Functions / Creating and Managing 3D Sound Sources


SSpSource_SetVelocity

You can use the SSpSource_SetVelocity function to set the velocity of a sound source.

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

A velocity is specified in listener units per second.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996