forked from AtomicGameEngine/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.cs
More file actions
86 lines (67 loc) · 2.68 KB
/
Camera.cs
File metadata and controls
86 lines (67 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Runtime.InteropServices;
namespace AtomicEngine
{
public partial class Camera : Component
{
/// Return ray corresponding to normalized screen coordinates (0 - 1), with origin on the near clip plane.
public Ray GetScreenRay(float x, float y)
{
csi_Atomic_Camera_GetScreenRay(nativeInstance, x, y, ref GetScreenRayReturnValue);
return GetScreenRayReturnValue;
}
public Plane ClipPlane
{
get
{
return GetClipPlane();
}
set
{
SetClipPlane(value);
}
}
public Plane ReflectionPlane
{
get
{
return GetReflectionPlane();
}
set
{
SetReflectionPlane(value);
}
}
public Plane GetClipPlane()
{
Plane plane = new Plane();
csi_Atomic_Camera_GetClipPlane(nativeInstance, ref plane);
return plane;
}
public Plane GetReflectionPlane()
{
Plane plane = new Plane();
csi_Atomic_Camera_GetReflectionPlane(nativeInstance, ref plane);
return plane;
}
public void SetClipPlane(Plane plane)
{
csi_Atomic_Camera_SetClipPlane(nativeInstance, ref plane);
}
public void SetReflectionPlane(Plane plane)
{
csi_Atomic_Camera_SetReflectionPlane(nativeInstance, ref plane);
}
private Ray GetScreenRayReturnValue = new Ray();
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void csi_Atomic_Camera_GetScreenRay(IntPtr self, float x, float y, ref Ray retValue);
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void csi_Atomic_Camera_GetClipPlane(IntPtr self, ref Plane retValue);
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void csi_Atomic_Camera_GetReflectionPlane(IntPtr self, ref Plane retValue);
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void csi_Atomic_Camera_SetClipPlane(IntPtr self, ref Plane retValue);
[DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void csi_Atomic_Camera_SetReflectionPlane(IntPtr self, ref Plane retValue);
};
}