-
Notifications
You must be signed in to change notification settings - Fork 23
/
Jaylib.java
158 lines (146 loc) · 5.13 KB
/
Jaylib.java
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package com.raylib;
public class Jaylib extends Raylib{
public static Raylib.Color LIGHTGRAY = c(200, 200, 200, 255);
public static Raylib.Color GRAY = c(130, 130, 130, 255);
public static Raylib.Color DARKGRAY = c(80, 80, 80, 255);
public static Raylib.Color YELLOW = c(253, 249, 0, 255);
public static Raylib.Color GOLD = c(255, 203, 0, 255);
public static Raylib.Color ORANGE = c(255, 161, 0, 255);
public static Raylib.Color PINK = c(255, 109, 194, 255);
public static Raylib.Color RED = c(230, 41, 55, 255);
public static Raylib.Color MAROON = c(190, 33, 55, 255);
public static Raylib.Color GREEN = c(0, 228, 48, 255);
public static Raylib.Color LIME = c(0, 158, 47, 255);
public static Raylib.Color DARKGREEN = c(0, 117, 44, 255);
public static Raylib.Color SKYBLUE = c(102, 191, 255, 255);
public static Raylib.Color BLUE = c(0, 121, 241, 255);
public static Raylib.Color DARKBLUE = c(0, 82, 172, 255);
public static Raylib.Color PURPLE = c(200, 122, 255, 255);
public static Raylib.Color VIOLET = c(135, 60, 190, 255);
public static Raylib.Color DARKPURPLE = c(112, 31, 126, 255);
public static Raylib.Color BEIGE = c(211, 176, 131, 255);
public static Raylib.Color BROWN = c(127, 106, 79, 255);
public static Raylib.Color DARKBROWN = c(76, 63, 47, 255);
public static Raylib.Color WHITE = c(255, 255, 255, 255);
public static Raylib.Color BLACK = c(0, 0, 0, 255);
public static Raylib.Color BLANK = c(0, 0, 0, 0);
public static Raylib.Color MAGENTA = c(255, 0, 255, 255);
public static Raylib.Color RAYWHITE = c(245, 245, 245, 255);
private static Raylib.Color c(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 class Color extends Raylib.Color{
public Color(int r, int g, int b, int a){
super();
r((byte)r);
g((byte)g);
b((byte)b);
a((byte)a);
}
}
public static class Camera extends Raylib.Camera3D{
public Camera(Raylib.Vector3 position, Raylib.Vector3 target, Raylib.Vector3 up, float fovy, int projection){
super();
_position(position);
target(target);
up(up);
fovy(fovy);
projection(projection);
}
}
public static class Camera2D extends Raylib.Camera2D{
public Camera2D(Raylib.Vector2 offset, Raylib.Vector2 target, float rotation, float zoom) {
super();
offset(offset);
target(target);
rotation(rotation);
zoom(zoom);
}
}
public Raylib.Rectangle Rectangle(float x, float y, float width, float height) {
return new Raylib.Rectangle().x(x).y(y).width(width).height(height);
}
public static class Rectangle extends Raylib.Rectangle {
public Rectangle() {
super();
}
public Rectangle(float x, float y, float width, float height) {
super();
x(x);
y(y);
width(width);
height(height);
}
public Rectangle(Raylib.Rectangle r) {
this(r.x(), r.y(), r.width(), r.height());
}
}
public static class BoundingBox extends Raylib.BoundingBox {
public BoundingBox() {
super();
}
public BoundingBox(Raylib.Vector3 min, Raylib.Vector3 max) {
super();
min(min);
max(max);
}
public BoundingBox(Raylib.BoundingBox b) {
this(b.min(), b.max());
}
}
public static class Ray extends Raylib.Ray {
public Ray() {
super();
}
public Ray(Raylib.Vector3 position, Raylib.Vector3 direction) {
super();
_position(position);
direction(direction);
}
public Ray(Raylib.Ray r) {
this(r._position(), r.direction());
}
}
public static class RayCollision extends Raylib.RayCollision {
public RayCollision() {
super();
}
public RayCollision(boolean hit, float distance, Raylib.Vector3 point, Raylib.Vector3 normal) {
super();
hit(hit);
distance(distance);
point(point);
normal(normal);
}
public RayCollision(Raylib.RayCollision rhi) {
this(rhi.hit(), rhi.distance(), rhi.point(), rhi.normal());
}
}
public static class Vector3 extends Raylib.Vector3{
public Vector3(){
super();
}
public Vector3(float x, float y, float z){
super();
x(x);
y(y);
z(z);
}
public Vector3(Raylib.Vector3 v){
this(v.x(), v.y(), v.z());
}
}
public static class Vector2 extends Raylib.Vector2{
public Vector2(){
super();
}
public Vector2(float x, float y){
super();
x(x);
y(y);
}
public Vector2(Raylib.Vector3 v){
this(v.x(), v.y());
}
}
}