se_core::PosComponent Class Reference

Parent class for entities that exists in and has a position in the game world. More...

#include <PosComponent.hpp>

Inheritance diagram for se_core::PosComponent:

se_core::Component List of all members.

Public Types

typedef ComponentPtr< PosComponent,
sct_POS > 
Ptr

Public Member Functions

 PosComponent (Composite *owner)
virtual ~PosComponent ()
const Pospos () const
 Return a const reference to the current position of the thing.
bool didMove () const
 Does the PosComponent move during this simulation step?
void resetFutureCoor ()
 Reset the next coordinate.
void resetFutureXZCoor ()
PosnextPos ()
 Get the next coordinate.
const PosnextPos () const
void flip ()
 Flip from Pos() to nextPos().
virtual void leaveCurrentParent ()
 Remove the PosNode from the child list of its parent.
virtual bool changeParent ()
 Move this PosNode from the child list of the old parent, to the child list of the new.
void updateWorldViewPoint ()
 Update the world viewpoint.
void worldCoor (scale_t alpha, Point3 &dest) const
 World coor interpolated between now and next.
void worldViewPoint (scale_t alpha, ViewPoint &dest) const
 World viewpoint interpolated between now and next.
virtual const char * name () const
 By default returns name of composite, which returns name of composite factory.
Compositeowner ()
const Compositeowner () const
 Component type.
Componentcomponent (int type)
const Componentcomponent (int type) const
int type () const
const ComponentFactoryfactory ()
bool isActive ()
bool isDead () const

Static Public Member Functions

PosComponentget (Composite *composite)
PosComponentget (Composite &composite)
const PosComponentget (const Composite &composite)
PosComponentget (Component &component)
const PosComponentget (const Component &component)

Protected Member Functions

virtual void cleanup ()
 Called by Composite.
virtual void setActive (bool state)
 Called by Composite.
virtual void setDead ()
 Called by Composite.
virtual void parentChanged (Composite *newParent, Composite *oldParent)
 Called by Composite.
virtual void zoneChanged (int type, Composite *newArea, Composite *oldArea)
 Called by Composite.
virtual void init ()
 Called by Composite.

Protected Attributes

Pos position_
 Position of the PosComponent at the beginning of the current simulation step.
Pos nextPosition_
 Position of the PosComponent at the beginning of the next simulation step.
bool didMove_
 Flag which indicates that the PosComponent moves between the current and the next simulation step.
bool isCollideable_
 Flag that indicated wether other PosNodes can collide with this PosNode.
int type_
 The type of Component.
Compositeowner_
const ComponentFactoryfactory_

Friends

class Composite

Detailed Description

Parent class for entities that exists in and has a position in the game world.

PosComponent is the base class for all world entities, including the Area, Thing and Actor classes. It maintains information about the present local coordinate of a world entity, a reference to its parent, a list of its children, and methods for traversing the parents to calculate the world coordinates of the entity.

Definition at line 44 of file PosComponent.hpp.


Member Typedef Documentation

typedef ComponentPtr<PosComponent, sct_POS> se_core::PosComponent::Ptr
 

Definition at line 46 of file PosComponent.hpp.


Constructor & Destructor Documentation

se_core::PosComponent::PosComponent Composite owner  ) 
 

Definition at line 33 of file PosComponent.cpp.

References se_core::sct_POS.

se_core::PosComponent::~PosComponent  )  [virtual]
 

Definition at line 40 of file PosComponent.cpp.


Member Function Documentation

bool se_core::PosComponent::changeParent  )  [virtual]
 

Move this PosNode from the child list of the old parent, to the child list of the new.

You don't call this method directly. It is called automatically by the SagaEngine during the flip phase of a new simulation step.

Definition at line 105 of file PosComponent.cpp.

void se_core::PosComponent::cleanup  )  [protected, virtual]
 

Called by Composite.

Reimplemented from se_core::Component.

