Unravel Engine C++ Reference
Loading...
Searching...
No Matches
script_interop.cpp
Go to the documentation of this file.
1#include "script_interop.h"
2
3namespace mono
4{
5namespace managed_interface
6{
7
8template<>
9auto converter::convert(const math::vec2& v) -> vector2
10{
11 return {v.x, v.y};
12}
13
14template<>
15auto converter::convert(const vector2& v) -> math::vec2
16{
17 return {v.x, v.y};
18}
19
20template<>
21auto converter::convert(const math::vec3& v) -> vector3
22{
23 return {v.x, v.y, v.z};
24}
25
26template<>
27auto converter::convert(const vector3& v) -> math::vec3
28{
29 return {v.x, v.y, v.z};
30}
31
32template<>
33auto converter::convert(const math::vec4& v) -> vector4
34{
35 return {v.x, v.y, v.z, v.w};
36}
37
38template<>
39auto converter::convert(const vector4& v) -> math::vec4
40{
41 return {v.x, v.y, v.z, v.w};
42}
43
44template<>
45auto converter::convert(const math::quat& q) -> quaternion
46{
47 return {q.x, q.y, q.z, q.w};
48}
49
50template<>
51auto converter::convert(const quaternion& q) -> math::quat
52{
53 return math::quat::wxyz(q.w, q.x, q.y, q.z);
54}
55
56template<>
57auto converter::convert(const math::color& v) -> color
58{
59 return {v.value.r, v.value.g, v.value.b, v.value.a};
60}
61
62template<>
63auto converter::convert(const color& v) -> math::color
64{
65 return {v.r, v.g, v.b, v.a};
66}
67
68template<>
69auto converter::convert(const math::bbox& v) -> bbox
70{
71 return {{v.min.x, v.min.y, v.min.z}, {v.max.x, v.max.y, v.max.z}};
72}
73
74template<>
75auto converter::convert(const bbox& v) -> math::bbox
76{
77 return {{v.min.x, v.min.y, v.min.z}, {v.max.x, v.max.y, v.max.z}};
78}
79}
80}
Storage for box vector values and wraps up common functionality.
Definition bbox.h:21