WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
ModelAttachment.cpp
Go to the documentation of this file.
1#include "ModelAttachment.h"
2
3#include "Bone.h"
4#include "WoWModel.h"
5#include <glad/gl.h>
6#include "glm/gtc/type_ptr.hpp"
7
9{
10 pos = mad.pos;
11 bone = mad.bone;
12 id = mad.id;
13}
14
16{
17 glMultMatrixf(glm::value_ptr(model->bones[bone].mat));
18 glTranslatef(pos.x, pos.y, pos.z);
19}
std::vector< Bone > bones
Definition WoWModel.h:181
On-disk attachment point definition in an M2 file.
int bone
Index of the bone this attachment is parented to.
void init(ModelAttachmentDef &mad)
Initialise from an on-disk attachment definition.
void setup() const
Set up the attachment transform for rendering.
glm::vec3 pos
Position relative to the parent bone.
WoWModel * model
The model this attachment belongs to.