-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathHelpers.java
More file actions
131 lines (105 loc) · 3.9 KB
/
Helpers.java
File metadata and controls
131 lines (105 loc) · 3.9 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package com.raylib;
public final class Helpers {
public static Raylib.Color newColor(int r, int g, int b, int a) {
return new Raylib.Color()
.r((byte) r)
.g((byte) g)
.b((byte) b)
.a((byte) a);
}
public static Raylib.Camera3D newCamera(Raylib.Vector3 position,
Raylib.Vector3 target,
Raylib.Vector3 up,
float fovy,
int projection) {
return new Raylib.Camera3D()
._position(position)
.target(target)
.up(up)
.fovy(fovy)
.projection(projection);
}
public static Raylib.Camera2D newCamera2D(Raylib.Vector2 offset,
Raylib.Vector2 target,
float rotation,
float zoom) {
return new Raylib.Camera2D()
.offset(offset)
.target(target)
.rotation(rotation)
.zoom(zoom);
}
public Raylib.Rectangle newRectangle(float x, float y, float width, float height) {
return new Raylib.Rectangle()
.x(x)
.y(y)
.width(width)
.height(height);
}
public static Raylib.Rectangle newRectangle(Raylib.Rectangle rect) {
return new Raylib.Rectangle()
.x(rect.x())
.y(rect.y())
.width(rect.width())
.height(rect.height());
}
public static Raylib.BoundingBox newBoundingBox(Raylib.Vector3 min, Raylib.Vector3 max) {
return new Raylib.BoundingBox()
.min(min)
.max(max);
}
public static Raylib.BoundingBox newBoundingBox(Raylib.BoundingBox bb) {
return new Raylib.BoundingBox()
.min(bb.min())
.max(bb.max());
}
public static Raylib.Ray newRay(Raylib.Vector3 position, Raylib.Vector3 direction) {
return new Raylib.Ray()
._position(position)
.direction(direction);
}
public static Raylib.Ray newRay(Raylib.Ray ray) {
return new Raylib.Ray()
._position(ray._position())
.direction(ray.direction());
}
public static Raylib.RayCollision newRayCollision(boolean hit,
float distance,
Raylib.Vector3 point,
Raylib.Vector3 normal) {
return new Raylib.RayCollision()
.hit(hit)
.distance(distance)
.point(point)
.normal(normal);
}
public static Raylib.RayCollision newRayCollision(Raylib.RayCollision rc) {
return new Raylib.RayCollision()
.hit(rc.hit())
.distance(rc.distance())
.point(rc.point())
.normal(rc.normal());
}
public static Raylib.Vector3 newVector3(float x, float y, float z) {
return new Raylib.Vector3()
.x(x)
.y(y)
.z(z);
}
public static Raylib.Vector3 newVector3(Raylib.Vector3 vector3) {
return new Raylib.Vector3()
.x(vector3.x())
.y(vector3.y())
.z(vector3.z());
}
public static Raylib.Vector2 newVector2(float x, float y) {
return new Raylib.Vector2()
.x(x)
.y(y);
}
public static Raylib.Vector2 newVector2(Raylib.Vector2 vector2) {
return new Raylib.Vector2()
.x(vector2.x())
.y(vector2.y());
}
}