19class AnmObjChr :
public AnmObj {
21 enum BindOption { BIND_ONE, BIND_PARTIAL, NUM_OF_BIND_OPTION };
24 AnmObjChr(
MEMAllocator* pAllocator, u16* pBindingBuf,
int numBinding);
25 virtual void G3dProc(ulong task, ulong param,
void* pInfo) = 0;
26 virtual ~AnmObjChr() {}
28 virtual void SetFrame(f32 frame) = 0;
29 virtual f32 GetFrame()
const = 0;
30 virtual void UpdateFrame() = 0;
32 virtual void SetUpdateRate(f32 rate) = 0;
33 virtual f32 GetUpdateRate()
const = 0;
35 virtual bool Bind(
const ResMdl mdl) = 0;
36 virtual void Release();
43 virtual void DetachAll();
45 virtual void SetWeight(
int idx, f32 weight);
46 virtual f32 GetWeight(
int idx)
const;
48 virtual bool Bind(
const ResMdl mdl, ulong target,
49 BindOption option) = 0;
50 virtual void Release(
const ResMdl mdl, ulong target,
51 BindOption option) = 0;
53 bool TestExistence(ulong idx)
const;
54 bool TestDefined(ulong idx)
const;
56 void UseQuaternionBlend(
bool enable) {
57 SetAnmFlag(FLAG_USE_QUATERNION_ROTATION_BLEND, enable);
60 void UseAccurateScaleBlend(
bool enable) {
61 SetAnmFlag(FLAG_USE_ACCURATE_SCALE_BLEND, enable);
66 BINDING_ID_MASK = (1 << 14) - 1,
67 BINDING_INVALID = (1 << 14),
68 BINDING_UNDEFINED = (1 << 15),
72 static const int DEFAULT_MAX_CHILDREN = 4;
78 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjChr, AnmObj);
86class AnmObjChrNode :
public AnmObjChr {
88 AnmObjChrNode(
MEMAllocator* pAllocator, u16* pBindingBuf,
int numBinding,
90 virtual void G3dProc(ulong task, ulong param,
void* pInfo);
91 virtual ~AnmObjChrNode();
93 virtual void SetFrame(f32 frame);
94 virtual f32 GetFrame()
const;
95 virtual void UpdateFrame();
97 virtual void SetUpdateRate(f32 rate);
98 virtual f32 GetUpdateRate()
const;
100 virtual bool Bind(
const ResMdl mdl);
101 virtual void Release();
105 virtual void DetachAll();
107 virtual bool Bind(
const ResMdl mdl, ulong target,
109 virtual void Release(
const ResMdl mdl, ulong target,
112 int Size()
const {
return mChildrenArraySize; }
113 AnmObjChrRes* GetChild(
int idx)
const {
return mpChildrenArray[idx]; }
116 int mChildrenArraySize;
119 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjChrNode, AnmObjChr);
155class AnmObjChrRes :
public AnmObjChr,
protected FrameCtrl {
157 static AnmObjChrRes* Construct(
MEMAllocator* pAllocator,
size_t* pSize,
162 virtual void G3dProc(ulong task, ulong param,
void* pInfo);
163 virtual ~AnmObjChrRes() {}
165 virtual void SetFrame(f32 frame);
166 virtual f32 GetFrame()
const;
167 virtual void UpdateFrame();
169 virtual void SetUpdateRate(f32 rate);
170 virtual f32 GetUpdateRate()
const;
172 virtual bool Bind(
const ResMdl mdl);
173 using AnmObjChr::Release;
178 virtual bool Bind(
const ResMdl mdl, ulong target,
180 virtual void Release(
const ResMdl mdl, ulong target,
189 void SetPlayPolicy(PlayPolicyFunc pFunc) {
190 FrameCtrl::SetPlayPolicy(pFunc);
197 NW4R_G3D_RTTI_DECL_DERIVED(AnmObjChrRes, AnmObjChr);