Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csPolyTreeBBox Class Reference

This class represents a (dynamic) object that can be placed in a polygon tree (BSP, octree, ...). More...

#include <bspbbox.h>

List of all members.

Public Methods

 csPolyTreeBBox ()
 Constructor.

 ~csPolyTreeBBox ()
 Destructor.

 CS_DECLARE_STATIC_CLASSVAR (stub_pool, GetPolyStubPool, csPolygonStubPool) CS_DECLARE_STATIC_CLASSVAR(stub_fact, GetPolyStubFactory, csPolygonStubFactory) void RemoveFromTree()
 Remove this object from its tree.

void UnlinkStub (csPolygonStub *ps)
 Unlink a stub from the stub list. More...

void LinkStub (csPolygonStub *ps)
 Link a stub to the stub list.

const csBox3GetWorldBoundingBox ()
 Get the bounding box that represents this object. More...

csPolygonStubGetBaseStub ()
 Get the base stub. More...

csVector3ArrayGetVertices ()
 Get vector array for this container.

csVector3ArrayGetCameraVertices ()
 Get camera vector array for this container.

void Update (const csBox3 &object_bbox, const csTransform &o2w, csVisObjInfo *vinf)
 Update this object using an object space bounding box and a transformation.

void Update (const csBox3 &world_bbox, csVisObjInfo *vinf)
 Update this object using a world space bounding box.

void AddPolygon (csPolygonInt *poly)
 Add a polygon to this container.

int GetPolygonCount ()
 Get the number of polygons in this polygonset.

csPolygonIntGetPolygon (int idx)
 Get the specified polygon from this set.

csPolygonInt** GetPolygons ()
 Get the array of polygons.

void World2Camera (const csTransform &trans, int cur_camera_nr)
 Transform the vertices of this container from world to camera.

bool IsTransformed (int cur_camera_nr)
 Return true if this object is already transformed to camera space.

void ClearTransform ()
 Clear camera transformation.

void SplitWithPlane (csPolygonStub *stub, csPolygonStub **stub_on, csPolygonStub **stub_front, csPolygonStub **stub_back, const csPlane3 &plane)
 Split the given stub with a plane and return three new stubs (all on the plane, in front, or back of the plane).<. More...

void SplitWithPlaneX (csPolygonStub *stub, csPolygonStub **stub_on, csPolygonStub **stub_front, csPolygonStub **stub_back, float x)
 Split the given stub with an X plane.

void SplitWithPlaneY (csPolygonStub *stub, csPolygonStub **stub_on, csPolygonStub **stub_front, csPolygonStub **stub_back, float y)
 Split the given stub with an Y plane.

void SplitWithPlaneZ (csPolygonStub *stub, csPolygonStub **stub_on, csPolygonStub **stub_front, csPolygonStub **stub_back, float z)
 Split the given stub with an Z plane.


Detailed Description

This class represents a (dynamic) object that can be placed in a polygon tree (BSP, octree, ...).

Every engine entity that is interested in adding itself to the tree will be represented by such an object.


Member Function Documentation

csPolygonStub * csPolyTreeBBox::GetBaseStub ( ) [inline]
 

Get the base stub.

In case of csPolygonStub this corresponds to the set of polygons that make up the desired object to be placed in the polygon tree. In most cases this will be a bounding box for the real object.

const csBox3 & csPolyTreeBBox::GetWorldBoundingBox ( ) [inline]
 

Get the bounding box that represents this object.

If the camera is inside this bbox then the object is certainly visible.

void csPolyTreeBBox::SplitWithPlane ( csPolygonStub * stub,
csPolygonStub ** stub_on,
csPolygonStub ** stub_front,
csPolygonStub ** stub_back,
const csPlane3 & plane )
 

Split the given stub with a plane and return three new stubs (all on the plane, in front, or back of the plane).<.

p>

Note that this function is responsible for freeing 'stub' itself if needed. Also this function can return NULL for stub_on, stub_front, and stub_back in which case there simply is no stub for that particular case.

Other note. This function will also correctly account for the case where the given stub_on pointer is NULL. In that case the tree is not interested in the polygons on the plane and those polygons will be distributed to stub_front.

void csPolyTreeBBox::UnlinkStub ( csPolygonStub * ps )
 

Unlink a stub from the stub list.

Warning! This function does not test if the stub is really on the list!


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000