![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Any entity in a field. More...
#include <Entity.h>
Public Types | |
enum | AnimationState { REQUESTED_ANIMATION , AUTO_ANIMATION } |
Entity animation states. More... | |
enum | AnimationPlayType { PLAY_DEFAULT , PLAY_ONCE , PLAY_LOOPED } |
Types of animations. More... | |
enum | State { NONE , WALKMESH , LINEAR , JUMP , NEEDS_TO_REATTACH } |
Entity state. More... | |
Public Member Functions | |
Entity (const Ogre::String &name, Ogre::SceneNode *node) | |
Constructor. More... | |
virtual | ~Entity () |
Destructor. More... | |
virtual void | Update () |
Updates the entity status. More... | |
virtual void | UpdateDebug () |
Updates the entity status with debug information. More... | |
const Ogre::String & | GetName () const |
Retrieves the entity name. More... | |
void | SetPosition (const Ogre::Vector3 &position) |
Sets the entity position. More... | |
void | ScriptSetPosition (const float x, const float y, const float z) |
Sets the entity position. More... | |
const Ogre::Vector3 | GetPosition () const |
Retrieves the entity position. More... | |
void | ScriptGetPosition () const |
Retrieves the entity position. More... | |
void | SetOffset (const Ogre::Vector3 &position) |
Sets the entity position. More... | |
const Ogre::Vector3 | GetOffset () const |
Retrieves the entity position. More... | |
void | SetRotation (const Ogre::Degree &rotation) |
Sets the entity rotation. More... | |
void | ScriptSetRotation (const float rotation) |
Sets the entity rotation. More... | |
Ogre::Degree | GetRotation () const |
Retrieves the entity rotation. More... | |
float | ScriptGetRotation () const |
Retrieves the entity rotation. More... | |
virtual void | setScale (const Ogre::Vector3 &scale) |
Sets the entity scale. More... | |
void | SetIndex (const int index) |
Sets the entity index in the field. More... | |
int | GetIndex () |
Retrieves the entity index in the field. More... | |
virtual void | setRootOrientation (const Ogre::Quaternion &root_orientation) |
Sets the entity's absolute orientation. More... | |
float | GetHeight () const |
Retrieves the entity's height. More... | |
void | SetSolidRadius (const float radius) |
Sets the entity's solid radius. More... | |
float | GetSolidRadius () const |
Retrieves the entity's solid radius. More... | |
void | SetSolid (const bool solid) |
Makes the entity solid or non-solid. More... | |
bool | IsSolid () const |
Checks if the entity is solid. More... | |
void | SetTalkRadius (const float radius) |
Sets the entity talk radius. More... | |
float | GetTalkRadius () const |
Retrieves the entity talk radius. More... | |
void | SetTalkable (const bool talkable) |
Sets an entity as talkable or non-talkable. More... | |
bool | IsTalkable () const |
Checks if an entity is talkable or non-talkable. More... | |
virtual void | SetVisible (const bool visible)=0 |
Makes the entity visible or invisible. More... | |
virtual bool | IsVisible () const =0 |
Checks if the entity is visible or invisible. More... | |
void | SetState (const State state) |
Sets the entity's state. More... | |
State | GetState () const |
Retrieves the entity's state. More... | |
void | SetMoveAutoSpeed (const float speed) |
Sets the entity's automatic movement speed. More... | |
float | GetMoveAutoSpeed () const |
Retrieves the entity's automatic movement speed. More... | |
void | SetMoveWalkSpeed (const float speed) |
Sets the entity's walking movement speed. More... | |
float | GetMoveWalkSpeed () const |
Retrieves the entity's walking speed. More... | |
void | SetMoveRunSpeed (const float speed) |
Sets the entity's running movement speed. More... | |
float | GetMoveRunSpeed () const |
Retrieves the entity's running speed. More... | |
void | SetMovePosition (const Ogre::Vector3 &target) |
Sets the entity's movement destination position. More... | |
const Ogre::Vector3 & | GetMovePosition () const |
Retrieves the entity's movement destination position. More... | |
float | GetMoveStopDistance () const |
Retrieves the distance to destination. More... | |
void | SetMoveTriangleId (const int triangle) |
Sets the destination triangle in the walkmesh. More... | |
int | GetMoveTriangleId () const |
Sets the destination triangle in the walkmesh. More... | |
void | SetMoveAutoRotation (const bool rotate) |
Enables or disables autorotation while the entity is moving. More... | |
bool | GetMoveAutoRotation () const |
Checks if the unit can autorotate while it's moving. More... | |
void | SetMoveAutoAnimation (const bool animate) |
Enables or disables autoanimation while the entity is moving. More... | |
bool | GetMoveAutoAnimation () const |
Checks if the unit can autoanimate while it's moving. More... | |
const Ogre::String & | GetMoveAnimationWalkName () const |
Retrieves the entity's walk animation name. More... | |
const Ogre::String & | GetMoveAnimationRunName () const |
Retrieves the entity's run animation name. More... | |
void | ScriptMoveToPosition (const float x, const float y) |
Makes the entity move to a point in the map. More... | |
void | ScriptMoveToEntity (Entity *entity) |
Makes the unit move towards another in the map. More... | |
int | ScriptMoveSync () |
Waits for entity's movement to end. More... | |
int | ScriptJumpSync () |
Waits for the jump to finish. More... | |
void | UnsetMove () |
Cancels the entity's current movement. More... | |
void | ScriptLinearToPosition (const float x, const float y, const float z, const LinearMovement movement, const char *animation, const float orientation, const int dest_triangle) |
Linearly moves the entity. More... | |
int | ScriptLinearSync () |
Adds the unit linear movement to the sync queue. More... | |
void | SetLinear (const Ogre::Vector3 &end, const LinearMovement movement, const Ogre::String &animation, const float orientation, const int dest_triangle) |
Linearly moves the entity. More... | |
void | UnsetLinear () |
Cancels the entity's current linear movement. More... | |
LinearMovement | GetLinearMovement () const |
Retrieves the entity's current linear movement. More... | |
const Ogre::Vector3 & | GetLinearStart () const |
Retrieves the starting point of the current linear movement. More... | |
const Ogre::Vector3 & | GetLinearEnd () const |
Retrieves the ending point of the current linear movement. More... | |
const int | GetLinearDestTriangle () const |
Retrieves the ending triangle of the current linear movement. More... | |
void | ScriptJumpToPosition (const float x, const float y, const float z, const float seconds, const int dest_triangle) |
Makes the unit jump to a point in the field. More... | |
void | SetJump (const Ogre::Vector3 &jump_to, const float seconds, const int dest_triangle) |
Makes the unit jump to a point in the field. More... | |
void | UnsetJump () |
Cancels the entity's current jump. More... | |
const Ogre::Vector3 & | GetJumpStart () const |
Retrieves the starting point of the current jump. More... | |
const Ogre::Vector3 & | GetJumpEnd () const |
Retrieves the ending point of the current jump. More... | |
float | GetJumpSeconds () const |
Gets the total duration of the jump. More... | |
void | SetJumpCurrentSeconds (const float seconds) |
Sets the current duration of the jump. More... | |
float | GetJumpCurrentSeconds () const |
Gets the current duration of the jump. More... | |
const int | GetJumpDestTriangle () const |
Retrieves the ending triangle of the current jump. More... | |
void | ScriptOffsetToPosition (const float x, const float y, const float z, const ActionType type, const float seconds) |
int | ScriptOffsetSync () |
void | UnsetOffset () |
const Ogre::Vector3 & | GetOffsetPositionStart () const |
const Ogre::Vector3 & | GetOffsetPositionEnd () const |
ActionType | GetOffsetType () const |
float | GetOffsetSeconds () const |
void | SetOffsetCurrentSeconds (const float seconds) |
float | GetOffsetCurrentSeconds () const |
void | ScriptTurnToDirection (const float direction, const TurnDirection turn_direction, const ActionType turn_type, const float seconds) |
Makes the entity turn to a fixed direction. More... | |
void | ScriptTurnToEntity (Entity *entity, const TurnDirection turn_direction, const float seconds) |
Makes the entity turn towards another entity. More... | |
int | ScriptTurnSync () |
Adds the entity's turn to the sync queue. More... | |
void | SetTurn (const Ogre::Degree &direction_to, Entity *entity, const TurnDirection turn_direction, const ActionType turn_type, const float seconds) |
Makes the entity turn towards a point or another entity. More... | |
void | UnsetTurn () |
Cancels the entity's current jump. More... | |
Ogre::Degree | CalculateTurnAngle (const Ogre::Degree &start, const Ogre::Degree &end) const |
Calculates the turn angle. More... | |
Ogre::Degree | GetTurnDirectionStart () const |
Retrieves the turn staring orientation. More... | |
Ogre::Degree | GetTurnDirectionEnd () const |
Retrieves the turn ending orientation. More... | |
ActionType | GetTurnType () const |
Retrieves the turn type. More... | |
float | GetTurnSeconds () const |
Retrieves the turn total duration. More... | |
void | SetTurnCurrentSeconds (const float seconds) |
Sets the turn current duration. More... | |
float | GetTurnCurrentSeconds () const |
Retrieves the turn current duration. More... | |
void | ScriptSetAnimationSpeed (const float speed) |
Sets the animation speed. More... | |
const Ogre::String & | GetDefaultAnimationName () const |
Retrieves the entity's default animation name. More... | |
const Ogre::String & | GetCurrentAnimationName () const |
Retrieves the entity's current animation name. More... | |
AnimationState | GetAnimationState () const |
Retrieves the entity's current animation state. More... | |
virtual void | PlayAnimation (const Ogre::String &animation, AnimationState state, AnimationPlayType play_type, const float start, const float end)=0 |
Plays one of the entity's animations. More... | |
virtual void | PlayAnimationContinue (const Ogre::String &animation)=0 |
Resumes an animation. More... | |
virtual void | UpdateAnimation (const float delta)=0 |
Updates the animation state. More... | |
void | ScriptPlayAnimation (const char *name) |
Plays one of the entity's animations. More... | |
void | ScriptPlayAnimationStop (const char *name) |
Stops one of the entity's animations. More... | |
void | ScriptPlayAnimation (const char *name, const float start, const float end) |
Plays one of the entity's animations. More... | |
void | ScriptPlayAnimationStop (const char *name, const float start, const float end) |
Stops one of the entity's animations. More... | |
void | ScriptSetDefaultAnimation (const char *animation) |
Sets the default animation of the entity. More... | |
int | ScriptAnimationSync () |
Adds the entity's animation to the sync queue. More... | |
void | SetCharacter (int char_id) |
Assigns the entity as a character. More... | |
bool | IsCharacter () |
Checks if the entity is a character. More... | |
int | GetCharacterId () |
Retrieves the entity's character ID. More... | |
bool | IsLine () |
Checks if the entity is a line. More... | |
Protected Attributes | |
Ogre::String | name_ |
The name of the entity. More... | |
Ogre::SceneNode * | scene_node_ |
The scene node the entity is attached to. More... | |
Ogre::SceneNode * | model_node_ |
The entity's model. More... | |
Ogre::SceneNode * | model_root_node_ |
The entity's root node. More... | |
float | height_ |
The entity's height. More... | |
Ogre::SceneNode * | direction_node_ |
The entity's direction node. More... | |
EntityDirection * | direction_ |
The entity's direction. More... | |
Ogre::SceneNode * | solid_collision_node_ |
The entity's collision node. More... | |
EntityCollision * | solid_collision_ |
The entity's collision. More... | |
float | solid_radius_ |
The entity's solid radius. More... | |
bool | solid_ |
Indicates it the entity is solid and can handle collisions. More... | |
Ogre::SceneNode * | talk_collision_node_ |
The entity's talk collision node. More... | |
EntityCollision * | talk_collision_ |
The entity's talk collision. More... | |
float | talk_radius_ |
The radius at which the entity can be interacted with. More... | |
bool | talkable_ |
Indicates if the entity can be interacted with. More... | |
State | state_ |
Entity's movement status. More... | |
std::vector< ScriptId > | sync_ |
Entity's movement sync queue. More... | |
float | move_auto_speed_ |
The entity's automatic movement speed. More... | |
float | move_walk_speed_ |
The entity's walking speed. More... | |
float | move_run_speed_ |
The entity's running speed. More... | |
Ogre::Vector3 | move_position_ |
The entity's movement destination point. More... | |
Entity * | move_entity_ |
The entity's movement destination entity. More... | |
float | move_stop_distance_ |
Distance between the entity and it's movement destination point. More... | |
int | move_triangle_id_ |
Entity's movement destination triangle ID. More... | |
bool | move_auto_rotation_ |
Indicates if the entity can rotate while moving. More... | |
bool | move_auto_animation_ |
Indicates if the entity can animate while moving. More... | |
Ogre::String | move_animation_walk_ |
The name of the entity's walk animation. More... | |
Ogre::String | move_animation_run_ |
The name of the entity's run animation. More... | |
LinearMovement | linear_movement_ |
The entity's linear movement direction. More... | |
Ogre::Vector3 | linear_start_ |
The linear movement starting point. More... | |
Ogre::Vector3 | linear_end_ |
The linear movement ending point. More... | |
int | linear_dest_triangle_ |
Triangle to set the entity on after a linear movement. More... | |
Ogre::Vector3 | jump_start_ |
The jump starting point. More... | |
Ogre::Vector3 | jump_end_ |
The jump ending point. More... | |
float | jump_seconds_ |
Total jump duration. More... | |
float | jump_current_seconds_ |
Current jump duration. More... | |
bool | jump_was_solid_ |
Used to store solidity status before a jump. More... | |
int | jump_dest_triangle_ |
Triangle to set the entity on after a jump. More... | |
Ogre::Vector3 | offset_position_start_ |
Ogre::Vector3 | offset_position_end_ |
ActionType | offset_type_ |
float | offset_seconds_ |
float | offset_current_seconds_ |
std::vector< ScriptId > | offset_sync_ |
TurnDirection | turn_direction_ |
Turn movement direction. More... | |
Ogre::Degree | turn_direction_start_ |
Turn initial orientation. More... | |
Ogre::Degree | turn_direction_end_ |
Turn final orientation. More... | |
Entity * | turn_entity_ |
The turn destination entity. More... | |
ActionType | turn_type_ |
The turn type. More... | |
float | turn_seconds_ |
Total turn duration. More... | |
float | turn_current_seconds_ |
Current turn duration. More... | |
std::vector< ScriptId > | turn_sync_ |
Entity's turning sync queue. More... | |
float | animation_speed_ |
The animation speed. More... | |
Ogre::String | animation_current_name_ |
The entity's current animation name. More... | |
std::vector< ScriptId > | animation_sync_ |
Entity's animation sync queue. More... | |
AnimationState | animation_state_ |
The entity's current animation state. More... | |
AnimationPlayType | animation_play_type_ |
The entity's current animation type. More... | |
Ogre::String | animation_default_ |
The name of the entity's default name. More... | |
float | animation_end_time_ |
bool | animation_auto_play_ |
Indicates if an automation must be played automatically. More... | |
Private Member Functions | |
Entity () | |
Constructor. More... | |
Ogre::Degree | GetDirectionToEntity (Entity *entity) const |
Calculates the angular distance to an entity. More... | |
Private Attributes | |
bool | is_character_ |
Indicates if the entity is a playable character. More... | |
int | character_id_ |
The ID of the playable character the entity is, if any. More... | |
int | index_ |
Index of the entity on the field. More... | |
bool | is_line_ |
Indicates if the entity is a line. More... | |
Any entity in a field.
Types of animations.
Enumerator | |
---|---|
PLAY_DEFAULT | Default animation mode.
|
PLAY_ONCE | Play the animation once, then stop. |
PLAY_LOOPED | Play an animation in a continous loop. |
Entity animation states.
Enumerator | |
---|---|
REQUESTED_ANIMATION | An animation has been requested. |
AUTO_ANIMATION | An animation is set to play automatically. |
enum Entity::State |
Entity state.
Entity::Entity | ( | const Ogre::String & | name, |
Ogre::SceneNode * | node | ||
) |
Constructor.
[in] | name | Entity name. |
[in] | node | Scene node to which the entity should be attached. |
|
virtual |
Destructor.
|
private |
Constructor.
Ogre::Degree Entity::CalculateTurnAngle | ( | const Ogre::Degree & | start, |
const Ogre::Degree & | end | ||
) | const |
Calculates the turn angle.
If the turn direction is {
[in] | start | Starting angle. |
[in] | end | Ending angle. |
Entity::AnimationState Entity::GetAnimationState | ( | ) | const |
Retrieves the entity's current animation state.
int Entity::GetCharacterId | ( | ) |
Retrieves the entity's character ID.
const Ogre::String & Entity::GetCurrentAnimationName | ( | ) | const |
Retrieves the entity's current animation name.
const Ogre::String & Entity::GetDefaultAnimationName | ( | ) | const |
Retrieves the entity's default animation name.
|
private |
Calculates the angular distance to an entity.
[in] | entity | Entity to calculate the angular distance to. |
float Entity::GetHeight | ( | ) | const |
Retrieves the entity's height.
int Entity::GetIndex | ( | ) |
Retrieves the entity index in the field.
float Entity::GetJumpCurrentSeconds | ( | ) | const |
Gets the current duration of the jump.
const int Entity::GetJumpDestTriangle | ( | ) | const |
Retrieves the ending triangle of the current jump.
const Ogre::Vector3 & Entity::GetJumpEnd | ( | ) | const |
Retrieves the ending point of the current jump.
float Entity::GetJumpSeconds | ( | ) | const |
Gets the total duration of the jump.
const Ogre::Vector3 & Entity::GetJumpStart | ( | ) | const |
Retrieves the starting point of the current jump.
const int Entity::GetLinearDestTriangle | ( | ) | const |
Retrieves the ending triangle of the current linear movement.
const Ogre::Vector3 & Entity::GetLinearEnd | ( | ) | const |
Retrieves the ending point of the current linear movement.
LinearMovement Entity::GetLinearMovement | ( | ) | const |
Retrieves the entity's current linear movement.
const Ogre::Vector3 & Entity::GetLinearStart | ( | ) | const |
Retrieves the starting point of the current linear movement.
const Ogre::String & Entity::GetMoveAnimationRunName | ( | ) | const |
Retrieves the entity's run animation name.
const Ogre::String & Entity::GetMoveAnimationWalkName | ( | ) | const |
Retrieves the entity's walk animation name.
bool Entity::GetMoveAutoAnimation | ( | ) | const |
Checks if the unit can autoanimate while it's moving.
bool Entity::GetMoveAutoRotation | ( | ) | const |
Checks if the unit can autorotate while it's moving.
float Entity::GetMoveAutoSpeed | ( | ) | const |
Retrieves the entity's automatic movement speed.
const Ogre::Vector3 & Entity::GetMovePosition | ( | ) | const |
Retrieves the entity's movement destination position.
float Entity::GetMoveRunSpeed | ( | ) | const |
Retrieves the entity's running speed.
float Entity::GetMoveStopDistance | ( | ) | const |
Retrieves the distance to destination.
It's the distance between the entity's current position and it's current movement destination point.
int Entity::GetMoveTriangleId | ( | ) | const |
Sets the destination triangle in the walkmesh.
float Entity::GetMoveWalkSpeed | ( | ) | const |
Retrieves the entity's walking speed.
const Ogre::String & Entity::GetName | ( | ) | const |
Retrieves the entity name.
const Ogre::Vector3 Entity::GetOffset | ( | ) | const |
float Entity::GetOffsetCurrentSeconds | ( | ) | const |
const Ogre::Vector3 & Entity::GetOffsetPositionEnd | ( | ) | const |
const Ogre::Vector3 & Entity::GetOffsetPositionStart | ( | ) | const |
float Entity::GetOffsetSeconds | ( | ) | const |
ActionType Entity::GetOffsetType | ( | ) | const |
const Ogre::Vector3 Entity::GetPosition | ( | ) | const |
Retrieves the entity position.
Ogre::Degree Entity::GetRotation | ( | ) | const |
Retrieves the entity rotation.
float Entity::GetSolidRadius | ( | ) | const |
Retrieves the entity's solid radius.
The solid radius is used to detect collisions.
Entity::State Entity::GetState | ( | ) | const |
Retrieves the entity's state.
float Entity::GetTalkRadius | ( | ) | const |
Retrieves the entity talk radius.
The talk radius is the maximum distance at which an entity can be talked to or interacted with.
float Entity::GetTurnCurrentSeconds | ( | ) | const |
Retrieves the turn current duration.
Ogre::Degree Entity::GetTurnDirectionEnd | ( | ) | const |
Retrieves the turn ending orientation.
Ogre::Degree Entity::GetTurnDirectionStart | ( | ) | const |
Retrieves the turn staring orientation.
float Entity::GetTurnSeconds | ( | ) | const |
Retrieves the turn total duration.
ActionType Entity::GetTurnType | ( | ) | const |
Retrieves the turn type.
bool Entity::IsCharacter | ( | ) |
Checks if the entity is a character.
An entity is not a character until {
bool Entity::IsLine | ( | ) |
Checks if the entity is a line.
bool Entity::IsSolid | ( | ) | const |
Checks if the entity is solid.
Solid entities can produce collisions.
bool Entity::IsTalkable | ( | ) | const |
Checks if an entity is talkable or non-talkable.
Talkable units can be talked to or interacted with.
|
pure virtual |
Checks if the entity is visible or invisible.
Invisible entities can't be interacted with.
Implemented in EntityModel.
|
pure virtual |
Plays one of the entity's animations.
[in] | animation | Name of the animation to play. |
[in] | state | The animation initial state. |
[in] | play_type | The animation play type, to play it once or in a loop. |
[in] | start | Animation starting point in time, in seconds. |
[in] | end | Animation ending point in time, in seconds. |
Implemented in EntityModel.
|
pure virtual |
Resumes an animation.
[in] | animation | Name of the animation to resume. |
Implemented in EntityModel.
int Entity::ScriptAnimationSync | ( | ) |
void Entity::ScriptGetPosition | ( | ) | const |
Retrieves the entity position.
To be used from Lua scripts only. It doesn't return anything, but adds three values to the stack for the X, Y and Z coordinates.
float Entity::ScriptGetRotation | ( | ) | const |
Retrieves the entity rotation.
int Entity::ScriptJumpSync | ( | ) |
Waits for the jump to finish.
void Entity::ScriptJumpToPosition | ( | const float | x, |
const float | y, | ||
const float | z, | ||
const float | seconds, | ||
const int | dest_triangle | ||
) |
Makes the unit jump to a point in the field.
[in] | x | X coordinate of the jump destination point. |
[in] | y | Y coordinate of the jump destination point. |
[in] | z | Maximum height of the jump. |
[in] | seconds | Jump duration. |
[in] | dest_triangle | Triangle to place the entity after the jump. |
int Entity::ScriptLinearSync | ( | ) |
void Entity::ScriptLinearToPosition | ( | const float | x, |
const float | y, | ||
const float | z, | ||
const LinearMovement | movement, | ||
const char * | animation, | ||
const float | orientation, | ||
const int | dest_triangle | ||
) |
Linearly moves the entity.
[in] | x | X coordinate of the destination point. |
[in] | y | Y coordinate of the destination point. |
[in] | z | Z coordinate of the destination point. |
[in] | movement | Movement direction. |
[in] | animation | Movement animation. |
[in] | orientation | Orientation during the animation. |
[in] | dest_triangle | Triangle to place the entity after the linear movement. |
int Entity::ScriptMoveSync | ( | ) |
Waits for entity's movement to end.
void Entity::ScriptMoveToEntity | ( | Entity * | entity | ) |
Makes the unit move towards another in the map.
[in] | entity | entity to move towards. |
void Entity::ScriptMoveToPosition | ( | const float | x, |
const float | y | ||
) |
Makes the entity move to a point in the map.
[in] | x | X coordinate of the destination point. |
[in] | y | Y coordinate of the destination point. |
int Entity::ScriptOffsetSync | ( | ) |
void Entity::ScriptOffsetToPosition | ( | const float | x, |
const float | y, | ||
const float | z, | ||
const ActionType | type, | ||
const float | seconds | ||
) |
[in] | x | X coordinate of the destination point. |
[in] | y | Y coordinate of the destination point. |
[in] | z | Z coordinate of the destination point. |
[in] | type | Type of action. |
[in] | seconds | Duration of the action, in seconds. |
void Entity::ScriptPlayAnimation | ( | const char * | name | ) |
Plays one of the entity's animations.
[in] | name | Name of the animation to play. |
void Entity::ScriptPlayAnimation | ( | const char * | name, |
const float | start, | ||
const float | end | ||
) |
Plays one of the entity's animations.
[in] | name | Name of the animation to play. |
[in] | start | Animation starting point in time, in seconds. |
[in] | end | Animation ending point in time, in seconds. |
void Entity::ScriptPlayAnimationStop | ( | const char * | name | ) |
Stops one of the entity's animations.
[in] | name | Name of the animation to stop. |
void Entity::ScriptPlayAnimationStop | ( | const char * | name, |
const float | start, | ||
const float | end | ||
) |
Stops one of the entity's animations.
[in] | name | Name of the animation to stop. |
[in] | start | Animation starting point in time, in seconds. |
[in] | end | Animation ending point in time, in seconds. |
void Entity::ScriptSetAnimationSpeed | ( | const float | speed | ) |
Sets the animation speed.
[in] | speed | The animation speed. |
void Entity::ScriptSetDefaultAnimation | ( | const char * | animation | ) |
Sets the default animation of the entity.
[in] | animation | Name of the default animation. |
void Entity::ScriptSetPosition | ( | const float | x, |
const float | y, | ||
const float | z | ||
) |
void Entity::ScriptSetRotation | ( | const float | rotation | ) |
Sets the entity rotation.
[in] | rotation | The entity rotation (0-360). |
int Entity::ScriptTurnSync | ( | ) |
void Entity::ScriptTurnToDirection | ( | const float | direction, |
const TurnDirection | turn_direction, | ||
const ActionType | turn_type, | ||
const float | seconds | ||
) |
Makes the entity turn to a fixed direction.
[in] | direction | Final direction to turn the entity's to. |
[in] | turn_direction | Direction of the turn. |
[in] | turn_type | Turn mode. |
[in] | seconds | Total turn duration, in seconds. |
void Entity::ScriptTurnToEntity | ( | Entity * | entity, |
const TurnDirection | turn_direction, | ||
const float | seconds | ||
) |
Makes the entity turn towards another entity.
[in] | entity | Entity to turn to. |
[in] | turn_direction | Direction of the turn. |
[in] | seconds | Total turn duration, in seconds. |
void Entity::SetCharacter | ( | int | char_id | ) |
Assigns the entity as a character.
Marks the entity as a character, and assigns a character name and ID. If the ID is passed as a negative number, the entity will no longer be considered a character.
[in] | char_id | The character name. |
void Entity::SetIndex | ( | const int | index | ) |
Sets the entity index in the field.
[in] | index | Index of the entity. |
void Entity::SetJump | ( | const Ogre::Vector3 & | jump_to, |
const float | seconds, | ||
const int | dest_triangle | ||
) |
Makes the unit jump to a point in the field.
[in] | jump_to | The jump destination point. |
[in] | seconds | Jump duration. |
[in] | dest_triangle | Triangle to place the entity after the jump. |
void Entity::SetJumpCurrentSeconds | ( | const float | seconds | ) |
Sets the current duration of the jump.
[in] | seconds | Jump current duration, in seconds. |
void Entity::SetLinear | ( | const Ogre::Vector3 & | end, |
const LinearMovement | movement, | ||
const Ogre::String & | animation, | ||
const float | orientation, | ||
const int | dest_triangle | ||
) |
Linearly moves the entity.
[in] | end | Destination point. |
[in] | movement | Movement direction. |
[in] | animation | Movement animation. |
[in] | orientation | Orientation during the animation. |
[in] | dest_triangle | Triangle to place the entity after the linear movement. |
void Entity::SetMoveAutoAnimation | ( | const bool | animate | ) |
Enables or disables autoanimation while the entity is moving.
[in] | animate | If true, the entity will animate automatically while moving. If false, the entity will not animate. |
void Entity::SetMoveAutoRotation | ( | const bool | rotate | ) |
Enables or disables autorotation while the entity is moving.
[in] | rotate | If true, the entity will rotate automatically while moving. If false, the entity will not rotate. |
void Entity::SetMoveAutoSpeed | ( | const float | speed | ) |
Sets the entity's automatic movement speed.
[in] | speed | Automatic movement speed. |
void Entity::SetMovePosition | ( | const Ogre::Vector3 & | target | ) |
Sets the entity's movement destination position.
[in] | target | The destination position. |
void Entity::SetMoveRunSpeed | ( | const float | speed | ) |
Sets the entity's running movement speed.
[in] | speed | Running speed. |
void Entity::SetMoveTriangleId | ( | const int | triangle | ) |
Sets the destination triangle in the walkmesh.
Sets the units destination to one of the walkmesh triangles. The movement will stop once the unit enters the triangle.
[in] | triangle | Destination triangle in the walkmesh. |
void Entity::SetMoveWalkSpeed | ( | const float | speed | ) |
Sets the entity's walking movement speed.
[in] | speed | Walking speed. |
void Entity::SetOffset | ( | const Ogre::Vector3 & | position | ) |
void Entity::SetOffsetCurrentSeconds | ( | const float | seconds | ) |
[in] | seconds | Action current duration in seconds. |
void Entity::SetPosition | ( | const Ogre::Vector3 & | position | ) |
Sets the entity position.
[in] | position | Entity's new position. |
|
virtual |
Sets the entity's absolute orientation.
[in] | root_orientation | The entity's new orientation. |
void Entity::SetRotation | ( | const Ogre::Degree & | rotation | ) |
Sets the entity rotation.
[in] | rotation | The entity rotation, in degrees. |
|
virtual |
Sets the entity scale.
[in] | scale | Three dimensional scale. |
void Entity::SetSolid | ( | const bool | solid | ) |
Makes the entity solid or non-solid.
Solid entities can produce collisions.
[in] | solid | True to make the entity solid, false otherwise. |
void Entity::SetSolidRadius | ( | const float | radius | ) |
Sets the entity's solid radius.
The solid radius is used to detect collisions.
[in] | radius | The solid radius. |
void Entity::SetState | ( | const State | state | ) |
Sets the entity's state.
[in] | state | The entity's state. |
void Entity::SetTalkable | ( | const bool | talkable | ) |
Sets an entity as talkable or non-talkable.
Talkable units can be talked to or interacted with.
[in] | talkable | True to make the entity talkable, false to make it non-talkable. |
void Entity::SetTalkRadius | ( | const float | radius | ) |
Sets the entity talk radius.
The talk radius is the maximum distance at which an entity can be talked to or interacted with.
[in] | radius | The talk radius. |
void Entity::SetTurn | ( | const Ogre::Degree & | direction_to, |
Entity * | entity, | ||
const TurnDirection | turn_direction, | ||
const ActionType | turn_type, | ||
const float | seconds | ||
) |
void Entity::SetTurnCurrentSeconds | ( | const float | seconds | ) |
Sets the turn current duration.
[in] | seconds | The turn current duration, in seconds. |
|
pure virtual |
Makes the entity visible or invisible.
Invisible entities can't be interacted with.
[in] | visible | True to make the unit visible, false to make it invisible. |
Implemented in EntityModel.
void Entity::UnsetJump | ( | ) |
Cancels the entity's current jump.
It also clears the movement sync queue.
void Entity::UnsetLinear | ( | ) |
Cancels the entity's current linear movement.
It also clears the movement sync queue.
void Entity::UnsetMove | ( | ) |
Cancels the entity's current movement.
It also clears the movement sync queue.
void Entity::UnsetOffset | ( | ) |
void Entity::UnsetTurn | ( | ) |
Cancels the entity's current jump.
It also clears the movement sync queue.
|
virtual |
Updates the entity status.
Reimplemented in EntityModel.
|
pure virtual |
|
virtual |
Updates the entity status with debug information.
|
protected |
Indicates if an automation must be played automatically.
|
protected |
The entity's current animation name.
|
protected |
The name of the entity's default name.
|
protected |
|
protected |
The entity's current animation type.
|
protected |
The animation speed.
|
protected |
The entity's current animation state.
|
private |
The ID of the playable character the entity is, if any.
|
protected |
The entity's direction.
|
protected |
The entity's direction node.
|
protected |
The entity's height.
|
private |
Index of the entity on the field.
|
private |
Indicates if the entity is a playable character.
|
private |
Indicates if the entity is a line.
|
protected |
Current jump duration.
|
protected |
Triangle to set the entity on after a jump.
|
protected |
The jump ending point.
|
protected |
Total jump duration.
|
protected |
The jump starting point.
|
protected |
Used to store solidity status before a jump.
|
protected |
Triangle to set the entity on after a linear movement.
|
protected |
The linear movement ending point.
|
protected |
The entity's linear movement direction.
|
protected |
The linear movement starting point.
|
protected |
The entity's model.
|
protected |
The entity's root node.
|
protected |
The name of the entity's run animation.
|
protected |
The name of the entity's walk animation.
|
protected |
Indicates if the entity can animate while moving.
|
protected |
Indicates if the entity can rotate while moving.
|
protected |
The entity's automatic movement speed.
|
protected |
The entity's movement destination entity.
|
protected |
The entity's movement destination point.
|
protected |
The entity's running speed.
|
protected |
Distance between the entity and it's movement destination point.
|
protected |
Entity's movement destination triangle ID.
|
protected |
The entity's walking speed.
|
protected |
The name of the entity.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The scene node the entity is attached to.
|
protected |
Indicates it the entity is solid and can handle collisions.
|
protected |
The entity's collision.
|
protected |
The entity's collision node.
|
protected |
The entity's solid radius.
|
protected |
The entity's talk collision.
|
protected |
The entity's talk collision node.
|
protected |
The radius at which the entity can be interacted with.
|
protected |
Indicates if the entity can be interacted with.
|
protected |
Current turn duration.
|
protected |
Turn movement direction.
|
protected |
Turn final orientation.
|
protected |
Turn initial orientation.
|
protected |
The turn destination entity.
|
protected |
Total turn duration.
|
protected |
The turn type.