@dayme/bunraylib 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -11
- package/package.json +11 -3
- package/src/Raylib.ts +58 -3678
- package/src/c/common.h +0 -2
- package/src/constants.ts +2 -2
- package/src/index.ts +6 -6
- package/src/main.c +0 -1
- package/src/main.d.ts +1 -1
- package/src/modules/audio/AudioModule.ts +197 -0
- package/src/modules/audio/symbols.ts +70 -0
- package/src/{c/audio.c → modules/audio/wrapper.c} +40 -80
- package/src/modules/camera/CameraModule.ts +239 -0
- package/src/modules/camera/symbols.ts +49 -0
- package/src/modules/camera/wrapper.c +141 -0
- package/src/modules/collision/CollisionModule.ts +363 -0
- package/src/modules/collision/symbols.ts +149 -0
- package/src/modules/collision/wrapper.c +176 -0
- package/src/modules/color/ColorModule.ts +65 -0
- package/src/modules/color/symbols.ts +26 -0
- package/src/modules/color/wrapper.c +16 -0
- package/src/modules/draw3d/Draw3DModule.ts +441 -0
- package/src/modules/draw3d/symbols.ts +199 -0
- package/src/modules/draw3d/wrapper.c +202 -0
- package/src/modules/font/FontModule.ts +250 -0
- package/src/modules/font/symbols.ts +46 -0
- package/src/{c/font.c → modules/font/wrapper.c} +50 -70
- package/src/modules/image/ImageModule.ts +451 -0
- package/src/{symbols/image.ts → modules/image/symbols.ts} +15 -12
- package/src/{c/image.c → modules/image/wrapper.c} +23 -45
- package/src/modules/input/InputModule.ts +160 -0
- package/src/modules/input/symbols.ts +54 -0
- package/src/modules/input/wrapper.c +31 -0
- package/src/modules/model/ModelModule.ts +228 -0
- package/src/{symbols/model.ts → modules/model/symbols.ts} +17 -14
- package/src/{c/model.c → modules/model/wrapper.c} +30 -30
- package/src/modules/shader/ShaderModule.ts +78 -0
- package/src/{symbols/shader.ts → modules/shader/symbols.ts} +3 -1
- package/src/{c/shader.c → modules/shader/wrapper.c} +11 -1
- package/src/modules/shapes/ShapesModule.ts +687 -0
- package/src/modules/shapes/symbols.ts +161 -0
- package/src/modules/shapes/wrapper.c +183 -0
- package/src/modules/texture/TextureModule.ts +190 -0
- package/src/{symbols/texture.ts → modules/texture/symbols.ts} +15 -9
- package/src/{c/texture.c → modules/texture/wrapper.c} +7 -22
- package/src/modules/window/WindowModule.ts +248 -0
- package/src/modules/window/symbols.ts +85 -0
- package/src/modules/window/wrapper.c +39 -0
- package/src/symbols.ts +87 -47
- package/src/utils.ts +63 -15
- package/src/c/camera.c +0 -161
- package/src/c/collision.c +0 -176
- package/src/c/color.c +0 -100
- package/src/c/draw3d.c +0 -222
- package/src/c/filesystem.c +0 -36
- package/src/c/input.c +0 -85
- package/src/c/shapes.c +0 -283
- package/src/c/window.c +0 -150
- package/src/symbols/audio.ts +0 -64
- package/src/symbols/camera.ts +0 -46
- package/src/symbols/collision.ts +0 -116
- package/src/symbols/color.ts +0 -22
- package/src/symbols/draw3d.ts +0 -137
- package/src/symbols/filesystem.ts +0 -30
- package/src/symbols/font.ts +0 -40
- package/src/symbols/input.ts +0 -51
- package/src/symbols/shapes.ts +0 -92
- package/src/symbols/window.ts +0 -83
package/src/c/camera.c
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
#include "common.h"
|
|
2
|
-
|
|
3
|
-
void BeginMode2DW(int offX, int offY, int tarX, int tarY, int rotation, int zoom) {
|
|
4
|
-
float r, z;
|
|
5
|
-
memcpy(&r, &rotation, sizeof(float));
|
|
6
|
-
memcpy(&z, &zoom, sizeof(float));
|
|
7
|
-
Camera2D cam = { {offX, offY}, {tarX, tarY}, r, z };
|
|
8
|
-
BeginMode2D(cam);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
void EndMode2DW() {
|
|
12
|
-
EndMode2D();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
void BeginMode3DW(int posX, int posY, int posZ, int tarX, int tarY, int tarZ, int upX, int upY, int upZ, int fovy, int projection) {
|
|
16
|
-
Camera3D cam = { {i2f(posX), i2f(posY), i2f(posZ)}, {i2f(tarX), i2f(tarY), i2f(tarZ)}, {i2f(upX), i2f(upY), i2f(upZ)}, i2f(fovy), projection };
|
|
17
|
-
BeginMode3D(cam);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
void EndMode3DW() {
|
|
21
|
-
EndMode3D();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
void UpdateCameraW(float* pos, float* tar, float* up, float* fovy, int* projection, int mode) {
|
|
25
|
-
Camera3D cam = {
|
|
26
|
-
{pos[0], pos[1], pos[2]},
|
|
27
|
-
{tar[0], tar[1], tar[2]},
|
|
28
|
-
{up[0], up[1], up[2]},
|
|
29
|
-
fovy[0],
|
|
30
|
-
projection[0]
|
|
31
|
-
};
|
|
32
|
-
UpdateCamera(&cam, mode);
|
|
33
|
-
pos[0] = cam.position.x; pos[1] = cam.position.y; pos[2] = cam.position.z;
|
|
34
|
-
tar[0] = cam.target.x; tar[1] = cam.target.y; tar[2] = cam.target.z;
|
|
35
|
-
up[0] = cam.up.x; up[1] = cam.up.y; up[2] = cam.up.z;
|
|
36
|
-
fovy[0] = cam.fovy;
|
|
37
|
-
projection[0] = cam.projection;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
void UpdateCameraProW(float* pos, float* tar, float* up, float* fovy, int* projection,
|
|
41
|
-
float mx, float my, float mz, float rx, float ry, float rz, float zoom) {
|
|
42
|
-
Camera3D cam = {
|
|
43
|
-
{pos[0], pos[1], pos[2]},
|
|
44
|
-
{tar[0], tar[1], tar[2]},
|
|
45
|
-
{up[0], up[1], up[2]},
|
|
46
|
-
fovy[0],
|
|
47
|
-
projection[0]
|
|
48
|
-
};
|
|
49
|
-
UpdateCameraPro(&cam, (Vector3){mx, my, mz}, (Vector3){rx, ry, rz}, zoom);
|
|
50
|
-
pos[0] = cam.position.x; pos[1] = cam.position.y; pos[2] = cam.position.z;
|
|
51
|
-
tar[0] = cam.target.x; tar[1] = cam.target.y; tar[2] = cam.target.z;
|
|
52
|
-
up[0] = cam.up.x; up[1] = cam.up.y; up[2] = cam.up.z;
|
|
53
|
-
fovy[0] = cam.fovy;
|
|
54
|
-
projection[0] = cam.projection;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
void GetScreenToWorldRayW(float* outPos, float* outDir, int screenX, int screenY,
|
|
58
|
-
int camPosX, int camPosY, int camPosZ, int camTarX, int camTarY, int camTarZ,
|
|
59
|
-
int camUpX, int camUpY, int camUpZ, int camFovy, int camProj) {
|
|
60
|
-
Camera3D cam = {
|
|
61
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
62
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
63
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
64
|
-
i2f(camFovy), camProj
|
|
65
|
-
};
|
|
66
|
-
Ray r = GetScreenToWorldRay((Vector2){screenX, screenY}, cam);
|
|
67
|
-
outPos[0] = r.position.x; outPos[1] = r.position.y; outPos[2] = r.position.z;
|
|
68
|
-
outDir[0] = r.direction.x; outDir[1] = r.direction.y; outDir[2] = r.direction.z;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
void GetWorldToScreenW(float* out, int posX, int posY, int posZ,
|
|
72
|
-
int camPosX, int camPosY, int camPosZ, int camTarX, int camTarY, int camTarZ,
|
|
73
|
-
int camUpX, int camUpY, int camUpZ, int camFovy, int camProj) {
|
|
74
|
-
Camera3D cam = {
|
|
75
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
76
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
77
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
78
|
-
i2f(camFovy), camProj
|
|
79
|
-
};
|
|
80
|
-
Vector2 v = GetWorldToScreen((Vector3){i2f(posX), i2f(posY), i2f(posZ)}, cam);
|
|
81
|
-
out[0] = v.x; out[1] = v.y;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
void GetWorldToScreen2DW(float* out, int posX, int posY,
|
|
85
|
-
int offX, int offY, int tarX, int tarY, int rotation, int zoom) {
|
|
86
|
-
float r, z;
|
|
87
|
-
memcpy(&r, &rotation, sizeof(float));
|
|
88
|
-
memcpy(&z, &zoom, sizeof(float));
|
|
89
|
-
Camera2D cam = { {offX, offY}, {tarX, tarY}, r, z };
|
|
90
|
-
Vector2 v = GetWorldToScreen2D((Vector2){posX, posY}, cam);
|
|
91
|
-
out[0] = v.x; out[1] = v.y;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
void GetScreenToWorld2DW(float* out, int posX, int posY,
|
|
95
|
-
int offX, int offY, int tarX, int tarY, int rotation, int zoom) {
|
|
96
|
-
float r, z;
|
|
97
|
-
memcpy(&r, &rotation, sizeof(float));
|
|
98
|
-
memcpy(&z, &zoom, sizeof(float));
|
|
99
|
-
Camera2D cam = { {offX, offY}, {tarX, tarY}, r, z };
|
|
100
|
-
Vector2 v = GetScreenToWorld2D((Vector2){posX, posY}, cam);
|
|
101
|
-
out[0] = v.x; out[1] = v.y;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
void GetScreenToWorldRayExW(float* outPos, float* outDir,
|
|
105
|
-
int screenX, int screenY, int screenW, int screenH,
|
|
106
|
-
int camPosX, int camPosY, int camPosZ,
|
|
107
|
-
int camTarX, int camTarY, int camTarZ,
|
|
108
|
-
int camUpX, int camUpY, int camUpZ,
|
|
109
|
-
int camFovy, int camProj) {
|
|
110
|
-
Camera3D cam = {
|
|
111
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
112
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
113
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
114
|
-
i2f(camFovy), camProj
|
|
115
|
-
};
|
|
116
|
-
Ray r = GetScreenToWorldRayEx((Vector2){screenX, screenY}, cam, screenW, screenH);
|
|
117
|
-
outPos[0] = r.position.x; outPos[1] = r.position.y; outPos[2] = r.position.z;
|
|
118
|
-
outDir[0] = r.direction.x; outDir[1] = r.direction.y; outDir[2] = r.direction.z;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
void GetWorldToScreenExW(float* out,
|
|
122
|
-
int posX, int posY, int posZ,
|
|
123
|
-
int camPosX, int camPosY, int camPosZ,
|
|
124
|
-
int camTarX, int camTarY, int camTarZ,
|
|
125
|
-
int camUpX, int camUpY, int camUpZ,
|
|
126
|
-
int camFovy, int camProj,
|
|
127
|
-
int screenW, int screenH) {
|
|
128
|
-
Camera3D cam = {
|
|
129
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
130
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
131
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
132
|
-
i2f(camFovy), camProj
|
|
133
|
-
};
|
|
134
|
-
Vector2 v = GetWorldToScreenEx((Vector3){i2f(posX), i2f(posY), i2f(posZ)}, cam, screenW, screenH);
|
|
135
|
-
out[0] = v.x; out[1] = v.y;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
void GetCameraMatrixW(float* out,
|
|
139
|
-
int camPosX, int camPosY, int camPosZ,
|
|
140
|
-
int camTarX, int camTarY, int camTarZ,
|
|
141
|
-
int camUpX, int camUpY, int camUpZ,
|
|
142
|
-
int camFovy, int camProj) {
|
|
143
|
-
Camera3D cam = {
|
|
144
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
145
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
146
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
147
|
-
i2f(camFovy), camProj
|
|
148
|
-
};
|
|
149
|
-
Matrix m = GetCameraMatrix(cam);
|
|
150
|
-
memcpy(out, &m, sizeof(Matrix));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
void GetCameraMatrix2DW(float* out,
|
|
154
|
-
int offX, int offY, int tarX, int tarY, int rotation, int zoom) {
|
|
155
|
-
float r, z;
|
|
156
|
-
memcpy(&r, &rotation, sizeof(float));
|
|
157
|
-
memcpy(&z, &zoom, sizeof(float));
|
|
158
|
-
Camera2D cam = { {offX, offY}, {tarX, tarY}, r, z };
|
|
159
|
-
Matrix m = GetCameraMatrix2D(cam);
|
|
160
|
-
memcpy(out, &m, sizeof(Matrix));
|
|
161
|
-
}
|
package/src/c/collision.c
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
#include "common.h"
|
|
2
|
-
|
|
3
|
-
bool CheckCollisionRecsW(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) {
|
|
4
|
-
Rectangle r1 = { x1, y1, w1, h1 };
|
|
5
|
-
Rectangle r2 = { x2, y2, w2, h2 };
|
|
6
|
-
return CheckCollisionRecs(r1, r2);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
bool CheckCollisionCirclesW(int cx1, int cy1, int r1, int cx2, int cy2, int r2) {
|
|
10
|
-
return CheckCollisionCircles((Vector2){cx1, cy1}, r1, (Vector2){cx2, cy2}, r2);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
bool CheckCollisionCircleRecW(int cx, int cy, int radius, int rx, int ry, int rw, int rh) {
|
|
14
|
-
return CheckCollisionCircleRec((Vector2){cx, cy}, radius, (Rectangle){rx, ry, rw, rh});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
bool CheckCollisionCircleLineW(int cx, int cy, int radius, int p1x, int p1y, int p2x, int p2y) {
|
|
18
|
-
return CheckCollisionCircleLine((Vector2){cx, cy}, radius, (Vector2){p1x, p1y}, (Vector2){p2x, p2y});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
bool CheckCollisionPointRecW(int px, int py, int rx, int ry, int rw, int rh) {
|
|
22
|
-
return CheckCollisionPointRec((Vector2){px, py}, (Rectangle){rx, ry, rw, rh});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
bool CheckCollisionPointCircleW(int px, int py, int cx, int cy, int radius) {
|
|
26
|
-
return CheckCollisionPointCircle((Vector2){px, py}, (Vector2){cx, cy}, radius);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
bool CheckCollisionPointTriangleW(int px, int py, int p1x, int p1y, int p2x, int p2y, int p3x, int p3y) {
|
|
30
|
-
return CheckCollisionPointTriangle((Vector2){px, py}, (Vector2){p1x, p1y}, (Vector2){p2x, p2y}, (Vector2){p3x, p3y});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
bool CheckCollisionPointLineW(int px, int py, int p1x, int p1y, int p2x, int p2y, int threshold) {
|
|
34
|
-
return CheckCollisionPointLine((Vector2){px, py}, (Vector2){p1x, p1y}, (Vector2){p2x, p2y}, threshold);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
bool CheckCollisionPointPolyW(int px, int py, const float* points, int pointCount) {
|
|
38
|
-
return CheckCollisionPointPoly((Vector2){px, py}, (const Vector2*)points, pointCount);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
bool CheckCollisionLinesW(float* out, int s1x, int s1y, int e1x, int e1y, int s2x, int s2y, int e2x, int e2y) {
|
|
42
|
-
Vector2 cp;
|
|
43
|
-
bool result = CheckCollisionLines((Vector2){s1x, s1y}, (Vector2){e1x, e1y}, (Vector2){s2x, s2y}, (Vector2){e2x, e2y}, &cp);
|
|
44
|
-
out[0] = cp.x;
|
|
45
|
-
out[1] = cp.y;
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
void GetCollisionRecW(float* out, int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) {
|
|
50
|
-
Rectangle r1 = { x1, y1, w1, h1 };
|
|
51
|
-
Rectangle r2 = { x2, y2, w2, h2 };
|
|
52
|
-
Rectangle result = GetCollisionRec(r1, r2);
|
|
53
|
-
out[0] = result.x;
|
|
54
|
-
out[1] = result.y;
|
|
55
|
-
out[2] = result.width;
|
|
56
|
-
out[3] = result.height;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
bool CheckCollisionSpheresW(int cx1, int cy1, int cz1, int r1, int cx2, int cy2, int cz2, int r2) {
|
|
60
|
-
return CheckCollisionSpheres(
|
|
61
|
-
(Vector3){i2f(cx1), i2f(cy1), i2f(cz1)}, i2f(r1),
|
|
62
|
-
(Vector3){i2f(cx2), i2f(cy2), i2f(cz2)}, i2f(r2));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
bool CheckCollisionBoxesW(
|
|
66
|
-
int minX1, int minY1, int minZ1, int maxX1, int maxY1, int maxZ1,
|
|
67
|
-
int minX2, int minY2, int minZ2, int maxX2, int maxY2, int maxZ2) {
|
|
68
|
-
BoundingBox bb1 = {
|
|
69
|
-
{i2f(minX1), i2f(minY1), i2f(minZ1)},
|
|
70
|
-
{i2f(maxX1), i2f(maxY1), i2f(maxZ1)}
|
|
71
|
-
};
|
|
72
|
-
BoundingBox bb2 = {
|
|
73
|
-
{i2f(minX2), i2f(minY2), i2f(minZ2)},
|
|
74
|
-
{i2f(maxX2), i2f(maxY2), i2f(maxZ2)}
|
|
75
|
-
};
|
|
76
|
-
return CheckCollisionBoxes(bb1, bb2);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
bool CheckCollisionBoxSphereW(
|
|
80
|
-
int minX, int minY, int minZ, int maxX, int maxY, int maxZ,
|
|
81
|
-
int cx, int cy, int cz, int radius) {
|
|
82
|
-
BoundingBox bb = {
|
|
83
|
-
{i2f(minX), i2f(minY), i2f(minZ)},
|
|
84
|
-
{i2f(maxX), i2f(maxY), i2f(maxZ)}
|
|
85
|
-
};
|
|
86
|
-
return CheckCollisionBoxSphere(bb,
|
|
87
|
-
(Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
void GetRayCollisionSphereW(bool* outHit, float* outDist, float* outPt, float* outNorm,
|
|
91
|
-
int rPx, int rPy, int rPz, int rDx, int rDy, int rDz,
|
|
92
|
-
int cx, int cy, int cz, int radius) {
|
|
93
|
-
Ray ray = {
|
|
94
|
-
{i2f(rPx), i2f(rPy), i2f(rPz)},
|
|
95
|
-
{i2f(rDx), i2f(rDy), i2f(rDz)}
|
|
96
|
-
};
|
|
97
|
-
RayCollision rc = GetRayCollisionSphere(ray,
|
|
98
|
-
(Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius));
|
|
99
|
-
*outHit = rc.hit;
|
|
100
|
-
outDist[0] = rc.distance;
|
|
101
|
-
outPt[0] = rc.point.x; outPt[1] = rc.point.y; outPt[2] = rc.point.z;
|
|
102
|
-
outNorm[0] = rc.normal.x; outNorm[1] = rc.normal.y; outNorm[2] = rc.normal.z;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
void GetRayCollisionBoxW(bool* outHit, float* outDist, float* outPt, float* outNorm,
|
|
106
|
-
int rPx, int rPy, int rPz, int rDx, int rDy, int rDz,
|
|
107
|
-
int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
|
|
108
|
-
Ray ray = {
|
|
109
|
-
{i2f(rPx), i2f(rPy), i2f(rPz)},
|
|
110
|
-
{i2f(rDx), i2f(rDy), i2f(rDz)}
|
|
111
|
-
};
|
|
112
|
-
BoundingBox bb = {
|
|
113
|
-
{i2f(minX), i2f(minY), i2f(minZ)},
|
|
114
|
-
{i2f(maxX), i2f(maxY), i2f(maxZ)}
|
|
115
|
-
};
|
|
116
|
-
RayCollision rc = GetRayCollisionBox(ray, bb);
|
|
117
|
-
*outHit = rc.hit;
|
|
118
|
-
outDist[0] = rc.distance;
|
|
119
|
-
outPt[0] = rc.point.x; outPt[1] = rc.point.y; outPt[2] = rc.point.z;
|
|
120
|
-
outNorm[0] = rc.normal.x; outNorm[1] = rc.normal.y; outNorm[2] = rc.normal.z;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
void GetRayCollisionTriangleW(bool* outHit, float* outDist, float* outPt, float* outNorm,
|
|
124
|
-
int rPx, int rPy, int rPz, int rDx, int rDy, int rDz,
|
|
125
|
-
int p1x, int p1y, int p1z, int p2x, int p2y, int p2z, int p3x, int p3y, int p3z) {
|
|
126
|
-
Ray ray = {
|
|
127
|
-
{i2f(rPx), i2f(rPy), i2f(rPz)},
|
|
128
|
-
{i2f(rDx), i2f(rDy), i2f(rDz)}
|
|
129
|
-
};
|
|
130
|
-
RayCollision rc = GetRayCollisionTriangle(ray,
|
|
131
|
-
(Vector3){i2f(p1x), i2f(p1y), i2f(p1z)},
|
|
132
|
-
(Vector3){i2f(p2x), i2f(p2y), i2f(p2z)},
|
|
133
|
-
(Vector3){i2f(p3x), i2f(p3y), i2f(p3z)});
|
|
134
|
-
*outHit = rc.hit;
|
|
135
|
-
outDist[0] = rc.distance;
|
|
136
|
-
outPt[0] = rc.point.x; outPt[1] = rc.point.y; outPt[2] = rc.point.z;
|
|
137
|
-
outNorm[0] = rc.normal.x; outNorm[1] = rc.normal.y; outNorm[2] = rc.normal.z;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
void GetRayCollisionQuadW(bool* outHit, float* outDist, float* outPt, float* outNorm,
|
|
141
|
-
int rPx, int rPy, int rPz, int rDx, int rDy, int rDz,
|
|
142
|
-
int p1x, int p1y, int p1z, int p2x, int p2y, int p2z,
|
|
143
|
-
int p3x, int p3y, int p3z, int p4x, int p4y, int p4z) {
|
|
144
|
-
Ray ray = {
|
|
145
|
-
{i2f(rPx), i2f(rPy), i2f(rPz)},
|
|
146
|
-
{i2f(rDx), i2f(rDy), i2f(rDz)}
|
|
147
|
-
};
|
|
148
|
-
RayCollision rc = GetRayCollisionQuad(ray,
|
|
149
|
-
(Vector3){i2f(p1x), i2f(p1y), i2f(p1z)},
|
|
150
|
-
(Vector3){i2f(p2x), i2f(p2y), i2f(p2z)},
|
|
151
|
-
(Vector3){i2f(p3x), i2f(p3y), i2f(p3z)},
|
|
152
|
-
(Vector3){i2f(p4x), i2f(p4y), i2f(p4z)});
|
|
153
|
-
*outHit = rc.hit;
|
|
154
|
-
outDist[0] = rc.distance;
|
|
155
|
-
outPt[0] = rc.point.x; outPt[1] = rc.point.y; outPt[2] = rc.point.z;
|
|
156
|
-
outNorm[0] = rc.normal.x; outNorm[1] = rc.normal.y; outNorm[2] = rc.normal.z;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
void GetRayCollisionMeshW(bool* outHit, float* outDist, float* outPt, float* outNorm,
|
|
160
|
-
int rPx, int rPy, int rPz, int rDx, int rDy, int rDz,
|
|
161
|
-
int meshId,
|
|
162
|
-
int im0, int im4, int im8, int im12,
|
|
163
|
-
int im1, int im5, int im9, int im13,
|
|
164
|
-
int im2, int im6, int im10, int im14,
|
|
165
|
-
int im3, int im7, int im11, int im15) {
|
|
166
|
-
Ray ray = { { i2f(rPx), i2f(rPy), i2f(rPz) }, { i2f(rDx), i2f(rDy), i2f(rDz) } };
|
|
167
|
-
Matrix transform = { i2f(im0), i2f(im1), i2f(im2), i2f(im3), i2f(im4), i2f(im5), i2f(im6), i2f(im7), i2f(im8), i2f(im9), i2f(im10), i2f(im11), i2f(im12), i2f(im13), i2f(im14), i2f(im15) };
|
|
168
|
-
if (meshId < 0 || meshId >= MAX_MESHES || !meshUsed[meshId]) {
|
|
169
|
-
*outHit = false; *outDist = 0; return;
|
|
170
|
-
}
|
|
171
|
-
RayCollision rc = GetRayCollisionMesh(ray, meshRegistry[meshId], transform);
|
|
172
|
-
*outHit = rc.hit;
|
|
173
|
-
*outDist = rc.distance;
|
|
174
|
-
outPt[0] = rc.point.x; outPt[1] = rc.point.y; outPt[2] = rc.point.z;
|
|
175
|
-
outNorm[0] = rc.normal.x; outNorm[1] = rc.normal.y; outNorm[2] = rc.normal.z;
|
|
176
|
-
}
|
package/src/c/color.c
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#include "common.h"
|
|
2
|
-
|
|
3
|
-
int ColorToIntW(Color color) { return ColorToInt(color); }
|
|
4
|
-
|
|
5
|
-
void ColorNormalizeW(float* out, Color color) {
|
|
6
|
-
Vector4 v = ColorNormalize(color);
|
|
7
|
-
out[0] = v.x; out[1] = v.y; out[2] = v.z; out[3] = v.w;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
int ColorFromNormalizedW(int x, int y, int z, int w) {
|
|
11
|
-
float fx, fy, fz, fw;
|
|
12
|
-
memcpy(&fx, &x, sizeof(float));
|
|
13
|
-
memcpy(&fy, &y, sizeof(float));
|
|
14
|
-
memcpy(&fz, &z, sizeof(float));
|
|
15
|
-
memcpy(&fw, &w, sizeof(float));
|
|
16
|
-
Color c = ColorFromNormalized((Vector4){fx, fy, fz, fw});
|
|
17
|
-
return *((int*)&c);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
void ColorToHSWW(float* out, Color color) {
|
|
21
|
-
Vector3 v = ColorToHSV(color);
|
|
22
|
-
out[0] = v.x; out[1] = v.y; out[2] = v.z;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
int ColorFromHSWW(int hue, int saturation, int value) {
|
|
26
|
-
float h, s, v;
|
|
27
|
-
memcpy(&h, &hue, sizeof(float));
|
|
28
|
-
memcpy(&s, &saturation, sizeof(float));
|
|
29
|
-
memcpy(&v, &value, sizeof(float));
|
|
30
|
-
Color c = ColorFromHSV(h, s, v);
|
|
31
|
-
return *((int*)&c);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
int ColorTintW(Color color, Color tint) {
|
|
35
|
-
Color c = ColorTint(color, tint);
|
|
36
|
-
return *((int*)&c);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
int ColorBrightnessW(Color color, int factor) {
|
|
40
|
-
float f;
|
|
41
|
-
memcpy(&f, &factor, sizeof(float));
|
|
42
|
-
Color c = ColorBrightness(color, f);
|
|
43
|
-
return *((int*)&c);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
int ColorContrastW(Color color, int contrast) {
|
|
47
|
-
float c_val;
|
|
48
|
-
memcpy(&c_val, &contrast, sizeof(float));
|
|
49
|
-
Color c = ColorContrast(color, c_val);
|
|
50
|
-
return *((int*)&c);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
int ColorAlphaW(Color color, int alpha) {
|
|
54
|
-
float a;
|
|
55
|
-
memcpy(&a, &alpha, sizeof(float));
|
|
56
|
-
Color c = ColorAlpha(color, a);
|
|
57
|
-
return *((int*)&c);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
int ColorAlphaBlendW(Color dst, Color src, Color tint) {
|
|
61
|
-
Color c = ColorAlphaBlend(dst, src, tint);
|
|
62
|
-
return *((int*)&c);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
int ColorLerpW(Color color1, Color color2, int factor) {
|
|
66
|
-
float f;
|
|
67
|
-
memcpy(&f, &factor, sizeof(float));
|
|
68
|
-
Color c = ColorLerp(color1, color2, f);
|
|
69
|
-
return *((int*)&c);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
int GetColorW(unsigned int hexValue) {
|
|
73
|
-
Color c = GetColor(hexValue);
|
|
74
|
-
return *((int*)&c);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
int FadeW(Color color, int alpha) {
|
|
78
|
-
float a;
|
|
79
|
-
memcpy(&a, &alpha, sizeof(float));
|
|
80
|
-
Color c = Fade(color, a);
|
|
81
|
-
return *((int*)&c);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
bool ColorIsEqualW(Color col1, Color col2) { return ColorIsEqual(col1, col2); }
|
|
85
|
-
|
|
86
|
-
int GetPixelDataSizeW(int width, int height, int format) { return GetPixelDataSize(width, height, format); }
|
|
87
|
-
|
|
88
|
-
void ColorToHSVW(float* out, Color color) {
|
|
89
|
-
Vector3 v = ColorToHSV(color);
|
|
90
|
-
out[0] = v.x; out[1] = v.y; out[2] = v.z;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
int ColorFromHSVW(int hue, int saturation, int value) {
|
|
94
|
-
float h, s, v;
|
|
95
|
-
memcpy(&h, &hue, sizeof(float));
|
|
96
|
-
memcpy(&s, &saturation, sizeof(float));
|
|
97
|
-
memcpy(&v, &value, sizeof(float));
|
|
98
|
-
Color c = ColorFromHSV(h, s, v);
|
|
99
|
-
return *((int*)&c);
|
|
100
|
-
}
|
package/src/c/draw3d.c
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
#include "common.h"
|
|
2
|
-
|
|
3
|
-
void DrawLine3DW(int sx, int sy, int sz, int ex, int ey, int ez, Color color) {
|
|
4
|
-
DrawLine3D((Vector3){i2f(sx), i2f(sy), i2f(sz)}, (Vector3){i2f(ex), i2f(ey), i2f(ez)}, color);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
void DrawPoint3DW(int px, int py, int pz, Color color) {
|
|
8
|
-
DrawPoint3D((Vector3){i2f(px), i2f(py), i2f(pz)}, color);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
void DrawCircle3DW(int cx, int cy, int cz, int radius, int rax, int ray_, int raz, int angle, Color color) {
|
|
12
|
-
DrawCircle3D((Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius), (Vector3){i2f(rax), i2f(ray_), i2f(raz)}, i2f(angle), color);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
void DrawTriangle3DW(int v1x, int v1y, int v1z, int v2x, int v2y, int v2z, int v3x, int v3y, int v3z, Color color) {
|
|
16
|
-
DrawTriangle3D(
|
|
17
|
-
(Vector3){i2f(v1x), i2f(v1y), i2f(v1z)},
|
|
18
|
-
(Vector3){i2f(v2x), i2f(v2y), i2f(v2z)},
|
|
19
|
-
(Vector3){i2f(v3x), i2f(v3y), i2f(v3z)},
|
|
20
|
-
color
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
void DrawTriangleStrip3DW(const float* points, int pointCount, Color color) {
|
|
25
|
-
DrawTriangleStrip3D((const Vector3*)points, pointCount, color);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
void DrawCubeW(int px, int py, int pz, int w, int h, int l, Color color) {
|
|
29
|
-
DrawCube((Vector3){i2f(px), i2f(py), i2f(pz)}, i2f(w), i2f(h), i2f(l), color);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
void DrawCubeVW(int px, int py, int pz, int sx, int sy, int sz, Color color) {
|
|
33
|
-
DrawCubeV((Vector3){i2f(px), i2f(py), i2f(pz)}, (Vector3){i2f(sx), i2f(sy), i2f(sz)}, color);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
void DrawCubeWiresW(int px, int py, int pz, int w, int h, int l, Color color) {
|
|
37
|
-
DrawCubeWires((Vector3){i2f(px), i2f(py), i2f(pz)}, i2f(w), i2f(h), i2f(l), color);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
void DrawCubeWiresVW(int px, int py, int pz, int sx, int sy, int sz, Color color) {
|
|
41
|
-
DrawCubeWiresV((Vector3){i2f(px), i2f(py), i2f(pz)}, (Vector3){i2f(sx), i2f(sy), i2f(sz)}, color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
void DrawSphereW(int cx, int cy, int cz, int radius, Color color) {
|
|
45
|
-
DrawSphere((Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius), color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
void DrawSphereExW(int cx, int cy, int cz, int radius, int rings, int slices, Color color) {
|
|
49
|
-
DrawSphereEx((Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius), rings, slices, color);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
void DrawSphereWiresW(int cx, int cy, int cz, int radius, int rings, int slices, Color color) {
|
|
53
|
-
DrawSphereWires((Vector3){i2f(cx), i2f(cy), i2f(cz)}, i2f(radius), rings, slices, color);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
void DrawCylinderW(int px, int py, int pz, int rt, int rb, int h, int slices, Color color) {
|
|
57
|
-
DrawCylinder((Vector3){i2f(px), i2f(py), i2f(pz)}, i2f(rt), i2f(rb), i2f(h), slices, color);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
void DrawCylinderExW(int sx, int sy, int sz, int ex, int ey, int ez, int sr, int er, int sides, Color color) {
|
|
61
|
-
DrawCylinderEx((Vector3){i2f(sx), i2f(sy), i2f(sz)}, (Vector3){i2f(ex), i2f(ey), i2f(ez)}, i2f(sr), i2f(er), sides, color);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
void DrawCylinderWiresW(int px, int py, int pz, int rt, int rb, int h, int slices, Color color) {
|
|
65
|
-
DrawCylinderWires((Vector3){i2f(px), i2f(py), i2f(pz)}, i2f(rt), i2f(rb), i2f(h), slices, color);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
void DrawCylinderWiresExW(int sx, int sy, int sz, int ex, int ey, int ez, int sr, int er, int sides, Color color) {
|
|
69
|
-
DrawCylinderWiresEx((Vector3){i2f(sx), i2f(sy), i2f(sz)}, (Vector3){i2f(ex), i2f(ey), i2f(ez)}, i2f(sr), i2f(er), sides, color);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
void DrawCapsuleW(int sx, int sy, int sz, int ex, int ey, int ez, int radius, int slices, int rings, Color color) {
|
|
73
|
-
DrawCapsule((Vector3){i2f(sx), i2f(sy), i2f(sz)}, (Vector3){i2f(ex), i2f(ey), i2f(ez)}, i2f(radius), slices, rings, color);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
void DrawCapsuleWiresW(int sx, int sy, int sz, int ex, int ey, int ez, int radius, int slices, int rings, Color color) {
|
|
77
|
-
DrawCapsuleWires((Vector3){i2f(sx), i2f(sy), i2f(sz)}, (Vector3){i2f(ex), i2f(ey), i2f(ez)}, i2f(radius), slices, rings, color);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
void DrawPlaneW(int cx, int cy, int cz, int sw, int sh, Color color) {
|
|
81
|
-
DrawPlane((Vector3){i2f(cx), i2f(cy), i2f(cz)}, (Vector2){i2f(sw), i2f(sh)}, color);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
void DrawRayW(int px, int py, int pz, int dx, int dy, int dz, Color color) {
|
|
85
|
-
Ray ray = { {i2f(px), i2f(py), i2f(pz)}, {i2f(dx), i2f(dy), i2f(dz)} };
|
|
86
|
-
DrawRay(ray, color);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
void DrawGridW(int slices, int spacing) {
|
|
90
|
-
DrawGrid(slices, spacing);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
void DrawModelW(int id, int posX, int posY, int posZ, int scale, Color tint) {
|
|
94
|
-
if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return;
|
|
95
|
-
float s;
|
|
96
|
-
memcpy(&s, &scale, sizeof(float));
|
|
97
|
-
DrawModel(modelRegistry[id], (Vector3){i2f(posX), i2f(posY), i2f(posZ)}, s, tint);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
void DrawModelExW(int id,
|
|
101
|
-
int posX, int posY, int posZ,
|
|
102
|
-
int rotAxisX, int rotAxisY, int rotAxisZ, int rotAngle,
|
|
103
|
-
int scaleX, int scaleY, int scaleZ, Color tint) {
|
|
104
|
-
if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return;
|
|
105
|
-
float ra, sx, sy, sz;
|
|
106
|
-
memcpy(&ra, &rotAngle, sizeof(float));
|
|
107
|
-
memcpy(&sx, &scaleX, sizeof(float));
|
|
108
|
-
memcpy(&sy, &scaleY, sizeof(float));
|
|
109
|
-
memcpy(&sz, &scaleZ, sizeof(float));
|
|
110
|
-
DrawModelEx(modelRegistry[id],
|
|
111
|
-
(Vector3){i2f(posX), i2f(posY), i2f(posZ)},
|
|
112
|
-
(Vector3){i2f(rotAxisX), i2f(rotAxisY), i2f(rotAxisZ)}, ra,
|
|
113
|
-
(Vector3){sx, sy, sz}, tint);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
void DrawModelWiresW(int id, int posX, int posY, int posZ, int scale, Color tint) {
|
|
117
|
-
if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return;
|
|
118
|
-
float s;
|
|
119
|
-
memcpy(&s, &scale, sizeof(float));
|
|
120
|
-
DrawModelWires(modelRegistry[id], (Vector3){i2f(posX), i2f(posY), i2f(posZ)}, s, tint);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
void DrawModelWiresExW(int id,
|
|
124
|
-
int posX, int posY, int posZ,
|
|
125
|
-
int rotAxisX, int rotAxisY, int rotAxisZ, int rotAngle,
|
|
126
|
-
int scaleX, int scaleY, int scaleZ, Color tint) {
|
|
127
|
-
if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return;
|
|
128
|
-
float ra, sx, sy, sz;
|
|
129
|
-
memcpy(&ra, &rotAngle, sizeof(float));
|
|
130
|
-
memcpy(&sx, &scaleX, sizeof(float));
|
|
131
|
-
memcpy(&sy, &scaleY, sizeof(float));
|
|
132
|
-
memcpy(&sz, &scaleZ, sizeof(float));
|
|
133
|
-
DrawModelWiresEx(modelRegistry[id],
|
|
134
|
-
(Vector3){i2f(posX), i2f(posY), i2f(posZ)},
|
|
135
|
-
(Vector3){i2f(rotAxisX), i2f(rotAxisY), i2f(rotAxisZ)}, ra,
|
|
136
|
-
(Vector3){sx, sy, sz}, tint);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
void DrawBoundingBoxW(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Color color) {
|
|
140
|
-
BoundingBox bb = {
|
|
141
|
-
{i2f(minX), i2f(minY), i2f(minZ)},
|
|
142
|
-
{i2f(maxX), i2f(maxY), i2f(maxZ)}
|
|
143
|
-
};
|
|
144
|
-
DrawBoundingBox(bb, color);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
void DrawBillboardW(
|
|
148
|
-
int camPosX, int camPosY, int camPosZ,
|
|
149
|
-
int camTarX, int camTarY, int camTarZ,
|
|
150
|
-
int camUpX, int camUpY, int camUpZ,
|
|
151
|
-
int camFovy, int camProj,
|
|
152
|
-
unsigned int texId, int texW, int texH,
|
|
153
|
-
int posX, int posY, int posZ,
|
|
154
|
-
int scale, Color tint) {
|
|
155
|
-
Camera3D cam = {
|
|
156
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
157
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
158
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
159
|
-
i2f(camFovy), camProj
|
|
160
|
-
};
|
|
161
|
-
Texture2D tex = { texId, texW, texH, 1, 7 };
|
|
162
|
-
float s;
|
|
163
|
-
memcpy(&s, &scale, sizeof(float));
|
|
164
|
-
DrawBillboard(cam, tex, (Vector3){i2f(posX), i2f(posY), i2f(posZ)}, s, tint);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
void DrawBillboardRecW(
|
|
168
|
-
int camPosX, int camPosY, int camPosZ,
|
|
169
|
-
int camTarX, int camTarY, int camTarZ,
|
|
170
|
-
int camUpX, int camUpY, int camUpZ,
|
|
171
|
-
int camFovy, int camProj,
|
|
172
|
-
unsigned int texId, int texW, int texH,
|
|
173
|
-
int srcX, int srcY, int srcW, int srcH,
|
|
174
|
-
int posX, int posY, int posZ,
|
|
175
|
-
int sizeX, int sizeY, Color tint) {
|
|
176
|
-
Camera3D cam = {
|
|
177
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
178
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
179
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
180
|
-
i2f(camFovy), camProj
|
|
181
|
-
};
|
|
182
|
-
Texture2D tex = { texId, texW, texH, 1, 7 };
|
|
183
|
-
Rectangle src = { srcX, srcY, srcW, srcH };
|
|
184
|
-
float sx, sy;
|
|
185
|
-
memcpy(&sx, &sizeX, sizeof(float));
|
|
186
|
-
memcpy(&sy, &sizeY, sizeof(float));
|
|
187
|
-
DrawBillboardRec(cam, tex, src, (Vector3){i2f(posX), i2f(posY), i2f(posZ)}, (Vector2){sx, sy}, tint);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
void DrawBillboardProW(
|
|
191
|
-
int camPosX, int camPosY, int camPosZ,
|
|
192
|
-
int camTarX, int camTarY, int camTarZ,
|
|
193
|
-
int camUpX, int camUpY, int camUpZ,
|
|
194
|
-
int camFovy, int camProj,
|
|
195
|
-
unsigned int texId, int texW, int texH,
|
|
196
|
-
int srcX, int srcY, int srcW, int srcH,
|
|
197
|
-
int posX, int posY, int posZ,
|
|
198
|
-
int upX, int upY, int upZ,
|
|
199
|
-
int sizeX, int sizeY,
|
|
200
|
-
int originX, int originY,
|
|
201
|
-
int rotation, Color tint) {
|
|
202
|
-
Camera3D cam = {
|
|
203
|
-
{i2f(camPosX), i2f(camPosY), i2f(camPosZ)},
|
|
204
|
-
{i2f(camTarX), i2f(camTarY), i2f(camTarZ)},
|
|
205
|
-
{i2f(camUpX), i2f(camUpY), i2f(camUpZ)},
|
|
206
|
-
i2f(camFovy), camProj
|
|
207
|
-
};
|
|
208
|
-
Texture2D tex = { texId, texW, texH, 1, 7 };
|
|
209
|
-
Rectangle src = { srcX, srcY, srcW, srcH };
|
|
210
|
-
float sx, sy, ox, oy, rot;
|
|
211
|
-
memcpy(&sx, &sizeX, sizeof(float));
|
|
212
|
-
memcpy(&sy, &sizeY, sizeof(float));
|
|
213
|
-
memcpy(&ox, &originX, sizeof(float));
|
|
214
|
-
memcpy(&oy, &originY, sizeof(float));
|
|
215
|
-
memcpy(&rot, &rotation, sizeof(float));
|
|
216
|
-
DrawBillboardPro(cam, tex, src,
|
|
217
|
-
(Vector3){i2f(posX), i2f(posY), i2f(posZ)},
|
|
218
|
-
(Vector3){i2f(upX), i2f(upY), i2f(upZ)},
|
|
219
|
-
(Vector2){sx, sy},
|
|
220
|
-
(Vector2){ox, oy},
|
|
221
|
-
rot, tint);
|
|
222
|
-
}
|
package/src/c/filesystem.c
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#include "common.h"
|
|
2
|
-
|
|
3
|
-
bool FileExistsW(const char* fileName) { return FileExists(fileName); }
|
|
4
|
-
bool DirectoryExistsW(const char* dirPath) { return DirectoryExists(dirPath); }
|
|
5
|
-
bool IsFileExtensionW(const char* fileName, const char* ext) { return IsFileExtension(fileName, ext); }
|
|
6
|
-
int GetFileLengthW(const char* fileName) { return GetFileLength(fileName); }
|
|
7
|
-
const char* GetFileExtensionW(const char* fileName) { return GetFileExtension(fileName); }
|
|
8
|
-
const char* GetFileNameW(const char* filePath) { return GetFileName(filePath); }
|
|
9
|
-
const char* GetFileNameWithoutExtW(const char* filePath) { return GetFileNameWithoutExt(filePath); }
|
|
10
|
-
const char* GetDirectoryPathW(const char* filePath) { return GetDirectoryPath(filePath); }
|
|
11
|
-
const char* GetPrevDirectoryPathW(const char* dirPath) { return GetPrevDirectoryPath(dirPath); }
|
|
12
|
-
const char* GetWorkingDirectoryW() { return GetWorkingDirectory(); }
|
|
13
|
-
const char* GetApplicationDirectoryW() { return GetApplicationDirectory(); }
|
|
14
|
-
int MakeDirectoryW(const char* dirPath) { return MakeDirectory(dirPath); }
|
|
15
|
-
bool ChangeDirectoryW(const char* dir) { return ChangeDirectory(dir); }
|
|
16
|
-
bool IsPathFileW(const char* path) { return IsPathFile(path); }
|
|
17
|
-
bool IsFileNameValidW(const char* fileName) { return IsFileNameValid(fileName); }
|
|
18
|
-
long GetFileModTimeW(const char* fileName) { return GetFileModTime(fileName); }
|
|
19
|
-
|
|
20
|
-
const char* LoadFileTextW(const char* fileName) { return LoadFileText(fileName); }
|
|
21
|
-
void UnloadFileTextW(const char* text) { UnloadFileText((char*)text); }
|
|
22
|
-
bool SaveFileTextW(const char* fileName, const char* text) { return SaveFileText((char*)fileName, (char*)text); }
|
|
23
|
-
|
|
24
|
-
unsigned int ComputeCRC32W(const unsigned char* data, int dataSize) { return ComputeCRC32((unsigned char*)data, dataSize); }
|
|
25
|
-
|
|
26
|
-
void UnloadRandomSequenceW(int* sequence) { UnloadRandomSequence(sequence); }
|
|
27
|
-
void MemFreeW(void* ptr) { MemFree(ptr); }
|
|
28
|
-
void UnloadFileDataW(unsigned char* data) { UnloadFileData(data); }
|
|
29
|
-
|
|
30
|
-
bool SaveFileDataW(const char* fileName, const void* data, int dataSize) {
|
|
31
|
-
return SaveFileData(fileName, (void*)data, dataSize);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
bool ExportDataAsCodeW(const unsigned char* data, int dataSize, const char* fileName) {
|
|
35
|
-
return ExportDataAsCode(data, dataSize, fileName);
|
|
36
|
-
}
|