18#include <OgreSingleton.h>
111 const Ogre::Vector3&
position,
const Ogre::Degree& direction,
int index
129 const Ogre::Vector3&
position,
const Ogre::Degree& rotation,
130 const Ogre::Vector3& scale,
const Ogre::Quaternion& root_orientation,
const int index
147 const char* name,
const char* file_name,
148 const float x,
const float y,
const float z,
const float direction,
int index
164 const Ogre::Vector3& point2,
const bool enabled
322 bool IsKeyOn(
unsigned int key_code);
330 bool IsKeyOff(
unsigned int key_code);
369 const Ogre::Vector2& point,
370 const Ogre::Vector3&
a,
const Ogre::Vector3&
b,
const Ogre::Vector3& c
384 const Ogre::Vector2& point,
const Ogre::Vector2& p1,
const Ogre::Vector2& p2
400 const Ogre::Vector3& point,
const Ogre::Vector3& point_a,
const Ogre::Vector3& point_b,
412 const Ogre::Vector3& current_point,
const Ogre::Vector3& direction_point
458 const Ogre::Vector3&
position,
const Ogre::Degree& rotation,
459 const Ogre::Vector3& scale,
const Ogre::Quaternion& root_orientation,
const int index
477 const Ogre::Vector3&
position,
const Ogre::Degree& orientation,
478 const Ogre::Vector3& scale,
const Ogre::Quaternion& root_orientation,
const int index
517 Entity* entity, Ogre::Vector3&
position,
const Ogre::Vector2& move_vector
float * position
Used to keep track of the skeleton and it's bones positions.
Definition: DrawSkeleton.cpp:33
uint16 a
Alpha component.
Definition: TxzFileSerializer.h:19
uint16 b
Blue component.
Definition: TxzFileSerializer.h:14
A field background.
Definition: Background2D.h:29
The entity manager.
Definition: EntityManager.h:30
Walkmesh walkmesh_
The map walkmesh.
Definition: EntityManager.h:601
bool PerformWalkmeshMove(Entity *entity, const float speed)
Moves an entity in the walkmesh.
Definition: EntityManager.cpp:751
Ogre::Entity * grid_
Definition: EntityManager.h:682
Ogre::String entity_table_name_
The entity table name.
Definition: EntityManager.h:611
void ClearBattle() override
Clears all battle information in the entity manager.
Definition: EntityManager.cpp:449
bool random_encounters_
Indicates if random encounters happen in the map.
Definition: EntityManager.h:692
bool CheckSolidCollisions(Entity *entity, Ogre::Vector3 &position)
Checks for collisions of the entity with other entities.
Definition: EntityManager.cpp:1047
Background2D background_2d_
The map background.
Definition: EntityManager.h:606
void ScriptAddEntity(const char *name, const char *file_name, const float x, const float y, const float z, const float direction, int index)
Adds an entity to the manager.
Definition: EntityManager.cpp:507
float encounter_rate_
The encounter rate of the map.
Definition: EntityManager.h:697
bool IsKeyOff(unsigned int key_code)
Checks if a key is not being pressed.
Definition: EntityManager.cpp:674
bool GetRandomEncounters()
Checks if random battle encounters are active in the field.
Definition: EntityManager.cpp:646
bool WalkmeshBorderCross(Entity *entity, Ogre::Vector3 &position, const Ogre::Vector2 &move_vector)
Checks if the entity is crossing a walkmesh triangle border.
Definition: EntityManager.cpp:1005
void UpdateWorld() override
Updates the world map entities in the manager.
Definition: EntityManager.cpp:307
std::vector< EntityTrigger * > entity_triggers_
List of triggers.
Definition: EntityManager.h:662
Ogre::Radian player_move_rotation_
The playable entity current movement turn indicator.
Definition: EntityManager.h:645
void ClearField() override
Clears all field information in the entity manager.
Definition: EntityManager.cpp:422
static const unsigned int WORLD_MAP_BACKGROUND_ID
Entity ID for world map background entity.
Definition: EntityManager.h:428
void ScriptAddEntityScript(const char *name)
Adds an entity script to the manager.
Definition: EntityManager.cpp:546
Ogre::Vector3 player_move_
The playable entity current movement indicator.
Definition: EntityManager.h:638
void CheckTriggers(Entity *entity, const Ogre::Vector3 &position)
Checks for entity triggers near a entity.
Definition: EntityManager.cpp:1072
bool player_run_
Indicates if the playable is being moved by running.
Definition: EntityManager.h:657
Entity * player_entity_
The player controlled entity.
Definition: EntityManager.h:631
void AddEntity(const Ogre::String &name, const Ogre::String &file_name, const Ogre::Vector3 &position, const Ogre::Degree &direction, int index)
Adds an entity to the manager.
Definition: EntityManager.cpp:484
float GetEncounterRate()
Get the encounter rate for the field.
Definition: EntityManager.cpp:650
void SetRandomEncounters(bool active)
Enables or disables random encounters in the field.
Definition: EntityManager.cpp:648
void ScriptSetPlayerEntity(const char *name)
Sets the playable entity.
Definition: EntityManager.cpp:597
EntityPoint * ScriptGetEntityPoint(const char *name) const
Retrieves an entity point by name.
Definition: EntityManager.cpp:591
Ogre::SceneNode * scene_node_
The scene node.
Definition: EntityManager.h:677
void AddBattleEntity(const Ogre::String &name, const Ogre::String &file_name, const Ogre::Vector3 &position, const Ogre::Degree &orientation, const Ogre::Vector3 &scale, const Ogre::Quaternion &root_orientation, const int index)
Adds a battle entity to the manager.
Definition: EntityManager.cpp:331
std::vector< Entity * > battle_entity_
The list of battle entities.
Definition: EntityManager.h:621
void AddEntityScript(const Ogre::String &name)
Adds an entity script to the manager.
Definition: EntityManager.cpp:540
void SetNextTurnStep(Entity *entity)
Calculates the next turn step for an entity.
Definition: EntityManager.cpp:1278
virtual ~EntityManager()
Destructor.
Definition: EntityManager.cpp:126
static Ogre::Degree GetDirectionToPoint(const Ogre::Vector3 ¤t_point, const Ogre::Vector3 &direction_point)
Calculates the direction degree between to points.
Definition: EntityManager.cpp:92
Entity * background_3d_
A 3D background.
Definition: EntityManager.h:626
EntityManager()
Constructor.
Definition: EntityManager.cpp:103
Entity * ScriptGetEntity(const char *name) const
Retrieves an entity by name.
Definition: EntityManager.cpp:587
Entity * GetBackground3D() const
Retrieves the entity associated to the 3D background.
Definition: EntityManager.cpp:375
void SetBackground3D(const Ogre::String &name, const Ogre::String &file_name)
Sets the 3D model for the background.
Definition: EntityManager.cpp:383
void CheckEntityInteract()
Checks if an entity can be interacted.
Definition: EntityManager.cpp:1209
std::vector< Ogre::String > entity_scripts_
List of scripts.
Definition: EntityManager.h:672
bool player_lock_
Indicates if player control is locked.
Definition: EntityManager.h:650
void AddFieldOrWorldMapEntity(const Ogre::String &name, const Ogre::String &file_name, const Ogre::Vector3 &position, const Ogre::Degree &rotation, const Ogre::Vector3 &scale, const Ogre::Quaternion &root_orientation, const int index)
Adds a field entity to the manager.
Definition: EntityManager.cpp:311
bool SetEntityOnWalkmesh(Entity *entity)
Attaches an entity to the walkmesh.
Definition: EntityManager.cpp:699
Entity * ScriptGetPlayerEntity() const
Retrieves the playable entity.
Definition: EntityManager.cpp:613
void ScriptPlayerLock(const bool lock)
Locks or unlocks player control of the playable entity.
Definition: EntityManager.cpp:629
static const float SCENE_SCALE
Scale factor for battle background models.
Definition: EntityManager.h:418
Walkmesh * GetWalkmesh()
Retrieves the walkmesh.
Definition: EntityManager.cpp:480
std::vector< EntityPoint * > entity_points_
List of points.
Definition: EntityManager.h:667
Ogre::Entity * axis_
Definition: EntityManager.h:687
void AddEntityTrigger(const Ogre::String &name, const Ogre::Vector3 &point1, const Ogre::Vector3 &point2, const bool enabled)
Adds an entity trigger to the manager.
Definition: EntityManager.cpp:512
static float PointElevation(const Ogre::Vector2 &point, const Ogre::Vector3 &a, const Ogre::Vector3 &b, const Ogre::Vector3 &c)
Calculates the point elevation over a plane.
Definition: EntityManager.cpp:46
void SetEntityToCharacter(const char *entity_name, unsigned int char_id)
Assigns a character to an entity.
Definition: EntityManager.cpp:676
Entity * GetEntity(const Ogre::String &name) const
Retrieves an entity by name.
Definition: EntityManager.cpp:548
void SetPlayerMoveRotation(const Ogre::Radian rotation)
Sets the baseline rotation for the player controlled entity.
Definition: EntityManager.cpp:638
static const unsigned int BATTLE_BACKGROUND_ID
Entity ID for battle background entity.
Definition: EntityManager.h:423
void UpdateField() override
Updates the field entities in the manager.
Definition: EntityManager.cpp:176
void Input(const VGears::Event &event) override
Handles an input event.
Definition: EntityManager.cpp:136
void SetEntityDirectionByVector(Entity *entity, const Ogre::Vector2 &vector)
Sets an entity direction.
void SetEncounterRate(float rate)
Sets the battle encounter rate.
Definition: EntityManager.cpp:652
bool IsKeyOn(unsigned int key_code)
Checks if a key is being pressed.
Definition: EntityManager.cpp:658
Background2D * GetBackground2D()
Retrieves the 2D background.
Definition: EntityManager.cpp:482
void SetNextJumpStep(Entity *entity)
Calculates and sets the next position during a jump.
Definition: EntityManager.cpp:1375
void OnResize() override
Handles resizing events.
Definition: EntityManager.cpp:420
void AddEntityPoint(const Ogre::String &name, const Ogre::Vector3 &position, const float rotation)
Adds an entity point to the manager.
Definition: EntityManager.cpp:527
void SetNextLinearStep(Entity *entity)
Calculates and sets the next position during a linear movement.
Definition: EntityManager.cpp:1296
void UpdateDebug() override
Updates the entities in the manager with debug information.
Definition: EntityManager.cpp:403
void ClearWorld() override
Clears all world map information in the entity manager.
Definition: EntityManager.cpp:476
Entity * GetEntityFromIndex(const int id) const
Retrieves an entity by it's index in the field.
Definition: EntityManager.cpp:560
static float SideOfVector(const Ogre::Vector2 &point, const Ogre::Vector2 &p1, const Ogre::Vector2 &p2)
Determines at which side of a line a point is.
Definition: EntityManager.cpp:58
std::vector< Entity * > entity_
The list of field or world entities.
Definition: EntityManager.h:616
void ScriptUnsetPlayerEntity()
Unsets any playable entities.
Definition: EntityManager.cpp:621
static float SquareDistanceToLine(const Ogre::Vector3 &point, const Ogre::Vector3 &point_a, const Ogre::Vector3 &point_b, Ogre::Vector3 &proj)
Calculates the square distance between a point and a line.
Definition: EntityManager.cpp:66
void SetNextScrollStep()
Definition: EntityManager.cpp:1400
Entity * GetEntityFromCharacterId(const int id) const
Retrieves an entity by it's assigned character ID.
Definition: EntityManager.cpp:574
void UpdateBattle() override
Updates the battle entities in the manager.
Definition: EntityManager.cpp:294
void SetNextOffsetStep(Entity *entity)
Calculates the next offset step for an entity.
Definition: EntityManager.cpp:1259
An entity point.
Definition: EntityPoint.h:22
Any entity in a field.
Definition: Entity.h:101
A base manager.
Definition: Manager.h:24
A walkmesh.
Definition: Walkmesh.h:68
Ogre::String String
Definition: TypeDefine.h:37
An input event.
Definition: Event.h:84