Unravel Engine C++ Reference
Loading...
Searching...
No Matches
script_interop.cpp
Go to the documentation of this file.
1
#include "
script_interop.h
"
2
#include <
engine/scripting/ecs/systems/script_system.h
>
3
4
namespace
dotnetpp_backend::managed_interface
5
{
6
7
template
<>
8
auto
converter::convert(
const
math::vec2&
v
) ->
dotnetpp_backend::managed_interface::vector2
9
{
10
return
{
v
.x,
v
.y};
11
}
12
13
template
<>
14
auto
converter::convert(
const
dotnetpp_backend::managed_interface::vector2
&
v
) -> math::vec2
15
{
16
return
{
v
.x,
v
.y};
17
}
18
19
template
<>
20
auto
converter::convert(
const
math::vec3&
v
) ->
dotnetpp_backend::managed_interface::vector3
21
{
22
return
{
v
.x,
v
.y,
v
.z};
23
}
24
25
template
<>
26
auto
converter::convert(
const
dotnetpp_backend::managed_interface::vector3
&
v
) -> math::vec3
27
{
28
return
{
v
.x,
v
.y,
v
.z};
29
}
30
31
template
<>
32
auto
converter::convert(
const
math::vec4&
v
) ->
dotnetpp_backend::managed_interface::vector4
33
{
34
return
{
v
.x,
v
.y,
v
.z,
v
.w};
35
}
36
37
template
<>
38
auto
converter::convert(
const
dotnetpp_backend::managed_interface::vector4
&
v
) -> math::vec4
39
{
40
return
{
v
.x,
v
.y,
v
.z,
v
.w};
41
}
42
43
template
<>
44
auto
converter::convert(
const
math::quat& q) ->
dotnetpp_backend::managed_interface::quaternion
45
{
46
return
{q.x, q.y, q.z, q.w};
47
}
48
49
template
<>
50
auto
converter::convert(
const
dotnetpp_backend::managed_interface::quaternion
& q) -> math::quat
51
{
52
return
math::quat::wxyz(q.w, q.x, q.y, q.z);
53
}
54
55
template
<>
56
auto
converter::convert(
const
math::color
&
v
) ->
dotnetpp_backend::managed_interface::color
57
{
58
return
{
v
.value.r,
v
.value.g,
v
.value.b,
v
.value.a};
59
}
60
61
template
<>
62
auto
converter::convert(
const
dotnetpp_backend::managed_interface::color
&
v
) ->
math::color
63
{
64
return
{
v
.r,
v
.g,
v
.b,
v
.a};
65
}
66
67
template
<>
68
auto
converter::convert(
const
math::bbox
&
v
) ->
dotnetpp_backend::managed_interface::bbox
69
{
70
return
{{
v
.min.x,
v
.min.y,
v
.min.z}, {
v
.max.x,
v
.max.y,
v
.max.z}};
71
}
72
73
template
<>
74
auto
converter::convert(
const
dotnetpp_backend::managed_interface::bbox
&
v
) ->
math::bbox
75
{
76
return
{{
v
.min.x,
v
.min.y,
v
.min.z}, {
v
.max.x,
v
.max.y,
v
.max.z}};
77
}
78
79
}
// namespace managed_interface
80
81
auto
dotnet_converter<dotnetpp_backend::managed_interface::ui_event_base>::create_instance(
const
std::string& namespace_name,
82
const
std::string& type_name)
83
-> dotnet::object
84
{
85
auto
& ctx =
unravel::engine::context
();
86
auto
app_assembly = ctx.get_cached<
unravel::script_system
>().get_engine_assembly();
87
auto
type
= app_assembly.get_type(namespace_name, type_name);
88
return
type
.new_instance();
89
}
type
texture_job_type type
Definition
mesh_importer.cpp:2611
dotnetpp_backend::managed_interface
Definition
script_interop.cpp:5
v
float v
Definition
particle_system_soa.cpp:340
script_interop.h
script_system.h
dotnetpp_backend::managed_interface::bbox
Definition
script_interop.h:53
dotnetpp_backend::managed_interface::color
Definition
script_interop.h:45
dotnetpp_backend::managed_interface::quaternion
Definition
script_interop.h:37
dotnetpp_backend::managed_interface::vector2
Definition
script_interop.h:16
dotnetpp_backend::managed_interface::vector3
Definition
script_interop.h:22
dotnetpp_backend::managed_interface::vector4
Definition
script_interop.h:29
math::bbox
Storage for box vector values and wraps up common functionality.
Definition
bbox.h:21
math::color
Definition
color.h:12
unravel::engine::context
static auto context() -> rtti::context &
Definition
engine.cpp:111
unravel::script_system
Definition
script_system.h:20
engine
engine
scripting
ecs
systems
script_interop.cpp
Generated by
1.12.0