NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
anm_obj_chr.hpp
1#pragma once
2
3#include <lib/nw4r/g3d/anm_obj.hpp>
4#include <lib/nw4r/g3d/res_anm.hpp>
5#include <lib/nw4r/math/vec.hpp>
6#include <lib/nw4r/math/mtx.hpp>
7
8#include <lib/rvl/mem/MEMHeapCommon.h>
9
10namespace nw4r {
11namespace g3d {
12
13/// @brief Character animation result.
15
16 /// @brief Information flags related to the character animation result.
17 enum Flag {
18 FLAG_ANM_EXISTS = BIT_FLAG(0), ///< The animation exists.
19 FLAG_IDENTITY = BIT_FLAG(1), ///< The node's matrix is always an identity matrix.
20 FLAG_RT_ZERO = BIT_FLAG(2), ///< The rotation and translation are always 0.
21 FLAG_SCALE_ONE = BIT_FLAG(3), ///< The scale is always 1.
22 FLAG_SCALE_UNIFORM = BIT_FLAG(4), ///< The scale is always the same along all axes.
23 FLAG_ROTATE_ZERO = BIT_FLAG(5), ///< The rotation is always 0.
24 FLAG_TRANS_ZERO = BIT_FLAG(6), ///< The translation is always 0.
25
26 /// @brief The model's value is used for the scale, and a result is not stored in ChrAnmResult::mScale.
27 FLAG_SCALE_USE_MODEL = BIT_FLAG(7),
28
29 /// @brief The model's value is used for the rotation, and a result is not stored in ChrAnmResult::mMtx.
30 FLAG_ROTATE_USE_MODEL = BIT_FLAG(8),
31
32 /// @brief The model's value is used for the translation, and a result is not stored in ChrAnmResult::mMtx.
33 FLAG_TRANS_USE_MODEL = BIT_FLAG(9),
34
35 /// @brief Scale calculations at this node must involve Maya's Segment Scale Compensate.
37
38 /// @brief One of this node's child nodes will involve Maya's Segment Scale Compensate in scale calculations.
40
41 /// @brief Softimage's Classic Scale Off must be taken into account for scale calculations at this node.
42 FLAG_CLASSIC_SCALE_OFF = BIT_FLAG(12),
43
44 /// @brief An appropriate value is stored in ChrAnmResult::mRotation.
45 FLAG_RAW_ROTATE_VALID = BIT_FLAG(31),
46 };
47
48 u32 mFlags; ///< The attributes held by the character animation result data. See Flag.
49 nw4r::math::VEC3 mScale; ///< The result scale.
50 nw4r::math::VEC3 mRotation; ///< The result rotation.
51 nw4r::math::MTX34 mMtx; ///< The matrix for rotation and translation.
52};
53
54class AnmObjChr : public AnmObj {
55public:
56 virtual void DetachAll();
57 virtual void SetWeight(int, float);
58 virtual float GetWeight(int) const;
59
60 NW4R_G3D_TYPE_OBJ_DECL(AnmObjChr);
61};
62
63class AnmObjChrRes : public AnmObjChr {
64public:
65 static AnmObjChrRes *Construct(MEMAllocator*, size_t*, nw4r::g3d::ResAnmChr, nw4r::g3d::ResMdl, bool);
66
67 NW4R_G3D_TYPE_OBJ_DECL(AnmObjChr);
68};
69
70class AnmObjChrNode : public AnmObjChr {
71public:
72 static AnmObjChrNode *Construct(MEMAllocator*, size_t*, nw4r::g3d::ResAnmChr, nw4r::g3d::ResMdl, bool);
73
74 NW4R_G3D_TYPE_OBJ_DECL(AnmObjChrNode);
75
76 char pad[0x10];
77 int a;
78 AnmObj **arr;
79
80 int getCount() const { return a; }
81};
82
83class AnmObjChrBlend : public AnmObjChr {
84public:
85 static AnmObjChrBlend *Construct(MEMAllocator*, size_t*, nw4r::g3d::ResMdl, int);
86
87 NW4R_G3D_TYPE_OBJ_DECL(AnmObjChrBlend);
88};
89
90} // namespace g3d
91} // namespace nw4r
3D graphics drawing library.
Definition docgroup.h:10
Character animation result.
u32 mFlags
The attributes held by the character animation result data. See Flag.
nw4r::math::MTX34 mMtx
The matrix for rotation and translation.
Flag
Information flags related to the character animation result.
@ FLAG_RAW_ROTATE_VALID
An appropriate value is stored in ChrAnmResult::mRotation.
@ FLAG_TRANS_ZERO
The translation is always 0.
@ FLAG_SEGMENT_SCALE_COMPENSATE_APPLY
Scale calculations at this node must involve Maya's Segment Scale Compensate.
@ FLAG_SCALE_ONE
The scale is always 1.
@ FLAG_ROTATE_ZERO
The rotation is always 0.
@ FLAG_CLASSIC_SCALE_OFF
Softimage's Classic Scale Off must be taken into account for scale calculations at this node.
@ FLAG_ROTATE_USE_MODEL
The model's value is used for the rotation, and a result is not stored in ChrAnmResult::mMtx.
@ FLAG_SEGMENT_SCALE_COMPENSATE_PARENT
One of this node's child nodes will involve Maya's Segment Scale Compensate in scale calculations.
@ FLAG_SCALE_UNIFORM
The scale is always the same along all axes.
@ FLAG_ANM_EXISTS
The animation exists.
@ FLAG_TRANS_USE_MODEL
The model's value is used for the translation, and a result is not stored in ChrAnmResult::mMtx.
@ FLAG_RT_ZERO
The rotation and translation are always 0.
@ FLAG_SCALE_USE_MODEL
The model's value is used for the scale, and a result is not stored in ChrAnmResult::mScale.
@ FLAG_IDENTITY
The node's matrix is always an identity matrix.
nw4r::math::VEC3 mRotation
The result rotation.
nw4r::math::VEC3 mScale
The result scale.
A 3x4 matrix.
Definition mtx.hpp:15
A three-dimensional floating point vector.
Definition vec.hpp:22