raylib-bindings 0.1.4 → 0.3.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.
- checksums.yaml +4 -4
- data/ChangeLog +279 -244
- data/LICENSE.txt +1 -1
- data/README.md +171 -143
- data/examples/template.rb +148 -146
- data/lib/config.rb +98 -0
- data/lib/libraylib.aarch64.so +0 -0
- data/lib/libraylib.dll +0 -0
- data/lib/libraylib.dylib +0 -0
- data/lib/libraylib.x86_64.so +0 -0
- data/lib/physac.aarch64.so +0 -0
- data/lib/physac.dll +0 -0
- data/lib/physac.dylib +0 -0
- data/lib/physac.rb +222 -224
- data/lib/physac.x86_64.so +0 -0
- data/lib/raygui.aarch64.so +0 -0
- data/lib/raygui.dll +0 -0
- data/lib/raygui.dylib +0 -0
- data/lib/raygui.rb +795 -743
- data/lib/raygui.x86_64.so +0 -0
- data/lib/raylib.rb +59 -178
- data/lib/raylib_helper.rb +419 -0
- data/lib/raylib_main.rb +3979 -3874
- data/lib/raymath.rb +709 -713
- data/lib/rlgl.rb +1107 -1078
- metadata +11 -3
data/lib/config.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# Yet another raylib wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/raylib-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Raylib
|
10
|
+
extend FFI::Library
|
11
|
+
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
SUPPORT_MODULE_RSHAPES = 1
|
15
|
+
SUPPORT_MODULE_RTEXTURES = 1
|
16
|
+
SUPPORT_MODULE_RTEXT = 1 # WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures
|
17
|
+
SUPPORT_MODULE_RMODELS = 1
|
18
|
+
SUPPORT_MODULE_RAUDIO = 1
|
19
|
+
SUPPORT_CAMERA_SYSTEM = 1
|
20
|
+
SUPPORT_GESTURES_SYSTEM = 1
|
21
|
+
SUPPORT_MOUSE_GESTURES = 1
|
22
|
+
SUPPORT_SSH_KEYBOARD_RPI = 1
|
23
|
+
SUPPORT_WINMM_HIGHRES_TIMER = 1
|
24
|
+
SUPPORT_PARTIALBUSY_WAIT_LOOP = 1
|
25
|
+
SUPPORT_SCREEN_CAPTURE = 1
|
26
|
+
SUPPORT_GIF_RECORDING = 1
|
27
|
+
SUPPORT_COMPRESSION_API = 1
|
28
|
+
MAX_FILEPATH_CAPACITY = 8192 # Maximum file paths capacity
|
29
|
+
MAX_FILEPATH_LENGTH = 4096 # Maximum length for filepaths (Linux PATH_MAX default value)
|
30
|
+
MAX_KEYBOARD_KEYS = 512 # Maximum number of keyboard keys supported
|
31
|
+
MAX_MOUSE_BUTTONS = 8 # Maximum number of mouse buttons supported
|
32
|
+
MAX_GAMEPADS = 4 # Maximum number of gamepads supported
|
33
|
+
MAX_GAMEPAD_AXIS = 8 # Maximum number of axis supported (per gamepad)
|
34
|
+
MAX_GAMEPAD_BUTTONS = 32 # Maximum number of buttons supported (per gamepad)
|
35
|
+
MAX_TOUCH_POINTS = 8 # Maximum number of touch points supported
|
36
|
+
MAX_KEY_PRESSED_QUEUE = 16 # Maximum number of keys in the key input queue
|
37
|
+
MAX_CHAR_PRESSED_QUEUE = 16 # Maximum number of characters in the char input queue
|
38
|
+
MAX_DECOMPRESSION_SIZE = 64 # Max size allocated for decompression in MB
|
39
|
+
RL_DEFAULT_BATCH_BUFFERS = 1 # Default number of batch buffers (multi-buffering)
|
40
|
+
RL_DEFAULT_BATCH_DRAWCALLS = 256 # Default number of batch draw calls (by state changes: mode, texture)
|
41
|
+
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
42
|
+
RL_MAX_MATRIX_STACK_SIZE = 32 # Maximum size of internal Matrix stack
|
43
|
+
RL_MAX_SHADER_LOCATIONS = 32 # Maximum number of shader locations supported
|
44
|
+
RL_CULL_DISTANCE_NEAR = 0.01 # Default projection matrix near cull distance
|
45
|
+
RL_CULL_DISTANCE_FAR = 1000.0 # Default projection matrix far cull distance
|
46
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition" # Binded by default to shader location: 0
|
47
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord" # Binded by default to shader location: 1
|
48
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal" # Binded by default to shader location: 2
|
49
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor" # Binded by default to shader location: 3
|
50
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent" # Binded by default to shader location: 4
|
51
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2" # Binded by default to shader location: 5
|
52
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp" # model-view-projection matrix
|
53
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView" # view matrix
|
54
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION = "matProjection" # projection matrix
|
55
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel" # model matrix
|
56
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal" # normal matrix (transpose(inverse(matModelView))
|
57
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse" # color diffuse (base tint color, multiplied by texture color)
|
58
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0" # texture0 (texture slot active 0)
|
59
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1" # texture1 (texture slot active 1)
|
60
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2" # texture2 (texture slot active 2)
|
61
|
+
SUPPORT_QUADS_DRAW_MODE = 1
|
62
|
+
SUPPORT_FILEFORMAT_PNG = 1
|
63
|
+
SUPPORT_FILEFORMAT_GIF = 1
|
64
|
+
SUPPORT_FILEFORMAT_QOI = 1
|
65
|
+
SUPPORT_FILEFORMAT_DDS = 1
|
66
|
+
SUPPORT_FILEFORMAT_HDR = 1
|
67
|
+
SUPPORT_IMAGE_EXPORT = 1
|
68
|
+
SUPPORT_IMAGE_GENERATION = 1
|
69
|
+
SUPPORT_IMAGE_MANIPULATION = 1
|
70
|
+
SUPPORT_DEFAULT_FONT = 1
|
71
|
+
SUPPORT_FILEFORMAT_FNT = 1
|
72
|
+
SUPPORT_FILEFORMAT_TTF = 1
|
73
|
+
SUPPORT_TEXT_MANIPULATION = 1
|
74
|
+
MAX_TEXT_BUFFER_LENGTH = 1024 # Size of internal static buffers used on some functions:
|
75
|
+
MAX_TEXTSPLIT_COUNT = 128 # Maximum number of substrings to split: TextSplit()
|
76
|
+
SUPPORT_FILEFORMAT_OBJ = 1
|
77
|
+
SUPPORT_FILEFORMAT_MTL = 1
|
78
|
+
SUPPORT_FILEFORMAT_IQM = 1
|
79
|
+
SUPPORT_FILEFORMAT_GLTF = 1
|
80
|
+
SUPPORT_FILEFORMAT_VOX = 1
|
81
|
+
SUPPORT_FILEFORMAT_M3D = 1
|
82
|
+
SUPPORT_MESH_GENERATION = 1
|
83
|
+
MAX_MATERIAL_MAPS = 12 # Maximum number of shader maps supported
|
84
|
+
MAX_MESH_VERTEX_BUFFERS = 7 # Maximum vertex buffers (VBO) per mesh
|
85
|
+
SUPPORT_FILEFORMAT_WAV = 1
|
86
|
+
SUPPORT_FILEFORMAT_OGG = 1
|
87
|
+
SUPPORT_FILEFORMAT_XM = 1
|
88
|
+
SUPPORT_FILEFORMAT_MOD = 1
|
89
|
+
SUPPORT_FILEFORMAT_MP3 = 1
|
90
|
+
AUDIO_DEVICE_FORMAT = "ma_format_f32" # Device output format (miniaudio: float-32bit)
|
91
|
+
AUDIO_DEVICE_CHANNELS = 2 # Device output channels: stereo
|
92
|
+
AUDIO_DEVICE_SAMPLE_RATE = 0 # Device sample rate (device default)
|
93
|
+
MAX_AUDIO_BUFFER_POOL_CHANNELS = 16 # Maximum number of audio pool channels
|
94
|
+
SUPPORT_STANDARD_FILEIO = 1
|
95
|
+
SUPPORT_TRACELOG = 1
|
96
|
+
MAX_TRACELOG_MSG_LENGTH = 128 # Max length of one trace-log message
|
97
|
+
|
98
|
+
end
|
Binary file
|
data/lib/libraylib.dll
CHANGED
Binary file
|
data/lib/libraylib.dylib
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/physac.dll
CHANGED
Binary file
|
data/lib/physac.dylib
CHANGED
Binary file
|
data/lib/physac.rb
CHANGED
@@ -1,224 +1,222 @@
|
|
1
|
-
# Yet another raylib wrapper for Ruby
|
2
|
-
#
|
3
|
-
# * https://github.com/vaiorabbit/raylib-bindings
|
4
|
-
#
|
5
|
-
# [NOTICE] Autogenerated. Do not edit.
|
6
|
-
|
7
|
-
require 'ffi'
|
8
|
-
|
9
|
-
module Raylib
|
10
|
-
extend FFI::Library
|
11
|
-
|
12
|
-
# Define/Macro
|
13
|
-
|
14
|
-
PHYSAC_MAX_BODIES = 64 # Maximum number of physic bodies supported
|
15
|
-
PHYSAC_MAX_MANIFOLDS = 4096 # Maximum number of physic bodies interactions (64x64)
|
16
|
-
PHYSAC_MAX_VERTICES = 24 # Maximum number of vertex for polygons shapes
|
17
|
-
PHYSAC_DEFAULT_CIRCLE_VERTICES = 24 # Default number of vertices for circle shapes
|
18
|
-
PHYSAC_COLLISION_ITERATIONS = 100
|
19
|
-
PHYSAC_PENETRATION_ALLOWANCE = 0.05
|
20
|
-
PHYSAC_PENETRATION_CORRECTION = 0.4
|
21
|
-
PHYSAC_PI = 3.14159265358979323846
|
22
|
-
|
23
|
-
# Enum
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
typedef :
|
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
|
-
# @param
|
140
|
-
# @
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
#
|
146
|
-
# @param
|
147
|
-
# @param
|
148
|
-
# @
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
#
|
154
|
-
# @param
|
155
|
-
# @param
|
156
|
-
# @
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
#
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
#
|
167
|
-
# @
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
#
|
173
|
-
# @
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
#
|
179
|
-
# @param
|
180
|
-
# @
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
#
|
186
|
-
# @
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
#
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
#
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
#
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
#
|
211
|
-
# @
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
end
|
224
|
-
|
1
|
+
# Yet another raylib wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/raylib-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Raylib
|
10
|
+
extend FFI::Library
|
11
|
+
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
PHYSAC_MAX_BODIES = 64 # Maximum number of physic bodies supported
|
15
|
+
PHYSAC_MAX_MANIFOLDS = 4096 # Maximum number of physic bodies interactions (64x64)
|
16
|
+
PHYSAC_MAX_VERTICES = 24 # Maximum number of vertex for polygons shapes
|
17
|
+
PHYSAC_DEFAULT_CIRCLE_VERTICES = 24 # Default number of vertices for circle shapes
|
18
|
+
PHYSAC_COLLISION_ITERATIONS = 100
|
19
|
+
PHYSAC_PENETRATION_ALLOWANCE = 0.05
|
20
|
+
PHYSAC_PENETRATION_CORRECTION = 0.4
|
21
|
+
PHYSAC_PI = 3.14159265358979323846
|
22
|
+
|
23
|
+
# Enum
|
24
|
+
|
25
|
+
# enum PhysicsShapeType
|
26
|
+
PHYSICS_CIRCLE = 0
|
27
|
+
PHYSICS_POLYGON = 1
|
28
|
+
|
29
|
+
|
30
|
+
# Typedef
|
31
|
+
|
32
|
+
typedef :int, :PhysicsShapeType
|
33
|
+
typedef :pointer, :PhysicsBody
|
34
|
+
typedef :pointer, :PhysicsManifold
|
35
|
+
|
36
|
+
# Struct
|
37
|
+
|
38
|
+
# Matrix2x2 type (used for polygon shape rotation matrix)
|
39
|
+
class Matrix2x2 < FFI::Struct
|
40
|
+
layout(
|
41
|
+
:m00, :float,
|
42
|
+
:m01, :float,
|
43
|
+
:m10, :float,
|
44
|
+
:m11, :float,
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
class PhysicsVertexData < FFI::Struct
|
49
|
+
layout(
|
50
|
+
:vertexCount, :uint, # Vertex count (positions and normals)
|
51
|
+
:positions, [Vector2, 24], # Vertex positions vectors
|
52
|
+
:normals, [Vector2, 24], # Vertex normals vectors
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
class PhysicsShape < FFI::Struct
|
57
|
+
layout(
|
58
|
+
:type, :int, # Shape type (circle or polygon)
|
59
|
+
:body, :pointer, # Shape physics body data pointer
|
60
|
+
:vertexData, PhysicsVertexData, # Shape vertices data (used for polygon shapes)
|
61
|
+
:radius, :float, # Shape radius (used for circle shapes)
|
62
|
+
:transform, Matrix2x2, # Vertices transform matrix 2x2
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
class PhysicsBodyData < FFI::Struct
|
67
|
+
layout(
|
68
|
+
:id, :uint, # Unique identifier
|
69
|
+
:enabled, :bool, # Enabled dynamics state (collisions are calculated anyway)
|
70
|
+
:position, Vector2, # Physics body shape pivot
|
71
|
+
:velocity, Vector2, # Current linear velocity applied to position
|
72
|
+
:force, Vector2, # Current linear force (reset to 0 every step)
|
73
|
+
:angularVelocity, :float, # Current angular velocity applied to orient
|
74
|
+
:torque, :float, # Current angular force (reset to 0 every step)
|
75
|
+
:orient, :float, # Rotation in radians
|
76
|
+
:inertia, :float, # Moment of inertia
|
77
|
+
:inverseInertia, :float, # Inverse value of inertia
|
78
|
+
:mass, :float, # Physics body mass
|
79
|
+
:inverseMass, :float, # Inverse value of mass
|
80
|
+
:staticFriction, :float, # Friction when the body has not movement (0 to 1)
|
81
|
+
:dynamicFriction, :float, # Friction when the body has movement (0 to 1)
|
82
|
+
:restitution, :float, # Restitution coefficient of the body (0 to 1)
|
83
|
+
:useGravity, :bool, # Apply gravity force to dynamics
|
84
|
+
:isGrounded, :bool, # Physics grounded on other body state
|
85
|
+
:freezeOrient, :bool, # Physics rotation constraint
|
86
|
+
:shape, PhysicsShape, # Physics body shape information (type, radius, vertices, transform)
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
class PhysicsManifoldData < FFI::Struct
|
91
|
+
layout(
|
92
|
+
:id, :uint, # Unique identifier
|
93
|
+
:bodyA, :pointer, # Manifold first physics body reference
|
94
|
+
:bodyB, :pointer, # Manifold second physics body reference
|
95
|
+
:penetration, :float, # Depth of penetration from collision
|
96
|
+
:normal, Vector2, # Normal direction vector from 'a' to 'b'
|
97
|
+
:contacts, [Vector2, 2], # Points of contact during collision
|
98
|
+
:contactsCount, :uint, # Current collision number of contacts
|
99
|
+
:restitution, :float, # Mixed restitution during collision
|
100
|
+
:dynamicFriction, :float, # Mixed dynamic friction during collision
|
101
|
+
:staticFriction, :float, # Mixed static friction during collision
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
# Function
|
107
|
+
|
108
|
+
def self.setup_physac_symbols
|
109
|
+
entries = [
|
110
|
+
|
111
|
+
# InitPhysics : Initializes physics system
|
112
|
+
# @return [void]
|
113
|
+
[:InitPhysics, :InitPhysics, [], :void],
|
114
|
+
|
115
|
+
# UpdatePhysics : Update physics system
|
116
|
+
# @return [void]
|
117
|
+
[:UpdatePhysics, :UpdatePhysics, [], :void],
|
118
|
+
|
119
|
+
# ResetPhysics : Reset physics system (global variables)
|
120
|
+
# @return [void]
|
121
|
+
[:ResetPhysics, :ResetPhysics, [], :void],
|
122
|
+
|
123
|
+
# ClosePhysics : Close physics system and unload used memory
|
124
|
+
# @return [void]
|
125
|
+
[:ClosePhysics, :ClosePhysics, [], :void],
|
126
|
+
|
127
|
+
# SetPhysicsTimeStep : Sets physics fixed time step in milliseconds. 1.666666 by default
|
128
|
+
# @param delta [double]
|
129
|
+
# @return [void]
|
130
|
+
[:SetPhysicsTimeStep, :SetPhysicsTimeStep, [:double], :void],
|
131
|
+
|
132
|
+
# SetPhysicsGravity : Sets physics global gravity force
|
133
|
+
# @param x [float]
|
134
|
+
# @param y [float]
|
135
|
+
# @return [void]
|
136
|
+
[:SetPhysicsGravity, :SetPhysicsGravity, [:float, :float], :void],
|
137
|
+
|
138
|
+
# CreatePhysicsBodyCircle : Creates a new circle physics body with generic parameters
|
139
|
+
# @param pos [Vector2]
|
140
|
+
# @param radius [float]
|
141
|
+
# @param density [float]
|
142
|
+
# @return [PhysicsBody]
|
143
|
+
[:CreatePhysicsBodyCircle, :CreatePhysicsBodyCircle, [Vector2.by_value, :float, :float], :pointer],
|
144
|
+
|
145
|
+
# CreatePhysicsBodyRectangle : Creates a new rectangle physics body with generic parameters
|
146
|
+
# @param pos [Vector2]
|
147
|
+
# @param width [float]
|
148
|
+
# @param height [float]
|
149
|
+
# @param density [float]
|
150
|
+
# @return [PhysicsBody]
|
151
|
+
[:CreatePhysicsBodyRectangle, :CreatePhysicsBodyRectangle, [Vector2.by_value, :float, :float, :float], :pointer],
|
152
|
+
|
153
|
+
# CreatePhysicsBodyPolygon : Creates a new polygon physics body with generic parameters
|
154
|
+
# @param pos [Vector2]
|
155
|
+
# @param radius [float]
|
156
|
+
# @param sides [int]
|
157
|
+
# @param density [float]
|
158
|
+
# @return [PhysicsBody]
|
159
|
+
[:CreatePhysicsBodyPolygon, :CreatePhysicsBodyPolygon, [Vector2.by_value, :float, :int, :float], :pointer],
|
160
|
+
|
161
|
+
# DestroyPhysicsBody : Destroy a physics body
|
162
|
+
# @param body [PhysicsBody]
|
163
|
+
# @return [void]
|
164
|
+
[:DestroyPhysicsBody, :DestroyPhysicsBody, [:pointer], :void],
|
165
|
+
|
166
|
+
# PhysicsAddForce : Adds a force to a physics body
|
167
|
+
# @param body [PhysicsBody]
|
168
|
+
# @param force [Vector2]
|
169
|
+
# @return [void]
|
170
|
+
[:PhysicsAddForce, :PhysicsAddForce, [:pointer, Vector2.by_value], :void],
|
171
|
+
|
172
|
+
# PhysicsAddTorque : Adds an angular force to a physics body
|
173
|
+
# @param body [PhysicsBody]
|
174
|
+
# @param amount [float]
|
175
|
+
# @return [void]
|
176
|
+
[:PhysicsAddTorque, :PhysicsAddTorque, [:pointer, :float], :void],
|
177
|
+
|
178
|
+
# PhysicsShatter : Shatters a polygon shape physics body to little physics bodies with explosion force
|
179
|
+
# @param body [PhysicsBody]
|
180
|
+
# @param position [Vector2]
|
181
|
+
# @param force [float]
|
182
|
+
# @return [void]
|
183
|
+
[:PhysicsShatter, :PhysicsShatter, [:pointer, Vector2.by_value, :float], :void],
|
184
|
+
|
185
|
+
# SetPhysicsBodyRotation : Sets physics body shape transform based on radians parameter
|
186
|
+
# @param body [PhysicsBody]
|
187
|
+
# @param radians [float]
|
188
|
+
# @return [void]
|
189
|
+
[:SetPhysicsBodyRotation, :SetPhysicsBodyRotation, [:pointer, :float], :void],
|
190
|
+
|
191
|
+
# GetPhysicsBody : Returns a physics body of the bodies pool at a specific index
|
192
|
+
# @param index [int]
|
193
|
+
# @return [PhysicsBody]
|
194
|
+
[:GetPhysicsBody, :GetPhysicsBody, [:int], :pointer],
|
195
|
+
|
196
|
+
# GetPhysicsBodiesCount : Returns the current amount of created physics bodies
|
197
|
+
# @return [int]
|
198
|
+
[:GetPhysicsBodiesCount, :GetPhysicsBodiesCount, [], :int],
|
199
|
+
|
200
|
+
# GetPhysicsShapeType : Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
|
201
|
+
# @param index [int]
|
202
|
+
# @return [int]
|
203
|
+
[:GetPhysicsShapeType, :GetPhysicsShapeType, [:int], :int],
|
204
|
+
|
205
|
+
# GetPhysicsShapeVerticesCount : Returns the amount of vertices of a physics body shape
|
206
|
+
# @param index [int]
|
207
|
+
# @return [int]
|
208
|
+
[:GetPhysicsShapeVerticesCount, :GetPhysicsShapeVerticesCount, [:int], :int],
|
209
|
+
|
210
|
+
# GetPhysicsShapeVertex : Returns transformed position of a body shape (body position + vertex transformed position)
|
211
|
+
# @param body [PhysicsBody]
|
212
|
+
# @param vertex [int]
|
213
|
+
# @return [Vector2]
|
214
|
+
[:GetPhysicsShapeVertex, :GetPhysicsShapeVertex, [:pointer, :int], Vector2.by_value],
|
215
|
+
]
|
216
|
+
entries.each do |entry|
|
217
|
+
attach_function entry[0], entry[1], entry[2], entry[3]
|
218
|
+
rescue FFI::NotFoundError => e
|
219
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
Binary file
|
Binary file
|
data/lib/raygui.dll
CHANGED
Binary file
|
data/lib/raygui.dylib
CHANGED
Binary file
|