raylib-bindings 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +21 -0
- data/README.md +9 -4
- data/examples/template.rb +2 -1
- data/lib/config.rb +43 -43
- 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.dll +0 -0
- data/lib/physac.dylib +0 -0
- data/lib/physac.rb +117 -35
- 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 +26 -20
- data/lib/raygui.x86_64.so +0 -0
- data/lib/raylib_helper.rb +0 -108
- data/lib/raylib_main.rb +712 -408
- data/lib/raymath.rb +10 -0
- data/lib/rlgl.rb +189 -155
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e060a3747c49eb4a2e7c19234033be6223ffdd583321dd0a1986c8b6ab5dab9
|
4
|
+
data.tar.gz: 827e97691123d3345e906d0083102004016e4b427310b5ac977747b32236e48d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25b6cd2357b7ca42bf6651d59135f11583413f33e5e9dee2d45dd743efb13d50fd18dc48eeed31131ba403f9e1d2dc04e10bf187b48ef9ad1770b272a69c762a
|
7
|
+
data.tar.gz: 0345afd0cca23a91ba00101caa827fb0d53b33014e3f2356c8eeb6c1fde82b04b9f729c903c9571ff45f7978bf91316e151e057d0272787ff6f626f0c6e95e0a
|
data/ChangeLog
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
2023-02-26 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* generator/raylib_generator.py: Emits accessors for struct members
|
4
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/7fd2bf1a32c3ed7c932fe7c020858ecadb3b2056 ) and raygui ( https://github.com/raysan5/raygui/commit/c02a5883e0fa0bf78dbd65e70c530080deac5056 )
|
5
|
+
|
6
|
+
2023-02-25 vaiorabbit <http://twitter.com/vaiorabbit>
|
7
|
+
|
8
|
+
* generator/raylib_generator.py: Emits appropriate spaces to align comments
|
9
|
+
|
10
|
+
2023-02-18 vaiorabbit <http://twitter.com/vaiorabbit>
|
11
|
+
|
12
|
+
* example/generate_heightmap_obj.rb: Added
|
13
|
+
|
14
|
+
2023-02-15 vaiorabbit <http://twitter.com/vaiorabbit>
|
15
|
+
|
16
|
+
* example/models_heightmap.rb: Added
|
17
|
+
|
18
|
+
2023-02-04 vaiorabbit <http://twitter.com/vaiorabbit>
|
19
|
+
|
20
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/7914332c40ee811ad08a90e4eb7d40c2d1e81f4e ) and raygui ( https://github.com/raysan5/raygui/commit/cec2de3440eac0ad0020d3ce3d546706c0749335 )
|
21
|
+
|
1
22
|
2023-01-28 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
23
|
|
3
24
|
* Added Linux x86_64 binaries
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Yet another raylib wrapper for Ruby #
|
4
4
|
|
5
5
|
* Created : 2021-10-17
|
6
|
-
* Last modified : 2023-
|
6
|
+
* Last modified : 2023-02-26
|
7
7
|
|
8
8
|
Provides Ruby bindings for raylib-related libraries including:
|
9
9
|
|
@@ -48,7 +48,7 @@ D:\> ruby template.rb
|
|
48
48
|
* Ruby interpreter
|
49
49
|
* Tested on:
|
50
50
|
* [macOS] https://rvm.io
|
51
|
-
* ruby 3.2.
|
51
|
+
* ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22]
|
52
52
|
* [Windows] https://rubyinstaller.org/downloads/ Ruby+Devkit
|
53
53
|
* ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]
|
54
54
|
* [Linux/x86_64 WSL] https://github.com/rvm/ubuntu_rvm
|
@@ -83,6 +83,7 @@ D:\> ruby template.rb
|
|
83
83
|
* Ruby interpreter
|
84
84
|
* Tested on:
|
85
85
|
* [macOS]
|
86
|
+
* ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
|
86
87
|
* ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
|
87
88
|
* ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
|
88
89
|
* ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
|
@@ -119,14 +120,18 @@ D:\> ruby template.rb
|
|
119
120
|
|
120
121
|
</details>
|
121
122
|
|
122
|
-
##
|
123
|
+
## Projects ##
|
123
124
|
|
124
|
-
See the
|
125
|
+
See the projects below to learn how to use this library:
|
125
126
|
|
126
127
|
* Whac-a-Mole! : Ruby raylib bindings demo
|
127
128
|
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-whacamole/main/doc/screenshot_00.png" width="300"> <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-whacamole/main/doc/screenshot_01.png" width="300">
|
128
129
|
* <https://github.com/vaiorabbit/raylib-bindings-whacamole>
|
129
130
|
|
131
|
+
* 1D dot eater : Ruby raylib bindings demo
|
132
|
+
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-pacone/main/doc/screenshot_00.png" width="600">
|
133
|
+
* <https://github.com/vaiorabbit/raylib-bindings-pacone>
|
134
|
+
|
130
135
|
## Limitation ##
|
131
136
|
|
132
137
|
* `SetTraceLogCallback` and `TraceLogCallback` are unusable since Ruby-FFI does not support `:varargs` parameter in callbacks (`Proc`, etc.)
|
data/examples/template.rb
CHANGED
@@ -21,7 +21,8 @@ when /mswin|msys|mingw|cygwin/
|
|
21
21
|
when /darwin/
|
22
22
|
Raylib.load_lib(shared_lib_path + 'libraylib.dylib', raygui_libpath: shared_lib_path + 'raygui.dylib', physac_libpath: shared_lib_path + 'physac.dylib')
|
23
23
|
when /linux/
|
24
|
-
|
24
|
+
arch = RUBY_PLATFORM.split('-')[0]
|
25
|
+
Raylib.load_lib(shared_lib_path + "libraylib.#{arch}.so", raygui_libpath: shared_lib_path + "raygui.#{arch}.so", physac_libpath: shared_lib_path + "physac.#{arch}.so")
|
25
26
|
else
|
26
27
|
raise RuntimeError, "Unknown OS: #{RUBY_PLATFORM}"
|
27
28
|
end
|
data/lib/config.rb
CHANGED
@@ -13,7 +13,7 @@ module Raylib
|
|
13
13
|
|
14
14
|
SUPPORT_MODULE_RSHAPES = 1
|
15
15
|
SUPPORT_MODULE_RTEXTURES = 1
|
16
|
-
SUPPORT_MODULE_RTEXT = 1
|
16
|
+
SUPPORT_MODULE_RTEXT = 1 # WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures
|
17
17
|
SUPPORT_MODULE_RMODELS = 1
|
18
18
|
SUPPORT_MODULE_RAUDIO = 1
|
19
19
|
SUPPORT_CAMERA_SYSTEM = 1
|
@@ -25,39 +25,39 @@ module Raylib
|
|
25
25
|
SUPPORT_SCREEN_CAPTURE = 1
|
26
26
|
SUPPORT_GIF_RECORDING = 1
|
27
27
|
SUPPORT_COMPRESSION_API = 1
|
28
|
-
MAX_FILEPATH_CAPACITY = 8192
|
29
|
-
MAX_FILEPATH_LENGTH = 4096
|
30
|
-
MAX_KEYBOARD_KEYS = 512
|
31
|
-
MAX_MOUSE_BUTTONS = 8
|
32
|
-
MAX_GAMEPADS = 4
|
33
|
-
MAX_GAMEPAD_AXIS = 8
|
34
|
-
MAX_GAMEPAD_BUTTONS = 32
|
35
|
-
MAX_TOUCH_POINTS = 8
|
36
|
-
MAX_KEY_PRESSED_QUEUE = 16
|
37
|
-
MAX_CHAR_PRESSED_QUEUE = 16
|
38
|
-
MAX_DECOMPRESSION_SIZE = 64
|
39
|
-
RL_DEFAULT_BATCH_BUFFERS = 1
|
40
|
-
RL_DEFAULT_BATCH_DRAWCALLS = 256
|
41
|
-
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4
|
42
|
-
RL_MAX_MATRIX_STACK_SIZE = 32
|
43
|
-
RL_MAX_SHADER_LOCATIONS = 32
|
44
|
-
RL_CULL_DISTANCE_NEAR = 0.01
|
45
|
-
RL_CULL_DISTANCE_FAR = 1000.0
|
46
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition"
|
47
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord"
|
48
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal"
|
49
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor"
|
50
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent"
|
51
|
-
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2" #
|
52
|
-
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp"
|
53
|
-
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView"
|
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" # Bound by default to shader location: 0
|
47
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord" # Bound by default to shader location: 1
|
48
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal" # Bound by default to shader location: 2
|
49
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor" # Bound by default to shader location: 3
|
50
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent" # Bound by default to shader location: 4
|
51
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2" # Bound 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
54
|
RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION = "matProjection" # projection matrix
|
55
|
-
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel"
|
56
|
-
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal"
|
57
|
-
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse"
|
58
|
-
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0"
|
59
|
-
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1"
|
60
|
-
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2"
|
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
61
|
SUPPORT_QUADS_DRAW_MODE = 1
|
62
62
|
SUPPORT_FILEFORMAT_PNG = 1
|
63
63
|
SUPPORT_FILEFORMAT_GIF = 1
|
@@ -71,8 +71,8 @@ module Raylib
|
|
71
71
|
SUPPORT_FILEFORMAT_FNT = 1
|
72
72
|
SUPPORT_FILEFORMAT_TTF = 1
|
73
73
|
SUPPORT_TEXT_MANIPULATION = 1
|
74
|
-
MAX_TEXT_BUFFER_LENGTH = 1024
|
75
|
-
MAX_TEXTSPLIT_COUNT = 128
|
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
76
|
SUPPORT_FILEFORMAT_OBJ = 1
|
77
77
|
SUPPORT_FILEFORMAT_MTL = 1
|
78
78
|
SUPPORT_FILEFORMAT_IQM = 1
|
@@ -80,19 +80,19 @@ module Raylib
|
|
80
80
|
SUPPORT_FILEFORMAT_VOX = 1
|
81
81
|
SUPPORT_FILEFORMAT_M3D = 1
|
82
82
|
SUPPORT_MESH_GENERATION = 1
|
83
|
-
MAX_MATERIAL_MAPS = 12
|
84
|
-
MAX_MESH_VERTEX_BUFFERS = 7
|
83
|
+
MAX_MATERIAL_MAPS = 12 # Maximum number of shader maps supported
|
84
|
+
MAX_MESH_VERTEX_BUFFERS = 7 # Maximum vertex buffers (VBO) per mesh
|
85
85
|
SUPPORT_FILEFORMAT_WAV = 1
|
86
86
|
SUPPORT_FILEFORMAT_OGG = 1
|
87
|
+
SUPPORT_FILEFORMAT_MP3 = 1
|
87
88
|
SUPPORT_FILEFORMAT_XM = 1
|
88
89
|
SUPPORT_FILEFORMAT_MOD = 1
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
MAX_AUDIO_BUFFER_POOL_CHANNELS = 16 # Maximum number of audio pool channels
|
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
94
|
SUPPORT_STANDARD_FILEIO = 1
|
95
95
|
SUPPORT_TRACELOG = 1
|
96
|
-
MAX_TRACELOG_MSG_LENGTH = 128
|
96
|
+
MAX_TRACELOG_MSG_LENGTH = 128 # Max length of one trace-log message
|
97
97
|
|
98
98
|
end
|
data/lib/libraylib.aarch64.so
CHANGED
Binary file
|
data/lib/libraylib.dll
CHANGED
Binary file
|
data/lib/libraylib.dylib
CHANGED
Binary file
|
data/lib/libraylib.x86_64.so
CHANGED
Binary file
|
data/lib/physac.dll
CHANGED
Binary file
|
data/lib/physac.dylib
CHANGED
Binary file
|
data/lib/physac.rb
CHANGED
@@ -11,9 +11,9 @@ module Raylib
|
|
11
11
|
|
12
12
|
# Define/Macro
|
13
13
|
|
14
|
-
PHYSAC_MAX_BODIES = 64
|
15
|
-
PHYSAC_MAX_MANIFOLDS = 4096
|
16
|
-
PHYSAC_MAX_VERTICES = 24
|
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
17
|
PHYSAC_DEFAULT_CIRCLE_VERTICES = 24 # Default number of vertices for circle shapes
|
18
18
|
PHYSAC_COLLISION_ITERATIONS = 100
|
19
19
|
PHYSAC_PENETRATION_ALLOWANCE = 0.05
|
@@ -43,63 +43,145 @@ module Raylib
|
|
43
43
|
:m10, :float,
|
44
44
|
:m11, :float,
|
45
45
|
)
|
46
|
+
def m00 = self[:m00]
|
47
|
+
def m00=(v) self[:m00] = v end
|
48
|
+
def m01 = self[:m01]
|
49
|
+
def m01=(v) self[:m01] = v end
|
50
|
+
def m10 = self[:m10]
|
51
|
+
def m10=(v) self[:m10] = v end
|
52
|
+
def m11 = self[:m11]
|
53
|
+
def m11=(v) self[:m11] = v end
|
46
54
|
end
|
47
55
|
|
48
56
|
class PhysicsVertexData < FFI::Struct
|
49
57
|
layout(
|
50
|
-
:vertexCount, :uint,
|
58
|
+
:vertexCount, :uint, # Vertex count (positions and normals)
|
51
59
|
:positions, [Vector2, 24], # Vertex positions vectors
|
52
|
-
:normals, [Vector2, 24],
|
60
|
+
:normals, [Vector2, 24], # Vertex normals vectors
|
53
61
|
)
|
62
|
+
def vertexCount = self[:vertexCount]
|
63
|
+
def vertexCount=(v) self[:vertexCount] = v end
|
64
|
+
def positions = self[:positions]
|
65
|
+
def positions=(v) self[:positions] = v end
|
66
|
+
def normals = self[:normals]
|
67
|
+
def normals=(v) self[:normals] = v end
|
54
68
|
end
|
55
69
|
|
56
70
|
class PhysicsShape < FFI::Struct
|
57
71
|
layout(
|
58
|
-
:type, :int,
|
59
|
-
:body, :pointer,
|
72
|
+
:type, :int, # Shape type (circle or polygon)
|
73
|
+
:body, :pointer, # Shape physics body data pointer
|
60
74
|
:vertexData, PhysicsVertexData, # Shape vertices data (used for polygon shapes)
|
61
|
-
:radius, :float,
|
62
|
-
:transform, Matrix2x2,
|
75
|
+
:radius, :float, # Shape radius (used for circle shapes)
|
76
|
+
:transform, Matrix2x2, # Vertices transform matrix 2x2
|
63
77
|
)
|
78
|
+
def type = self[:type]
|
79
|
+
def type=(v) self[:type] = v end
|
80
|
+
def body = self[:body]
|
81
|
+
def body=(v) self[:body] = v end
|
82
|
+
def vertexData = self[:vertexData]
|
83
|
+
def vertexData=(v) self[:vertexData] = v end
|
84
|
+
def radius = self[:radius]
|
85
|
+
def radius=(v) self[:radius] = v end
|
86
|
+
def transform = self[:transform]
|
87
|
+
def transform=(v) self[:transform] = v end
|
64
88
|
end
|
65
89
|
|
66
90
|
class PhysicsBodyData < FFI::Struct
|
67
91
|
layout(
|
68
|
-
:id, :uint,
|
69
|
-
:enabled, :bool,
|
70
|
-
:position, Vector2,
|
71
|
-
:velocity, Vector2,
|
72
|
-
:force, Vector2,
|
92
|
+
:id, :uint, # Unique identifier
|
93
|
+
:enabled, :bool, # Enabled dynamics state (collisions are calculated anyway)
|
94
|
+
:position, Vector2, # Physics body shape pivot
|
95
|
+
:velocity, Vector2, # Current linear velocity applied to position
|
96
|
+
:force, Vector2, # Current linear force (reset to 0 every step)
|
73
97
|
:angularVelocity, :float, # Current angular velocity applied to orient
|
74
|
-
:torque, :float,
|
75
|
-
:orient, :float,
|
76
|
-
:inertia, :float,
|
77
|
-
:inverseInertia, :float,
|
78
|
-
:mass, :float,
|
79
|
-
:inverseMass, :float,
|
80
|
-
:staticFriction, :float,
|
98
|
+
:torque, :float, # Current angular force (reset to 0 every step)
|
99
|
+
:orient, :float, # Rotation in radians
|
100
|
+
:inertia, :float, # Moment of inertia
|
101
|
+
:inverseInertia, :float, # Inverse value of inertia
|
102
|
+
:mass, :float, # Physics body mass
|
103
|
+
:inverseMass, :float, # Inverse value of mass
|
104
|
+
:staticFriction, :float, # Friction when the body has not movement (0 to 1)
|
81
105
|
:dynamicFriction, :float, # Friction when the body has movement (0 to 1)
|
82
|
-
:restitution, :float,
|
83
|
-
:useGravity, :bool,
|
84
|
-
:isGrounded, :bool,
|
85
|
-
:freezeOrient, :bool,
|
86
|
-
:shape, PhysicsShape,
|
106
|
+
:restitution, :float, # Restitution coefficient of the body (0 to 1)
|
107
|
+
:useGravity, :bool, # Apply gravity force to dynamics
|
108
|
+
:isGrounded, :bool, # Physics grounded on other body state
|
109
|
+
:freezeOrient, :bool, # Physics rotation constraint
|
110
|
+
:shape, PhysicsShape, # Physics body shape information (type, radius, vertices, transform)
|
87
111
|
)
|
112
|
+
def id = self[:id]
|
113
|
+
def id=(v) self[:id] = v end
|
114
|
+
def enabled = self[:enabled]
|
115
|
+
def enabled=(v) self[:enabled] = v end
|
116
|
+
def position = self[:position]
|
117
|
+
def position=(v) self[:position] = v end
|
118
|
+
def velocity = self[:velocity]
|
119
|
+
def velocity=(v) self[:velocity] = v end
|
120
|
+
def force = self[:force]
|
121
|
+
def force=(v) self[:force] = v end
|
122
|
+
def angularVelocity = self[:angularVelocity]
|
123
|
+
def angularVelocity=(v) self[:angularVelocity] = v end
|
124
|
+
def torque = self[:torque]
|
125
|
+
def torque=(v) self[:torque] = v end
|
126
|
+
def orient = self[:orient]
|
127
|
+
def orient=(v) self[:orient] = v end
|
128
|
+
def inertia = self[:inertia]
|
129
|
+
def inertia=(v) self[:inertia] = v end
|
130
|
+
def inverseInertia = self[:inverseInertia]
|
131
|
+
def inverseInertia=(v) self[:inverseInertia] = v end
|
132
|
+
def mass = self[:mass]
|
133
|
+
def mass=(v) self[:mass] = v end
|
134
|
+
def inverseMass = self[:inverseMass]
|
135
|
+
def inverseMass=(v) self[:inverseMass] = v end
|
136
|
+
def staticFriction = self[:staticFriction]
|
137
|
+
def staticFriction=(v) self[:staticFriction] = v end
|
138
|
+
def dynamicFriction = self[:dynamicFriction]
|
139
|
+
def dynamicFriction=(v) self[:dynamicFriction] = v end
|
140
|
+
def restitution = self[:restitution]
|
141
|
+
def restitution=(v) self[:restitution] = v end
|
142
|
+
def useGravity = self[:useGravity]
|
143
|
+
def useGravity=(v) self[:useGravity] = v end
|
144
|
+
def isGrounded = self[:isGrounded]
|
145
|
+
def isGrounded=(v) self[:isGrounded] = v end
|
146
|
+
def freezeOrient = self[:freezeOrient]
|
147
|
+
def freezeOrient=(v) self[:freezeOrient] = v end
|
148
|
+
def shape = self[:shape]
|
149
|
+
def shape=(v) self[:shape] = v end
|
88
150
|
end
|
89
151
|
|
90
152
|
class PhysicsManifoldData < FFI::Struct
|
91
153
|
layout(
|
92
|
-
:id, :uint,
|
93
|
-
:bodyA, :pointer,
|
94
|
-
:bodyB, :pointer,
|
95
|
-
:penetration, :float,
|
96
|
-
:normal, Vector2,
|
97
|
-
:contacts, [Vector2, 2],
|
98
|
-
:contactsCount, :uint,
|
99
|
-
:restitution, :float,
|
154
|
+
:id, :uint, # Unique identifier
|
155
|
+
:bodyA, :pointer, # Manifold first physics body reference
|
156
|
+
:bodyB, :pointer, # Manifold second physics body reference
|
157
|
+
:penetration, :float, # Depth of penetration from collision
|
158
|
+
:normal, Vector2, # Normal direction vector from 'a' to 'b'
|
159
|
+
:contacts, [Vector2, 2], # Points of contact during collision
|
160
|
+
:contactsCount, :uint, # Current collision number of contacts
|
161
|
+
:restitution, :float, # Mixed restitution during collision
|
100
162
|
:dynamicFriction, :float, # Mixed dynamic friction during collision
|
101
|
-
:staticFriction, :float,
|
163
|
+
:staticFriction, :float, # Mixed static friction during collision
|
102
164
|
)
|
165
|
+
def id = self[:id]
|
166
|
+
def id=(v) self[:id] = v end
|
167
|
+
def bodyA = self[:bodyA]
|
168
|
+
def bodyA=(v) self[:bodyA] = v end
|
169
|
+
def bodyB = self[:bodyB]
|
170
|
+
def bodyB=(v) self[:bodyB] = v end
|
171
|
+
def penetration = self[:penetration]
|
172
|
+
def penetration=(v) self[:penetration] = v end
|
173
|
+
def normal = self[:normal]
|
174
|
+
def normal=(v) self[:normal] = v end
|
175
|
+
def contacts = self[:contacts]
|
176
|
+
def contacts=(v) self[:contacts] = v end
|
177
|
+
def contactsCount = self[:contactsCount]
|
178
|
+
def contactsCount=(v) self[:contactsCount] = v end
|
179
|
+
def restitution = self[:restitution]
|
180
|
+
def restitution=(v) self[:restitution] = v end
|
181
|
+
def dynamicFriction = self[:dynamicFriction]
|
182
|
+
def dynamicFriction=(v) self[:dynamicFriction] = v end
|
183
|
+
def staticFriction = self[:staticFriction]
|
184
|
+
def staticFriction=(v) self[:staticFriction] = v end
|
103
185
|
end
|
104
186
|
|
105
187
|
|
data/lib/physac.x86_64.so
CHANGED
Binary file
|
data/lib/raygui.aarch64.so
CHANGED
Binary file
|
data/lib/raygui.dll
CHANGED
Binary file
|
data/lib/raygui.dylib
CHANGED
Binary file
|
data/lib/raygui.rb
CHANGED
@@ -33,17 +33,17 @@ module Raylib
|
|
33
33
|
# enum GuiControl
|
34
34
|
# Gui controls
|
35
35
|
DEFAULT = 0
|
36
|
-
LABEL = 1
|
36
|
+
LABEL = 1 # Used also for: LABELBUTTON
|
37
37
|
BUTTON = 2
|
38
|
-
TOGGLE = 3
|
39
|
-
SLIDER = 4
|
38
|
+
TOGGLE = 3 # Used also for: TOGGLEGROUP
|
39
|
+
SLIDER = 4 # Used also for: SLIDERBAR
|
40
40
|
PROGRESSBAR = 5
|
41
41
|
CHECKBOX = 6
|
42
42
|
COMBOBOX = 7
|
43
43
|
DROPDOWNBOX = 8
|
44
|
-
TEXTBOX = 9
|
44
|
+
TEXTBOX = 9 # Used also for: TEXTBOXMULTI
|
45
45
|
VALUEBOX = 10
|
46
|
-
SPINNER = 11
|
46
|
+
SPINNER = 11 # Uses: BUTTON, VALUEBOX
|
47
47
|
LISTVIEW = 12
|
48
48
|
COLORPICKER = 13
|
49
49
|
SCROLLBAR = 14
|
@@ -70,9 +70,9 @@ module Raylib
|
|
70
70
|
|
71
71
|
# enum GuiDefaultProperty
|
72
72
|
# DEFAULT extended properties
|
73
|
-
TEXT_SIZE = 16
|
74
|
-
TEXT_SPACING = 17
|
75
|
-
LINE_COLOR = 18
|
73
|
+
TEXT_SIZE = 16 # Text size (glyphs max height)
|
74
|
+
TEXT_SPACING = 17 # Text spacing between glyphs
|
75
|
+
LINE_COLOR = 18 # Line control color
|
76
76
|
BACKGROUND_COLOR = 19 # Background color
|
77
77
|
|
78
78
|
# enum GuiToggleProperty
|
@@ -81,7 +81,7 @@ module Raylib
|
|
81
81
|
|
82
82
|
# enum GuiSliderProperty
|
83
83
|
# Slider/SliderBar
|
84
|
-
SLIDER_WIDTH = 16
|
84
|
+
SLIDER_WIDTH = 16 # Slider size of internal bar
|
85
85
|
SLIDER_PADDING = 17 # Slider/SliderBar internal bar padding
|
86
86
|
|
87
87
|
# enum GuiProgressBarProperty
|
@@ -103,12 +103,12 @@ module Raylib
|
|
103
103
|
|
104
104
|
# enum GuiComboBoxProperty
|
105
105
|
# ComboBox
|
106
|
-
COMBO_BUTTON_WIDTH = 16
|
106
|
+
COMBO_BUTTON_WIDTH = 16 # ComboBox right button width
|
107
107
|
COMBO_BUTTON_SPACING = 17 # ComboBox button separation
|
108
108
|
|
109
109
|
# enum GuiDropdownBoxProperty
|
110
110
|
# DropdownBox
|
111
|
-
ARROW_PADDING = 16
|
111
|
+
ARROW_PADDING = 16 # DropdownBox arrow separation from border and items
|
112
112
|
DROPDOWN_ITEMS_SPACING = 17 # DropdownBox items separation
|
113
113
|
|
114
114
|
# enum GuiTextBoxProperty
|
@@ -118,22 +118,22 @@ module Raylib
|
|
118
118
|
|
119
119
|
# enum GuiSpinnerProperty
|
120
120
|
# Spinner
|
121
|
-
SPIN_BUTTON_WIDTH = 16
|
121
|
+
SPIN_BUTTON_WIDTH = 16 # Spinner left/right buttons width
|
122
122
|
SPIN_BUTTON_SPACING = 17 # Spinner buttons separation
|
123
123
|
|
124
124
|
# enum GuiListViewProperty
|
125
125
|
# ListView
|
126
|
-
LIST_ITEMS_HEIGHT = 16
|
126
|
+
LIST_ITEMS_HEIGHT = 16 # ListView items height
|
127
127
|
LIST_ITEMS_SPACING = 17 # ListView items separation
|
128
|
-
SCROLLBAR_WIDTH = 18
|
129
|
-
SCROLLBAR_SIDE = 19
|
128
|
+
SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
|
129
|
+
SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
|
130
130
|
|
131
131
|
# enum GuiColorPickerProperty
|
132
132
|
# ColorPicker
|
133
133
|
COLOR_SELECTOR_SIZE = 16
|
134
|
-
HUEBAR_WIDTH = 17
|
135
|
-
HUEBAR_PADDING = 18
|
136
|
-
HUEBAR_SELECTOR_HEIGHT = 19
|
134
|
+
HUEBAR_WIDTH = 17 # ColorPicker right hue bar width
|
135
|
+
HUEBAR_PADDING = 18 # ColorPicker right hue bar separation from panel
|
136
|
+
HUEBAR_SELECTOR_HEIGHT = 19 # ColorPicker right hue bar selector height
|
137
137
|
HUEBAR_SELECTOR_OVERFLOW = 20 # ColorPicker right hue bar selector overflow
|
138
138
|
|
139
139
|
# enum GuiIconName
|
@@ -421,10 +421,16 @@ module Raylib
|
|
421
421
|
# Style property
|
422
422
|
class GuiStyleProp < FFI::Struct
|
423
423
|
layout(
|
424
|
-
:controlId, :ushort,
|
425
|
-
:propertyId, :ushort,
|
424
|
+
:controlId, :ushort,
|
425
|
+
:propertyId, :ushort,
|
426
426
|
:propertyValue, :uint,
|
427
427
|
)
|
428
|
+
def controlId = self[:controlId]
|
429
|
+
def controlId=(v) self[:controlId] = v end
|
430
|
+
def propertyId = self[:propertyId]
|
431
|
+
def propertyId=(v) self[:propertyId] = v end
|
432
|
+
def propertyValue = self[:propertyValue]
|
433
|
+
def propertyValue=(v) self[:propertyValue] = v end
|
428
434
|
end
|
429
435
|
|
430
436
|
|
data/lib/raygui.x86_64.so
CHANGED
Binary file
|