2012-02-19 00:15:34 -06:00
|
|
|
/*
|
2012-05-21 23:27:44 -05:00
|
|
|
libvitaboy - Open source OpenGL TSO character animation library
|
|
|
|
libvitaboy.hpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
|
|
|
Author(s): Fatbag <X-Fi6@phppoll.org>
|
2012-02-19 00:15:34 -06:00
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2012-02-27 02:55:53 -06:00
|
|
|
#ifndef LIBVITABOY_HPP
|
|
|
|
#define LIBVITABOY_HPP
|
|
|
|
|
2012-02-04 01:19:52 -06:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
2024-04-28 09:04:43 -04:00
|
|
|
#include <filehandler.h>
|
2012-02-04 01:19:52 -06:00
|
|
|
|
2012-10-27 23:45:56 -05:00
|
|
|
/****
|
|
|
|
** Bytestream
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
class VBFile_t
|
|
|
|
{
|
|
|
|
private:
|
2012-02-04 01:19:52 -06:00
|
|
|
const uint8_t *Buffer, *Position;
|
|
|
|
unsigned Size;
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
public:
|
|
|
|
inline void set(const void *_Buffer, unsigned _Size)
|
|
|
|
{
|
|
|
|
Buffer = (const uint8_t *)_Buffer;
|
|
|
|
Position = (const uint8_t *)_Buffer;
|
2012-02-04 01:19:52 -06:00
|
|
|
Size = _Size;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline unsigned getpos()
|
|
|
|
{
|
|
|
|
return Position - Buffer;
|
2012-02-04 01:19:52 -06:00
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline void seekto(unsigned offset)
|
|
|
|
{
|
|
|
|
Position = Buffer + offset;
|
2012-02-04 01:19:52 -06:00
|
|
|
}
|
2024-04-28 09:04:43 -04:00
|
|
|
inline void seekahead(unsigned count)
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
Position += count;
|
|
|
|
}
|
2024-04-28 09:04:43 -04:00
|
|
|
inline void seekback(unsigned count)
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
Position -= count;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline uint32_t readint32()
|
|
|
|
{
|
|
|
|
uint32_t value = (uint32_t)((Position[0] << (8 * 3)) | (Position[1] << (8 * 2)) | (Position[2] << (8 * 1)) | (Position[3] << (8 * 0)));
|
2012-02-04 01:19:52 -06:00
|
|
|
Position += 4;
|
|
|
|
return value;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline uint32_t readint16()
|
|
|
|
{
|
|
|
|
uint16_t value = (uint16_t)((Position[0] << (8 * 1)) | (Position[1] << (8 * 0)));
|
2012-02-04 01:19:52 -06:00
|
|
|
Position += 2;
|
|
|
|
return value;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline uint32_t readint8()
|
|
|
|
{
|
|
|
|
uint8_t value = (uint8_t)((Position[0] << (8 * 0)));
|
2012-02-04 01:19:52 -06:00
|
|
|
Position += 1;
|
|
|
|
return value;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline float readfloat()
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
uint32_t i;
|
|
|
|
float f;
|
|
|
|
} value;
|
|
|
|
value.i = (uint32_t)((Position[0] << (8 * 0)) | (Position[1] << (8 * 1)) | (Position[2] << (8 * 2)) | (Position[3] << (8 * 3)));
|
2012-02-04 01:19:52 -06:00
|
|
|
Position += 4;
|
2012-05-28 23:37:38 -05:00
|
|
|
return value.f;
|
2012-02-04 01:19:52 -06:00
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline void readbytes(void *Destination, unsigned length)
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
memcpy(Destination, Position, length);
|
|
|
|
Position += length;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline char *readstring()
|
|
|
|
{
|
|
|
|
// Read a Pascal string with 1 length byte
|
2012-02-04 01:19:52 -06:00
|
|
|
unsigned length = readint8();
|
2024-04-28 09:04:43 -04:00
|
|
|
char *string = (char *)malloc(length + 1);
|
2012-02-04 01:19:52 -06:00
|
|
|
readbytes(string, length);
|
|
|
|
string[length] = '\0';
|
|
|
|
return string;
|
|
|
|
}
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
inline char *readstring2()
|
|
|
|
{
|
|
|
|
// Read a Pascal string with 2 length bytes
|
2012-02-04 01:19:52 -06:00
|
|
|
unsigned length = readint16();
|
2024-04-28 09:04:43 -04:00
|
|
|
char *string = (char *)malloc(length + 1);
|
2012-02-04 01:19:52 -06:00
|
|
|
readbytes(string, length);
|
|
|
|
string[length] = '\0';
|
|
|
|
return string;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
extern VBFile_t VBFile;
|
|
|
|
|
2012-02-05 21:02:28 -06:00
|
|
|
/****
|
2012-02-07 15:49:09 -06:00
|
|
|
** Common
|
2012-02-05 21:02:28 -06:00
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
enum ReadGroup
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
NOGROUP,
|
|
|
|
READGROUP
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Translation_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
float x, y, z;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Rotation_t
|
|
|
|
{
|
2012-02-07 15:49:09 -06:00
|
|
|
float x, y, z, w;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct KeyValuePair_t
|
|
|
|
{
|
|
|
|
char *Key;
|
|
|
|
char *Value;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Prop_t
|
|
|
|
{
|
2012-02-04 16:04:40 -06:00
|
|
|
uint32_t EntriesCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
KeyValuePair_t *Entries;
|
2012-02-04 16:04:40 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct PropsList_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t PropsCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Prop_t *Props;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadAsset(Asset_t &Asset, bool ReadGroup);
|
|
|
|
void ReadPropEntry(KeyValuePair_t &Entry);
|
|
|
|
void ReadPropEntries(Prop_t &Prop);
|
|
|
|
void ReadPropsList(PropsList_t &PropsList);
|
|
|
|
float DotProduct(Rotation_t *q1, Rotation_t *q2);
|
|
|
|
void Normalize(Rotation_t *q);
|
|
|
|
void CombineQuaternions(Rotation_t *Destination, Rotation_t *Source);
|
|
|
|
void FindQuaternionMatrix(float *Matrix, Rotation_t *Quaternion);
|
2012-02-07 15:49:09 -06:00
|
|
|
|
|
|
|
/****
|
|
|
|
** Animation (*.anim)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct TimeProp_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t ID;
|
|
|
|
PropsList_t PropsList;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct TimePropsList_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t TimePropsCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
TimeProp_t *TimeProps;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Motion_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t Unknown;
|
2024-04-28 09:04:43 -04:00
|
|
|
char *BoneName;
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t FrameCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
float Duration; // Converted to seconds
|
2012-02-04 01:19:52 -06:00
|
|
|
uint8_t HasTranslation;
|
|
|
|
uint8_t HasRotation;
|
2012-02-19 00:15:34 -06:00
|
|
|
uint32_t FirstTranslation;
|
|
|
|
uint32_t FirstRotation;
|
2024-04-28 09:04:43 -04:00
|
|
|
Translation_t *Translations;
|
|
|
|
Rotation_t *Rotations;
|
2012-02-04 01:19:52 -06:00
|
|
|
|
|
|
|
uint8_t HasPropsLists;
|
|
|
|
uint32_t PropsListsCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
PropsList_t *PropsLists;
|
2012-02-04 01:19:52 -06:00
|
|
|
|
|
|
|
uint8_t HasTimePropsLists;
|
|
|
|
uint32_t TimePropsListsCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
TimePropsList_t *TimePropsLists;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Animation_t
|
|
|
|
{
|
2012-02-04 01:19:52 -06:00
|
|
|
uint32_t Version;
|
2024-04-28 09:04:43 -04:00
|
|
|
char *Name;
|
|
|
|
float Duration; // Converted to seconds
|
2012-02-04 01:19:52 -06:00
|
|
|
float Distance;
|
|
|
|
uint8_t IsMoving;
|
|
|
|
uint32_t TranslationsCount;
|
|
|
|
uint32_t RotationsCount;
|
|
|
|
uint32_t MotionsCount;
|
|
|
|
|
|
|
|
unsigned TranslationsOffset;
|
|
|
|
unsigned RotationsOffset;
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
Motion_t *Motions;
|
2012-02-04 01:19:52 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadAnimation(Animation_t &Animation);
|
|
|
|
void ReadMotion(Animation_t &Animation, Motion_t &Motion);
|
|
|
|
void ReadPropsLists(Motion_t &Motion);
|
|
|
|
void ReadTimePropsList(TimePropsList_t &TimePropsList);
|
|
|
|
void ReadTimePropsLists(Motion_t &Motion);
|
2012-02-05 21:02:28 -06:00
|
|
|
|
2012-02-27 02:55:53 -06:00
|
|
|
/****
|
|
|
|
** Appearance (*.apr)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Appearance_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Version;
|
|
|
|
Asset_t Thumbnail;
|
|
|
|
uint32_t BindingCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Asset_t *Bindings;
|
2012-02-27 02:55:53 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadAppearance(Appearance_t &Appearance);
|
2012-10-27 23:45:56 -05:00
|
|
|
|
2012-02-27 02:55:53 -06:00
|
|
|
/****
|
|
|
|
** Binding (*.bnd)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Binding_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Version;
|
2024-04-28 09:04:43 -04:00
|
|
|
char *BoneName;
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t MeshDef;
|
|
|
|
Asset_t Mesh;
|
|
|
|
uint32_t AppearanceDef;
|
|
|
|
Asset_t Appearance;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadBinding(Binding_t &Binding);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
|
|
|
/****
|
|
|
|
** Collection (*.col)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct PODef_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Index;
|
|
|
|
Asset_t PO;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Collection_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t POCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
PODef_t *PurchasableOutfits;
|
2012-02-27 02:55:53 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadCollection(Collection_t &Collection);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
|
|
|
/****
|
|
|
|
** Hand Group (*.hag)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct HandGroup_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Version;
|
|
|
|
Asset_t HandAppearances[18];
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadHandGroup(HandGroup_t &HandGroup);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2012-02-05 21:02:28 -06:00
|
|
|
/****
|
|
|
|
** Mesh (*.mesh)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct TextureVertex_t
|
|
|
|
{
|
2012-02-05 21:02:28 -06:00
|
|
|
float u, v;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Coord_t
|
|
|
|
{
|
2012-02-05 21:02:28 -06:00
|
|
|
float x, y, z;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct TextureCoord_t
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
float u, v;
|
2012-02-05 21:02:28 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct NormalCoord_t
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
float x, y, z;
|
2012-02-07 15:49:09 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct BlendData_t
|
|
|
|
{
|
2012-02-13 20:55:19 -06:00
|
|
|
float Weight;
|
|
|
|
unsigned OtherVertex;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Vertex_t
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
Coord_t Coord;
|
|
|
|
TextureCoord_t TextureCoord;
|
|
|
|
NormalCoord_t NormalCoord;
|
2012-05-21 23:27:44 -05:00
|
|
|
|
2012-03-10 14:56:32 -06:00
|
|
|
unsigned BoneIndex;
|
|
|
|
BlendData_t BlendData;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Face_t
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
unsigned VertexA, VertexB, VertexC;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct BoneBinding_t
|
|
|
|
{
|
2012-03-10 14:56:32 -06:00
|
|
|
unsigned BoneIndex;
|
|
|
|
unsigned FirstRealVertex;
|
|
|
|
unsigned RealVertexCount;
|
|
|
|
unsigned FirstBlendVertex;
|
|
|
|
unsigned BlendVertexCount;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Mesh_t
|
|
|
|
{
|
2012-02-05 21:02:28 -06:00
|
|
|
uint32_t Version;
|
|
|
|
uint32_t BoneCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
char **BoneNames;
|
2012-02-05 21:02:28 -06:00
|
|
|
uint32_t FaceCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Face_t *FaceData;
|
2012-02-05 21:02:28 -06:00
|
|
|
uint32_t BindingCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
BoneBinding_t *BoneBindings;
|
2012-03-10 14:56:32 -06:00
|
|
|
uint32_t RealVertexCount;
|
|
|
|
uint32_t BlendVertexCount;
|
2012-02-13 20:55:19 -06:00
|
|
|
uint32_t TotalVertexCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Vertex_t *VertexData;
|
|
|
|
Vertex_t *TransformedVertexData;
|
2012-02-07 15:49:09 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadMesh(Mesh_t &Mesh);
|
2012-02-07 15:49:09 -06:00
|
|
|
|
2012-02-27 02:55:53 -06:00
|
|
|
/****
|
|
|
|
** Outfit (*.oft)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
enum OutfitColor
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
OutfitColor_Light,
|
|
|
|
OutfitColor_Medium,
|
|
|
|
OutfitColor_Dark
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
enum OutfitRegion
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
OutfitRegion_Head = 0,
|
|
|
|
OutfitRegion_Body = 18
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Outfit_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Version;
|
|
|
|
uint32_t Unknown;
|
|
|
|
Asset_t Appearance[3];
|
|
|
|
uint32_t Group;
|
|
|
|
uint32_t Region;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadOutfit(Outfit_t &Outfit);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
|
|
|
/****
|
|
|
|
** Purchasable Outfit (*.po)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct PurchasableOutfit_t
|
|
|
|
{
|
2012-02-27 02:55:53 -06:00
|
|
|
uint32_t Version;
|
|
|
|
uint32_t Unknown;
|
|
|
|
uint32_t OutfitDef;
|
|
|
|
Asset_t Outfit;
|
|
|
|
uint32_t CollectionDef;
|
|
|
|
Asset_t Collection;
|
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadPurchasableOutfit(PurchasableOutfit_t &PurchasableOutfit);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2012-02-07 15:49:09 -06:00
|
|
|
/****
|
|
|
|
** Skeleton (*.skel)
|
|
|
|
*/
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Bone_t
|
|
|
|
{
|
2012-02-07 15:49:09 -06:00
|
|
|
uint32_t Unknown;
|
2024-04-28 09:04:43 -04:00
|
|
|
char *Name;
|
|
|
|
char *ParentsName;
|
2012-02-07 15:49:09 -06:00
|
|
|
uint8_t HasProps;
|
|
|
|
PropsList_t PropsList;
|
|
|
|
Translation_t Translation;
|
|
|
|
Rotation_t Rotation;
|
|
|
|
uint32_t CanTranslate;
|
|
|
|
uint32_t CanRotate;
|
|
|
|
uint32_t CanBlend;
|
|
|
|
float WiggleValue;
|
|
|
|
float WigglePower;
|
2012-02-27 02:55:53 -06:00
|
|
|
|
2012-02-07 15:49:09 -06:00
|
|
|
unsigned ChildrenCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Bone_t **Children;
|
2012-02-07 15:49:09 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
struct Skeleton_t
|
|
|
|
{
|
2012-02-07 15:49:09 -06:00
|
|
|
uint32_t Version;
|
2024-04-28 09:04:43 -04:00
|
|
|
char *Name;
|
2012-02-07 15:49:09 -06:00
|
|
|
uint16_t BoneCount;
|
2024-04-28 09:04:43 -04:00
|
|
|
Bone_t *Bones;
|
2012-02-05 21:02:28 -06:00
|
|
|
};
|
|
|
|
|
2024-04-28 09:04:43 -04:00
|
|
|
void ReadSkeleton(Skeleton_t &Bone);
|
|
|
|
void ReadBone(Skeleton_t &Skeleton, Bone_t &Bone, unsigned Index);
|
|
|
|
unsigned FindBone(Skeleton_t &Skeleton, const char *BoneName, unsigned Count);
|
2012-02-27 02:55:53 -06:00
|
|
|
|
|
|
|
#endif
|