Definition at line 97 of file PosComponent.cpp.

const Component* se_core::Component::component int  type  )  const [inline, inherited]
 

Definition at line 71 of file Component.hpp.

References se_core::Component::component().

Component* se_core::Component::component int  type  )  [inline, inherited]
 

Definition at line 67 of file Component.hpp.

References se_core::Composite::component().

Referenced by se_core::Component::component(), se_core::Component::ComponentPtr< T, type >::ComponentPtr(), se_ogre::O3dThingComponent::get(), se_ogre::O3dNodeComponent::get(), and se_ogre::O3dAreaComponent::get().

bool se_core::PosComponent::didMove  )  const [inline]
 

Does the PosComponent move during this simulation step?

Definition at line 96 of file PosComponent.hpp.

Referenced by se_core::Pos::didParentMove().

const ComponentFactory* se_core::Component::factory  )  [inline, inherited]
 

Definition at line 81 of file Component.hpp.

Referenced by se_core::Composite::releaseComponents().

void se_core::PosComponent::flip  ) 
 

Flip from Pos() to nextPos().

Make the next position the current position. This method is called by the Area the beginning of a new AI step.

Definition at line 45 of file PosComponent.cpp.

References se_core::st_AREA, and se_core::Composite::zoneChanged().

Referenced by se_client::PlayerParser::parse().

const PosComponent* se_core::PosComponent::get const Component component  )  [inline, static]
 

Definition at line 73 of file PosComponent.hpp.

References se_core::Composite::component(), and se_core::Component::owner().

PosComponent* se_core::PosComponent::get Component component  )  [inline, static]
 

Definition at line 68 of file PosComponent.hpp.

References se_core::Composite::component(), and se_core::Component::owner().

const PosComponent* se_core::PosComponent::get const Composite composite  )  [inline, static]
 

Definition at line 63 of file PosComponent.hpp.

References se_core::Composite::component().

PosComponent* se_core::PosComponent::get Composite composite  )  [inline, static]
 

Definition at line 58 of file PosComponent.hpp.

References se_core::Composite::component().

PosComponent* se_core::PosComponent::get Composite composite  )  [inline, static]
 

Definition at line 51 of file PosComponent.hpp.

References se_core::Composite::component().

void se_core::Component::init  )  [protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::RootComponent, se_core::SignalAreaComponent, se_ogre::O3dAreaComponent, and se_ogre::O3dThingComponent.

Definition at line 42 of file Component.cpp.

Referenced by se_core::Composite::init().

bool se_core::Component::isActive  )  [inherited]
 

Definition at line 26 of file Component.cpp.

bool se_core::Component::isDead  )  const [inherited]
 

Definition at line 31 of file Component.cpp.

Referenced by se_core::Actor::affect().

void se_core::PosComponent::leaveCurrentParent  )  [virtual]
 

Remove the PosNode from the child list of its parent.

You don't call this method directly. It is called automatically by the SagaEngine during the flip phase of a new simulation step.

Definition at line 89 of file PosComponent.cpp.

const char * se_core::Component::name  )  const [virtual, inherited]
 

By default returns name of composite, which returns name of composite factory.

Reimplemented in se_core::CutsceneAreaComponent, se_core::CutsceneComponent, se_core::CutsceneManager, se_core::CollisionAreaComponent, se_core::SignalAreaComponent, se_core::SignalComponent, se_core::SpawnAreaComponent, se_core::SpawnManager, se_core::ZoneAreaComponent, se_core::ZoneComponent, se_core::ZoneManager, se_basic::NavMeshAreaComponent, se_basic::NavMeshComponent, and se_basic::NavMeshManager.

Definition at line 21 of file Component.cpp.

Referenced by se_core::Area::addNeighbour(), se_core::DefaultTC::collide(), se_core::CoDefault::collide(), se_basic::Say::perform(), and se_ogre::SpeechBubble::speechEvent().

const Pos& se_core::PosComponent::nextPos  )  const [inline]
 

