#include <GraphicalObject.h>
Inheritance diagram for GraphicalObject:
Public Member Functions | |
GraphicalObject (RawObject *raw_object) | |
~GraphicalObject () | |
virtual void | Draw (int time, Camera *camera, Camera *monitor, bool show_bounding_volume, int culling_mode, bool level_of_detail) |
void | CalculateRelativePositions () |
void | ApplyTransformation (const Position &position, bool rotation) |
void | UndoTransformation (const Position &position, bool rotation) |
virtual void | PrintToConsole () |
void | UpdateBoundingRadius (bool recurse) |
void | UpdateBoundingBox (bool recurse) |
Public Attributes | |
PositionPath * | position |
double | bounding_radius |
BoundingBox | bounding_box |
Protected Types | |
typedef GraphicalObject::ChildListElem | ChildList |
Protected Member Functions | |
int | CullObject (Camera *camera, Camera *monitor, int culling_mode, bool show_volume) |
virtual void | ComputeBoundingRadius () |
virtual void | ComputeBoundingBox () |
Protected Attributes | |
ChildList * | first_child |
RawObject * | raw_object |
Private Member Functions | |
GraphicalObject () | |
void | UpdateBoxCorners () |
int | SphereCulling (Camera *camera, Camera *monitor) |
int | SphereCulling2 (Camera *camera) |
int | BoxCulling (Camera *camera, Camera *monitor) |
int | BoxCulling2 (Camera *camera) |
void | DrawBoundingSphere (int culling_result) |
void | DrawBoundingBox (int culling_result) |
Private Attributes | |
BoxCorners | box_corners |
int | last_outside |
Classes | |
struct | ChildListElem |
This is the basis of all the objects which are rendered within a scene. A graphical object is very similar to a node in a scene graph, with the difference that it does not provide any information about color, texture and other attributes that describe the appearance of an object. It does, however, provide a position (that may vary over time) which determines the local coordinate system spawned by this object.
A graphical object may contain any number of child objects, be associated with a RawObject (which is responsible for the appearance), provides some functionality to apply/unapply its local coordinate system to the current OpenGL matrix and to allow view frustum culling against a camera.
Definition at line 34 of file GraphicalObject.h.
|
Structure holding all the children of this graphical object. |
|
Constructor: Brings the graphical object into a consistent state and associates an object with it.
Definition at line 5 of file GraphicalObject.cpp. |
|
Destructor. Definition at line 40 of file GraphicalObject.cpp. |
|
Hide the default constructor. |
|
Appies the transformation described by an arbitrary position to the current matrix in OpenGL.
Definition at line 45 of file GraphicalObject.cpp. |
|
Performs a view frustum culling test with the bounding box of this object (uses global coordinates to cull), applied during monitoring mode.
Definition at line 441 of file GraphicalObject.cpp. |
|
Performs a view frustum culling test with the bounding box of this object (uses coordinate system right before the projection takes place), applied when not in monitoring mode.
Definition at line 535 of file GraphicalObject.cpp. |
|
A utility routine that levels out the difference between the own position and the positions of all the children of this object. The new position is set to the average of all child positions and the child positions are updated in such a way that no change can be noticed. Note that this routine will create the expected result only if the children of this object are not interleaved with themselves or other objects (which means that the whole structure below this object has to be a tree). Definition at line 303 of file GraphicalObject.cpp. |
|
Routine to compute the bounding box of the graphical object. Has to be implemented by the descendants of this class. Reimplemented in DLODObject, GroupObject, and TerminalObject. |
|
Routine to compute the bounding sphere of the graphical object. Has to be implemented by the descendants of this class. Reimplemented in DLODObject, GroupObject, and TerminalObject. |
|
Returns the result of the view frustum culling test depending on culling mode. Furthermore, this routine may visualize the bounding volume.
Definition at line 236 of file GraphicalObject.cpp. |
|
The way a graphical object is being drawn has to be implemented by the different types of objects that inherit from this class.
Reimplemented in DLODObject, GroupObject, and TerminalObject. |
|
Draws the bounding box around the graphical object.
Definition at line 224 of file GraphicalObject.cpp. |
|
Draws the bounding sphere around the graphcical object.
Definition at line 212 of file GraphicalObject.cpp. |
|
Prints information about the object to the console. Has to be implemented by all descendants. Reimplemented in DLODObject, GroupObject, and TerminalObject. |
|
Performs a view frustum culling test with a sphere (uses global coordinates to cull), applied during monitoring mode.
Definition at line 352 of file GraphicalObject.cpp. |
|
Performs a view frustum culling test with a sphere (uses coordinate system right before the projection takes place), applied when not in monitoring mode.
Definition at line 411 of file GraphicalObject.cpp. |
|
Undoes the transformation described by an arbitrary position on the current matrix in OpenGL.
Definition at line 58 of file GraphicalObject.cpp. |
|
routine that updates the bounding box of this graphical object according to the RawObject associated with this graphical object and the position as well as the movement of the children. The object itself and all its children will always be inside the newly calculated bounding box at every point in time. If the local coordinate systems of the children contain dynamic rotation, a conservative guess about the size of the new bounding box is being made. If the local coordinate systems of the chidren contain rotation that stays constant over time, the exact bounding box is being calculated.
Definition at line 117 of file GraphicalObject.cpp. |
|
Routine that updates the bounding radius of this graphical object according to the RawObject associated with this graphical object and the position as well as the movement of the children. The object itself and all its children will always be inside the sphere defined by the newly created bounding radius at every point in time. Definition at line 70 of file GraphicalObject.cpp. |
|
Calculates the corners of the bounding box. Definition at line 293 of file GraphicalObject.cpp. |
|
The bounding box around this graphical object. Used for the view frustum culling. Definition at line 135 of file GraphicalObject.h. |
|
The radius of the bounding sphere around this graphical object. Used for the view frustum culling. Definition at line 132 of file GraphicalObject.h. |
|
Corners of the bounding box. Only valid after 'UpdateBoxCorners ()' has been called. Definition at line 183 of file GraphicalObject.h. |
|
Pointer to the first child of this graphical object. Definition at line 115 of file GraphicalObject.h. |
|
Index of the plane where the object was rejected as being outside at the last time. Definition at line 186 of file GraphicalObject.h. |
|
The path of this object over time. Definition at line 71 of file GraphicalObject.h. |
|
The RawObject that is associated to this graphical object Definition at line 118 of file GraphicalObject.h. |