Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Object Class Reference

#include <object.h>

Inheritance diagram for Object:

Actor List of all members.

Public Member Functions

 Object (Model *model, Vec3 position=Vec3(0.0, 0.0, 0.0), dMatrix3 orientation=NULL, Vec3 scale=Vec3(1.0, 1.0, 1.0), double mass=1.0, bool on=false, bool stationary=true, bool movable=false, const bool rotatable[3]=NULL)
virtual EffectHandler get_effect_handler (Effect *effect)
virtual void render (bool selected=false)
void draw_decor (const Vec3 &color)
virtual void apply_transform (void)
virtual void tick (double t)
virtual void start_sim (void)
virtual void stop_sim (void)
virtual void collide (dContact *contact)
 notify the object that he has been collided with.

void set_id (int id)
void set_position (const Vec3 &pos)
void set_orientation_mat (const dMatrix3 orientation)
void set_orientation_quat (const dQuaternion orientation)
void set_scale (const Vec3 s)
void set_stationary (const bool s)
void set_movable (const bool s)
void set_rotatable (const bool s[3])
void set_ethereal (const bool e)
void set_on (const bool o)
void set_bbox_color (const Vec3 &v)
int get_id () const
Vec3 get_position (void) const
void get_orientation_mat (dMatrix3 dmat3) const
Mat4 get_orientation_mat () const
void get_orientation_quat (dQuaternion dquat) const
Quat get_orientation_quat () const
Vec3 get_forward_vec () const
Vec3 get_up_vec () const
virtual double get_mass (void) const
virtual Vec3 get_scale (void) const
virtual bool is_stationary (void) const
virtual bool is_movable (void) const
virtual bool is_rotatable (int i) const
virtual bool is_ethereal (void) const
virtual bool is_on (void) const
virtual Vec3 get_bbox_color () const
virtual Modelget_model () const
virtual string get_type_str () const
virtual string get_info () const
Vec3 get_init_position (void) const
void get_init_orientation_mat (dMatrix3 dmat3) const
void get_init_orientation_quat (dQuaternion dquat) const
bool is_sim_on (void) const
const dBodyID get_body_id ()
const dGeomID get_geom_id ()
void enable_body (void)
void disable_body (void)

Protected Member Functions

void setup_geom (void)

Protected Attributes

Model_model
 my graphical representation

Vec3 _scale
 the scaling factor

int _id
dBodyID _body_id
dGeomID _geom_id
Vec3 _init_position
dQuaternion _init_orientation
bool _sim_on
dMass _mass
bool _stationary
 does the physical simulation affect me?

bool _movable
 can the user move me?

bool _rotatable [3]
 can the user rotate me about x,y,z?

bool _ethereal
 can objects collide with me / can I overlap objects

bool _on
 am i activated?

Vec3 _bbox_color

Detailed Description

A physical, visible object.

Objects are physical things in the scene, and interact with each other via effects. To receive effects, an Object must implement get_effect_handler(), and return the function it wants called whenever it receives a effect of a given type.


Constructor & Destructor Documentation

Object::Object Model model,
Vec3  position = Vec3(0.0, 0.0, 0.0),
dMatrix3  orientation = NULL,
Vec3  scale = Vec3(1.0, 1.0, 1.0),
double  mass = 1.0,
bool  on = false,
bool  stationary = true,
bool  movable = false,
const bool  rotatable[3] = NULL
 

Constructor.

Parameters:
model the model (graphical representation) of this object. The object *will* obtain possession of the model (and *will* delete it when destructed).
position 3d position of the object.
orientation 3d orientation of the object scaling factor of the object
mass the mass in kg.


Member Function Documentation

void Object::draw_decor const Vec3 &  color  ) 
 

Draw a decoration around the object to show its status.

EffectHandler Object::get_effect_handler Effect effect  )  [virtual]
 

Have the object determine what kind of Effect effect is, and return a method pointer that will handle applications of that effect.

Parameters:
effect the effect that we wish to find the handler for.
Returns:
the handler (method pointer) for the given effect.

void Object::render bool  selected = false  )  [virtual]
 

Render the object to the screen. I think this will actually just call the model's render() function.

void Object::set_id int  id  )  [inline]
 

Accessor functions.

These give access to private object data. See variables for details.

virtual void Object::tick double  t  )  [inline, virtual]
 

This is called every game loop, with however many seconds passed since the last call.

Implements Actor.


The documentation for this class was generated from the following files:
Generated on Sat Mar 13 15:00:11 2004 by doxygen 1.3.5