![Logo](../../rorlogo.png) |
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
32 #include <OgreScriptLoader.h>
34 #define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigOnce ( (_ACTOR_), (_TRIG_) )
35 #define SOUND_START(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigStart ( (_ACTOR_), (_TRIG_) )
36 #define SOUND_STOP(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigStop ( (_ACTOR_), (_TRIG_) )
37 #define SOUND_TOGGLE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigToggle ( (_ACTOR_), (_TRIG_) )
38 #define SOUND_KILL(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigKill ( (_ACTOR_), (_TRIG_) )
39 #define SOUND_GET_STATE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->getTrigState( (_ACTOR_), (_TRIG_) )
40 #define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_) App::GetSoundScriptManager()->modulate ( (_ACTOR_), (_MOD_), (_VALUE_) )
302 void parseScript(Ogre::DataStreamPtr& stream,
const Ogre::String& groupName);
320 void trigKill (
int actor_id,
int trig,
int linkType =
SL_DEFAULT,
int linkItemID = -1);
324 void modulate (
int actor_id,
int mod,
float value,
int linkType =
SL_DEFAULT,
int linkItemID=-1);
329 void setCamera(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity);
334 void update(
float dt_sec);
352 std::map <Ogre::String, SoundScriptTemplatePtr>
templates;
357 std::array<SoundScriptInstancePtr, SS_MAX_TRIG* MAX_INSTANCES_PER_GROUP>
trigs;
360 std::array<SoundScriptInstancePtr, SS_MAX_MOD* MAX_INSTANCES_PER_GROUP>
pitches;
363 std::array<SoundScriptInstancePtr, SS_MAX_MOD* MAX_INSTANCES_PER_GROUP>
gains;
367 std::map <int, std::map <int, std::map <int, std::map <int, bool > > > >
state_map;
378 #define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_)
379 #define SOUND_START(_ACTOR_, _TRIG_)
380 #define SOUND_STOP(_ACTOR_, _TRIG_)
381 #define SOUND_TOGGLE(_ACTOR_, _TRIG_)
382 #define SOUND_KILL(_ACTOR_, _TRIG_)
383 #define SOUND_GET_STATE(_ACTOR_, _TRIG_) (false)
384 #define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
std::map< Ogre::String, SoundScriptTemplatePtr > templates
@ SS_TRIG_GPWS_APDISCONNECT
std::array< SoundScriptInstancePtr, SS_MAX_MOD *MAX_INSTANCES_PER_GROUP > gains
float pitchgain_cutoff(float sourcepitch, float targetpitch)
@ MAX_INSTANCES_PER_GROUP
float getSoundPitch(int pos)
void setCamera(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity)
@ SS_TRIG_TURN_SIGNAL_TICK
void trigKill(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
bool getTrigState(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
static const int ACTOR_ID_TERRAIN_OBJECT
void setPitch(float value)
void removeInstance(const SoundScriptInstancePtr &ssi)
void trigOnce(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
float getStopSoundPitchgain()
void setVelocity(Ogre::Vector3 velo)
std::array< int, SS_MAX_MOD > free_gains
SoundManager * sound_manager
SoundManager * getSoundManager()
static const float PITCHDOWN_FADE_FACTOR
void setEnabled(bool state)
SoundManager * sound_manager
static const int ACTOR_ID_UNKNOWN
std::vector< SoundScriptInstancePtr > & getAllInstances()
void setGain(float value)
SoundScriptTemplatePtr getTemplate(Ogre::String name)
void setLoadingBaseSounds(bool value)
@ SS_TRIG_TURN_SIGNAL_WARN_TICK
Ogre::String sound_names[MAX_SOUNDS_PER_SCRIPT]
std::map< Ogre::String, SoundScriptTemplatePtr > & getAllTemplates()
SoundScriptTemplatePtr createTemplate(Ogre::String name, Ogre::String groupname, Ogre::String filename)
Ogre::String getGroupName()
static const float PITCHDOWN_CUTOFF_FACTOR
void parseScript(Ogre::DataStreamPtr &stream, const Ogre::String &groupName)
SoundScriptTemplate(Ogre::String name, Ogre::String groupname, Ogre::String filename, bool baseTemplate)
float getStartSoundPitchgain()
float sound_pitches[MAX_SOUNDS_PER_SCRIPT]
float getSoundPitchgain(int pos)
void skipToNextCloseBrace(Ogre::DataStreamPtr &chunk)
Ogre::String stop_sound_name
SoundScriptInstancePtr createInstance(Ogre::String templatename, int actor_id, int soundLinkType=SL_DEFAULT, int soundLinkItemId=-1)
Ogre::String getSoundName(int pos)
Central state/object manager and communications hub.
Ogre::String getFileName()
const Ogre::String & getInstanceName()
const SoundPtr & getStopSound()
Ogre::String getStartSoundName()
@ SS_MOD_LINKED_COMMANDRATE
std::array< int, SS_MAX_TRIG > free_trigs
virtual ~SoundScriptInstance() override
const SoundPtr & getStartSound()
float getStopSoundPitch()
Ogre::String start_sound_name
float sounds_pitchgain[MAX_SOUNDS_PER_SCRIPT]
virtual ~SoundScriptTemplate() override
float start_sound_pitchgain
void trigStart(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
std::array< int, SS_MAX_MOD > free_pitches
int parseModulation(Ogre::String str)
SoundPtr sounds[MAX_SOUNDS_PER_SCRIPT]
bool setParameter(Ogre::StringVector vec)
float getStartSoundPitch()
std::array< SoundScriptInstancePtr, SS_MAX_MOD *MAX_INSTANCES_PER_GROUP > pitches
void modulate(int actor_id, int mod, float value, int linkType=SL_DEFAULT, int linkItemID=-1)
const SoundPtr & getSound(int pos)
Self reference-counting objects, as requred by AngelScript garbage collector.
void update(float dt_sec)
Ogre::String getStopSoundName()
const Ogre::StringVector & getScriptPatterns(void) const
float stop_sound_pitchgain
void skipToNextOpenBrace(Ogre::DataStreamPtr &chunk)
Ogre::Real getLoadingOrder(void) const
SoundScriptTemplatePtr templ
void setPosition(Ogre::Vector3 pos)
void trigToggle(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
SoundScriptTemplatePtr getTemplate()
std::map< int, std::map< int, std::map< int, std::map< int, bool > > > > state_map
void trigStop(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
static const SoundPtr SOUNDPTR_NULL
SoundScriptInstance(int actor_id, SoundScriptTemplatePtr templ, SoundManager *sm, Ogre::String instancename, int soundLinkType=SL_DEFAULT, int soundLinkItemId=-1)
Ogre::String instance_name
std::array< SoundScriptInstancePtr, SS_MAX_TRIG *MAX_INSTANCES_PER_GROUP > trigs
Ogre::StringVector script_patterns
std::vector< SoundScriptInstancePtr > instances