V-Gears 0
Free Final Fantasy VII engine.
Entity.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OgreString.h>
19#include "EntityCollision.h"
20#include "EntityDirection.h"
21#include "ScriptManager.h"
22
27
32
39
47};
48
53
58
63
70};
71
76
81
86
91
96};
97
101class Entity{
102
103 public:
104
109
114
119 };
120
125
132
137
142 };
143
147 enum State{
148
155
160
165
170
176 };
177
184 Entity(const Ogre::String& name, Ogre::SceneNode* node);
185
189 virtual ~Entity();
190
194 virtual void Update();
195
199 virtual void UpdateDebug();
200
206 const Ogre::String& GetName() const;
207
213 void SetPosition(const Ogre::Vector3& position);
214
225 void ScriptSetPosition(const float x, const float y, const float z);
226
232 const Ogre::Vector3 GetPosition() const;
233
240 void ScriptGetPosition() const;
241
248 void SetOffset(const Ogre::Vector3& position);
249
256 const Ogre::Vector3 GetOffset() const;
257
263 void SetRotation(const Ogre::Degree& rotation);
264
270 void ScriptSetRotation(const float rotation);
271
277 Ogre::Degree GetRotation() const;
278
284 float ScriptGetRotation() const;
285
291 virtual void setScale(const Ogre::Vector3 &scale);
292
298 void SetIndex(const int index);
299
305 int GetIndex();
306
312 virtual void setRootOrientation(
313 const Ogre::Quaternion &root_orientation
314 );
315
321 float GetHeight() const;
322
331 void SetSolidRadius(const float radius);
332
341 float GetSolidRadius() const;
342
350 void SetSolid(const bool solid);
351
359 bool IsSolid() const;
360
370 void SetTalkRadius(const float radius);
371
381 float GetTalkRadius() const;
382
391 void SetTalkable(const bool talkable);
392
400 bool IsTalkable() const;
401
410 virtual void SetVisible(const bool visible) = 0;
411
419 virtual bool IsVisible() const = 0;
420
426 void SetState(const State state);
427
433 State GetState() const;
434
442 void SetMoveAutoSpeed(const float speed);
443
451 float GetMoveAutoSpeed() const;
452
460 void SetMoveWalkSpeed(const float speed);
461
469 float GetMoveWalkSpeed() const;
470
478 void SetMoveRunSpeed(const float speed);
479
487 float GetMoveRunSpeed() const;
488
494 void SetMovePosition(const Ogre::Vector3& target);
495
501 const Ogre::Vector3& GetMovePosition() const;
502
512 float GetMoveStopDistance() const;
513
522 void SetMoveTriangleId(const int triangle);
523
529 int GetMoveTriangleId() const;
530
537 void SetMoveAutoRotation(const bool rotate);
538
545 bool GetMoveAutoRotation() const;
546
553 void SetMoveAutoAnimation(const bool animate);
554
561 bool GetMoveAutoAnimation() const;
562
569
576
583 void ScriptMoveToPosition(const float x, const float y);
584
590 void ScriptMoveToEntity(Entity* entity);
591
597 int ScriptMoveSync();
598
604 int ScriptJumpSync();
605
611 void UnsetMove();
612
626 const float x, const float y, const float z, const LinearMovement movement,
627 const char* animation, const float orientation, const int dest_triangle
628 );
629
636 int ScriptLinearSync();
637
648 void SetLinear(
649 const Ogre::Vector3& end, const LinearMovement movement,
650 const Ogre::String& animation, const float orientation, const int dest_triangle
651 );
652
658 void UnsetLinear();
659
666
672 const Ogre::Vector3& GetLinearStart() const;
673
679 const Ogre::Vector3& GetLinearEnd() const;
680
686 const int GetLinearDestTriangle() const;
687
699 const float x, const float y, const float z, const float seconds, const int dest_triangle
700 );
701
710 void SetJump(const Ogre::Vector3& jump_to, const float seconds, const int dest_triangle);
711
717 void UnsetJump();
718
724 const Ogre::Vector3& GetJumpStart() const;
725
731 const Ogre::Vector3& GetJumpEnd() const;
732
738 float GetJumpSeconds() const;
739
745 void SetJumpCurrentSeconds(const float seconds);
746
752 float GetJumpCurrentSeconds() const;
753
759 const int GetJumpDestTriangle() const;
760
771 const float x, const float y, const float z,
772 const ActionType type, const float seconds
773 );
774
780 int ScriptOffsetSync();
781
785 void UnsetOffset();
786
792 const Ogre::Vector3& GetOffsetPositionStart() const;
793
799 const Ogre::Vector3& GetOffsetPositionEnd() const;
800
807
813 float GetOffsetSeconds() const;
814
820 void SetOffsetCurrentSeconds(const float seconds);
821
827 float GetOffsetCurrentSeconds() const;
828
838 const float direction, const TurnDirection turn_direction,
839 const ActionType turn_type, const float seconds
840 );
841
850 Entity* entity, const TurnDirection turn_direction,
851 const float seconds
852 );
853
860 int ScriptTurnSync();
861
872 void SetTurn(
873 const Ogre::Degree& direction_to, Entity* entity, const TurnDirection turn_direction,
874 const ActionType turn_type, const float seconds
875 );
876
882 void UnsetTurn();
883
895 Ogre::Degree CalculateTurnAngle(const Ogre::Degree& start, const Ogre::Degree& end) const;
896
902 Ogre::Degree GetTurnDirectionStart() const;
903
909 Ogre::Degree GetTurnDirectionEnd() const;
910
916 ActionType GetTurnType() const;
917
923 float GetTurnSeconds() const;
924
930 void SetTurnCurrentSeconds(const float seconds);
931
937 float GetTurnCurrentSeconds() const;
938
945 void ScriptSetAnimationSpeed(const float speed);
946
953
960
967
978 virtual void PlayAnimation(
979 const Ogre::String& animation, AnimationState state,
980 AnimationPlayType play_type, const float start, const float end
981 ) = 0;
982
988 virtual void PlayAnimationContinue(const Ogre::String& animation) = 0;
989
995 virtual void UpdateAnimation(const float delta) = 0;
996
1002 void ScriptPlayAnimation(const char* name);
1003
1009 void ScriptPlayAnimationStop(const char* name);
1010
1018 void ScriptPlayAnimation(const char* name, const float start, const float end);
1019
1027 void ScriptPlayAnimationStop(const char* name, const float start, const float end);
1028
1034 void ScriptSetDefaultAnimation(const char* animation);
1035
1042 int ScriptAnimationSync();
1043
1052 void SetCharacter(int char_id);
1053
1061 bool IsCharacter();
1062
1068 int GetCharacterId();
1069
1075 bool IsLine();
1076
1077 protected:
1078
1083
1087 Ogre::SceneNode* scene_node_;
1088
1092 Ogre::SceneNode* model_node_;
1093
1097 Ogre::SceneNode* model_root_node_;
1098
1102 float height_;
1103
1107 Ogre::SceneNode* direction_node_;
1108
1113
1117 Ogre::SceneNode* solid_collision_node_;
1118
1123
1128
1133
1137 Ogre::SceneNode* talk_collision_node_;
1138
1143
1148
1153
1158
1162 std::vector<ScriptId> sync_;
1163
1168
1173
1178
1182 Ogre::Vector3 move_position_;
1183
1188
1193
1198
1203
1208
1213
1218
1223
1227 Ogre::Vector3 linear_start_;
1228
1232 Ogre::Vector3 linear_end_;
1233
1238
1242 Ogre::Vector3 jump_start_;
1243
1247 Ogre::Vector3 jump_end_;
1248
1253
1258
1263
1268
1273
1278
1283
1288
1293
1297 std::vector<ScriptId> offset_sync_;
1298
1303
1308
1313
1318
1323
1328
1333
1337 std::vector<ScriptId> turn_sync_;
1338
1343
1348
1352 std::vector<ScriptId> animation_sync_;
1353
1358
1363
1368
1373
1378
1379 private:
1380
1385
1392 Ogre::Degree GetDirectionToEntity(Entity* entity) const;
1393
1398
1403
1408
1413
1414};
1415
float * position
Used to keep track of the skeleton and it's bones positions.
Definition: DrawSkeleton.cpp:33
ActionType
Action types.
Definition: Entity.h:26
@ AT_SMOOTH
Smooth action.
Definition: Entity.h:46
@ AT_LINEAR
Linear action.
Definition: Entity.h:38
@ AT_NONE
No action.
Definition: Entity.h:31
TurnDirection
The direction for an entity turn.
Definition: Entity.h:52
@ TD_CLOSEST
Choose direction automatically.
Definition: Entity.h:69
@ TD_CLOCKWISE
Turn clockwise.
Definition: Entity.h:57
@ TD_ANTICLOCKWISE
Turn anticlockwise.
Definition: Entity.h:62
LinearMovement
Linear movement modes.
Definition: Entity.h:75
@ LM_UP_TO_DOWN
Move down.
Definition: Entity.h:80
@ LM_RIGHT_TO_LEFT
Move left.
Definition: Entity.h:95
@ LM_LEFT_TO_RIGHT
Move right.
Definition: Entity.h:90
@ LM_DOWN_TO_UP
Move up.
Definition: Entity.h:85
An entity collision.
Definition: EntityCollision.h:24
An entity direction.
Definition: EntityDirection.h:24
Any entity in a field.
Definition: Entity.h:101
Ogre::Degree turn_direction_end_
Turn final orientation.
Definition: Entity.h:1312
float solid_radius_
The entity's solid radius.
Definition: Entity.h:1127
const Ogre::Vector3 & GetLinearEnd() const
Retrieves the ending point of the current linear movement.
Definition: Entity.cpp:433
int linear_dest_triangle_
Triangle to set the entity on after a linear movement.
Definition: Entity.h:1237
const Ogre::Vector3 & GetMovePosition() const
Retrieves the entity's movement destination position.
Definition: Entity.cpp:323
TurnDirection turn_direction_
Turn movement direction.
Definition: Entity.h:1302
void SetMovePosition(const Ogre::Vector3 &target)
Sets the entity's movement destination position.
Definition: Entity.cpp:321
bool IsLine()
Checks if the entity is a line.
Definition: Entity.cpp:683
void SetTurnCurrentSeconds(const float seconds)
Sets the turn current duration.
Definition: Entity.cpp:629
void ScriptGetPosition() const
Retrieves the entity position.
Definition: Entity.cpp:218
void ScriptPlayAnimationStop(const char *name)
Stops one of the entity's animations.
Definition: Entity.cpp:645
float move_stop_distance_
Distance between the entity and it's movement destination point.
Definition: Entity.h:1192
float GetOffsetCurrentSeconds() const
Definition: Entity.cpp:541
Ogre::String animation_default_
The name of the entity's default name.
Definition: Entity.h:1367
float GetTalkRadius() const
Retrieves the entity talk radius.
Definition: Entity.cpp:299
float talk_radius_
The radius at which the entity can be interacted with.
Definition: Entity.h:1147
const Ogre::Vector3 & GetOffsetPositionEnd() const
Definition: Entity.cpp:533
float turn_seconds_
Total turn duration.
Definition: Entity.h:1327
const Ogre::String & GetMoveAnimationWalkName() const
Retrieves the entity's walk animation name.
Definition: Entity.cpp:339
std::vector< ScriptId > animation_sync_
Entity's animation sync queue.
Definition: Entity.h:1352
float move_run_speed_
The entity's running speed.
Definition: Entity.h:1177
Ogre::SceneNode * direction_node_
The entity's direction node.
Definition: Entity.h:1107
int ScriptTurnSync()
Adds the entity's turn to the sync queue.
Definition: Entity.cpp:564
void UnsetLinear()
Cancels the entity's current linear movement.
Definition: Entity.cpp:419
EntityDirection * direction_
The entity's direction.
Definition: Entity.h:1112
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.
Definition: Entity.cpp:380
int move_triangle_id_
Entity's movement destination triangle ID.
Definition: Entity.h:1197
const Ogre::String & GetCurrentAnimationName() const
Retrieves the entity's current animation name.
Definition: Entity.cpp:637
AnimationPlayType
Types of animations.
Definition: Entity.h:124
@ PLAY_ONCE
Play the animation once, then stop.
Definition: Entity.h:136
@ PLAY_DEFAULT
Default animation mode.
Definition: Entity.h:131
@ PLAY_LOOPED
Play an animation in a continous loop.
Definition: Entity.h:141
AnimationState animation_state_
The entity's current animation state.
Definition: Entity.h:1357
float turn_current_seconds_
Current turn duration.
Definition: Entity.h:1332
float move_walk_speed_
The entity's walking speed.
Definition: Entity.h:1172
float offset_seconds_
Definition: Entity.h:1287
float ScriptGetRotation() const
Retrieves the entity rotation.
Definition: Entity.cpp:262
const Ogre::Vector3 & GetJumpEnd() const
Retrieves the ending point of the current jump.
Definition: Entity.cpp:485
ActionType GetTurnType() const
Retrieves the turn type.
Definition: Entity.cpp:625
Ogre::String move_animation_walk_
The name of the entity's walk animation.
Definition: Entity.h:1212
float animation_end_time_
Definition: Entity.h:1372
State
Entity state.
Definition: Entity.h:147
@ WALKMESH
The entity is attached to the walkmesh.
Definition: Entity.h:159
@ JUMP
The entity is in the middle of a jump.
Definition: Entity.h:169
@ NONE
No state.
Definition: Entity.h:154
@ LINEAR
The entity is in the middle of a linear movement.
Definition: Entity.h:164
@ NEEDS_TO_REATTACH
The entity has completed an action and needs to be reattached to the walkmesh before continuing execu...
Definition: Entity.h:175
ActionType offset_type_
Definition: Entity.h:1282
float move_auto_speed_
The entity's automatic movement speed.
Definition: Entity.h:1167
void SetIndex(const int index)
Sets the entity index in the field.
Definition: Entity.cpp:269
EntityCollision * solid_collision_
The entity's collision.
Definition: Entity.h:1122
State state_
Entity's movement status.
Definition: Entity.h:1157
int ScriptJumpSync()
Waits for the jump to finish.
Definition: Entity.cpp:451
const int GetJumpDestTriangle() const
Retrieves the ending triangle of the current jump.
Definition: Entity.cpp:493
void ScriptPlayAnimation(const char *name)
Plays one of the entity's animations.
Definition: Entity.cpp:641
Ogre::String animation_current_name_
The entity's current animation name.
Definition: Entity.h:1347
float jump_current_seconds_
Current jump duration.
Definition: Entity.h:1257
const Ogre::Vector3 & GetJumpStart() const
Retrieves the starting point of the current jump.
Definition: Entity.cpp:483
void ScriptSetAnimationSpeed(const float speed)
Sets the animation speed.
Definition: Entity.cpp:633
Ogre::SceneNode * model_node_
The entity's model.
Definition: Entity.h:1092
Ogre::Degree GetTurnDirectionEnd() const
Retrieves the turn ending orientation.
Definition: Entity.cpp:623
Ogre::Vector3 offset_position_end_
Definition: Entity.h:1277
Ogre::Degree GetTurnDirectionStart() const
Retrieves the turn staring orientation.
Definition: Entity.cpp:621
void SetSolid(const bool solid)
Makes the entity solid or non-solid.
Definition: Entity.cpp:290
std::vector< ScriptId > turn_sync_
Entity's turning sync queue.
Definition: Entity.h:1337
void ScriptTurnToEntity(Entity *entity, const TurnDirection turn_direction, const float seconds)
Makes the entity turn towards another entity.
Definition: Entity.cpp:554
virtual void setScale(const Ogre::Vector3 &scale)
Sets the entity scale.
Definition: Entity.cpp:264
virtual bool IsVisible() const =0
Checks if the entity is visible or invisible.
float GetMoveAutoSpeed() const
Retrieves the entity's automatic movement speed.
Definition: Entity.cpp:311
Entity * move_entity_
The entity's movement destination entity.
Definition: Entity.h:1187
bool GetMoveAutoAnimation() const
Checks if the unit can autoanimate while it's moving.
Definition: Entity.cpp:337
bool IsTalkable() const
Checks if an entity is talkable or non-talkable.
Definition: Entity.cpp:303
void SetMoveAutoSpeed(const float speed)
Sets the entity's automatic movement speed.
Definition: Entity.cpp:309
Ogre::SceneNode * scene_node_
The scene node the entity is attached to.
Definition: Entity.h:1087
const int GetLinearDestTriangle() const
Retrieves the ending triangle of the current linear movement.
Definition: Entity.cpp:435
int ScriptLinearSync()
Adds the unit linear movement to the sync queue.
Definition: Entity.cpp:392
void SetJumpCurrentSeconds(const float seconds)
Sets the current duration of the jump.
Definition: Entity.cpp:489
void SetJump(const Ogre::Vector3 &jump_to, const float seconds, const int dest_triangle)
Makes the unit jump to a point in the field.
Definition: Entity.cpp:461
std::vector< ScriptId > sync_
Entity's movement sync queue.
Definition: Entity.h:1162
Ogre::Vector3 jump_start_
The jump starting point.
Definition: Entity.h:1242
ActionType turn_type_
The turn type.
Definition: Entity.h:1322
std::vector< ScriptId > offset_sync_
Definition: Entity.h:1297
void UnsetMove()
Cancels the entity's current movement.
Definition: Entity.cpp:372
Ogre::SceneNode * solid_collision_node_
The entity's collision node.
Definition: Entity.h:1117
ActionType GetOffsetType() const
Definition: Entity.cpp:535
virtual void PlayAnimationContinue(const Ogre::String &animation)=0
Resumes an animation.
virtual void Update()
Updates the entity status.
Definition: Entity.cpp:114
void SetTalkRadius(const float radius)
Sets the entity talk radius.
Definition: Entity.cpp:294
Ogre::Degree turn_direction_start_
Turn initial orientation.
Definition: Entity.h:1307
void ScriptTurnToDirection(const float direction, const TurnDirection turn_direction, const ActionType turn_type, const float seconds)
Makes the entity turn to a fixed direction.
Definition: Entity.cpp:543
float height_
The entity's height.
Definition: Entity.h:1102
bool move_auto_animation_
Indicates if the entity can animate while moving.
Definition: Entity.h:1207
int GetIndex()
Retrieves the entity index in the field.
Definition: Entity.cpp:274
Ogre::Vector3 offset_position_start_
Definition: Entity.h:1272
float GetTurnSeconds() const
Retrieves the turn total duration.
Definition: Entity.cpp:627
bool animation_auto_play_
Indicates if an automation must be played automatically.
Definition: Entity.h:1377
float offset_current_seconds_
Definition: Entity.h:1292
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.
Definition: Entity.cpp:437
void UnsetOffset()
Definition: Entity.cpp:524
AnimationState GetAnimationState() const
Retrieves the entity's current animation state.
Definition: Entity.cpp:639
Ogre::Vector3 jump_end_
The jump ending point.
Definition: Entity.h:1247
void SetRotation(const Ogre::Degree &rotation)
Sets the entity rotation.
Definition: Entity.cpp:235
bool solid_
Indicates it the entity is solid and can handle collisions.
Definition: Entity.h:1132
Entity()
Constructor.
void ScriptOffsetToPosition(const float x, const float y, const float z, const ActionType type, const float seconds)
Definition: Entity.cpp:495
int GetCharacterId()
Retrieves the entity's character ID.
Definition: Entity.cpp:681
Ogre::String move_animation_run_
The name of the entity's run animation.
Definition: Entity.h:1217
Ogre::SceneNode * model_root_node_
The entity's root node.
Definition: Entity.h:1097
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.
void SetPosition(const Ogre::Vector3 &position)
Sets the entity position.
Definition: Entity.cpp:201
void ScriptSetPosition(const float x, const float y, const float z)
Sets the entity position.
Definition: Entity.cpp:203
Ogre::Vector3 move_position_
The entity's movement destination point.
Definition: Entity.h:1182
bool IsCharacter()
Checks if the entity is a character.
Definition: Entity.cpp:679
void ScriptMoveToPosition(const float x, const float y)
Makes the entity move to a point in the map.
Definition: Entity.cpp:343
void ScriptSetDefaultAnimation(const char *animation)
Sets the default animation of the entity.
Definition: Entity.cpp:659
bool move_auto_rotation_
Indicates if the entity can rotate while moving.
Definition: Entity.h:1202
Ogre::SceneNode * talk_collision_node_
The entity's talk collision node.
Definition: Entity.h:1137
Ogre::Vector3 linear_end_
The linear movement ending point.
Definition: Entity.h:1232
void SetMoveWalkSpeed(const float speed)
Sets the entity's walking movement speed.
Definition: Entity.cpp:313
EntityCollision * talk_collision_
The entity's talk collision.
Definition: Entity.h:1142
float GetMoveWalkSpeed() const
Retrieves the entity's walking speed.
Definition: Entity.cpp:315
bool is_character_
Indicates if the entity is a playable character.
Definition: Entity.h:1397
void SetMoveAutoRotation(const bool rotate)
Enables or disables autorotation while the entity is moving.
Definition: Entity.cpp:331
const Ogre::String & GetMoveAnimationRunName() const
Retrieves the entity's run animation name.
Definition: Entity.cpp:341
void SetSolidRadius(const float radius)
Sets the entity's solid radius.
Definition: Entity.cpp:283
State GetState() const
Retrieves the entity's state.
Definition: Entity.cpp:307
virtual void setRootOrientation(const Ogre::Quaternion &root_orientation)
Sets the entity's absolute orientation.
Definition: Entity.cpp:276
const Ogre::Vector3 & GetOffsetPositionStart() const
Definition: Entity.cpp:531
int ScriptMoveSync()
Waits for entity's movement to end.
Definition: Entity.cpp:362
void SetState(const State state)
Sets the entity's state.
Definition: Entity.cpp:305
int index_
Index of the entity on the field.
Definition: Entity.h:1407
float GetOffsetSeconds() const
Definition: Entity.cpp:537
void SetOffset(const Ogre::Vector3 &position)
Sets the entity position.
Definition: Entity.cpp:225
AnimationPlayType animation_play_type_
The entity's current animation type.
Definition: Entity.h:1362
void ScriptMoveToEntity(Entity *entity)
Makes the unit move towards another in the map.
Definition: Entity.cpp:354
float jump_seconds_
Total jump duration.
Definition: Entity.h:1252
void ScriptSetRotation(const float rotation)
Sets the entity rotation.
Definition: Entity.cpp:249
const Ogre::Vector3 GetPosition() const
Retrieves the entity position.
Definition: Entity.cpp:216
void SetMoveAutoAnimation(const bool animate)
Enables or disables autoanimation while the entity is moving.
Definition: Entity.cpp:335
int ScriptAnimationSync()
Adds the entity's animation to the sync queue.
Definition: Entity.cpp:663
Ogre::Vector3 linear_start_
The linear movement starting point.
Definition: Entity.h:1227
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.
Definition: Entity.cpp:574
const Ogre::Vector3 GetOffset() const
Retrieves the entity position.
Definition: Entity.cpp:230
float GetJumpCurrentSeconds() const
Gets the current duration of the jump.
Definition: Entity.cpp:491
virtual void UpdateDebug()
Updates the entity status with debug information.
Definition: Entity.cpp:126
int GetMoveTriangleId() const
Sets the destination triangle in the walkmesh.
Definition: Entity.cpp:329
void SetLinear(const Ogre::Vector3 &end, const LinearMovement movement, const Ogre::String &animation, const float orientation, const int dest_triangle)
Linearly moves the entity.
Definition: Entity.cpp:402
bool jump_was_solid_
Used to store solidity status before a jump.
Definition: Entity.h:1262
const Ogre::String & GetDefaultAnimationName() const
Retrieves the entity's default animation name.
Definition: Entity.cpp:635
bool IsSolid() const
Checks if the entity is solid.
Definition: Entity.cpp:292
const Ogre::Vector3 & GetLinearStart() const
Retrieves the starting point of the current linear movement.
Definition: Entity.cpp:431
Entity * turn_entity_
The turn destination entity.
Definition: Entity.h:1317
bool talkable_
Indicates if the entity can be interacted with.
Definition: Entity.h:1152
virtual ~Entity()
Destructor.
Definition: Entity.cpp:107
void SetMoveRunSpeed(const float speed)
Sets the entity's running movement speed.
Definition: Entity.cpp:317
Ogre::String name_
The name of the entity.
Definition: Entity.h:1082
void UnsetTurn()
Cancels the entity's current jump.
Definition: Entity.cpp:593
int jump_dest_triangle_
Triangle to set the entity on after a jump.
Definition: Entity.h:1267
bool is_line_
Indicates if the entity is a line.
Definition: Entity.h:1412
void SetMoveTriangleId(const int triangle)
Sets the destination triangle in the walkmesh.
Definition: Entity.cpp:327
float animation_speed_
The animation speed.
Definition: Entity.h:1342
Ogre::Degree GetDirectionToEntity(Entity *entity) const
Calculates the angular distance to an entity.
Definition: Entity.cpp:685
AnimationState
Entity animation states.
Definition: Entity.h:108
@ AUTO_ANIMATION
An animation is set to play automatically.
Definition: Entity.h:118
@ REQUESTED_ANIMATION
An animation has been requested.
Definition: Entity.h:113
float GetSolidRadius() const
Retrieves the entity's solid radius.
Definition: Entity.cpp:288
Ogre::Degree CalculateTurnAngle(const Ogre::Degree &start, const Ogre::Degree &end) const
Calculates the turn angle.
Definition: Entity.cpp:600
float GetMoveRunSpeed() const
Retrieves the entity's running speed.
Definition: Entity.cpp:319
int character_id_
The ID of the playable character the entity is, if any.
Definition: Entity.h:1402
void SetOffsetCurrentSeconds(const float seconds)
Definition: Entity.cpp:539
bool GetMoveAutoRotation() const
Checks if the unit can autorotate while it's moving.
Definition: Entity.cpp:333
float GetJumpSeconds() const
Gets the total duration of the jump.
Definition: Entity.cpp:487
virtual void SetVisible(const bool visible)=0
Makes the entity visible or invisible.
virtual void UpdateAnimation(const float delta)=0
Updates the animation state.
float GetMoveStopDistance() const
Retrieves the distance to destination.
Definition: Entity.cpp:325
int ScriptOffsetSync()
Definition: Entity.cpp:514
const Ogre::String & GetName() const
Retrieves the entity name.
Definition: Entity.cpp:199
LinearMovement linear_movement_
The entity's linear movement direction.
Definition: Entity.h:1222
void SetCharacter(int char_id)
Assigns the entity as a character.
Definition: Entity.cpp:673
LinearMovement GetLinearMovement() const
Retrieves the entity's current linear movement.
Definition: Entity.cpp:429
Ogre::Degree GetRotation() const
Retrieves the entity rotation.
Definition: Entity.cpp:251
float GetTurnCurrentSeconds() const
Retrieves the turn current duration.
Definition: Entity.cpp:631
void SetTalkable(const bool talkable)
Sets an entity as talkable or non-talkable.
Definition: Entity.cpp:301
float GetHeight() const
Retrieves the entity's height.
Definition: Entity.cpp:281
void UnsetJump()
Cancels the entity's current jump.
Definition: Entity.cpp:474
Ogre::String String
Definition: TypeDefine.h:37