lilith3d::Mesh Class Reference

#include <mesh.h>

Inheritance diagram for lilith3d::Mesh:

lilith3d::AnimatedMesh lilith3d::DecalMesh lilith3d::SolidMesh lilith3d::StaticMesh lilith3d::MD2Mesh lilith3d::BuildingMesh lilith3d::TreeMesh List of all members.

Detailed Description

The parent class of objects that can draw themselves. This is the parent class of single objects. Collections are children of the MeshGroup. A Mesh cannot cull; only a MeshGroup.

A character walking around the world, or a tree, or a house, is a mesh. Complex things: terrain for instance, is a mesh group.

Also the mesh is the many of the one. There are many Redwood Tree mesh's - but only one Redwood Tree MeshResource.


Public Member Functions

const grinliz::Rectangle3F & AABB () const
 Query the axis aligned bounding box of the mesh.
const grinliz::Rectangle3F & AABBWithShadow () const
 Query the axis aligned bounding box of the mesh, including possible shadow dimensions.
MeshClass Type () const
 Return the type of the Mesh - not virtual & performance sensitive.
const MeshResource * Resource () const
 Return a pointer to the Resource used by this mesh. Can be null.
void AttachToTerrain (bool attach)
bool AttachedToTerrain () const
 Returns true if this mesh is attached ("walks") on the terrain.
void SetVisible (bool _visible)
 Set the visibility of this mesh.
bool Visible () const
 Query the visibility of this mesh.
const grinliz::Color3FColor () const
 Query the color (generally only used by shaders).
void SetColor (const grinliz::Color3F &c)
 Set the color.
float Alpha () const
 Query the current alpha.
virtual void SetAlpha (float _alpha)
 Set the alpha for the entire mesh.
const Shader * GetShader ()
 The current shader in use for this mesh. (0 is default rendering).
void SetShader (const Shader *_shader)
 Set a shader for this mesh.
void SetStencil (bool _stencil)
bool Stencil () const
 Returns true if this renders in the stencil pass.
const grinliz::Vector3F & Pos () const
 Query the current position.
float ZRot () const
 Query the z-rotation (presumes an object whos only rotation is around z.).
const grinliz::Matrix4Rotation () const
 Query the full rotation.
void SetPos (const grinliz::Vector3F &pos, float z)
 Set the position of this mesh.
void SetPos (const grinliz::Vector3F &pos, const grinliz::Quaternion &quat)
 Set the position of this mesh.
void SetPos (const grinliz::Vector3F &pos)
 Set the position of this mesh.
void SetPos (float x, float y, float z)
 Set the position of this mesh.
void SetPos (const grinliz::Vector3F &_pos, const grinliz::Matrix4 &_rotation)
 Set the position of this mesh.
virtual void IntersectRay (int flags, const grinliz::Vector3F &point, const grinliz::Vector3F &dir, LilithObjectList *vec)=0
int ID () const
 Get the unique 32 bit ID for this mesh.


Member Function Documentation

void lilith3d::Mesh::AttachToTerrain ( bool  attach  )  [inline]

Attach this mesh to the terrain. Good for anything that walks on the terrain.

WARNING: Be sure to call AttachToTerrain() before your first SetPos(), else the initial position may not be correct.

void lilith3d::Mesh::SetStencil ( bool  _stencil  )  [inline]

Set if you want this mesh to use the stencil pass, currently only supported for DecalMesh.

virtual void lilith3d::Mesh::IntersectRay ( int  flags,
const grinliz::Vector3F &  point,
const grinliz::Vector3F &  dir,
LilithObjectList *  vec 
) [pure virtual]

Check for intersection with the current Mesh.

Implemented in lilith3d::AnimatedMesh, lilith3d::BuildingMesh, lilith3d::MD2Mesh, lilith3d::DecalMesh, lilith3d::StaticMesh, and lilith3d::SolidMesh.


The documentation for this class was generated from the following file:
Generated on Fri Mar 23 19:36:27 2007 for Lilith3D by  doxygen 1.5.1-p1