Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WPCG::WP_DynamicObject Class Reference

#include <WP_ObjectManager.h>

Inheritance diagram for WPCG::WP_DynamicObject:

WPCG::WP_Object List of all members.

Public Methods

virtual ~WP_DynamicObject ()
void changeHeading (scalar delta_degrees)
void changePitch (scalar delta_degrees)
void changeRoll (scalar delta_degrees)
void changeSpeed (scalar delta_speed)
void setNewHeading (scalar new_heading)
void setNewPitch (scalar new_pitch)
void setNewRoll (scalar new_roll)
void setNewSpeed (scalar new_speed)
void setVelocityVector (const WP_Vector3D &vector)
void move ()
void print () const
void onCollision ()

Public Attributes

WP_Vector3D velocity
scalar speed

Protected Methods

 WP_DynamicObject ()
 WP_DynamicObject (const WP_Matrix3D &_matrix, const string &name, const WP_Vector3D &_velocity)
 WP_DynamicObject (const WP_Matrix3D &_matrix, const string &name, scalar _heading, scalar _speed, scalar _pitch)
scalar computeHeading () const
scalar computePitch () const
WP_Vector3D computeVelocityVector ()

Static Protected Attributes

WP_Mathmath = WP_Math::getInstance()

Friends

class WP_ObjectManager

Detailed Description

this class represents a dynamic object in a 3D scene. A dynamic object is an object which is able to change its position and its orientation
Author:
Copyright (C) 2001-2003 W.P. van Paassen peter@paassen.tmfweb.nl
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


Constructor & Destructor Documentation

virtual WPCG::WP_DynamicObject::~WP_DynamicObject   [inline, virtual]
 

WPCG::WP_DynamicObject::WP_DynamicObject   [inline, protected]
 

WPCG::WP_DynamicObject::WP_DynamicObject const WP_Matrix3D   _matrix,
const string &    name,
const WP_Vector3D   _velocity
[protected]
 

Parameters:
_matrix  a WP_Matrix3D object holding the world matrix of this object
name  the name of the object
_velocity  a WP_Vector3D object representing the velocity vector of this object

WPCG::WP_DynamicObject::WP_DynamicObject const WP_Matrix3D   _matrix,
const string &    name,
scalar    _heading,
scalar    _speed,
scalar    _pitch
[protected]
 

Parameters:
_matrix  a WP_Matrix3D object holding the world matrix of this object
name  the name of the object
_heading  the heading in degrees of the object
_speed  the speed of the object
_pitch  the pitch in degrees of the object


Member Function Documentation

void WPCG::WP_DynamicObject::changeHeading scalar    delta_degrees
 

this function changes the heading of the object

Parameters:
delta_degrees  the amount of change in degrees of the heading according to the current heading

void WPCG::WP_DynamicObject::changePitch scalar    delta_degrees
 

this function changes the pitch of the object

Parameters:
delta_degrees  the amount of change in degrees of the pitch according to the current pitch

void WPCG::WP_DynamicObject::changeRoll scalar    delta_degrees
 

this function changes the roll of the object

Parameters:
delta_degrees  the amount of change in degrees of the roll according to the current roll

void WPCG::WP_DynamicObject::changeSpeed scalar    delta_speed
 

this function changes the speed of the object and computes the new velocity vector

Parameters:
delta_speed  the amount of change in speed according to the current speed

scalar WPCG::WP_DynamicObject::computeHeading   const [protected]
 

this function computes the heading of the object according to its velocity vector

Returns:
the heading in degrees of the object

scalar WPCG::WP_DynamicObject::computePitch   const [protected]
 

this function computes the pitch of the object according to its velocity vector

Returns:
the pitch in degrees of the object

WP_Vector3D WPCG::WP_DynamicObject::computeVelocityVector   [protected]
 

this function computes the velocity vector of the object according to the object its speed, heading and pitch

Returns:
a WP_Vector3D object representing the velocity vector of the object

void WPCG::WP_DynamicObject::move  
 

this function moves the object according its velocity vector

void WPCG::WP_DynamicObject::onCollision   [inline, virtual]
 

Implements WPCG::WP_Object.

void WPCG::WP_DynamicObject::print   const [virtual]
 

this function prints the actual state of the dynamic object to standard output

Reimplemented from WPCG::WP_Object.

void WPCG::WP_DynamicObject::setNewHeading scalar    new_heading
 

this function sets the heading of the object to the new_heading

Parameters:
new_heading  the new heading of the object

void WPCG::WP_DynamicObject::setNewPitch scalar    new_pitch
 

this function sets the pitch of the object to the new_pitch

Parameters:
new_pitch  the new pitch of the object

void WPCG::WP_DynamicObject::setNewRoll scalar    new_roll
 

this function sets the roll of the object to the new_roll

Parameters:
new_roll  the new roll of the object

void WPCG::WP_DynamicObject::setNewSpeed scalar    new_speed
 

this function sets the speed of the object to the new_speed

Parameters:
new_speed  the new speed of the object

void WPCG::WP_DynamicObject::setVelocityVector const WP_Vector3D   vector
 

this function sets the velocity vector to the given vector. The speed, heading and pitch are corrected to match the new velocity vector

Parameters:
vector  the new velocity vector of the object


Friends And Related Function Documentation

friend class WP_ObjectManager [friend]
 


Member Data Documentation

WP_Math * WPCG::WP_DynamicObject::math = WP_Math::getInstance() [static, protected]
 

a pointer to the only instance of the WP_Math class

scalar WPCG::WP_DynamicObject::speed
 

the speed of the object, this is the length (square root) of the velocity vector

WP_Vector3D WPCG::WP_DynamicObject::velocity
 

a WP_Vector3D object representing the velocity vector of the object


The documentation for this class was generated from the following files:
Generated on Tue Jan 28 20:26:37 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002