WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
Bone.h
Go to the documentation of this file.
1/*
2 * Bone.h
3 *
4 * Created on: 19 oct. 2013
5 *
6 */
7
8#pragma once
9
10#include "animated.h"
11#include "modelheaders.h" // ModelBoneDef
12
13#include "glm/glm.hpp"
14
15class GameFile;
16class WoWModel;
17
19class Bone
20{
21public:
25
26 glm::vec3 pivot, transPivot;
28
29 bool billboard;
30 glm::mat4 mat;
31 glm::mat4 mrot;
32
34
35 bool calc;
36
38 void calcMatrix(std::vector<Bone>& allbones, ssize_t anim, size_t time, bool rotate = true);
40 void initV3(GameFile& f, ModelBoneDef& b, const modelAnimData& data);
41};
Generic animated value class that reads keyframe data from M2 files.
Definition animated.h:161
Represents a single bone in a WoW M2 model skeleton.
Definition Bone.h:20
void calcMatrix(std::vector< Bone > &allbones, ssize_t anim, size_t time, bool rotate=true)
Compute the bone matrix from parent bones and animation data.
Definition Bone.cpp:9
bool billboard
Whether this bone is billboarded.
Definition Bone.h:29
Animated< glm::fquat, PACK_QUATERNION, Quat16ToQuat32 > rot
Rotation animation track (packed 16-bit).
Definition Bone.h:23
glm::vec3 transPivot
Pivot point and translated pivot.
Definition Bone.h:26
int16 parent
Parent bone index (-1 if root).
Definition Bone.h:27
Animated< glm::vec3 > trans
Translation animation track.
Definition Bone.h:22
glm::mat4 mat
Computed transformation matrix.
Definition Bone.h:30
Animated< glm::vec3 > scale
Scale animation track.
Definition Bone.h:24
glm::mat4 mrot
Computed rotation-only matrix.
Definition Bone.h:31
ModelBoneDef boneDef
Raw bone definition from the M2 file.
Definition Bone.h:33
glm::vec3 pivot
Definition Bone.h:26
bool calc
Whether this bone has been calculated for the current frame.
Definition Bone.h:35
void initV3(GameFile &f, ModelBoneDef &b, const modelAnimData &data)
Initialise the bone from an M2 v3+ file.
Definition Bone.cpp:79
Abstract base class representing a file within the game data archive.
Definition GameFile.h:12
Core WoW .m2 model: geometry, animation, textures, and character data.
Definition WoWModel.h:50
Holds per-model animation metadata: index-to-id mapping, external anim files, and global sequences.
Definition animated.h:18
On-disk bone definition (block E) in an M2 file.
int16_t int16
Definition types.h:33