OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
skeletor_model_file_format.h
1/*
2===========================================================================
3Copyright (C) 2023 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// skeletor_model_file_format.h : Skeletor model file format
24
25#pragma once
26
27static const char *SKEL_BONENAME_WORLD = "worldbone";
28
29typedef enum boneType_e {
30 SKELBONE_ROTATION,
31 SKELBONE_POSROT,
32 SKELBONE_IKSHOULDER,
33 SKELBONE_IKELBOW,
34 SKELBONE_IKWRIST,
35 SKELBONE_HOSEROT,
36 SKELBONE_AVROT,
37 SKELBONE_ZERO,
38 SKELBONE_NUMBONETYPES,
39 SKELBONE_WORLD,
40 SKELBONE_HOSEROTBOTH,
41 SKELBONE_HOSEROTPARENT
42} boneType_t;
43
44typedef enum {
45 HRTYPE_PLAIN,
46 HRTYPE_ROTATEPARENT180Y,
47 HRTYPE_ROTATEBOTH180Y
48} hoseRotType_t;
49
50typedef struct boneFileData_s {
51 char name[32];
52 char parent[32];
53 boneType_t boneType;
54 int ofsBaseData;
55 int ofsChannelNames;
56 int ofsBoneNames;
57 int ofsEnd;
58} boneFileData_t;
59
60typedef struct skelHitBox_s {
61 int boneIndex;
62} skelHitBox_t;
63
64typedef struct {
65 int ident;
66 int version;
67 char name[64];
68 int numSurfaces;
69 int numBones;
70 int ofsBones;
71 int ofsSurfaces;
72 int ofsEnd;
73 int lodIndex[10];
74 int numBoxes;
75 int ofsBoxes;
76 int numMorphTargets;
77 int ofsMorphTargets;
79
80#if __cplusplus
81
82# include "SkelVec3.h"
83# include "SkelQuat.h"
84
85struct boneData_s;
86
87int CreateRotationBoneFileData(
88 const char *newBoneName, const char *newBoneParentName, SkelVec3 basePos, boneFileData_t *fileData
89);
90int CreatePosRotBoneFileData(char *newBoneName, char *newBoneParentName, boneFileData_t *fileData);
91void CreatePosRotBoneData(const char *newBoneName, const char *newBoneParentName, boneData_s *boneData);
92int CreateIKShoulderBoneFileData(
93 const char *newBoneName, const char *newBoneParentName, SkelQuat baseOrient, SkelVec3 basePos, boneData_s *boneData
94 );
95int CreateIKElbowBoneFileData(
96 const char *newBoneName, const char *newBoneParentName, SkelVec3 basePos, boneData_s *boneData
97);
98int CreateIKWristBoneFileData(
99 const char *newBoneName,
100 const char *newBoneParentName,
101 const char *shoulderBoneName,
102 SkelVec3 basePos,
103 boneFileData_t *fileData
104);
105int CreateHoseRotBoneFileData(
106 char *newBoneName,
107 char *newBoneParentName,
108 char *targetBoneName,
109 float bendRatio,
110 float bendMax,
111 float spinRatio,
112 hoseRotType_t hoseRotType,
113 SkelVec3 basePos,
114 boneFileData_t *fileData
115);
116int CreateAvRotBoneFileData(
117 char *newBoneName,
118 char *newBoneParentName,
119 char *baseBoneName,
120 char *targetBoneName,
121 float rotRatio,
122 SkelVec3 basePos,
123 boneFileData_t *fileData
124);
125
126#endif
Definition SkelQuat.h:274
Definition SkelVec3.h:197
Definition tiki_shared.h:273
Definition skeletor_model_file_format.h:50
Definition skeletor_model_file_format.h:64
Definition skeletor_model_file_format.h:60