NW4F G3d
Loading...
Searching...
No Matches
nw::g3d::res::ResAnimCurve Class Reference

#include <g3d_ResAnimCurve.h>

Inherits nw::g3d::res::ResAnimCurveData.

Classes

class  Impl

Public Types

enum  Flag {
  FRAME_SHIFT = 0 , FRAME32 = 0x0 << FRAME_SHIFT , FRAME16 = 0x1 << FRAME_SHIFT , FRAME8 = 0x2 << FRAME_SHIFT ,
  FRAME_MASK = 0x3 << FRAME_SHIFT , NUM_FRAME = 3 , KEY_SHIFT = 2 , KEY32 = 0x0 << KEY_SHIFT ,
  KEY16 = 0x1 << KEY_SHIFT , KEY8 = 0x2 << KEY_SHIFT , KEY_MASK = 0x3 << KEY_SHIFT , NUM_KEY = 3 ,
  CURVE_SHIFT = 4 , CURVE_CUBIC = 0x0 << CURVE_SHIFT , CURVE_LINEAR = 0x1 << CURVE_SHIFT , CURVE_BAKED_FLOAT = 0x2 << CURVE_SHIFT ,
  CURVE_STEP_INT = 0x4 << CURVE_SHIFT , CURVE_BAKED_INT = 0x5 << CURVE_SHIFT , CURVE_STEP_BOOL = 0x6 << CURVE_SHIFT , CURVE_BAKED_BOOL = 0x7 << CURVE_SHIFT ,
  CURVE_INT_BASE = CURVE_STEP_INT , CURVE_MASK = 0x7 << CURVE_SHIFT
}
enum  WrapMode {
  WRAP_CLAMP , WRAP_REPEAT , WRAP_MIRROR , WRAP_MASK = 0x3 ,
  WRAP_PRE_SHIFT = 8 , WRAP_POST_SHIFT = 12
}

Public Member Functions

float EvalFloat (float frame) const
int EvalInt (float frame) const
float EvalFloat (float frame, AnimFrameCache *pFrameCache) const
int EvalInt (float frame, AnimFrameCache *pFrameCache) const
bool IsFloatCurve () const
bool IsIntCurve () const
WrapMode GetPreWrapMode () const
WrapMode GetPostWrapMode () const
float GetStartFrame () const
float GetEndFrame () const

Protected Member Functions

bit32 GetFrameType () const
bit32 GetKeyType () const
bit32 GetCurveType () const
float WrapFrame (float frame) const
void UpdateFrameCache (AnimFrameCache *pFrameCache, float frame) const
template<typename T>
void FindFrame (AnimFrameCache *pFrameCache, float frame) const
template<typename T>
float EvalCubic (float frame, AnimFrameCache *pFrameCache) const
template<typename T>
float EvalLinear (float frame, AnimFrameCache *pFrameCache) const
template<typename T>
float EvalBakedFloat (float frame, AnimFrameCache *pFrameCache) const
template<typename T>
int EvalStepInt (float frame, AnimFrameCache *pFrameCache) const
template<typename T>
int EvalBakedInt (float frame, AnimFrameCache *pFrameCache) const
int EvalStepBool (float frame, AnimFrameCache *pFrameCache) const
int EvalBakedBool (float frame, AnimFrameCache *pFrameCache) const
template<typename T>
void BakeImpl (void *pBuffer, float start, int numKey)

Private Member Functions

 NW_G3D_RES_COMMON (ResAnimCurve)

Additional Inherited Members

Private Attributes inherited from nw::g3d::res::ResAnimCurveData
bit16 flag
u16 numKey
u32 targetOffset
f32 startFrame
f32 endFrame
union { 
   f32   fScale 
   s32   iScale 
}; 
union { 
   f32   fOffset 
   s32   iOffset 
}; 
Offset ofsFrameArray
Offset ofsKeyArray

Member Enumeration Documentation

◆ Flag

