Mount sound to a moving object
by Tobias B. · in Torque 3D Professional · 12/22/2009 (10:09 am) · 3 replies
Hi,
I successfully mounted headlights to my moving cars; see here:
www.torquepowered.com/community/forums/viewthread/103775.
Now I'd like to mount a sound emitter to my cars. So I went on defining an SFXEmitter
The sound plays correctly, but it remains at the initial position of the cars - so the mounting itself seems to fail.
Did anyone mount a sound successfully to a moving object?
I successfully mounted headlights to my moving cars; see here:
www.torquepowered.com/community/forums/viewthread/103775.
Now I'd like to mount a sound emitter to my cars. So I went on defining an SFXEmitter
%motorSound = new SFXEmitter(motorSound)
{
...
}and I mounted it likemyVehicleObject.mountObject( %motorSound, 1);
The sound plays correctly, but it remains at the initial position of the cars - so the mounting itself seems to fail.
Did anyone mount a sound successfully to a moving object?
#2
You'll need to create a sound profile (and a source) in your car's class.
This should work.
01/04/2010 (8:45 am)
I think the right way is to pull your car's render transform and call (each frame) setTransform() of your sfxemitter.You'll need to create a sound profile (and a source) in your car's class.
This should work.
#3
The right (and in fact very easy) way is to use ShapeBase audio:
ShapeBase audio will automatically be updated with the shape and also disappear when the shape does.
01/05/2010 (6:55 pm)
Scene graphs in Torque do not really lend themselves well to working this way (they are not so scenegraphy in fact). I actually tried to go this way some time ago and make listeners full 3D objects that are mounted to scene objects but this didn't not work well at all.The right (and in fact very easy) way is to use ShapeBase audio:
myVehicleObject.playAudio( $MyVehicleAudioSlot, MyVehicleAudioTrack );
ShapeBase audio will automatically be updated with the shape and also disappear when the shape does.
Torque Owner Tobias B.
mercatronics