#include <meshobj.h>
Inheritance diagram for csMeshWrapper:
Public Methods | |
csMeshWrapper (iMeshWrapper *theParent, iMeshObject *mesh) | |
Constructor. | |
csMeshWrapper (iMeshWrapper *theParent) | |
Constructor. | |
void | SetParentContainer (iMeshWrapper *newParent) |
Set parent container for this object. | |
iMeshWrapper* | GetParentContainer () const |
Get parent container for this object. | |
void | SetFactory (csMeshFactoryWrapper *factory) |
Set the mesh factory. | |
csMeshFactoryWrapper* | GetFactory () const |
Get the mesh factory. | |
void | SetMeshObject (iMeshObject *mesh) |
Set the mesh object. | |
iMeshObject* | GetMeshObject () const |
Get the mesh object. | |
void | SetZBufMode (csZBufMode mode) |
Set the Z-buf drawing mode to use for this object. | |
csZBufMode | GetZBufMode () const |
Get the Z-buf drawing mode. | |
void | SetDrawCallback (iMeshDrawCallback *cb) |
Set a callback which is called just before the object is drawn. More... | |
iMeshDrawCallback* | GetDrawCallback () const |
Get the draw callback. | |
void | MarkVisible () |
Mark this object as visible. | |
void | MarkInvisible () |
Mark this object as invisible. | |
bool | IsVisible () const |
Return if this object is visible. | |
void | UpdateLighting (iLight **lights, int num_lights) |
Light object according to the given array of lights (i.e. More... | |
void | DeferUpdateLighting (int flags, int num_lights) |
Update lighting as soon as the object becomes visible. More... | |
void | Draw (iRenderView *rview) |
Draw this mesh object given a camera transformation. More... | |
bool | WantToDie () |
Returns true if this object wants to die. | |
csMovable& | GetMovable () |
Get the movable instance for this object. More... | |
void | PlaceMesh () |
This routine will find out in which sectors a mesh object is positioned. More... | |
int | HitBeamBBox (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr) |
Check if this object is hit by this object space vector. More... | |
bool | HitBeamOutline (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr) |
Check if this object is hit by this object space vector. More... | |
bool | HitBeamObject (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr) |
Check if this object is hit by this object space vector. More... | |
bool | HitBeam (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr) |
Check if this object is hit by this world space vector. More... | |
const csMeshMeshList& | GetChildren () const |
Get the children of this mesh object. | |
void | GetRadius (csVector3 &rad, csVector3 ¢) const |
Get the radius of this mesh (ignoring children). | |
void | HardTransform (const csReversibleTransform &t) |
Do a hard transform of this object. More... | |
void | GetWorldBoundingBox (csBox3 &cbox) |
Get the bounding box of this object in world space. More... | |
void | GetTransformedBoundingBox (const csReversibleTransform &trans, csBox3 &cbox) |
Get the bounding box of this object after applying a transformation to it. More... | |
float | GetScreenBoundingBox (const csCamera &camera, csBox2 &sbox, csBox3 &cbox) |
Get a very inaccurate bounding box of the object in screen space. More... | |
void | Rotate (float angle) |
Rotate object in some manner in radians. More... | |
void | ScaleBy (float factor) |
Scale object by this factor. More... | |
void | SetRenderPriority (long rp) |
Set the render priority for this object. | |
long | GetRenderPriority () const |
Get the render priority for this object. | |
void | AddChild (iMeshWrapper *child) |
Add a child to this mesh. | |
void | RemoveChild (iMeshWrapper *child) |
Remove a child from this mesh. | |
SCF_DECLARE_IBASE_EXT (csObject) | |
Public Attributes | |
csFlags | flags |
Set of flags. | |
csMeshWrapper::MeshWrapper | scfiMeshWrapper |
csMeshWrapper::VisObject | scfiVisibilityObject |
Protected Methods | |
void | UpdateDeferedLighting (const csVector3 &pos) |
Update defered lighting. | |
void | MoveToSector (csSector *s) |
Move this object to the specified sector. Can be called multiple times. | |
void | RemoveFromSectors () |
Remove this object from all sectors it is in (but not from the engine). | |
void | UpdateMove () |
Update transformations after the object has moved (through updating the movable instance). More... | |
void | DrawInt (iRenderView *rview) |
Draw this mesh object given a camera transformation. More... | |
virtual | ~csMeshWrapper () |
Destructor. More... | |
Protected Attributes | |
iMeshWrapper* | Parent |
The parent mesh object, or NULL. | |
csBox3 | wor_bbox |
Bounding box in world space. More... | |
long | wor_bbox_movablenr |
Last used movable number for wor_bbox. | |
int | defered_num_lights |
Defered lighting. If > 0 then we have defered lighting. | |
int | defered_lighting_flags |
Flags to use for defered lighting. | |
csTicks | last_anim_time |
This value indicates the last time that was used to do animation. More... | |
bool | is_visible |
Flag which is set to true when the object is visible. More... | |
csMovable | movable |
Position in the world. | |
long | render_priority |
The renderer will render all objects in a sector based on this number. More... | |
Friends | |
class | csMovable |
class | csMovableSectorList |
class | MeshWrapper |
class | VisObject |
|
Destructor. This is private in order to force clients to use DecRef() for object destruction. |
|
Update lighting as soon as the object becomes visible. This will call engine->GetNearestLights with the supplied parameters. |
|
Draw this mesh object given a camera transformation. If needed the skeleton state will first be updated. Optionally update lighting if needed (DeferUpdateLighting()). |
|
Draw this mesh object given a camera transformation. If needed the skeleton state will first be updated. Optionally update lighting if needed (DeferUpdateLighting()). |
|
Get the movable instance for this object. It is very important to call GetMovable().UpdateMove() after doing any kind of modification to this movable to make sure that internal data structures are correctly updated. |
|
Get a very inaccurate bounding box of the object in screen space. Returns -1 if object behind the camera or else the distance between the camera and the furthest point of the 3D box. |
|
Get the bounding box of this object after applying a transformation to it. This is really a very inaccurate function as it will take the bounding box of the object in object space and then transform this bounding box. |
|
Get the bounding box of this object in world space. This routine will cache the bounding box and only recalculate it if the movable changes. |
|
Do a hard transform of this object. This transformation and the original coordinates are not remembered but the object space coordinates are directly computed (world space coordinates are set to the object space coordinates by this routine). Note that some implementations of mesh objects will not change the orientation of the object but only the position. |
|
Check if this object is hit by this world space vector. Return the collision point in world space coordinates. |
|
Check if this object is hit by this object space vector. BBox version. |
|
Check if this object is hit by this object space vector. Return the collision point in object space coordinates. |
|
Check if this object is hit by this object space vector. Outline version. |
|
This routine will find out in which sectors a mesh object is positioned. To use it the mesh has to be placed in one starting sector. This routine will then start from that sector, find all portals that touch the sprite and add all additional sectors from those portals. Note that this routine using a bounding sphere for this test so it is possible that the mesh will be added to sectors where it really isn't located (but the sphere is). If the mesh is already in several sectors those additional sectors will be ignored and only the first one will be used for this routine. |
|
Rotate object in some manner in radians. This function operates by rotating the movable transform. |
|
Scale object by this factor. This function operates by scaling the movable transform. |
|
Set a callback which is called just before the object is drawn. This is useful to do some expensive computations which only need to be done on a visible object. Note that this function will be called even if the object is not visible. In general it is called if there is a likely probability that the object is visible (i.e. it is in the same sector as the camera for example). |
|
Light object according to the given array of lights (i.e. fill the vertex color array). |
|
Update transformations after the object has moved (through updating the movable instance). This MUST be done after you change the movable otherwise some of the internal data structures will not be updated correctly. This function is called by movable.UpdateMove(); |
|
Flag which is set to true when the object is visible. This is used by the c-buffer/bsp routines. The object itself will not use this flag in any way at all. It is simply intended for external visibility culling routines. |
|
This value indicates the last time that was used to do animation. If 0 then we haven't done animation yet. We compare this value with the value returned by engine->GetLastAnimationTime() to see if we need to call meshobj->NextFrame() again. |
|
The renderer will render all objects in a sector based on this number. Low numbers get rendered first. High numbers get rendered later. There are a few predefined slots which the application is free to use or not. |
|
Bounding box in world space. This is a cache for GetWorldBoundingBox() which will recalculate this if the movable changes (by using movablenr). |