Enumerator
FRAME_SHIFT 
FRAME32 
FRAME16 
FRAME8 
FRAME_MASK 
NUM_FRAME 
KEY_SHIFT 
KEY32 
KEY16 
KEY8 
KEY_MASK 
NUM_KEY 
CURVE_SHIFT 
CURVE_CUBIC 
CURVE_LINEAR 
CURVE_BAKED_FLOAT 
CURVE_STEP_INT 
CURVE_BAKED_INT 
CURVE_STEP_BOOL 
CURVE_BAKED_BOOL 
CURVE_INT_BASE 
CURVE_MASK 

◆ WrapMode

Enumerator
WRAP_CLAMP 
WRAP_REPEAT 
WRAP_MIRROR 
WRAP_MASK 
WRAP_PRE_SHIFT 
WRAP_POST_SHIFT 

Member Function Documentation

◆ NW_G3D_RES_COMMON()

nw::g3d::res::ResAnimCurve::NW_G3D_RES_COMMON ( ResAnimCurve )
private

◆ EvalFloat() [1/2]

float nw::g3d::res::ResAnimCurve::EvalFloat ( float frame) const
inline

◆ EvalInt() [1/2]

int nw::g3d::res::ResAnimCurve::EvalInt ( float frame) const
inline

◆ EvalFloat() [2/2]

float nw::g3d::res::ResAnimCurve::EvalFloat ( float frame,
AnimFrameCache * pFrameCache ) const

◆ EvalInt() [2/2]

int nw::g3d::res::ResAnimCurve::EvalInt ( float frame,
AnimFrameCache * pFrameCache ) const

◆ IsFloatCurve()

bool nw::g3d::res::ResAnimCurve::IsFloatCurve ( ) const
inline

◆ IsIntCurve()

bool nw::g3d::res::ResAnimCurve::IsIntCurve ( ) const
inline

◆ GetPreWrapMode()

WrapMode nw::g3d::res::ResAnimCurve::GetPreWrapMode ( ) const
inline

◆ GetPostWrapMode()

WrapMode nw::g3d::res::ResAnimCurve::GetPostWrapMode ( ) const
inline

◆ GetStartFrame()

float nw::g3d::res::ResAnimCurve::GetStartFrame ( ) const
inline

◆ GetEndFrame()

float nw::g3d::res::ResAnimCurve::GetEndFrame ( ) const
inline

◆ GetFrameType()

bit32 nw::g3d::res::ResAnimCurve::GetFrameType ( ) const
inlineprotected

◆ GetKeyType()

bit32 nw::g3d::res::ResAnimCurve::GetKeyType ( ) const
inlineprotected

◆ GetCurveType()

bit32 nw::g3d::res::ResAnimCurve::GetCurveType ( ) const
inlineprotected

◆ WrapFrame()

float nw::g3d::res::ResAnimCurve::WrapFrame ( float frame) const
protected

◆ UpdateFrameCache()

void nw::g3d::res::ResAnimCurve::UpdateFrameCache ( AnimFrameCache * pFrameCache,
float frame ) const
protected

◆ FindFrame()

template<typename T>
void nw::g3d::res::ResAnimCurve::FindFrame ( AnimFrameCache * pFrameCache,
float frame ) const
protected

◆ EvalCubic()

template<typename T>
float nw::g3d::res::ResAnimCurve::EvalCubic ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalLinear()

template<typename T>
float nw::g3d::res::ResAnimCurve::EvalLinear ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalBakedFloat()

template<typename T>
float nw::g3d::res::ResAnimCurve::EvalBakedFloat ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalStepInt()

template<typename T>
int nw::g3d::res::ResAnimCurve::EvalStepInt ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalBakedInt()

template<typename T>
int nw::g3d::res::ResAnimCurve::EvalBakedInt ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalStepBool()

int nw::g3d::res::ResAnimCurve::EvalStepBool ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ EvalBakedBool()

int nw::g3d::res::ResAnimCurve::EvalBakedBool ( float frame,
AnimFrameCache * pFrameCache ) const
protected

◆ BakeImpl()

template<typename T>
void nw::g3d::res::ResAnimCurve::BakeImpl ( void * pBuffer,
float start,
int numKey )
protected