Logo
Transform.h
1#pragma once
2
3namespace SharpKmyGfx
4{
5 public ref class Transform
6 {
7 public:
11
12 this->translate = translate;
13 this->rotate = rotate;
14 this->scale = scale;
15 }
16
17 Transform(const kmyMath::Transform &t)
18 {
19 translate.x = t.getTranslate().x;
20 translate.y = t.getTranslate().y;
21 translate.z = t.getTranslate().z;
22
23 rotate.x = t.getRotateEular().x;
24 rotate.y = t.getRotateEular().y;
25 rotate.z = t.getRotateEular().z;
26
27 scale.x = t.getScale().x;
28 scale.y = t.getScale().y;
29 scale.z = t.getScale().z;
30 }
31
32 kmyMath::Transform toNative()
33 {
34 kmyMath::Transform t;
35 t.setTranslate(kmyMath::Vector3(translate.x, translate.y, translate.z));
36 t.setRotate(kmyMath::Vector3(rotate.x, rotate.y, rotate.z));
37 t.setScale(kmyMath::Vector3(scale.x, scale.y, scale.z));
38 return t;
39 }
40
41 void fromNative(const kmyMath::Transform &t)
42 {
43 translate.x = t.getTranslate().x;
44 translate.y = t.getTranslate().y;
45 translate.z = t.getTranslate().z;
46
47 rotate.x = t.getRotateEular().x;
48 rotate.y = t.getRotateEular().y;
49 rotate.z = t.getRotateEular().z;
50
51 scale.x = t.getScale().x;
52 scale.y = t.getScale().y;
53 scale.z = t.getScale().z;
54 }
55
57 {
59 rotate = t->rotate;
60 scale = t->scale;
61 }
62
64 };
65
66}
Definition: Transform.h:6
void copyFrom(Transform ^t)
Definition: Transform.h:56
SharpKmyMath::Vector3 rotate
Definition: Transform.h:63
Transform(const kmyMath::Transform &t)
Definition: Transform.h:17
Transform(SharpKmyMath::Vector3 translate, SharpKmyMath::Vector3 rotate, SharpKmyMath::Vector3 scale)
Definition: Transform.h:8
SharpKmyMath::Vector3 scale
Definition: Transform.h:63
SharpKmyMath::Vector3 translate
Definition: Transform.h:63
kmyMath::Transform toNative()
Definition: Transform.h:32
void fromNative(const kmyMath::Transform &t)
Definition: Transform.h:41
Definition: Billboard.cpp:4
Definition: Vector3.h:8
float y
Definition: Vector3.h:11
float z
Definition: Vector3.h:11
float x
Definition: Vector3.h:11