OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
skeletor_animation_file_format.h
1/*
2===========================================================================
3Copyright (C) 2024 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_animation_file_format.h : Skeletor animation file format
24
25#pragma once
26
27typedef float skelAnimChannel_t[4];
28
29typedef struct {
30 SkelVec3 bounds[2];
31 float radius;
32 SkelVec3 delta;
33 float angleDelta;
34 int iOfsChannels;
36
37typedef struct {
38 int ident;
39 int version;
40 int flags;
41 int nBytesUsed;
42 float frameTime;
43 SkelVec3 totalDelta;
44 float totalAngleDelta;
45 int numChannels;
46 int ofsChannelNames;
47 int numFrames;
48 skelAnimFileFrame_t frame[1];
50
51typedef struct {
52 SkelVec3 bounds[2];
53 float radius;
54 SkelVec3 delta;
55 float angleDelta;
56 vec4_t *pChannels; // FIXME: must delete
58
59typedef struct {
60 short int nFrameNum;
61 short int nPrevFrameIndex;
62 float pChannelData[1];
64
65typedef struct {
66 short int nFramesInChannel;
67 skanGameFrame *ary_frames;
69
70typedef struct {
71 short nFrameNum;
72 vec3_t pos;
73 vec3_t rot;
75
76typedef struct skelAnimDataGameHeader_s skelAnimDataGameHeader_t;
77
78#ifdef __cplusplus
79
80typedef struct skelAnimDataGameHeader_s {
81 int flags;
82 size_t nBytesUsed;
83 bool bHasDelta;
84 bool bHasMorph;
85 bool bHasUpper;
86 int numFrames;
87 SkelVec3 totalDelta;
88 float totalAngleDelta;
89 float frameTime;
90 skelChannelList_c channelList;
91 SkelVec3 bounds[2];
92 skelAnimGameFrame_t *m_frame;
93 short int nTotalChannels;
94 skanChannelHdr ary_channels[1];
95
96 skelAnimDataGameHeader_s(const skelAnimDataGameHeader_t&);
97 skelAnimDataGameHeader_s();
98
99 static skelAnimDataGameHeader_t *AllocRLEChannelData(size_t numChannels);
100 int GetFrameNums(
101 float timeSeconds,
102 float timeTolerance,
103 int *beforeFrame,
104 int *afterFrame,
105 float *beforeWeight,
106 float *afterWeight
107 );
108 SkelVec3 GetDeltaOverTime(float time1, float time2);
109 float GetAngularDeltaOverTime(float time1, float time2);
110 static skelAnimDataGameHeader_t *AllocAnimData(size_t numFrames, size_t numChannels);
111 static void DeallocAnimData(skelAnimDataGameHeader_t *data);
112} skelAnimDataGameHeader_t;
113
114#endif
Definition SkelVec3.h:197
Definition skeletor_animation_file_format.h:70
Definition skeletor_animation_file_format.h:65
Definition skeletor_animation_file_format.h:59
Definition skeletor_animation_file_format.h:37
Definition skeletor_animation_file_format.h:29
Definition skeletor_animation_file_format.h:51