Definition at line 121 of file PosComponent.hpp.

Pos& se_core::PosComponent::nextPos  )  [inline]
 

Get the next coordinate.

Get the precalculated Coor for where the Actor is at the beginning of the next (and the end of this) initiative.

Definition at line 117 of file PosComponent.hpp.

Referenced by se_core::DefaultTC::_pop(), se_core::CoDefault::_pop(), se_core::CollisionAreaComponent::_testCollisionCandidates(), se_core::CollisionAreaComponent::_testCollisionCandidates2(), se_core::Pos::areaCoor(), se_core::Pos::areaFace(), se_core::Pos::areaViewPoint(), se_ogre::O3dAreaComponent::compileStaticGeometry(), se_client::PlayerParser::parse(), se_core::Pos::setParent(), se_ogre::ThingBillboard::ThingBillboard(), and se_core::CollisionComponent::whenDoesGeometryCollide().

const Composite* se_core::Component::owner  )  const [inline, inherited]
 

Component type.

Definition at line 62 of file Component.hpp.

Composite* se_core::Component::owner  )  [inline, inherited]
 

Definition at line 54 of file Component.hpp.

Referenced by se_core::CollisionAreaComponent::_testCollisionCandidates(), se_core::CollisionAreaComponent::_testCollisionCandidates2(), se_core::HealthListeners::add(), se_core::ZoneAreaComponent::addNeighbour(), se_basic::PhTrackingCamera::affect(), se_core::HealthListeners::castHealthChangedEvent(), se_core::Component::ComponentPtr< T, type >::ComponentPtr(), se_ogre::ThingMOManager::create(), se_basic::SimpleAreaThingEncoder::encode(), se_core::SpawnComponent::get(), se_core::SignalComponent::get(), se_core::SignalAreaComponent::get(), se_core::ScriptComponent::get(), get(), se_core::PhysicsComponent::get(), se_core::StatComponent::get(), se_ogre::O3dThingComponent::get(), se_ogre::O3dNodeComponent::get(), se_ogre::O3dAreaComponent::get(), se_core::Pos::hasArea(), se_core::CollisionGrid::insert(), se_core::CollisionComponent::isCollideable(), se_core::ZoneComponent::name(), se_core::Component::ComponentPtr< T, type >::operator=(), se_core::DefaultTC::pop(), se_core::CoDefault::pop(), se_core::DefaultTC::popAndDie(), se_core::CoDefault::popAndDie(), se_core::CollisionAreaComponent::removeCollideable(), se_core::AreaManager::resetThings(), se_core::Actor::scheduleForDestruction(), se_core::AreaManager::setActive(), se_core::AreaManager::setInactive(), and se_ogre::O3dManager::updateStats().

virtual void se_core::Component::parentChanged Composite newParent,
Composite oldParent
[inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::AreaChildComponent, and se_core::NodeComponent.

Definition at line 101 of file Component.hpp.

Referenced by se_core::Composite::resetParent(), and se_core::Composite::setParent().

const Pos& se_core::PosComponent::pos  )  const [inline]
 

Return a const reference to the current position of the thing.

The current position should never be changed. Updates of the position for future steps should happen inside the nextPos(). The nextPos() is copied into pos() at the next AI-step.

The pos() object also contains information about the radius of the collision cylinder of the PosComponent. This is used for the first step of the collision testing. The PosComponentCollide object registered with the PosComponent may perform further collision testing.

Definition at line 90 of file PosComponent.hpp.

Referenced by se_basic::SimpleAreaThingEncoder::encode(), se_core::ThingCollide::isGuilty(), and se_basic::NavMeshArea::path().

void se_core::PosComponent::resetFutureCoor  )  [inline]
 

Reset the next coordinate.

Sets the next coordinate to be the same as the present one.

Definition at line 104 of file PosComponent.hpp.

void se_core::PosComponent::resetFutureXZCoor  )  [inline]
 

