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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bcee871c5ee2ff88b9da5aa1b5d4728f4fc354bc0d49c3420676bff37d7c0d9
4
- data.tar.gz: bf012b9633b4634a3af04d203ad0fe6f378693154c83b3d5f913e7c9540fbf58
3
+ metadata.gz: 5397ef38987b34a564b3414cf0c5999dbac9e49221d36c570bc099a6c4b2d19b
4
+ data.tar.gz: ca9ef0156d1e632f40e4d984511a954d69650fd94a47479d18799d8632d7d63c
5
5
  SHA512:
6
- metadata.gz: b24432fed4db03f9291795bd0cc7a04131daf5ad1fb39cf4cf62478f4dac1a018609d1159838672b8f829245364215d662997da106c8a7368d4685a765784607
7
- data.tar.gz: 31e53a0236351958d656bb0493b926ba294635672f241123ca30488b592e2fdf9d17da17077c053241902059205b374d8d432e7a1bf6cb1d0b5027a09e6c1d60
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-01-28
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.0 (2022-12-25 revision a528908271) [arm64-darwin21]
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
- ## Project ##
123
+ ## Projects ##
123
124
 
124
- See the project below to learn how to use this library:
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
- Raylib.load_lib(shared_lib_path + 'libraylib.so', raygui_libpath: shared_lib_path + 'raygui.so', physac_libpath: shared_lib_path + 'physac.so')
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
- SetCameraMode(camera, CAMERA_FREE)
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
- SetCameraMode(camera, auto_rotate ? CAMERA_ORBITAL : CAMERA_FREE)
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 # WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures
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 # 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
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" # 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)
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 # Size of internal static buffers used on some functions:
75
- MAX_TEXTSPLIT_COUNT = 128 # Maximum number of substrings to split: TextSplit()
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 # Maximum number of shader maps supported
84
- MAX_MESH_VERTEX_BUFFERS = 7 # Maximum vertex buffers (VBO) per mesh
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
- 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
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 # Max length of one trace-log message
96
+ MAX_TRACELOG_MSG_LENGTH = 128 # Max length of one trace-log message
97
97
 
98
98
  end
Binary file
data/lib/libraylib.dll CHANGED
Binary file
data/lib/libraylib.dylib CHANGED
Binary file
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 # 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
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, # Vertex count (positions and normals)
58
+ :vertexCount, :uint, # Vertex count (positions and normals)
51
59
  :positions, [Vector2, 24], # Vertex positions vectors
52
- :normals, [Vector2, 24], # Vertex normals vectors
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, # Shape type (circle or polygon)
59
- :body, :pointer, # Shape physics body data 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, # Shape radius (used for circle shapes)
62
- :transform, Matrix2x2, # Vertices transform matrix 2x2
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, # 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)
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, # 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)
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, # 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)
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, # 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
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, # Mixed static friction during collision
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
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 # Used also for: LABELBUTTON
36
+ LABEL = 1 # Used also for: LABELBUTTON
37
37
  BUTTON = 2
38
- TOGGLE = 3 # Used also for: TOGGLEGROUP
39
- SLIDER = 4 # Used also for: SLIDERBAR
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 # Used also for: TEXTBOXMULTI
44
+ TEXTBOX = 9 # Used also for: TEXTBOXMULTI
45
45
  VALUEBOX = 10
46
- SPINNER = 11 # Uses: BUTTON, VALUEBOX
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 # Text size (glyphs max height)
74
- TEXT_SPACING = 17 # Text spacing between glyphs
75
- LINE_COLOR = 18 # Line control color
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 # Slider size of internal bar
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 # ComboBox right button width
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 # DropdownBox arrow separation from border and items
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 # Spinner left/right buttons width
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 # ListView items height
126
+ LIST_ITEMS_HEIGHT = 16 # ListView items height
127
127
  LIST_ITEMS_SPACING = 17 # ListView items separation
128
- SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
129
- SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
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 # 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
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