se_core::CoDefault Class Reference

#include <CoDefault.hpp>

Inheritance diagram for se_core::CoDefault:

se_core::ThingCollide se_core::Object List of all members.

Public Types

enum  Substance {
  UNDEFINED, MOBILE, STATIC, GAS,
  MISSILE, PICK
}

Public Member Functions

 CoDefault ()
 CoDefault (const char *name)
bool collide (ContactInfo &pusher, const ContactInfo &target) const
int id () const
 Get the Object id of the object.
virtual const char * name () const
 Get the name of the Object.
int type () const
 Get the type of the Object (got_ACTION, got_THING, etc).

Static Public Member Functions

const ThingCollidelookup (const char *name)
int hash (int type, const char *name)
 Calculate hash (object id) given object type and name.

Public Attributes

const unsigned int PROPERTY_COLLIDE_SELF

Protected Member Functions

bool pop (ContactInfo &pusher, const ContactInfo &target) const
bool popAndDie (ContactInfo &pusher, const ContactInfo &target) const
void bounce (ContactInfo &pusher, const ContactInfo &target) const
void rebound (ContactInfo &pusher, const ContactInfo &target) const
bool slide (ContactInfo &pusher, const ContactInfo &target) const
void _away (ContactInfo &pusher, const ContactInfo &target, float speed) const
void slideOrRebound (ContactInfo &pusher, const ContactInfo &target) const
void slideOrBounce (ContactInfo &pusher, const ContactInfo &target) const
bool isGuilty (CollisionComponent &pusher, const CollisionComponent &target) const
 Returns true if the pusher caused the collision.
bool isGuilty (ContactInfo &pusher, const ContactInfo &target) const

Static Protected Member Functions

bool _pop (se_core::Composite &spawner, unsigned int hash)
const Object_lookup (int hash)
const Object_lookup (int type, const char *name)

Member Enumeration Documentation

enum se_core::CoDefault::Substance
 

Enumeration values:
UNDEFINED 
MOBILE 
STATIC 
GAS 
MISSILE 
PICK 

Definition at line 35 of file CoDefault.hpp.


Constructor & Destructor Documentation

se_core::CoDefault::CoDefault  ) 
 

Definition at line 31 of file CoDefault.cpp.

se_core::CoDefault::CoDefault const char *  name  ) 
 

Definition at line 37 of file CoDefault.cpp.


Member Function Documentation

void se_core::CoDefault::_away ContactInfo pusher,
const ContactInfo target,
float  speed
const [protected]
 

const Object* se_core::Object::_lookup int  type,
const char *  name
[inline, static, protected, inherited]
 

Definition at line 102 of file Object.hpp.

const Object * se_core::Object::_lookup int  hash  )  [static, protected, inherited]
 

Definition at line 56 of file Object.cpp.

References se_core::ObjectRepository::get(), and se_core::CompSchema::objectRepository().

Referenced by se_core::Signal::lookup(), se_core::Script::lookup(), se_core::QuestGoal::lookup(), se_core::Cutscene::lookup(), se_core::ThingCollide::lookup(), se_core::Physics::lookup(), se_core::Ambience::lookup(), and se_core::Action::lookup().

bool se_core::CoDefault::_pop se_core::Composite spawner,
unsigned int  hash
[static, protected]
 

Definition at line 241 of file CoDefault.cpp.

References se_core::Pos::anim(), AssertFatal, se_core::Composite::isDead(), se_core::Composite::name(), se_core::PosComponent::nextPos(), se_core::Anim::setAnim(), se_core::Property::string(), and se_core::Property::valueCount().

void se_core::CoDefault::bounce ContactInfo pusher,
const ContactInfo target
const [protected]
 

Definition at line 68 of file CoDefault.cpp.

References se_core::ContactInfo::bouncePoint_, se_core::ContactInfo::cc_, se_core::Vector3::dot(), se_core::Tuple3::isZero(), se_core::Vector3::normalize(), se_core::Tuple3::scale(), se_core::Tuple3::sub(), se_core::Tuple3::x_, and se_core::Tuple3::y_.

bool se_core::CoDefault::collide ContactInfo pusher,
const ContactInfo target
const [virtual]
 

Returns:
true if the collision blocks the movement of the collider.

Implements se_core::ThingCollide.

Definition at line 43 of file CoDefault.cpp.

References se_core::ContactInfo::cc_, LogFatal, se_core::Component::name(), and se_core::CollisionComponent::substance().

int se_core::Object::hash int  type,
const char *  name
[static, inherited]
 

Calculate hash (object id) given object type and name.

