Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members
WPCG::WP_ObjectManager Class Reference
#include <WP_ObjectManager.h>
List of all members.
Public Methods |
| ~WP_ObjectManager () |
WP_StaticObject * | createStaticObject (const WP_Matrix3D &matrix, const string &object_name, const string &model_name) |
WP_DynamicObject * | createDynamicObject (const WP_Matrix3D &matrix, const string &object_name, const string &model_name, const WP_Vector3D &velocity=WP_Vector3D()) |
void | addLight (const WP_Point3D &position, const WP_Color &ambient, const WP_Color &diffuse, const WP_Color &specular, const WP_Color &emissive, bool remote=true) |
WP_Object * | getObject (const string &name) const |
WP_StaticObject * | getNextStaticObject (const WP_StaticObject *last) const |
WP_DynamicObject * | getNextDynamicObject (const WP_DynamicObject *last) const |
WP_StaticObject * | getStaticObject () const |
WP_DynamicObject * | getDynamicObject () const |
WP_StaticObject * | getStaticObject (const string &name) const |
WP_DynamicObject * | getDynamicObject (const string &name) const |
bool | removeObject (const string &name) |
bool | removeStaticObject (const string &name) |
bool | removeDynamicObject (const string &name) |
bool | removeSameObjects (const string &name) |
bool | removeAll () |
void | drawObjectsSelection () |
WP_Object * | pickObject (int x, int y) |
void | createCollisionPairs () |
void | updateAll () |
Static Public Methods |
WP_ObjectManager * | getInstance () |
Public Attributes |
unsigned int | number_collisions |
Detailed Description
this singleton class creates and manages all created static and dynamic objects
-
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
WPCG::WP_ObjectManager::~WP_ObjectManager |
( |
|
) |
|
|
Member Function Documentation
void WPCG::WP_ObjectManager::createCollisionPairs |
( |
|
) |
|
|
|
this function is used for the creation of a dynamic object -
Parameters:
-
matrix |
a WP_Matrix3D object holding the world matrix of this object |
object_name |
the name of the object |
model_name |
the name of the 3D model belonging to the object |
velocity |
a WP_Vector3D object representing the velocity vector of the object |
-
Returns:
-
a pointer to a WP_Object representing the newly created dynamic object
|
WP_StaticObject * WPCG::WP_ObjectManager::createStaticObject |
( |
const WP_Matrix3D & |
matrix, |
|
|
const string & |
object_name, |
|
|
const string & |
model_name |
|
) |
|
|
|
this function is used for the creation of a static object -
Parameters:
-
matrix |
a WP_Matrix3D object holding the world matrix of this object |
object_name |
the name of the object |
model_name |
the name of the 3D model belonging to the object |
-
Returns:
-
a pointer to a WP_Object representing the newly created static object
|
void WPCG::WP_ObjectManager::drawObjectsSelection |
( |
|
) |
|
|
|
this function draws all objects currently in the camera's viewing volume to the selection buffer. In this way it is possible to determine which object in the 3D scene was picked by the user |
WP_DynamicObject * WPCG::WP_ObjectManager::getDynamicObject |
( |
const string & |
name |
) |
const |
|
|
this function returns the dynamic object from the object manager's internal dynamic object list with name name -
Parameters:
-
name |
the name of the dynamic object |
-
Returns:
-
a pointer to a WP_DynamicObject object matching name
|
|
this function returns the first dynamic object in the object manager's internal dynamic object list -
Returns:
-
a pointer to a WP_Dynamic object representing the first object in the dynamic object list
|
WP_ObjectManager* WPCG::WP_ObjectManager::getInstance |
( |
|
) |
[inline, static] |
|
|
this function is used to obtain a pointer to the only instance of this class (singleton) -
Returns:
-
a pointer to the only instance of this class
|
|
this function returns the next dynamic object following last in the object manager's internal dynamic object list -
Parameters:
-
last |
a pointer to a WP_DynamicObject to indicate the position of the object preceeding the wanted object. If this pointer is 0, the first object in the dynamic object list is returned. If last is the last object in the list, the first object is returned |
-
Returns:
-
a pointer to a WP_Object representing the next object (or first if last>/i> is 0 or last is the last object in the list, 0 in case of no available objects
|
|
this function returns the next static object following last in the object manager's internal static object list -
Parameters:
-
last |
a pointer to a WP_StaticObject to indicate the position of the object preceeding the wanted object. If this pointer is 0, the first object in the static object list is returned. If last is the last object in the list, the first object is returned |
-
Returns:
-
a pointer to a Object representing the next object (or first if last>/i> is 0 or last is the last object in the list, 0 in case of no available objects
|
WP_Object * WPCG::WP_ObjectManager::getObject |
( |
const string & |
name |
) |
const |
|
|
this function returns a pointer to an object with name name -
Parameters:
-
name |
the name of the to be retrieved object |
-
Returns:
-
a pointer to a WP_Object representing the object with name name
|
WP_StaticObject * WPCG::WP_ObjectManager::getStaticObject |
( |
const string & |
name |
) |
const |
|
|
this function returns the static object from the object manager's internal static object list with name name -
Parameters:
-
name |
the name of the static object |
-
Returns:
-
a pointer to a WP_StaticObject object matching name
|
|
this function returns the first static object in the object manager's internal static object list -
Returns:
-
a pointer to a WP_Static object representing the first object in the static object list
|
WP_Object * WPCG::WP_ObjectManager::pickObject |
( |
int |
x, |
|
|
int |
y |
|
) |
|
|
|
this function determines if an object was picked according to mouse input and returns this object -
Parameters:
-
x |
the x coordinate of the mouse-click |
y |
the y coordinate of the mouse-click |
-
Returns:
-
a pointer to a WP_Object object which is the picked object. 0 if no object was picked
|
bool WPCG::WP_ObjectManager::removeAll |
( |
|
) |
|
|
|
this function removes all objects from the object manager's internal static and dynamic object lists -
Returns:
-
a boolean indicating if all objects were removed succesfully
|
bool WPCG::WP_ObjectManager::removeDynamicObject |
( |
const string & |
name |
) |
|
|
|
this function removes the first object it encounters with name name from the dynamic object list -
Parameters:
-
name |
the name of the to be removed object |
-
Returns:
-
a boolean indicating of an object was removed
|
bool WPCG::WP_ObjectManager::removeObject |
( |
const string & |
name |
) |
|
|
|
this function removes the first object it encounters with name name from the static or dynamic object list -
Parameters:
-
name |
the name of the to be removed object |
-
Returns:
-
a boolean indicating of an object was removed
|
bool WPCG::WP_ObjectManager::removeSameObjects |
( |
const string & |
name |
) |
|
|
|
this function removes all objects called name from the static and dynamic object list -
Parameters:
-
name |
the name of the to be removed objects |
-
Returns:
-
a boolean indicating if all objects called name were removed succesfully
|
bool WPCG::WP_ObjectManager::removeStaticObject |
( |
const string & |
name |
) |
|
|
|
this function removes the first object it encounters with name name from the static object list -
Parameters:
-
name |
the name of the to be removed object |
-
Returns:
-
a boolean indicating of an object was removed
|
void WPCG::WP_ObjectManager::updateAll |
( |
|
) |
|
|
Member Data Documentation
unsigned int WPCG::WP_ObjectManager::number_collisions
|
|
The documentation for this class was generated from the following files:
Generated on Tue Jan 28 20:26:41 2003 by
1.2.14 written by Dimitri van Heesch,
© 1997-2002