-
Notifications
You must be signed in to change notification settings - Fork 1
/
raylib-models.scm
140 lines (114 loc) · 5.19 KB
/
raylib-models.scm
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
;;; Basic 3d Shapes Drawing Functions (Module: models)
;; Basic geometric 3D shapes drawing functions
(foreign-define-with-struct draw-cube
"DrawCube"
void
(((c-pointer (struct Vector3)) position)
(float width)
(float height)
(float length)
((c-pointer (struct Color)) color)))
(foreign-define-with-struct draw-cube-v
"DrawCubeV"
void
(((c-pointer (struct Vector3)) position)
((c-pointer (struct Vector3)) size)
((c-pointer (struct Color)) color)))
(foreign-define-with-struct draw-cube-wires
"DrawCubeWires"
void
(((c-pointer (struct Vector3)) position)
(float width)
(float height)
(float length)
((c-pointer (struct Color)) color)))
(foreign-define-with-struct draw-sphere
"DrawSphere"
void
(((c-pointer (struct Vector3)) centerPos)
(float radius)
((c-pointer (struct Color)) color)))
(foreign-define-with-struct draw-sphere-wires
"DrawSphereWires"
void
(((c-pointer (struct Vector3)) centerPos)
(float radius)
(int rings)
(int slices)
((c-pointer (struct Color)) color)))
(foreign-define-with-struct draw-plane
"DrawPlane"
void
(((c-pointer (struct Vector3)) centerPos)
((c-pointer (struct Vector2)) size)
((c-pointer (struct Color)) color)))
(define draw-grid
(foreign-lambda void "DrawGrid" int float))
(foreign-define-with-struct draw-gizmo
"DrawGizmo"
void
(((c-pointer (struct Vector3)) position)))
;;; Model 3d Loading and Drawing Functions (Module: models)
;; Model loading/unloading functions
(foreign-constructor load-model
"LoadModel"
model
(c-pointer (struct Model))
((c-string fileName)))
(foreign-constructor load-model-from-mesh
"LoadModelFromMesh"
model
(c-pointer (struct Model))
(((c-pointer (struct Mesh)) sourceMesh)))
(foreign-define-with-struct unload-model
"UnloadModel"
void
(((c-pointer (struct Model)) modelToUnload)))
;; Mesh generation functions
(foreign-constructor gen-mesh-cube
"GenMeshCube"
mesh
(c-pointer (struct Mesh))
((float width)
(float height)
(float length)))
(foreign-constructor gen-mesh-heightmap
"GenMeshHeightmap"
mesh
(c-pointer (struct Mesh))
(((c-pointer (struct Image)) mapImage)
((c-pointer (struct Vector3)) sizeVector)))
;; Material loading/unloading functions
;; Model drawing functions
(foreign-define-with-struct draw-model
"DrawModel"
void
(((c-pointer (struct Model)) model)
((c-pointer (struct Vector3)) position)
(float scale)
((c-pointer (struct Color)) tint)))
(foreign-define-with-struct draw-billboard
"DrawBillboard"
void
(((c-pointer (struct Camera3D)) camera)
((c-pointer (struct Texture2D)) texture)
((c-pointer (struct Vector3)) center)
(float size)
((c-pointer (struct Color)) tint)))
;; Collision detection functions
(foreign-predicate check-collision-boxes
"CheckCollisionBoxes"
int
(((c-pointer (struct BoundingBox)) box1)
((c-pointer (struct BoundingBox)) box2)))
(foreign-predicate check-collision-box-sphere
"CheckCollisionBoxSphere"
int
(((c-pointer (struct BoundingBox)) box)
((c-pointer (struct Vector3)) centerSphere)
(float radiusSphere)))
(foreign-predicate check-collision-ray-box
"CheckCollisionRayBox"
int
(((c-pointer (struct Ray)) ray)
((c-pointer (struct BoundingBox)) box)))