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

Inherits G3D::Model::Pose.

Classes

struct  Action
 

Public Member Functions

 Pose ()
 
 Pose (Animation a, SimTime t=0)
 
virtual ~Pose ()
 
shared_ptr< Model::Poseclone () const override
 
bool completelyDead () const
 True if the death animation has played and this object is now lying on the ground. More...
 
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...
 
void onSimulation (SimTime deltaTime, const Action &a)
 
Given a time and state flags indicating a character's desires, computes the new pose. More...
 
bool operator!= (const Pose &other) const
 
bool operator== (const Pose &other) const
 

Static Public Member Functions

static shared_ptr< Posecreate ()
 

Public Attributes

Animation animation
 
int preFrameNumber
 
When time is negative, this frame is blended into the first frame of the animation (which will occur at time 0) over PRE_BLEND_TIME. More...
 
SimTime time
 
Time since the start of the animation. 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...
 

Constructor & Destructor Documentation

◆ Pose() [1/2]

G3D::MD2Model::Pose::Pose ( )
inline

◆ Pose() [2/2]

G3D::MD2Model::Pose::Pose ( Animation  a,
SimTime  t = 0 
)
inline

◆ ~Pose()

virtual G3D::MD2Model::Pose::~Pose ( )
inlinevirtual

Reimplemented from G3D::Model::Pose.

Member Function Documentation

◆ clone()

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

Implements G3D::Model::Pose.

◆ completelyDead()

bool G3D::MD2Model::Pose::completelyDead ( ) const

True if the death animation has played and this object is now lying on the ground.

Typically used to decide when to remove dead bodies.

◆ create()

static shared_ptr<Pose> G3D::MD2Model::Pose::create ( )
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::MD2Model::Pose::differentBounds ( const shared_ptr< Model::Pose > &  other) const
inlineoverridevirtual

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.

◆ onSimulation()

void G3D::MD2Model::Pose::onSimulation ( SimTime  deltaTime,
const Action a 
)


Given a time and state flags indicating a character's desires, computes the new pose.

This may not be ideal for all applications; it is provided as a helper function.

If any death is triggered while crouching, the crouch death will be played instead.

Game logic should generally not use the JUMP animation, or the jump parameter to choosePose that triggers it. Instead, play the JUMP_UP animation when the character leaves the ground and the JUMP_DOWN animation when they hit it again.

◆ operator!=()

bool G3D::MD2Model::Pose::operator!= ( const Pose other) const

◆ operator==()

bool G3D::MD2Model::Pose::operator== ( const Pose other) const

Member Data Documentation

◆ animation

Animation G3D::MD2Model::Pose::animation

◆ preFrameNumber

int G3D::MD2Model::Pose::preFrameNumber


When time is negative, this frame is blended into the first frame of the animation (which will occur at time 0) over PRE_BLEND_TIME.

This allows disjoint animations to be smoothly connected.

MD2Model::choosePose will set time to -PRE_BLEND_TIME and set preFrame. If you are manually constructing a pose, MD2Model::getFrameNumber will return a value you can use.

◆ time

SimTime G3D::MD2Model::Pose::time


Time since the start of the animation.

Animations loop, so times after the final animation frame time are allowed. This must be less than 100000.0.

Referenced by Pose().


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