Definition at line 42 of file Object.cpp.

int se_core::Object::id  )  const [inline, inherited]
 

Get the Object id of the object.

Each instance of Object has a unique Object id assigned to it during construction. The id_ is a hash of the name. And will be the same every time the game is run.

Sometimes two different names can give the same hash, and id. When this occurs the name of the object must be changed.

Returns:
The unique Object instance id.

Definition at line 69 of file Object.hpp.

Referenced by se_core::ObjectRepository::add(), se_core::operator<<(), and se_core::ObjectRepository::remove().

bool se_core::ThingCollide::isGuilty ContactInfo pusher,
const ContactInfo target
const [protected, inherited]
 

Definition at line 37 of file ThingCollide.cpp.

References se_core::CollisionComponent::bouncePoint(), se_core::ContactInfo::cc_, coor_double_t, se_core::CollisionComponent::didGeometryCollide(), se_core::PosComponent::pos(), se_core::CollisionComponent::posComponent(), se_core::Pos::worldCoor(), and se_core::Point3::xzDistanceSquared().

bool se_core::ThingCollide::isGuilty CollisionComponent pusher,
const CollisionComponent target
const [protected, inherited]
 

Returns true if the pusher caused the collision.

Utility function that is meant to be used from collide method in subclasses.

Definition at line 61 of file ThingCollide.cpp.

References se_core::CollisionComponent::bouncePoint(), coor_double_t, se_core::CollisionComponent::didGeometryCollide(), se_core::PosComponent::pos(), se_core::CollisionComponent::posComponent(), se_core::Pos::worldCoor(), and se_core::Point3::xzDistanceSquared().

const ThingCollide* se_core::ThingCollide::lookup const char *  name  )  [inline, static, inherited]
 

Definition at line 38 of file ThingCollide.hpp.

References se_core::Object::_lookup(), and se_core::got_THING_COLLIDE.

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

Get the name of the Object.

Returns:
The name of the Object, or 0 if is not named.

Definition at line 78 of file Object.hpp.

Referenced by se_core::operator<<(), se_core::CutsceneParser::parse(), and se_basic::Say::perform().

bool se_core::CoDefault::pop ContactInfo pusher,
const ContactInfo target
const [protected]
 

Definition at line 210 of file CoDefault.cpp.

References se_core::Property::action(), AssertWarning, se_core::ContactInfo::cc_, se_core::CHANNEL_MOVEMENT, se_core::Property::hashValue(), se_core::Composite::name(), se_core::Component::owner(), and se_core::Property::type().

bool se_core::CoDefault::popAndDie ContactInfo pusher,
const ContactInfo target
const [protected]
 

Definition at line 199 of file CoDefault.cpp.

References se_core::ContactInfo::cc_, se_core::Component::owner(), and se_core::Composite::scheduleForDestruction().

void se_core::CoDefault::rebound ContactInfo pusher,
const ContactInfo target
const [protected]
 

Definition at line 117 of file CoDefault.cpp.

References se_core::ContactInfo::bouncePoint_, se_core::ContactInfo::cc_, se_core::Vector3::dot(), se_core::Tuple3::isZero(), se_core::Vector3::normalize(), se_core::Tuple3::scale(), se_core::Tuple3::sub(), and se_core::Tuple3::y_.

bool se_core::CoDefault::slide ContactInfo pusher,
const ContactInfo target
const [protected]
 

Definition at line 179 of file CoDefault.cpp.

References se_core::ContactInfo::bouncePoint_, coor_double_t, se_core::COOR_STEP, coor_t, se_core::ContactInfo::radius_, and se_core::Point3::xzDistanceSquared().

void se_core::CoDefault::slideOrBounce ContactInfo pusher,
const ContactInfo target
const [inline, protected]
 

Definition at line 52 of file CoDefault.hpp.

void se_core::CoDefault::slideOrRebound ContactInfo pusher,
const ContactInfo target
const [inline, protected]
 

Definition at line 47 of file CoDefault.hpp.

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

Get the type of the Object (got_ACTION, got_THING, etc).

Classes subclassing game objects should have a type enumerated in the enum ObjectType. The subclass is itself responsible for reporting the type during construction, and a whole subclass hierarchy may share the same type (like Action and its subclasses, Script and its subclasses, etc).

Returns:
The type of the game object.

Definition at line 91 of file Object.hpp.

Referenced by se_core::operator<<().


Member Data Documentation

const unsigned int se_core::CoDefault::PROPERTY_COLLIDE_SELF
 

Definition at line 36 of file CoDefault.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