Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
G3D::ArticulatedModel::Pose Class Reference

Specifies the transformation that occurs at each node in the heirarchy. More...

Inherits G3D::Model::Pose.

Public Member Functions

 Pose ()
 
 Pose (const Any &a)
 
Example: More...
 
shared_ptr< Model::Poseclone () const override
 
virtual bool differentBounds (const shared_ptr< Model::Pose > &other) const override
 Returns true if other is null, has a different type than this, or would cause a Model of the appropriate type to change its bounding boxes. More...
 
const PhysicsFrameframe (const String &partName) const
 Returns the identity coordinate frame if there isn't one bound for partName. More...
 

Static Public Member Functions

static shared_ptr< Posecreate ()
 
static shared_ptr< Posecreate (const Any &a)
 
static void interpolate (const Pose &pose1, const Pose &pose2, float alpha, Pose &result)
 

Public Attributes

Table< String, PhysicsFrameframeTable
 Mapping from part names to physics frames (relative to parent). More...
 
Table< String, shared_ptr< UniversalMaterial > > materialTable
 If material[meshName] exists and is notNull, then that material overrides the one specified in the model in this pose. More...
 
int numInstances
 For instanced rendering of a single model. More...
 
float scale = 1.0f
 Global scale to apply after all pose transformations and vertex scaling, but before the Entity's transformation. More...
 
shared_ptr< UniformTableuniformTable
 Additional uniform arguments passed to the Surfaces, useful for prototyping effects that need additional per-Entity state. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

Specifies the transformation that occurs at each node in the heirarchy.

Constructor & Destructor Documentation

◆ Pose() [1/2]

G3D::ArticulatedModel::Pose::Pose ( )
inline

Referenced by create().

◆ Pose() [2/2]

G3D::ArticulatedModel::Pose::Pose ( const Any a)
explicit


Example:

ArticulatedModel::Pose {
scale = 2;
"part" = Point3(0, 10, 0);
};
FOO = "macro value";
count = 3;
};
"mesh" = UniversalMaterial::Specification {
lambertian = Color3(1, 0, 0);
};
};
}

For convenience when initializing a VisibleEntity from an .Any file, a single UniversalMaterial::Specification Any will also cast to an entire ArticulatedModel::Pose, where the materialTable key is "mesh"

Member Function Documentation

◆ clone()

shared_ptr<Model::Pose> G3D::ArticulatedModel::Pose::clone ( ) const
inlineoverridevirtual

Implements G3D::Model::Pose.

◆ create() [1/2]

static shared_ptr<Pose> G3D::ArticulatedModel::Pose::create ( )
inlinestatic

Referenced by clone().

◆ create() [2/2]

static shared_ptr<Pose> G3D::ArticulatedModel::Pose::create ( const Any a)
inlinestatic

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ differentBounds()

virtual bool G3D::ArticulatedModel::Pose::differentBounds ( const shared_ptr< Model::Pose > &  other) const
overridevirtual

Returns true if other is null, has a different type than this, or would cause a Model of the appropriate type to change its bounding boxes.

Implements G3D::Model::Pose.

◆ frame()

const PhysicsFrame& G3D::ArticulatedModel::Pose::frame ( const String partName) const

Returns the identity coordinate frame if there isn't one bound for partName.

◆ interpolate()

static void G3D::ArticulatedModel::Pose::interpolate ( const Pose pose1,
const Pose pose2,
float  alpha,
Pose result 
)
static

Member Data Documentation

◆ frameTable

Table<String, PhysicsFrame> G3D::ArticulatedModel::Pose::frameTable

Mapping from part names to physics frames (relative to parent).

If a name is not present, then its coordinate frame is assumed to be the identity.

◆ materialTable

Table<String, shared_ptr<UniversalMaterial> > G3D::ArticulatedModel::Pose::materialTable

If material[meshName] exists and is notNull, then that material overrides the one specified in the model in this pose.

Allows the same model to be used with different materials when instancing.

To find mesh names:

  • load a model into the G3D Viewer, click on the part and press F3,
  • or using SceneEditorWindow, unlock the scene, select the Entity, and open the info pane.

◆ numInstances

int G3D::ArticulatedModel::Pose::numInstances

For instanced rendering of a single model.

Used as Args::numInstances

◆ scale

float G3D::ArticulatedModel::Pose::scale = 1.0f

Global scale to apply after all pose transformations and vertex scaling, but before the Entity's transformation.

Causes objects to grow or shrink in place. Non-uniform scale (e.g., xyz) is not allowed because that would require more expensive operations on the surface normal computations in the default vertex shader.

◆ uniformTable

shared_ptr<UniformTable> G3D::ArticulatedModel::Pose::uniformTable

Additional uniform arguments passed to the Surfaces, useful for prototyping effects that need additional per-Entity state.


documentation generated on Wed Nov 24 2021 08:01:53 using doxygen 1.8.15