Definition at line 106 of file PosComponent.hpp.

virtual void se_core::Component::setActive bool  state  )  [inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::RootChildComponent, se_core::ActionComponent, se_core::CutsceneAreaComponent, se_core::PhysicsAreaComponent, se_core::CollisionAreaComponent, se_core::ScriptComponent, se_core::SignalAreaComponent, se_core::SpawnAreaComponent, se_core::ZoneAreaComponent, se_client::CameraComponent, se_client::PlayerComponent, se_ogre::O3dAreaComponent, se_ogre::O3dThingComponent, and se_basic::NavMeshAreaComponent.

Definition at line 93 of file Component.hpp.

Referenced by se_core::Composite::setActive().

virtual void se_core::Component::setDead  )  [inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::SignalComponent, and se_core::SpawnComponent.

Definition at line 97 of file Component.hpp.

Referenced by se_core::Composite::scheduleForDestruction().

int se_core::Component::type  )  const [inline, inherited]
 

Definition at line 76 of file Component.hpp.

Referenced by se_core::Composite::component().

void se_core::PosComponent::updateWorldViewPoint  ) 
 

Update the world viewpoint.

Updates the world_ attribute in nextPos() make it harmonize with local_.

Definition at line 65 of file PosComponent.cpp.

void se_core::PosComponent::worldCoor scale_t  alpha,
Point3 dest
const
 

World coor interpolated between now and next.

Parameters:
alpha Interpolation value. 0 gets the coordinate at pos(), 1 at nextPos()
dest output value

Definition at line 74 of file PosComponent.cpp.

References se_core::Tuple3::interpolate(), and se_core::Tuple3::set().

Referenced by se_core::CollisionComponent::bouncePoints(), and se_core::CollisionComponent::whenDoesGeometryCollide().

void se_core::PosComponent::worldViewPoint scale_t  alpha,
ViewPoint dest
const
 

World viewpoint interpolated between now and next.

Parameters:
alpha Interpolation value. 0 gets the coordinate at pos(), 1 at nextPos()
dest output value

Definition at line 81 of file PosComponent.cpp.

References se_core::ViewPoint::coor_, se_core::ViewPoint::face_, se_core::Euler3::interpolate(), se_core::Tuple3::interpolate(), and se_core::ViewPoint::setViewPoint().

void se_core::Component::zoneChanged int  type,
Composite newArea,
Composite oldArea
[protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::AreaChildComponent, se_core::CollisionComponent, and se_core::SignalComponent.

Definition at line 37 of file Component.cpp.

Referenced by se_core::Composite::zoneChanged().


Friends And Related Function Documentation

friend class Composite [friend, inherited]
 

Definition at line 89 of file Component.hpp.


Member Data Documentation

bool se_core::PosComponent::didMove_ [protected]
 

Flag which indicates that the PosComponent moves between the current and the next simulation step.

Definition at line 182 of file PosComponent.hpp.

const ComponentFactory* se_core::Component::factory_ [protected, inherited]
 

Definition at line 120 of file Component.hpp.

bool se_core::PosComponent::isCollideable_ [protected]
 

Flag that indicated wether other PosNodes can collide with this PosNode.

Used by the Area class to decide wether the PosNode should be inserted into a collision grid.

Definition at line 187 of file PosComponent.hpp.

Pos se_core::PosComponent::nextPosition_ [protected]
 

Position of the PosComponent at the beginning of the next simulation step.

Definition at line 179 of file PosComponent.hpp.

Composite* se_core::Component::owner_ [protected, inherited]
 

Definition at line 118 of file Component.hpp.

Pos se_core::PosComponent::position_ [protected]
 

Position of the PosComponent at the beginning of the current simulation step.

Definition at line 176 of file PosComponent.hpp.

int se_core::Component::type_ [protected, inherited]
 

The type of Component.

Definition at line 117 of file Component.hpp.


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

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:27 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo