1 | //This is a static CORE interface |
---|
2 | |
---|
3 | |
---|
4 | #ifndef __IPHYSIQUEINTERFACE__H |
---|
5 | #define __IPHYSIQUEINTERFACE__H |
---|
6 | |
---|
7 | #include "max.h" |
---|
8 | #include "iFnPub.h" |
---|
9 | #include "phyexp.h" |
---|
10 | #include "bipexp.h" |
---|
11 | |
---|
12 | #define IPHYSIQUEINTERFACE Interface_ID(0x6a4e7329, 0x190169ac) |
---|
13 | |
---|
14 | class IPhysiqueInterface : public FPStaticInterface |
---|
15 | { |
---|
16 | public: |
---|
17 | Modifier* FindPhysiqueModifier (INode* physiquedNode, int modIndex = 0); |
---|
18 | BOOL CheckMatrix(INode* node, ReferenceTarget* mod); |
---|
19 | Matrix3 GetInitialNodeTM(INode* physiquedNode, ReferenceTarget* mod = NULL); |
---|
20 | Matrix3 GetInitialBoneTM(INode* physiquedNode, int index, ReferenceTarget* mod = NULL); |
---|
21 | int GetBoneCount(INode* physiquedNode, ReferenceTarget* mod = NULL); |
---|
22 | Tab<INode*> GetBoneList(INode* physiquedNode, ReferenceTarget* mod = NULL); |
---|
23 | |
---|
24 | int GetAPIVersion(INode* physiquedNode, ReferenceTarget* mod = NULL); |
---|
25 | |
---|
26 | int GetVertexCount(INode* physiquedNode, ReferenceTarget* mod = NULL); |
---|
27 | |
---|
28 | int GetVertexType(INode* physiquedNode, int vertIndex, ReferenceTarget* mod = NULL); |
---|
29 | |
---|
30 | int GetVertexBoneCount(INode* physiquedNode, int vertIndex, bool rigid = true, ReferenceTarget* mod = NULL); |
---|
31 | Tab<INode*> GetVertexBones(INode* node, int vertIndex, bool rigid, bool blending, ReferenceTarget* mod); |
---|
32 | INode* GetVertexBone(INode* physiquedNode, int vertIndex, int boneIndex, bool rigid = true, bool blending = true, ReferenceTarget* mod = NULL); |
---|
33 | Point3 GetVertexOffset(INode* physiquedNode, int vertIndex, int boneIndex, bool rigid = true, bool blending = true, ReferenceTarget* mod = NULL); |
---|
34 | Point3 GetVertexDeformableOffset(INode* physiquedNode, int vertIndex, ReferenceTarget* mod = NULL, TimeValue t = 0); |
---|
35 | float GetVertexWeight(INode* physiquedNode, int vertIndex, int boneIndex, bool rigid = true, bool blending = true, ReferenceTarget* mod = NULL); |
---|
36 | |
---|
37 | bool SetFigureMode(INode* physiquedNode, bool state, ReferenceTarget* mod = NULL); |
---|
38 | bool BipedFigureMode(INode* node, bool state); |
---|
39 | void SetInitialPose(INode* physiquedNode, bool set, ReferenceTarget* mod = NULL); |
---|
40 | |
---|
41 | bool AttachToNode(INode* physiquedNode, INode* rootNode, ReferenceTarget* mod = NULL, TimeValue t = GetCOREInterface()->GetTime()); |
---|
42 | bool Initialize(INode* physiquedNode, INode* rootNode, ReferenceTarget* mod = NULL, TimeValue t = GetCOREInterface()->GetTime()); |
---|
43 | |
---|
44 | void LockVertex(INode* physiquedNode, int vertexIndex, ReferenceTarget* mod = NULL); |
---|
45 | void UnLockVertex(INode* physiquedNode, int vertexIndex, ReferenceTarget* mod = NULL); |
---|
46 | void SetVertexBone(INode* physiquedNode, int vertexIndex, INode* bone, float weight = 1.0f, bool clear = false, ReferenceTarget* mod = NULL); |
---|
47 | |
---|
48 | //function ids |
---|
49 | enum{getAPIVersion, checkMatrix,getPhysique, |
---|
50 | getBoneList, getBoneCount, getVertexCount, |
---|
51 | getInitialNodeTM, getInitialBoneTM, |
---|
52 | getVertexType, getVertexBones, getVertexBoneCount, getVertexBone, |
---|
53 | getVertexOffset, getVertexDeformableOffset, getVertexWeight, |
---|
54 | setInitialPose, setFigureMode, |
---|
55 | attachToNode, initialize, lockVertex, unlockVertex, setVertexBone, |
---|
56 | }; |
---|
57 | //symbolic enumerator values |
---|
58 | enum{blendingTypeEnum, interfaceTypeEnum, }; |
---|
59 | |
---|
60 | DECLARE_DESCRIPTOR(IPhysiqueInterface); |
---|
61 | |
---|
62 | BEGIN_FUNCTION_MAP |
---|
63 | FN_2(getPhysique, TYPE_REFTARG, FindPhysiqueModifier, TYPE_INODE, TYPE_INDEX); |
---|
64 | FN_2(checkMatrix,TYPE_BOOL,CheckMatrix,TYPE_INODE,TYPE_REFTARG); |
---|
65 | FN_2(getInitialNodeTM, TYPE_MATRIX3_BV, GetInitialNodeTM, TYPE_INODE, TYPE_REFTARG); |
---|
66 | FN_3(getInitialBoneTM, TYPE_MATRIX3_BV, GetInitialBoneTM, TYPE_INODE, TYPE_INDEX, TYPE_REFTARG); |
---|
67 | FN_2(getBoneCount, TYPE_INT, GetBoneCount, TYPE_INODE, TYPE_REFTARG); |
---|
68 | FN_2(getBoneList, TYPE_INODE_TAB_BV, GetBoneList, TYPE_INODE, TYPE_REFTARG); |
---|
69 | FN_2(getAPIVersion, TYPE_INT, GetAPIVersion, TYPE_INODE, TYPE_REFTARG); |
---|
70 | VFN_3(setInitialPose, SetInitialPose, TYPE_INODE, TYPE_bool, TYPE_REFTARG); |
---|
71 | |
---|
72 | FN_2(getVertexCount, TYPE_INT, GetVertexCount, TYPE_INODE, TYPE_REFTARG); |
---|
73 | FN_3(getVertexType, TYPE_ENUM, GetVertexType, TYPE_INODE, TYPE_INDEX, TYPE_REFTARG); |
---|
74 | FN_4(getVertexBoneCount, TYPE_INT, GetVertexBoneCount, TYPE_INODE, TYPE_INDEX, TYPE_bool, TYPE_REFTARG); |
---|
75 | FN_5(getVertexBones, TYPE_INODE_TAB_BV, GetVertexBones, TYPE_INODE, TYPE_INDEX, TYPE_bool, TYPE_bool, TYPE_REFTARG); |
---|
76 | FN_6(getVertexBone, TYPE_INODE, GetVertexBone, TYPE_INODE, TYPE_INDEX, TYPE_INDEX, TYPE_bool, TYPE_bool, TYPE_REFTARG); |
---|
77 | FN_6(getVertexOffset, TYPE_POINT3_BV, GetVertexOffset, TYPE_INODE, TYPE_INDEX, TYPE_INDEX, TYPE_bool, TYPE_bool, TYPE_REFTARG); |
---|
78 | FNT_3(getVertexDeformableOffset, TYPE_POINT3_BV, GetVertexDeformableOffset, TYPE_INODE, TYPE_INDEX, TYPE_REFTARG); |
---|
79 | FN_6(getVertexWeight, TYPE_FLOAT, GetVertexWeight, TYPE_INODE, TYPE_INDEX, TYPE_INDEX, TYPE_bool, TYPE_bool, TYPE_REFTARG); |
---|
80 | |
---|
81 | FN_3(setFigureMode, TYPE_bool, SetFigureMode, TYPE_INODE, TYPE_bool, TYPE_REFTARG); |
---|
82 | FNT_3(attachToNode, TYPE_bool, AttachToNode, TYPE_INODE, TYPE_INODE, TYPE_REFTARG); |
---|
83 | FNT_3(initialize, TYPE_bool, Initialize, TYPE_INODE, TYPE_INODE, TYPE_REFTARG); |
---|
84 | VFN_3(lockVertex, LockVertex, TYPE_INODE, TYPE_INDEX, TYPE_REFTARG); |
---|
85 | VFN_3(unlockVertex, UnLockVertex, TYPE_INODE, TYPE_INDEX, TYPE_REFTARG); |
---|
86 | VFN_6(setVertexBone, SetVertexBone, TYPE_INODE, TYPE_INDEX, TYPE_INODE, TYPE_FLOAT, TYPE_bool, TYPE_REFTARG); |
---|
87 | END_FUNCTION_MAP |
---|
88 | }; |
---|
89 | |
---|
90 | #endif //__IPHYSIQUEINTERFACE__H |
---|