Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpVisual.h
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Returns the name of the currently played animation. | * Returns the name of the currently played animation. | ||||
*/ | */ | ||||
virtual std::string GetAnimationName() const = 0; | virtual std::string GetAnimationName() const = 0; | ||||
/** | /** | ||||
* Start playing the given animation. If there are multiple possible animations then it will | * Start playing the given animation. If there are multiple possible animations then it will | ||||
* pick one at random (not network-synchronised). | * pick one at random (not network-synchronised). | ||||
* If @p soundgroup is specified, then the sound will be played at each 'event' point in the | |||||
* animation cycle. | |||||
* @param name animation name (e.g. "idle", "walk", "melee"; the names are determined by actor XML files) | * @param name animation name (e.g. "idle", "walk", "melee"; the names are determined by actor XML files) | ||||
* @param once if true then the animation will play once and freeze at the final frame, else it will loop | * @param once if true then the animation will play once and freeze at the final frame, else it will loop | ||||
* @param speed animation speed multiplier (typically 1.0 for the default speed) | * @param speed animation speed multiplier (typically 1.0 for the default speed) | ||||
* @param soundgroup VFS path of sound group .xml, relative to audio/, or empty string for none | |||||
*/ | */ | ||||
virtual void SelectAnimation(const std::string& name, bool once, fixed speed) = 0; | virtual void SelectAnimation(const std::string& name, bool once, fixed speed) = 0; | ||||
/** | /** | ||||
* Start playing the walk/run animations, scaled to the unit's movement speed. | * Start playing the given movement animation unless we are currently playing a non-movement animation. | ||||
* @param runThreshold movement speed at which to switch to the run animation | * This is necessary so UnitMotion can set the movement animations without overwriting specific animations | ||||
* that might have been set by other components. | |||||
* TODO: Non-movement animations should probably be made into variants, defining "idle" (really "default"), "walk" and "run" as appropriate, | |||||
* and this would no longer be necessary. | |||||
* @param name animation name (i.e. one of "idle", "walk", "run"). | |||||
* @param speed animation speed multiplier (typically 1.0 for the default speed) | |||||
*/ | */ | ||||
virtual void SelectMovementAnimation(fixed runThreshold) = 0; | virtual void SelectMovementAnimation(const std::string& name, fixed speed) = 0; | ||||
/** | /** | ||||
* Adjust the speed of the current animation, so it can match simulation events. | * Adjust the speed of the current animation, so it can match simulation events. | ||||
* @param repeattime time for complete loop of animation, in msec | * @param repeattime time for complete loop of animation, in msec | ||||
*/ | */ | ||||
virtual void SetAnimationSyncRepeat(fixed repeattime) = 0; | virtual void SetAnimationSyncRepeat(fixed repeattime) = 0; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator