Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
LxS::Game::GameObject Class Reference

Three dimensional interactive game object that is not a character (typically just a decoration considered by renderer and collision detection system) More...

#include <gameobject.hpp>

Inheritance diagram for LxS::Game::GameObject:
Inheritance graph
Collaboration diagram for LxS::Game::GameObject:
Collaboration graph

Public Types

enum  Rendermode { ForReal, ForCoords3D, ForCoordsGame }
 purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked" More...
 

Public Member Functions

LxS::CoreGraphics::p_Model GetModel ()
 return model of an item (only if it has a graphical representation)
 
 GameObject (Map *p)
 a valid Map object must be given in a constructor
 
void SetFilename (std::string fn)
 set name of file describing this particular game object (its models, textures, animation sequences etc)
 
const std::string GetFilename ()
 return filename
 
virtual void SelectAnimation (std::string seq_name)
 select animation sequences to be played
 
const
LxS::CoreGraphics::TriangleSet
GetWalkableArea () const
 select area alongside which character is allowed to move
 
virtual void SetRotationY (float alpha)
 rotate around axis, that is perpendicular to the ground
 
virtual float GetRotationY ()
 for deserialization, status query etc.
 
virtual void Animate (float dt)
 move contents dt=delta time in seconds since last call to animate;
 
virtual void SetPosition (float x, float y, float z)
 set coordinates of game object in 3D space (its own 0/0/0 point is moved against global 0/0/0)
 
virtual float GetPositionX ()
 where it is (note, that this may be inaccurate if more than one gameobject is represented by the same model mesh; TODO: fix GetPositionX/Y/Z in GameObject)
 
virtual float GetPositionY ()
 where it is
 
virtual float GetPositionZ ()
 where it is
 
virtual void Initialize ()
 set up resources. (this is to facilitate late (delayed) initialization.
 
virtual void Render (Rendermode mode)
 render something
 
virtual void RefreshAssets ()
 To facilitate refreshing app after switching OpenGL Context (as in Android lifecycle)
 
virtual void UnloadResources ()
 free up consumed resources while (possibly temporarily) object is not critical
 
unsigned long GetTexelsCount ()
 sum of dimensionsxdepths of all textures
 
unsigned long GetFacesCount ()
 all 3D faces
 
virtual bool CollisionDetection (GameObject *cb, float x, float y, float z)
 does object cb in pos x,y,z cause collision with THIS?
 
float GetInitializedPercentage ()
 0= uninitialized; 100=ready; other? for progress bars
 

Protected Types

typedef std::map< std::string,
Sequence
AnimationMap
 sequence name, firstxo frame, last frame
 

Protected Attributes

boost::shared_ptr
< LxS::CoreGraphics::Model
p_Model
 pointer to a model
 
std::string object_fn
 filename
 
AnimationMap sequences
 all animation sequences supported
 
AnimationMap::iterator current_sequence
 current animation sequence that is played
 
float current_frame
 animation frame
 
Mapparent_map
 map containing this
 
float AnimationSpeedMultipiler
 set greater than 1 if want to accelerate animation;
 
float initialized_percentage
 0-100; 0- just constructed; 100 - redy to render; 0-100 - for progressbar
 

Detailed Description

Three dimensional interactive game object that is not a character (typically just a decoration considered by renderer and collision detection system)

Member Enumeration Documentation

purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked"

Enumerator
ForReal 

proper rendering for display

ForCoords3D 

rendering for coordinate detection

ForCoordsGame 

for detection of ingame coordinate system - unused


The documentation for this class was generated from the following files: