raylib-bindings 0.3.0 → 0.5.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 +26 -0
- data/README.md +9 -4
- data/examples/template.rb +5 -4
- data/lib/config.rb +44 -44
- 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.rb +2 -0
- data/lib/raylib_helper.rb +0 -108
- data/lib/raylib_main.rb +712 -426
- data/lib/raymath.rb +10 -0
- data/lib/rcamera.rb +79 -0
- data/lib/rlgl.rb +191 -155
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5397ef38987b34a564b3414cf0c5999dbac9e49221d36c570bc099a6c4b2d19b
|
4
|
+
data.tar.gz: ca9ef0156d1e632f40e4d984511a954d69650fd94a47479d18799d8632d7d63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f3a90d970d1512f8754db0a8d2cfc549577d4dc832daafbab493947d469347f0ee9b4facfc622cb37f088e4277f90101fbc71fd2b9a3a0ffac36d81e45c1a0a
|
7
|
+
data.tar.gz: 25778c5fb2d09ceca6613baaf6e8626bb767f4a05dd62f2fe6d9be5ee0a05946f88d902d6839e56e738b6187ef39aa63deb6482d021873359227c82ceb4141db
|
data/ChangeLog
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
2023-03-09 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* generator: Now generates binding code for rcamera.h
|
4
|
+
* example: Removed SetCameaMode
|
5
|
+
|
6
|
+
2023-02-26 vaiorabbit <http://twitter.com/vaiorabbit>
|
7
|
+
|
8
|
+
* generator/raylib_generator.py: Emits accessors for struct members
|
9
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/7fd2bf1a32c3ed7c932fe7c020858ecadb3b2056 ) and raygui ( https://github.com/raysan5/raygui/commit/c02a5883e0fa0bf78dbd65e70c530080deac5056 )
|
10
|
+
|
11
|
+
2023-02-25 vaiorabbit <http://twitter.com/vaiorabbit>
|
12
|
+
|
13
|
+
* generator/raylib_generator.py: Emits appropriate spaces to align comments
|
14
|
+
|
15
|
+
2023-02-18 vaiorabbit <http://twitter.com/vaiorabbit>
|
16
|
+
|
17
|
+
* example/generate_heightmap_obj.rb: Added
|
18
|
+
|
19
|
+
2023-02-15 vaiorabbit <http://twitter.com/vaiorabbit>
|
20
|
+
|
21
|
+
* example/models_heightmap.rb: Added
|
22
|
+
|
23
|
+
2023-02-04 vaiorabbit <http://twitter.com/vaiorabbit>
|
24
|
+
|
25
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/7914332c40ee811ad08a90e4eb7d40c2d1e81f4e ) and raygui ( https://github.com/raysan5/raygui/commit/cec2de3440eac0ad0020d3ce3d546706c0749335 )
|
26
|
+
|
1
27
|
2023-01-28 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
28
|
|
3
29
|
* 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-03-09
|
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
|
@@ -46,7 +47,7 @@ if __FILE__ == $PROGRAM_NAME
|
|
46
47
|
camera.projection = CAMERA_PERSPECTIVE
|
47
48
|
}
|
48
49
|
reset_camera.call
|
49
|
-
|
50
|
+
camera_mode = CAMERA_FREE
|
50
51
|
auto_rotate = false
|
51
52
|
|
52
53
|
# Player (red cube) settings
|
@@ -67,9 +68,9 @@ if __FILE__ == $PROGRAM_NAME
|
|
67
68
|
if IsKeyPressed(KEY_F1)
|
68
69
|
auto_rotate = !auto_rotate
|
69
70
|
reset_camera.call
|
70
|
-
|
71
|
+
camera_mode = auto_rotate ? CAMERA_ORBITAL : CAMERA_FREE
|
71
72
|
end
|
72
|
-
UpdateCamera(camera)
|
73
|
+
UpdateCamera(camera.pointer, camera_mode)
|
73
74
|
|
74
75
|
# Calculate move direction
|
75
76
|
move = Vector3.create(0, 0, 0)
|
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
|
@@ -21,43 +21,42 @@ module Raylib
|
|
21
21
|
SUPPORT_MOUSE_GESTURES = 1
|
22
22
|
SUPPORT_SSH_KEYBOARD_RPI = 1
|
23
23
|
SUPPORT_WINMM_HIGHRES_TIMER = 1
|
24
|
-
SUPPORT_PARTIALBUSY_WAIT_LOOP = 1
|
25
24
|
SUPPORT_SCREEN_CAPTURE = 1
|
26
25
|
SUPPORT_GIF_RECORDING = 1
|
27
26
|
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"
|
27
|
+
MAX_FILEPATH_CAPACITY = 8192 # Maximum file paths capacity
|
28
|
+
MAX_FILEPATH_LENGTH = 4096 # Maximum length for filepaths (Linux PATH_MAX default value)
|
29
|
+
MAX_KEYBOARD_KEYS = 512 # Maximum number of keyboard keys supported
|
30
|
+
MAX_MOUSE_BUTTONS = 8 # Maximum number of mouse buttons supported
|
31
|
+
MAX_GAMEPADS = 4 # Maximum number of gamepads supported
|
32
|
+
MAX_GAMEPAD_AXIS = 8 # Maximum number of axis supported (per gamepad)
|
33
|
+
MAX_GAMEPAD_BUTTONS = 32 # Maximum number of buttons supported (per gamepad)
|
34
|
+
MAX_TOUCH_POINTS = 8 # Maximum number of touch points supported
|
35
|
+
MAX_KEY_PRESSED_QUEUE = 16 # Maximum number of keys in the key input queue
|
36
|
+
MAX_CHAR_PRESSED_QUEUE = 16 # Maximum number of characters in the char input queue
|
37
|
+
MAX_DECOMPRESSION_SIZE = 64 # Max size allocated for decompression in MB
|
38
|
+
RL_DEFAULT_BATCH_BUFFERS = 1 # Default number of batch buffers (multi-buffering)
|
39
|
+
RL_DEFAULT_BATCH_DRAWCALLS = 256 # Default number of batch draw calls (by state changes: mode, texture)
|
40
|
+
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
41
|
+
RL_MAX_MATRIX_STACK_SIZE = 32 # Maximum size of internal Matrix stack
|
42
|
+
RL_MAX_SHADER_LOCATIONS = 32 # Maximum number of shader locations supported
|
43
|
+
RL_CULL_DISTANCE_NEAR = 0.01 # Default projection matrix near cull distance
|
44
|
+
RL_CULL_DISTANCE_FAR = 1000.0 # Default projection matrix far cull distance
|
45
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition" # Bound by default to shader location: 0
|
46
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord" # Bound by default to shader location: 1
|
47
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal" # Bound by default to shader location: 2
|
48
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor" # Bound by default to shader location: 3
|
49
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent" # Bound by default to shader location: 4
|
50
|
+
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2" # Bound by default to shader location: 5
|
51
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp" # model-view-projection matrix
|
52
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView" # view matrix
|
54
53
|
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"
|
54
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel" # model matrix
|
55
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal" # normal matrix (transpose(inverse(matModelView))
|
56
|
+
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse" # color diffuse (base tint color, multiplied by texture color)
|
57
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0" # texture0 (texture slot active 0)
|
58
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1" # texture1 (texture slot active 1)
|
59
|
+
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2" # texture2 (texture slot active 2)
|
61
60
|
SUPPORT_QUADS_DRAW_MODE = 1
|
62
61
|
SUPPORT_FILEFORMAT_PNG = 1
|
63
62
|
SUPPORT_FILEFORMAT_GIF = 1
|
@@ -71,8 +70,8 @@ module Raylib
|
|
71
70
|
SUPPORT_FILEFORMAT_FNT = 1
|
72
71
|
SUPPORT_FILEFORMAT_TTF = 1
|
73
72
|
SUPPORT_TEXT_MANIPULATION = 1
|
74
|
-
MAX_TEXT_BUFFER_LENGTH = 1024
|
75
|
-
MAX_TEXTSPLIT_COUNT = 128
|
73
|
+
MAX_TEXT_BUFFER_LENGTH = 1024 # Size of internal static buffers used on some functions:
|
74
|
+
MAX_TEXTSPLIT_COUNT = 128 # Maximum number of substrings to split: TextSplit()
|
76
75
|
SUPPORT_FILEFORMAT_OBJ = 1
|
77
76
|
SUPPORT_FILEFORMAT_MTL = 1
|
78
77
|
SUPPORT_FILEFORMAT_IQM = 1
|
@@ -80,19 +79,20 @@ module Raylib
|
|
80
79
|
SUPPORT_FILEFORMAT_VOX = 1
|
81
80
|
SUPPORT_FILEFORMAT_M3D = 1
|
82
81
|
SUPPORT_MESH_GENERATION = 1
|
83
|
-
MAX_MATERIAL_MAPS = 12
|
84
|
-
MAX_MESH_VERTEX_BUFFERS = 7
|
82
|
+
MAX_MATERIAL_MAPS = 12 # Maximum number of shader maps supported
|
83
|
+
MAX_MESH_VERTEX_BUFFERS = 7 # Maximum vertex buffers (VBO) per mesh
|
85
84
|
SUPPORT_FILEFORMAT_WAV = 1
|
86
85
|
SUPPORT_FILEFORMAT_OGG = 1
|
86
|
+
SUPPORT_FILEFORMAT_MP3 = 1
|
87
|
+
SUPPORT_FILEFORMAT_QOA = 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
|
data/lib/raylib.rb
CHANGED
@@ -7,6 +7,7 @@ require 'fileutils'
|
|
7
7
|
require_relative 'raylib_main'
|
8
8
|
require_relative 'config'
|
9
9
|
require_relative 'raymath'
|
10
|
+
require_relative 'rcamera'
|
10
11
|
require_relative 'rlgl'
|
11
12
|
require_relative 'raygui'
|
12
13
|
require_relative 'physac'
|
@@ -31,6 +32,7 @@ module Raylib
|
|
31
32
|
def self.setup_symbols
|
32
33
|
setup_raylib_symbols
|
33
34
|
setup_raymath_symbols
|
35
|
+
setup_rcamera_symbols
|
34
36
|
setup_rlgl_symbols
|
35
37
|
end
|
36
38
|
|