Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::ArticulatedModel Class Reference

A model composed of a heirarchy of rigid, textured sub-models. More...

#include <ArticulatedModel.h>

Inherits G3D::ReferenceCountedObject.

List of all members.

Public Types

enum  GraphicsProfile { UNKNOWN = 0, FIXED_FUNCTION, PS14, PS20 }
typedef ReferenceCountedPointer<
class ArticulatedModel
Ref

Public Member Functions

void pose (Array< PosedModel::Ref > &posedModelArray, const CoordinateFrame &cframe=CoordinateFrame(), const Pose &pose=DEFAULT_POSE)
void ReferenceCountedObject_zeroWeakPointers ()
void updateAll ()

Static Public Member Functions

static ArticulatedModelRef createEmpty ()
static void extractOpaquePosedAModels (Array< PosedModel::Ref > &all, Array< PosedModel::Ref > &opaqueAmodels)
static ArticulatedModelRef fromFile (const std::string &filename, float scale=1.0)
static ArticulatedModelRef fromFile (const std::string &filename, const Vector3 &scale)
static ArticulatedModelRef fromFile (const std::string &filename, const CoordinateFrame &xform)
static GraphicsProfile profile ()
static void renderNonShadowed (const Array< PosedModel::Ref > &posedArray, RenderDevice *rd, const LightingRef &lighting)
static void renderShadowMappedLightPass (const Array< PosedModel::Ref > &posedAModelArray, RenderDevice *rd, const GLight &light, const Matrix4 &lightMVP, const Texture::Ref &shadowMap)
static void setProfile (GraphicsProfile p)

Public Attributes

std::string name
Array< PartpartArray
Table< std::string, int > partNameToIndex
AtomicInt32 ReferenceCountedObject_refCount
_WeakPtrLinkedListReferenceCountedObject_weakPointer

Static Public Attributes

static const Pose DEFAULT_POSE

Friends

class Part
class PosedArticulatedModel

Classes

class  Part
 A named sub-set of the model that has a single reference frame. More...
class  Pose


Detailed Description

A model composed of a heirarchy of rigid, textured sub-models.

Since G3D doesn't load GIF files, any material with a GIF filename is converted to a PNG filename.


Member Typedef Documentation


Member Enumeration Documentation

Classification of a graphics card.

FIXED_FUNCTION Use OpenGL fixed function lighting only. PS14 Use pixel shader 1.4 (texture crossbar; adds specular maps) PS20 Use pixel shader 2.0 (shader objects; full feature)

Enumerator:
UNKNOWN 
FIXED_FUNCTION 
PS14 
PS20 


Member Function Documentation

static ArticulatedModelRef G3D::ArticulatedModel::createEmpty (  )  [static]

Creates a new articulated model that you can construct by editing the partArray directly.

static void G3D::ArticulatedModel::extractOpaquePosedAModels ( Array< PosedModel::Ref > &  all,
Array< PosedModel::Ref > &  opaqueAmodels 
) [static]

Removes the opaque PosedAModels from array all and appends them to the opaqueAmodels array (transparents must be rendered inline with other model types).

This produces an array for the array versions of renderNonShadowed and renderShadowMappedLightPass.

static ArticulatedModelRef G3D::ArticulatedModel::fromFile ( const std::string &  filename,
float  scale = 1.0 
) [inline, static]

static ArticulatedModelRef G3D::ArticulatedModel::fromFile ( const std::string &  filename,
const Vector3 scale 
) [inline, static]

static ArticulatedModelRef G3D::ArticulatedModel::fromFile ( const std::string &  filename,
const CoordinateFrame xform 
) [static]

Supports 3DS, IFS, and PLY2 file formats.

The format of a file is detected by the extension.

You can use the xform parameter to scale, translate, and rotate (or even invert!) the model as it is loaded. Example:

      CoordinateFrame xform(Matrix3::fromAxisAngle(axis, angle) * scale, translation);
      model = ArticulatedModel::fromFile(filename, xform);
      

Parameters:
xform Transform all vertices by this RST matrix during loading loading

void G3D::ArticulatedModel::pose ( Array< PosedModel::Ref > &  posedModelArray,
const CoordinateFrame cframe = CoordinateFrame(),
const Pose pose = DEFAULT_POSE 
)

Appends one posed model per sub-part with geometry.

If the lighting environment is NULL the system will default using to whatever fixed function state is enabled (e.g., with renderDevice->setLight). If the lighting environment is specified, the SuperShader will be used, providing detailed illuminaton.

static GraphicsProfile G3D::ArticulatedModel::profile (  )  [static]

Returns a measure of the capabilities of this machine.

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.

static void G3D::ArticulatedModel::renderNonShadowed ( const Array< PosedModel::Ref > &  posedArray,
RenderDevice rd,
const LightingRef lighting 
) [static]

Renders an array of PosedAModels in the order that they appear in the array, taking advantage of the fact that all objects have the same subclass to optimize the rendering calls.

static void G3D::ArticulatedModel::renderShadowMappedLightPass ( const Array< PosedModel::Ref > &  posedAModelArray,
RenderDevice rd,
const GLight light,
const Matrix4 lightMVP,
const Texture::Ref shadowMap 
) [static]

Renders an array of PosedAModels in the order that they appear in the array, taking advantage of the fact that all objects have the same subclass to optimize the rendering calls.

static void G3D::ArticulatedModel::setProfile ( GraphicsProfile  p  )  [static]

Force articulated model to use a different profile.

Only works if called before any models are loaded.

void G3D::ArticulatedModel::updateAll (  ) 

Update normals, var, and shaders on all Parts.

If you modify Parts explicitly, invoke this afterward to update dependent state. (slow)


Friends And Related Function Documentation

friend class Part [friend]

friend class PosedArticulatedModel [friend]


Member Data Documentation

All parts.

Root parts are identified by (parent == -1).

Returns the index in partArray of the part with this name.

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:44 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo