G3D::MD2Model::PosedMD2Model Class Reference#include <MD2Model.h>
Inherits G3D::PosedModel.
List of all members.
|
Public Types |
typedef ReferenceCountedPointer<
class PosedModel > | Ref |
Public Member Functions |
| virtual CoordinateFrame | coordinateFrame () const |
| virtual const Array< MeshAlg::Edge > & | edges () const |
| virtual const Array< MeshAlg::Face > & | faces () const |
| virtual void | getCoordinateFrame (CoordinateFrame &) const |
| virtual void | getObjectSpaceBoundingBox (Box &) const |
| virtual void | getObjectSpaceBoundingSphere (Sphere &) const |
| virtual void | getObjectSpaceFaceNormals (Array< Vector3 > &faceNormals, bool normalize=true) const |
| virtual void | getWorldSpaceBoundingBox (Box &box) const |
| virtual void | getWorldSpaceBoundingSphere (Sphere &s) const |
| virtual void | getWorldSpaceFaceNormals (Array< Vector3 > &faceNormals, bool normalize=true) const |
| virtual void | getWorldSpaceGeometry (MeshAlg::Geometry &geometry) const |
| virtual bool | hasTexCoords () const |
| virtual bool | hasTransparency () const |
| virtual std::string | name () const |
| virtual int | numBoundaryEdges () const |
| int | numBrokenEdges () const |
| virtual int | numWeldedBoundaryEdges () const |
| virtual Box | objectSpaceBoundingBox () const |
| virtual Sphere | objectSpaceBoundingSphere () const |
| virtual const Array< Vector3 > & | objectSpaceFaceNormals (bool normalize=true) const |
| virtual const MeshAlg::Geometry & | objectSpaceGeometry () const |
| | PosedMD2Model (MD2ModelRef _model, const CoordinateFrame &_cframe, const Pose &_pose, bool _useMat, const GMaterial &_mat) |
| void | ReferenceCountedObject_zeroWeakPointers () |
| virtual void | render (RenderDevice *renderDevice) const |
| virtual void | renderNonShadowed (RenderDevice *rd, const LightingRef &lighting) const |
| virtual void | renderShadowedLightPass (RenderDevice *rd, const GLight &light) const |
| virtual void | renderShadowMappedLightPass (RenderDevice *rd, const GLight &light, const Matrix4 &lightMVP, const Texture::Ref &shadowMap) const |
| virtual void | sendGeometry (RenderDevice *rd) const |
| virtual const Array< Vector2 > & | texCoords () const |
| virtual const Array< int > & | triangleIndices () const |
| virtual const Array< MeshAlg::Vertex > & | vertices () const |
| virtual const Array< MeshAlg::Edge > & | weldedEdges () const |
| virtual const Array< MeshAlg::Face > & | weldedFaces () const |
| virtual const Array< MeshAlg::Vertex > & | weldedVertices () const |
| virtual Box | worldSpaceBoundingBox () const |
| virtual Sphere | worldSpaceBoundingSphere () const |
| virtual | ~PosedMD2Model () |
Static Public Member Functions |
| static void | operator delete (void *p) |
| static void * | operator new (size_t size) |
| static void | sort (const Array< PosedModel::Ref > &inModels, const Vector3 &wsLookVector, Array< PosedModel::Ref > &opaque) |
| static void | sort (const Array< PosedModel::Ref > &inModels, const Vector3 &wsLookVector, Array< PosedModel::Ref > &opaque, Array< PosedModel::Ref > &transparent) |
Public Attributes |
| CoordinateFrame | cframe |
| Array< Vector3 > | faceNormals |
| MeshAlg::Geometry | geometry |
| GMaterial | material |
| MD2ModelRef | model |
| Pose | pose |
| AtomicInt32 | ReferenceCountedObject_refCount |
| _WeakPtrLinkedList * | ReferenceCountedObject_weakPointer |
| bool | useMaterial |
Protected Member Functions |
| virtual void | defaultRender (RenderDevice *rd) const |
Member Typedef Documentation
Constructor & Destructor Documentation
| virtual G3D::MD2Model::PosedMD2Model::~PosedMD2Model |
( |
|
) |
[inline, virtual] |
Member Function Documentation
| virtual CoordinateFrame G3D::PosedModel::coordinateFrame |
( |
|
) |
const [virtual, inherited] |
| virtual void G3D::PosedModel::defaultRender |
( |
RenderDevice * |
rd |
) |
const [protected, virtual, inherited] |
Implementation must obey the current stencil, depth write, color write, and depth test modes.
Implementation may freely set the blending, and alpha test modes.
Default implementation renders the triangles returned by getIndices and getGeometry.
| virtual const Array<MeshAlg::Edge>& G3D::MD2Model::PosedMD2Model::edges |
( |
|
) |
const [virtual] |
| virtual const Array<MeshAlg::Face>& G3D::MD2Model::PosedMD2Model::faces |
( |
|
) |
const [virtual] |
Adjacency information respecting the underlying connectivity of the mesh-- colocated vertices are treated as distinct.
Implements G3D::PosedModel.
| virtual void G3D::MD2Model::PosedMD2Model::getCoordinateFrame |
( |
CoordinateFrame & |
c |
) |
const [virtual] |
| virtual void G3D::MD2Model::PosedMD2Model::getObjectSpaceBoundingBox |
( |
Box & |
|
) |
const [virtual] |
| virtual void G3D::MD2Model::PosedMD2Model::getObjectSpaceBoundingSphere |
( |
Sphere & |
|
) |
const [virtual] |
| virtual void G3D::PosedModel::getObjectSpaceFaceNormals |
( |
Array< Vector3 > & |
faceNormals, |
|
|
bool |
normalize = true | |
|
) |
| | const [virtual, inherited] |
| virtual void G3D::PosedModel::getWorldSpaceBoundingBox |
( |
Box & |
box |
) |
const [virtual, inherited] |
| virtual void G3D::PosedModel::getWorldSpaceBoundingSphere |
( |
Sphere & |
s |
) |
const [virtual, inherited] |
| virtual void G3D::PosedModel::getWorldSpaceFaceNormals |
( |
Array< Vector3 > & |
faceNormals, |
|
|
bool |
normalize = true | |
|
) |
| | const [virtual, inherited] |
| virtual void G3D::PosedModel::getWorldSpaceGeometry |
( |
MeshAlg::Geometry & |
geometry |
) |
const [virtual, inherited] |
Get the world space geometry.
| virtual bool G3D::MD2Model::PosedMD2Model::hasTexCoords |
( |
|
) |
const [virtual] |
Returns true if this model has texture coordinates.
Reimplemented from G3D::PosedModel.
| virtual bool G3D::PosedModel::hasTransparency |
( |
|
) |
const [inline, virtual, inherited] |
If true, this object depends on back-to-front rendering order and should be rendered in sorted order.
Default is false.
| virtual std::string G3D::MD2Model::PosedMD2Model::name |
( |
|
) |
const [virtual] |
| virtual int G3D::MD2Model::PosedMD2Model::numBoundaryEdges |
( |
|
) |
const [virtual] |
Number of edges that have only one adjacent face in edges().
These boundary edges are all at the end of the edge list.
Implements G3D::PosedModel.
| int G3D::PosedModel::numBrokenEdges |
( |
|
) |
const [inline, inherited] |
| virtual int G3D::MD2Model::PosedMD2Model::numWeldedBoundaryEdges |
( |
|
) |
const [virtual] |
Number of edges that have only one adjacent face in weldedEdges().
These boundary edges are all at the end of the edge list.
Implements G3D::PosedModel.
| virtual Box G3D::PosedModel::objectSpaceBoundingBox |
( |
|
) |
const [virtual, inherited] |
| virtual Sphere G3D::PosedModel::objectSpaceBoundingSphere |
( |
|
) |
const [virtual, inherited] |
| virtual const Array<Vector3>& G3D::MD2Model::PosedMD2Model::objectSpaceFaceNormals |
( |
bool |
normalize = true |
) |
const [virtual] |
Return a pointer to an array of object space face normals.
Implements G3D::PosedModel.
| virtual const MeshAlg::Geometry& G3D::MD2Model::PosedMD2Model::objectSpaceGeometry |
( |
|
) |
const [virtual] |
Get the object space geometry (faster than getWorldSpaceGeometry).
Object and world space geometry only differ by a CoordinateFrame transformation.
Implements G3D::PosedModel.
| static void G3D::MD2Model::PosedMD2Model::operator delete |
( |
void * |
p |
) |
[inline, static] |
| static void* G3D::MD2Model::PosedMD2Model::operator new |
( |
size_t |
size |
) |
[inline, static] |
| void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers |
( |
|
) |
[inline, inherited] |
Automatically called immediately before the object is deleted.
This is not called from the destructor because it needs to be invoked before the subclass destructor.
| virtual void G3D::MD2Model::PosedMD2Model::render |
( |
RenderDevice * |
renderDevice |
) |
const [virtual] |
Render using current fixed function lighting environment.
Do not change the steBehavior with regard to stencil, shadowing, etc. is intentionally undefinded.
Default implementation calls defaultRender.
Reimplemented from G3D::PosedModel.
| virtual void G3D::PosedModel::renderNonShadowed |
( |
RenderDevice * |
rd, |
|
|
const LightingRef & |
lighting | |
|
) |
| | const [virtual, inherited] |
Render all terms that are independent of shadowing (e.g., transparency, reflection, ambient illumination, emissive illumination, nonShadowCastingLights).
Transparent objects are assumed to render additively (but should set the blend mode themselves). Restore all state to the original form on exit. Default implementation invokes render.
Implementation must obey the current stencil, depth write, color write, and depth test modes. Implementation may freely set the blending, and alpha test modes.
The caller should invoke this in depth sorted back to front order for transparent objects.
The default implementation configures the non-shadow casting lights and calls render.
Implementation advice:
-
If color write is disabled, don't bother performing any shading on this object.
-
It may be convenient to support multiple lights by invoking renderShadowedLightPass multiple times.
| virtual void G3D::PosedModel::renderShadowedLightPass |
( |
RenderDevice * |
rd, |
|
|
const GLight & |
light | |
|
) |
| | const [virtual, inherited] |
Render illumination from this light source additively.
Implementation must set the alpha blending mode to additive. Must obey the current stencil, depth write, and depth test modes. Default implementation enables a single light and calls render.
| virtual void G3D::PosedModel::renderShadowMappedLightPass |
( |
RenderDevice * |
rd, |
|
|
const GLight & |
light, |
|
|
const Matrix4 & |
lightMVP, |
|
|
const Texture::Ref & |
shadowMap | |
|
) |
| | const [virtual, inherited] |
Render illumination from this source additively, held out by the shadow map (which the caller must have computed, probably using renderNonShadowed).
Default implementation configures the shadow map in texture unit 1 and calls render.
| virtual void G3D::MD2Model::PosedMD2Model::sendGeometry |
( |
RenderDevice * |
rd |
) |
const [virtual] |
Sends all geometry including texture coordinates (uploading it first if necessary) but does not set any render device state or use any textures.
This is useful when applying your own G3D::Shader to an existing PosedModel.
Reimplemented from G3D::PosedModel.
Sorts the array in place along the look vector from front-to-back.
Divides the inModels into a front-to-back sorted array of opaque models and a back-to-front sorted array of potentially transparent models.
Any data originally in the output arrays is cleared.
- Parameters:
-
| wsLookVector | Sort axis; usually the -Z axis of the camera. |
| virtual const Array<Vector2>& G3D::MD2Model::PosedMD2Model::texCoords |
( |
|
) |
const [virtual] |
If this model has texture coordinates, returns per-vertex texture coordinates in an array indexed the same as vertices() and geometry.vertexArray, otherwise returns an array of size zero.
Default implementation returns an array of size zero.
Reimplemented from G3D::PosedModel.
| virtual const Array<int>& G3D::MD2Model::PosedMD2Model::triangleIndices |
( |
|
) |
const [virtual] |
Indices into the Geometry that create triangles.
May be welded or not, depending on the model.
Implements G3D::PosedModel.
| virtual const Array<MeshAlg::Edge>& G3D::MD2Model::PosedMD2Model::weldedEdges |
( |
|
) |
const [virtual] |
| virtual const Array<MeshAlg::Face>& G3D::MD2Model::PosedMD2Model::weldedFaces |
( |
|
) |
const [virtual] |
| virtual const Array<MeshAlg::Vertex>& G3D::MD2Model::PosedMD2Model::weldedVertices |
( |
|
) |
const [virtual] |
| virtual Box G3D::PosedModel::worldSpaceBoundingBox |
( |
|
) |
const [virtual, inherited] |
| virtual Sphere G3D::PosedModel::worldSpaceBoundingSphere |
( |
|
) |
const [virtual, inherited] |
Member Data Documentation
Computed on the first call to objectSpaceFaceNormals.
Filled out the first time objectSpaceGeometry is called.
The long name is to keep this from accidentally conflicting with a subclass's variable name.
Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.
Linked list of all weak pointers that reference this (some may be on the stack!).
Do not use or explicitly manipulate this value.
The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:46 2007 for G3D by
1.5.2
Hosted by
|