mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
update vcm bone 'move' semantics
This commit is contained in:
parent
a78a924093
commit
83f49f8cc4
1 changed files with 3 additions and 2 deletions
|
|
@ -344,9 +344,10 @@ static void perform_box(const xmlelement& root, ModelBuilder& builder) {
|
||||||
static void perform_bone(const xmlelement& root, ModelBuilder& builder, Context& ctx) {
|
static void perform_bone(const xmlelement& root, ModelBuilder& builder, Context& ctx) {
|
||||||
std::string name = root.attr("name", "").getText();
|
std::string name = root.attr("name", "").getText();
|
||||||
|
|
||||||
|
glm::vec3 movement {};
|
||||||
glm::mat4 tsf(1.0f);
|
glm::mat4 tsf(1.0f);
|
||||||
if (root.has("move")) {
|
if (root.has("move")) {
|
||||||
tsf = glm::translate(tsf, root.attr("move").asVec3());
|
movement = root.attr("move").asVec3();
|
||||||
}
|
}
|
||||||
if (root.has("rotate")) {
|
if (root.has("rotate")) {
|
||||||
auto text = root.attr("rotate").getText();
|
auto text = root.attr("rotate").getText();
|
||||||
|
|
@ -371,7 +372,7 @@ static void perform_bone(const xmlelement& root, ModelBuilder& builder, Context&
|
||||||
}
|
}
|
||||||
builder.pop();
|
builder.pop();
|
||||||
} else {
|
} else {
|
||||||
glm::vec3 origin = builder.getTransform() * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
|
glm::vec3 origin = builder.getTransform() * glm::vec4(movement, 1.0f);
|
||||||
size_t boneIndex = ctx.boneIndex++;
|
size_t boneIndex = ctx.boneIndex++;
|
||||||
|
|
||||||
std::vector<std::unique_ptr<Bone>> bones;
|
std::vector<std::unique_ptr<Bone>> bones;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue