raylib 4.5.0.alpha1
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 +7 -0
- data/LICENSE.txt +16 -0
- data/README.md +97 -0
- data/lib/raylib/core/callbacks.rb +19 -0
- data/lib/raylib/core/colors.rb +32 -0
- data/lib/raylib/core/enums.rb +694 -0
- data/lib/raylib/core/functions.rb +1552 -0
- data/lib/raylib/core/structs/audio_stream.rb +71 -0
- data/lib/raylib/core/structs/bone_info.rb +38 -0
- data/lib/raylib/core/structs/bounding_box.rb +38 -0
- data/lib/raylib/core/structs/camera2_d.rb +60 -0
- data/lib/raylib/core/structs/camera3_d.rb +74 -0
- data/lib/raylib/core/structs/color.rb +60 -0
- data/lib/raylib/core/structs/file_path_list.rb +51 -0
- data/lib/raylib/core/structs/font.rb +82 -0
- data/lib/raylib/core/structs/glyph_info.rb +71 -0
- data/lib/raylib/core/structs/image.rb +71 -0
- data/lib/raylib/core/structs/material.rb +49 -0
- data/lib/raylib/core/structs/material_map.rb +49 -0
- data/lib/raylib/core/structs/matrix.rb +192 -0
- data/lib/raylib/core/structs/mesh.rb +181 -0
- data/lib/raylib/core/structs/model.rb +115 -0
- data/lib/raylib/core/structs/model_animation.rb +60 -0
- data/lib/raylib/core/structs/music.rb +71 -0
- data/lib/raylib/core/structs/n_patch_info.rb +82 -0
- data/lib/raylib/core/structs/ray.rb +38 -0
- data/lib/raylib/core/structs/ray_collision.rb +60 -0
- data/lib/raylib/core/structs/rectangle.rb +60 -0
- data/lib/raylib/core/structs/render_texture.rb +52 -0
- data/lib/raylib/core/structs/shader.rb +38 -0
- data/lib/raylib/core/structs/sound.rb +38 -0
- data/lib/raylib/core/structs/texture.rb +77 -0
- data/lib/raylib/core/structs/transform.rb +49 -0
- data/lib/raylib/core/structs/vector2.rb +38 -0
- data/lib/raylib/core/structs/vector3.rb +49 -0
- data/lib/raylib/core/structs/vector4.rb +63 -0
- data/lib/raylib/core/structs/vr_device_info.rb +126 -0
- data/lib/raylib/core/structs/vr_stereo_config.rb +104 -0
- data/lib/raylib/core/structs/wave.rb +71 -0
- data/lib/raylib/core/structs.rb +32 -0
- data/lib/raylib/core.rb +5 -0
- data/lib/raylib/dsl.rb +2 -0
- data/lib/raylib/raymath/functions.rb +337 -0
- data/lib/raylib/raymath/structs/float16.rb +27 -0
- data/lib/raylib/raymath/structs/float3.rb +27 -0
- data/lib/raylib/raymath/structs.rb +2 -0
- data/lib/raylib/raymath.rb +2 -0
- data/lib/raylib/rlgl/callbacks.rb +4 -0
- data/lib/raylib/rlgl/enums.rb +270 -0
- data/lib/raylib/rlgl/functions.rb +448 -0
- data/lib/raylib/rlgl/structs/rl_draw_call.rb +60 -0
- data/lib/raylib/rlgl/structs/rl_render_batch.rb +82 -0
- data/lib/raylib/rlgl/structs/rl_vertex_buffer.rb +93 -0
- data/lib/raylib/rlgl/structs.rb +3 -0
- data/lib/raylib/rlgl.rb +4 -0
- data/lib/raylib/version.rb +5 -0
- data/lib/raylib.rb +12 -0
- metadata +162 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
module Raylib
|
2
|
+
# VrDeviceInfo, Head-Mounted-Display device parameters
|
3
|
+
class VrDeviceInfo < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:hResolution, :int, # Horizontal resolution in pixels,
|
6
|
+
:vResolution, :int, # Vertical resolution in pixels,
|
7
|
+
:hScreenSize, :float, # Horizontal size in meters,
|
8
|
+
:vScreenSize, :float, # Vertical size in meters,
|
9
|
+
:vScreenCenter, :float, # Screen center in meters,
|
10
|
+
:eyeToScreenDistance, :float, # Distance between eye and display in meters,
|
11
|
+
:lensSeparationDistance, :float, # Lens separation distance in meters,
|
12
|
+
:interpupillaryDistance, :float, # IPD (distance between pupils) in meters,
|
13
|
+
:lensDistortionValues, [:float, 4], # Lens distortion constant parameters,
|
14
|
+
:chromaAbCorrection, [:float, 4], # Chromatic aberration correction parameters
|
15
|
+
)
|
16
|
+
|
17
|
+
def self.create(h_resolution, v_resolution, h_screen_size, v_screen_size, v_screen_center, eye_to_screen_distance, lens_separation_distance, interpupillary_distance, lens_distortion_values, chroma_ab_correction)
|
18
|
+
new.tap do |instance|
|
19
|
+
instance[:hResolution] = h_resolution
|
20
|
+
instance[:vResolution] = v_resolution
|
21
|
+
instance[:hScreenSize] = h_screen_size
|
22
|
+
instance[:vScreenSize] = v_screen_size
|
23
|
+
instance[:vScreenCenter] = v_screen_center
|
24
|
+
instance[:eyeToScreenDistance] = eye_to_screen_distance
|
25
|
+
instance[:lensSeparationDistance] = lens_separation_distance
|
26
|
+
instance[:interpupillaryDistance] = interpupillary_distance
|
27
|
+
instance[:lensDistortionValues] = lens_distortion_values
|
28
|
+
instance[:chromaAbCorrection] = chroma_ab_correction
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_s
|
33
|
+
"Raylib::VrDeviceInfo##{object_id} h_resolution=#{h_resolution} v_resolution=#{v_resolution} h_screen_size=#{h_screen_size} v_screen_size=#{v_screen_size} v_screen_center=#{v_screen_center} eye_to_screen_distance=#{eye_to_screen_distance} lens_separation_distance=#{lens_separation_distance} interpupillary_distance=#{interpupillary_distance} lens_distortion_values=#{lens_distortion_values} chroma_ab_correction=#{chroma_ab_correction}"
|
34
|
+
end
|
35
|
+
|
36
|
+
# Horizontal resolution in pixels
|
37
|
+
# @return [Integer] hResolution
|
38
|
+
def h_resolution = self[:hResolution]
|
39
|
+
|
40
|
+
# Sets Horizontal resolution in pixels
|
41
|
+
def h_resolution=(new_h_resolution)
|
42
|
+
self[:hResolution] = new_h_resolution
|
43
|
+
end
|
44
|
+
|
45
|
+
# Vertical resolution in pixels
|
46
|
+
# @return [Integer] vResolution
|
47
|
+
def v_resolution = self[:vResolution]
|
48
|
+
|
49
|
+
# Sets Vertical resolution in pixels
|
50
|
+
def v_resolution=(new_v_resolution)
|
51
|
+
self[:vResolution] = new_v_resolution
|
52
|
+
end
|
53
|
+
|
54
|
+
# Horizontal size in meters
|
55
|
+
# @return [Float] hScreenSize
|
56
|
+
def h_screen_size = self[:hScreenSize]
|
57
|
+
|
58
|
+
# Sets Horizontal size in meters
|
59
|
+
def h_screen_size=(new_h_screen_size)
|
60
|
+
self[:hScreenSize] = new_h_screen_size
|
61
|
+
end
|
62
|
+
|
63
|
+
# Vertical size in meters
|
64
|
+
# @return [Float] vScreenSize
|
65
|
+
def v_screen_size = self[:vScreenSize]
|
66
|
+
|
67
|
+
# Sets Vertical size in meters
|
68
|
+
def v_screen_size=(new_v_screen_size)
|
69
|
+
self[:vScreenSize] = new_v_screen_size
|
70
|
+
end
|
71
|
+
|
72
|
+
# Screen center in meters
|
73
|
+
# @return [Float] vScreenCenter
|
74
|
+
def v_screen_center = self[:vScreenCenter]
|
75
|
+
|
76
|
+
# Sets Screen center in meters
|
77
|
+
def v_screen_center=(new_v_screen_center)
|
78
|
+
self[:vScreenCenter] = new_v_screen_center
|
79
|
+
end
|
80
|
+
|
81
|
+
# Distance between eye and display in meters
|
82
|
+
# @return [Float] eyeToScreenDistance
|
83
|
+
def eye_to_screen_distance = self[:eyeToScreenDistance]
|
84
|
+
|
85
|
+
# Sets Distance between eye and display in meters
|
86
|
+
def eye_to_screen_distance=(new_eye_to_screen_distance)
|
87
|
+
self[:eyeToScreenDistance] = new_eye_to_screen_distance
|
88
|
+
end
|
89
|
+
|
90
|
+
# Lens separation distance in meters
|
91
|
+
# @return [Float] lensSeparationDistance
|
92
|
+
def lens_separation_distance = self[:lensSeparationDistance]
|
93
|
+
|
94
|
+
# Sets Lens separation distance in meters
|
95
|
+
def lens_separation_distance=(new_lens_separation_distance)
|
96
|
+
self[:lensSeparationDistance] = new_lens_separation_distance
|
97
|
+
end
|
98
|
+
|
99
|
+
# IPD (distance between pupils) in meters
|
100
|
+
# @return [Float] interpupillaryDistance
|
101
|
+
def interpupillary_distance = self[:interpupillaryDistance]
|
102
|
+
|
103
|
+
# Sets IPD (distance between pupils) in meters
|
104
|
+
def interpupillary_distance=(new_interpupillary_distance)
|
105
|
+
self[:interpupillaryDistance] = new_interpupillary_distance
|
106
|
+
end
|
107
|
+
|
108
|
+
# Lens distortion constant parameters
|
109
|
+
# @return [float[4]] lensDistortionValues
|
110
|
+
def lens_distortion_values = self[:lensDistortionValues]
|
111
|
+
|
112
|
+
# Sets Lens distortion constant parameters
|
113
|
+
def lens_distortion_values=(new_lens_distortion_values)
|
114
|
+
self[:lensDistortionValues] = new_lens_distortion_values
|
115
|
+
end
|
116
|
+
|
117
|
+
# Chromatic aberration correction parameters
|
118
|
+
# @return [float[4]] chromaAbCorrection
|
119
|
+
def chroma_ab_correction = self[:chromaAbCorrection]
|
120
|
+
|
121
|
+
# Sets Chromatic aberration correction parameters
|
122
|
+
def chroma_ab_correction=(new_chroma_ab_correction)
|
123
|
+
self[:chromaAbCorrection] = new_chroma_ab_correction
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Raylib
|
2
|
+
# VrStereoConfig, VR stereo rendering configuration for simulator
|
3
|
+
class VrStereoConfig < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:projection, [Matrix, 2], # VR projection matrices (per eye),
|
6
|
+
:viewOffset, [Matrix, 2], # VR view offset matrices (per eye),
|
7
|
+
:leftLensCenter, [:float, 2], # VR left lens center,
|
8
|
+
:rightLensCenter, [:float, 2], # VR right lens center,
|
9
|
+
:leftScreenCenter, [:float, 2], # VR left screen center,
|
10
|
+
:rightScreenCenter, [:float, 2], # VR right screen center,
|
11
|
+
:scale, [:float, 2], # VR distortion scale,
|
12
|
+
:scaleIn, [:float, 2], # VR distortion scale in
|
13
|
+
)
|
14
|
+
|
15
|
+
def self.create(projection, view_offset, left_lens_center, right_lens_center, left_screen_center, right_screen_center, scale, scale_in)
|
16
|
+
new.tap do |instance|
|
17
|
+
instance[:projection] = projection
|
18
|
+
instance[:viewOffset] = view_offset
|
19
|
+
instance[:leftLensCenter] = left_lens_center
|
20
|
+
instance[:rightLensCenter] = right_lens_center
|
21
|
+
instance[:leftScreenCenter] = left_screen_center
|
22
|
+
instance[:rightScreenCenter] = right_screen_center
|
23
|
+
instance[:scale] = scale
|
24
|
+
instance[:scaleIn] = scale_in
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_s
|
29
|
+
"Raylib::VrStereoConfig##{object_id} projection=#{projection} view_offset=#{view_offset} left_lens_center=#{left_lens_center} right_lens_center=#{right_lens_center} left_screen_center=#{left_screen_center} right_screen_center=#{right_screen_center} scale=#{scale} scale_in=#{scale_in}"
|
30
|
+
end
|
31
|
+
|
32
|
+
# VR projection matrices (per eye)
|
33
|
+
# @return [Matrix[2]] projection
|
34
|
+
def projection = self[:projection]
|
35
|
+
|
36
|
+
# Sets VR projection matrices (per eye)
|
37
|
+
def projection=(new_projection)
|
38
|
+
self[:projection] = new_projection
|
39
|
+
end
|
40
|
+
|
41
|
+
# VR view offset matrices (per eye)
|
42
|
+
# @return [Matrix[2]] viewOffset
|
43
|
+
def view_offset = self[:viewOffset]
|
44
|
+
|
45
|
+
# Sets VR view offset matrices (per eye)
|
46
|
+
def view_offset=(new_view_offset)
|
47
|
+
self[:viewOffset] = new_view_offset
|
48
|
+
end
|
49
|
+
|
50
|
+
# VR left lens center
|
51
|
+
# @return [float[2]] leftLensCenter
|
52
|
+
def left_lens_center = self[:leftLensCenter]
|
53
|
+
|
54
|
+
# Sets VR left lens center
|
55
|
+
def left_lens_center=(new_left_lens_center)
|
56
|
+
self[:leftLensCenter] = new_left_lens_center
|
57
|
+
end
|
58
|
+
|
59
|
+
# VR right lens center
|
60
|
+
# @return [float[2]] rightLensCenter
|
61
|
+
def right_lens_center = self[:rightLensCenter]
|
62
|
+
|
63
|
+
# Sets VR right lens center
|
64
|
+
def right_lens_center=(new_right_lens_center)
|
65
|
+
self[:rightLensCenter] = new_right_lens_center
|
66
|
+
end
|
67
|
+
|
68
|
+
# VR left screen center
|
69
|
+
# @return [float[2]] leftScreenCenter
|
70
|
+
def left_screen_center = self[:leftScreenCenter]
|
71
|
+
|
72
|
+
# Sets VR left screen center
|
73
|
+
def left_screen_center=(new_left_screen_center)
|
74
|
+
self[:leftScreenCenter] = new_left_screen_center
|
75
|
+
end
|
76
|
+
|
77
|
+
# VR right screen center
|
78
|
+
# @return [float[2]] rightScreenCenter
|
79
|
+
def right_screen_center = self[:rightScreenCenter]
|
80
|
+
|
81
|
+
# Sets VR right screen center
|
82
|
+
def right_screen_center=(new_right_screen_center)
|
83
|
+
self[:rightScreenCenter] = new_right_screen_center
|
84
|
+
end
|
85
|
+
|
86
|
+
# VR distortion scale
|
87
|
+
# @return [float[2]] scale
|
88
|
+
def scale = self[:scale]
|
89
|
+
|
90
|
+
# Sets VR distortion scale
|
91
|
+
def scale=(new_scale)
|
92
|
+
self[:scale] = new_scale
|
93
|
+
end
|
94
|
+
|
95
|
+
# VR distortion scale in
|
96
|
+
# @return [float[2]] scaleIn
|
97
|
+
def scale_in = self[:scaleIn]
|
98
|
+
|
99
|
+
# Sets VR distortion scale in
|
100
|
+
def scale_in=(new_scale_in)
|
101
|
+
self[:scaleIn] = new_scale_in
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Raylib
|
2
|
+
# Wave, audio wave data
|
3
|
+
class Wave < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:frameCount, :uint, # Total number of frames (considering channels),
|
6
|
+
:sampleRate, :uint, # Frequency (samples per second),
|
7
|
+
:sampleSize, :uint, # Bit depth (bits per sample): 8, 16, 32 (24 not supported),
|
8
|
+
:channels, :uint, # Number of channels (1-mono, 2-stereo, ...),
|
9
|
+
:data, :pointer, # Buffer data pointer
|
10
|
+
)
|
11
|
+
|
12
|
+
def self.create(frame_count, sample_rate, sample_size, channels, data)
|
13
|
+
new.tap do |instance|
|
14
|
+
instance[:frameCount] = frame_count
|
15
|
+
instance[:sampleRate] = sample_rate
|
16
|
+
instance[:sampleSize] = sample_size
|
17
|
+
instance[:channels] = channels
|
18
|
+
instance[:data] = data
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def to_s
|
23
|
+
"Raylib::Wave##{object_id} frame_count=#{frame_count} sample_rate=#{sample_rate} sample_size=#{sample_size} channels=#{channels} data=#{data}"
|
24
|
+
end
|
25
|
+
|
26
|
+
# Total number of frames (considering channels)
|
27
|
+
# @return [Integer] frameCount
|
28
|
+
def frame_count = self[:frameCount]
|
29
|
+
|
30
|
+
# Sets Total number of frames (considering channels)
|
31
|
+
def frame_count=(new_frame_count)
|
32
|
+
self[:frameCount] = new_frame_count
|
33
|
+
end
|
34
|
+
|
35
|
+
# Frequency (samples per second)
|
36
|
+
# @return [Integer] sampleRate
|
37
|
+
def sample_rate = self[:sampleRate]
|
38
|
+
|
39
|
+
# Sets Frequency (samples per second)
|
40
|
+
def sample_rate=(new_sample_rate)
|
41
|
+
self[:sampleRate] = new_sample_rate
|
42
|
+
end
|
43
|
+
|
44
|
+
# Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
45
|
+
# @return [Integer] sampleSize
|
46
|
+
def sample_size = self[:sampleSize]
|
47
|
+
|
48
|
+
# Sets Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
49
|
+
def sample_size=(new_sample_size)
|
50
|
+
self[:sampleSize] = new_sample_size
|
51
|
+
end
|
52
|
+
|
53
|
+
# Number of channels (1-mono, 2-stereo, ...)
|
54
|
+
# @return [Integer] channels
|
55
|
+
def channels = self[:channels]
|
56
|
+
|
57
|
+
# Sets Number of channels (1-mono, 2-stereo, ...)
|
58
|
+
def channels=(new_channels)
|
59
|
+
self[:channels] = new_channels
|
60
|
+
end
|
61
|
+
|
62
|
+
# Buffer data pointer
|
63
|
+
# @return [void *] data
|
64
|
+
def data = self[:data]
|
65
|
+
|
66
|
+
# Sets Buffer data pointer
|
67
|
+
def data=(new_data)
|
68
|
+
self[:data] = new_data
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'raylib/core/structs/vector2'
|
2
|
+
require 'raylib/core/structs/vector3'
|
3
|
+
require 'raylib/core/structs/vector4'
|
4
|
+
require 'raylib/core/structs/matrix'
|
5
|
+
require 'raylib/core/structs/color'
|
6
|
+
require 'raylib/core/structs/rectangle'
|
7
|
+
require 'raylib/core/structs/image'
|
8
|
+
require 'raylib/core/structs/texture'
|
9
|
+
require 'raylib/core/structs/render_texture'
|
10
|
+
require 'raylib/core/structs/n_patch_info'
|
11
|
+
require 'raylib/core/structs/glyph_info'
|
12
|
+
require 'raylib/core/structs/font'
|
13
|
+
require 'raylib/core/structs/camera3_d'
|
14
|
+
require 'raylib/core/structs/camera2_d'
|
15
|
+
require 'raylib/core/structs/mesh'
|
16
|
+
require 'raylib/core/structs/shader'
|
17
|
+
require 'raylib/core/structs/material_map'
|
18
|
+
require 'raylib/core/structs/material'
|
19
|
+
require 'raylib/core/structs/transform'
|
20
|
+
require 'raylib/core/structs/bone_info'
|
21
|
+
require 'raylib/core/structs/model'
|
22
|
+
require 'raylib/core/structs/model_animation'
|
23
|
+
require 'raylib/core/structs/ray'
|
24
|
+
require 'raylib/core/structs/ray_collision'
|
25
|
+
require 'raylib/core/structs/bounding_box'
|
26
|
+
require 'raylib/core/structs/wave'
|
27
|
+
require 'raylib/core/structs/audio_stream'
|
28
|
+
require 'raylib/core/structs/sound'
|
29
|
+
require 'raylib/core/structs/music'
|
30
|
+
require 'raylib/core/structs/vr_device_info'
|
31
|
+
require 'raylib/core/structs/vr_stereo_config'
|
32
|
+
require 'raylib/core/structs/file_path_list'
|
data/lib/raylib/core.rb
ADDED
data/lib/raylib/dsl.rb
ADDED
@@ -0,0 +1,337 @@
|
|
1
|
+
module Raylib
|
2
|
+
# Clamp float value
|
3
|
+
attach_function :clamp, :Clamp, [:float, :float, :float], :float
|
4
|
+
|
5
|
+
# Calculate linear interpolation between two floats
|
6
|
+
attach_function :lerp, :Lerp, [:float, :float, :float], :float
|
7
|
+
|
8
|
+
# Normalize input value within input range
|
9
|
+
attach_function :normalize, :Normalize, [:float, :float, :float], :float
|
10
|
+
|
11
|
+
# Remap input value within input range to output range
|
12
|
+
attach_function :remap, :Remap, [:float, :float, :float, :float, :float], :float
|
13
|
+
|
14
|
+
# Wrap input value from min to max
|
15
|
+
attach_function :wrap, :Wrap, [:float, :float, :float], :float
|
16
|
+
|
17
|
+
# Check whether two given floats are almost equal
|
18
|
+
attach_function :float_equals, :FloatEquals, [:float, :float], :int
|
19
|
+
|
20
|
+
# Vector with components value 0.0f
|
21
|
+
attach_function :vector2_zero, :Vector2Zero, [], Vector2.by_value
|
22
|
+
|
23
|
+
# Vector with components value 1.0f
|
24
|
+
attach_function :vector2_one, :Vector2One, [], Vector2.by_value
|
25
|
+
|
26
|
+
# Add two vectors (v1 + v2)
|
27
|
+
attach_function :vector2_add, :Vector2Add, [Vector2.by_value, Vector2.by_value], Vector2.by_value
|
28
|
+
|
29
|
+
# Add vector and float value
|
30
|
+
attach_function :vector2_add_value, :Vector2AddValue, [Vector2.by_value, :float], Vector2.by_value
|
31
|
+
|
32
|
+
# Subtract two vectors (v1 - v2)
|
33
|
+
attach_function :vector2_subtract, :Vector2Subtract, [Vector2.by_value, Vector2.by_value], Vector2.by_value
|
34
|
+
|
35
|
+
# Subtract vector by float value
|
36
|
+
attach_function :vector2_subtract_value, :Vector2SubtractValue, [Vector2.by_value, :float], Vector2.by_value
|
37
|
+
|
38
|
+
# Calculate vector length
|
39
|
+
attach_function :vector2_length, :Vector2Length, [Vector2.by_value], :float
|
40
|
+
|
41
|
+
# Calculate vector square length
|
42
|
+
attach_function :vector2_length_sqr, :Vector2LengthSqr, [Vector2.by_value], :float
|
43
|
+
|
44
|
+
# Calculate two vectors dot product
|
45
|
+
attach_function :vector2_dot_product, :Vector2DotProduct, [Vector2.by_value, Vector2.by_value], :float
|
46
|
+
|
47
|
+
# Calculate distance between two vectors
|
48
|
+
attach_function :vector2_distance, :Vector2Distance, [Vector2.by_value, Vector2.by_value], :float
|
49
|
+
|
50
|
+
# Calculate square distance between two vectors
|
51
|
+
attach_function :vector2_distance_sqr, :Vector2DistanceSqr, [Vector2.by_value, Vector2.by_value], :float
|
52
|
+
|
53
|
+
# Calculate angle between two vectors
|
54
|
+
attach_function :vector2_angle, :Vector2Angle, [Vector2.by_value, Vector2.by_value], :float
|
55
|
+
|
56
|
+
# Calculate angle defined by a two vectors line
|
57
|
+
attach_function :vector2_line_angle, :Vector2LineAngle, [Vector2.by_value, Vector2.by_value], :float
|
58
|
+
|
59
|
+
# Scale vector (multiply by value)
|
60
|
+
attach_function :vector2_scale, :Vector2Scale, [Vector2.by_value, :float], Vector2.by_value
|
61
|
+
|
62
|
+
# Multiply vector by vector
|
63
|
+
attach_function :vector2_multiply, :Vector2Multiply, [Vector2.by_value, Vector2.by_value], Vector2.by_value
|
64
|
+
|
65
|
+
# Negate vector
|
66
|
+
attach_function :vector2_negate, :Vector2Negate, [Vector2.by_value], Vector2.by_value
|
67
|
+
|
68
|
+
# Divide vector by vector
|
69
|
+
attach_function :vector2_divide, :Vector2Divide, [Vector2.by_value, Vector2.by_value], Vector2.by_value
|
70
|
+
|
71
|
+
# Normalize provided vector
|
72
|
+
attach_function :vector2_normalize, :Vector2Normalize, [Vector2.by_value], Vector2.by_value
|
73
|
+
|
74
|
+
# Transforms a Vector2 by a given Matrix
|
75
|
+
attach_function :vector2_transform, :Vector2Transform, [Vector2.by_value, Matrix.by_value], Vector2.by_value
|
76
|
+
|
77
|
+
# Calculate linear interpolation between two vectors
|
78
|
+
attach_function :vector2_lerp, :Vector2Lerp, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value
|
79
|
+
|
80
|
+
# Calculate reflected vector to normal
|
81
|
+
attach_function :vector2_reflect, :Vector2Reflect, [Vector2.by_value, Vector2.by_value], Vector2.by_value
|
82
|
+
|
83
|
+
# Rotate vector by angle
|
84
|
+
attach_function :vector2_rotate, :Vector2Rotate, [Vector2.by_value, :float], Vector2.by_value
|
85
|
+
|
86
|
+
# Move Vector towards target
|
87
|
+
attach_function :vector2_move_towards, :Vector2MoveTowards, [Vector2.by_value, Vector2.by_value, :float], Vector2.by_value
|
88
|
+
|
89
|
+
# Invert the given vector
|
90
|
+
attach_function :vector2_invert, :Vector2Invert, [Vector2.by_value], Vector2.by_value
|
91
|
+
|
92
|
+
# Clamp the components of the vector between min and max values specified by the given vectors
|
93
|
+
attach_function :vector2_clamp, :Vector2Clamp, [Vector2.by_value, Vector2.by_value, Vector2.by_value], Vector2.by_value
|
94
|
+
|
95
|
+
# Clamp the magnitude of the vector between two values
|
96
|
+
attach_function :vector2_clamp_value, :Vector2ClampValue, [Vector2.by_value, :float, :float], Vector2.by_value
|
97
|
+
|
98
|
+
# Check whether two given vectors are almost equal
|
99
|
+
attach_function :vector2_equals, :Vector2Equals, [Vector2.by_value, Vector2.by_value], :int
|
100
|
+
|
101
|
+
# Vector with components value 0.0f
|
102
|
+
attach_function :vector3_zero, :Vector3Zero, [], Vector3.by_value
|
103
|
+
|
104
|
+
# Vector with components value 1.0f
|
105
|
+
attach_function :vector3_one, :Vector3One, [], Vector3.by_value
|
106
|
+
|
107
|
+
# Add two vectors
|
108
|
+
attach_function :vector3_add, :Vector3Add, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
109
|
+
|
110
|
+
# Add vector and float value
|
111
|
+
attach_function :vector3_add_value, :Vector3AddValue, [Vector3.by_value, :float], Vector3.by_value
|
112
|
+
|
113
|
+
# Subtract two vectors
|
114
|
+
attach_function :vector3_subtract, :Vector3Subtract, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
115
|
+
|
116
|
+
# Subtract vector by float value
|
117
|
+
attach_function :vector3_subtract_value, :Vector3SubtractValue, [Vector3.by_value, :float], Vector3.by_value
|
118
|
+
|
119
|
+
# Multiply vector by scalar
|
120
|
+
attach_function :vector3_scale, :Vector3Scale, [Vector3.by_value, :float], Vector3.by_value
|
121
|
+
|
122
|
+
# Multiply vector by vector
|
123
|
+
attach_function :vector3_multiply, :Vector3Multiply, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
124
|
+
|
125
|
+
# Calculate two vectors cross product
|
126
|
+
attach_function :vector3_cross_product, :Vector3CrossProduct, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
127
|
+
|
128
|
+
# Calculate one vector perpendicular vector
|
129
|
+
attach_function :vector3_perpendicular, :Vector3Perpendicular, [Vector3.by_value], Vector3.by_value
|
130
|
+
|
131
|
+
# Calculate vector length
|
132
|
+
attach_function :vector3_length, :Vector3Length, [Vector3], :float
|
133
|
+
|
134
|
+
# Calculate vector square length
|
135
|
+
attach_function :vector3_length_sqr, :Vector3LengthSqr, [Vector3], :float
|
136
|
+
|
137
|
+
# Calculate two vectors dot product
|
138
|
+
attach_function :vector3_dot_product, :Vector3DotProduct, [Vector3.by_value, Vector3.by_value], :float
|
139
|
+
|
140
|
+
# Calculate distance between two vectors
|
141
|
+
attach_function :vector3_distance, :Vector3Distance, [Vector3.by_value, Vector3.by_value], :float
|
142
|
+
|
143
|
+
# Calculate square distance between two vectors
|
144
|
+
attach_function :vector3_distance_sqr, :Vector3DistanceSqr, [Vector3.by_value, Vector3.by_value], :float
|
145
|
+
|
146
|
+
# Calculate angle between two vectors
|
147
|
+
attach_function :vector3_angle, :Vector3Angle, [Vector3.by_value, Vector3.by_value], :float
|
148
|
+
|
149
|
+
# Negate provided vector (invert direction)
|
150
|
+
attach_function :vector3_negate, :Vector3Negate, [Vector3.by_value], Vector3.by_value
|
151
|
+
|
152
|
+
# Divide vector by vector
|
153
|
+
attach_function :vector3_divide, :Vector3Divide, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
154
|
+
|
155
|
+
# Normalize provided vector
|
156
|
+
attach_function :vector3_normalize, :Vector3Normalize, [Vector3.by_value], Vector3.by_value
|
157
|
+
|
158
|
+
# Orthonormalize provided vectors
|
159
|
+
attach_function :vector3_ortho_normalize, :Vector3OrthoNormalize, [:pointer, :pointer], :void
|
160
|
+
|
161
|
+
# Transforms a Vector3 by a given Matrix
|
162
|
+
attach_function :vector3_transform, :Vector3Transform, [Vector3.by_value, Matrix.by_value], Vector3.by_value
|
163
|
+
|
164
|
+
# Transform a vector by quaternion rotation
|
165
|
+
attach_function :vector3_rotate_by_quaternion, :Vector3RotateByQuaternion, [Vector3.by_value, Quaternion.by_value], Vector3.by_value
|
166
|
+
|
167
|
+
# Rotates a vector around an axis
|
168
|
+
attach_function :vector3_rotate_by_axis_angle, :Vector3RotateByAxisAngle, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value
|
169
|
+
|
170
|
+
# Calculate linear interpolation between two vectors
|
171
|
+
attach_function :vector3_lerp, :Vector3Lerp, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value
|
172
|
+
|
173
|
+
# Calculate reflected vector to normal
|
174
|
+
attach_function :vector3_reflect, :Vector3Reflect, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
175
|
+
|
176
|
+
# Get min value for each pair of components
|
177
|
+
attach_function :vector3_min, :Vector3Min, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
178
|
+
|
179
|
+
# Get max value for each pair of components
|
180
|
+
attach_function :vector3_max, :Vector3Max, [Vector3.by_value, Vector3.by_value], Vector3.by_value
|
181
|
+
|
182
|
+
# Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
|
183
|
+
attach_function :vector3_barycenter, :Vector3Barycenter, [Vector3.by_value, Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value
|
184
|
+
|
185
|
+
# Projects a Vector3 from screen space into object space
|
186
|
+
attach_function :vector3_unproject, :Vector3Unproject, [Vector3.by_value, Matrix.by_value, Matrix.by_value], Vector3.by_value
|
187
|
+
|
188
|
+
# Get Vector3 as float array
|
189
|
+
attach_function :vector3_to_float_v, :Vector3ToFloatV, [Vector3.by_value], Float3.by_value
|
190
|
+
|
191
|
+
# Invert the given vector
|
192
|
+
attach_function :vector3_invert, :Vector3Invert, [Vector3.by_value], Vector3.by_value
|
193
|
+
|
194
|
+
# Clamp the components of the vector between min and max values specified by the given vectors
|
195
|
+
attach_function :vector3_clamp, :Vector3Clamp, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Vector3.by_value
|
196
|
+
|
197
|
+
# Clamp the magnitude of the vector between two values
|
198
|
+
attach_function :vector3_clamp_value, :Vector3ClampValue, [Vector3.by_value, :float, :float], Vector3.by_value
|
199
|
+
|
200
|
+
# Check whether two given vectors are almost equal
|
201
|
+
attach_function :vector3_equals, :Vector3Equals, [Vector3.by_value, Vector3.by_value], :int
|
202
|
+
|
203
|
+
# Compute the direction of a refracted ray where v specifies the normalized direction of the incoming ray, n specifies the normalized normal vector of the interface of two optical media, and r specifies the ratio of the refractive index of the medium from where the ray comes to the refractive index of the medium on the other side of the surface
|
204
|
+
attach_function :vector3_refract, :Vector3Refract, [Vector3.by_value, Vector3.by_value, :float], Vector3.by_value
|
205
|
+
|
206
|
+
# Compute matrix determinant
|
207
|
+
attach_function :matrix_determinant, :MatrixDeterminant, [Matrix.by_value], :float
|
208
|
+
|
209
|
+
# Get the trace of the matrix (sum of the values along the diagonal)
|
210
|
+
attach_function :matrix_trace, :MatrixTrace, [Matrix.by_value], :float
|
211
|
+
|
212
|
+
# Transposes provided matrix
|
213
|
+
attach_function :matrix_transpose, :MatrixTranspose, [Matrix.by_value], Matrix.by_value
|
214
|
+
|
215
|
+
# Invert provided matrix
|
216
|
+
attach_function :matrix_invert, :MatrixInvert, [Matrix.by_value], Matrix.by_value
|
217
|
+
|
218
|
+
# Get identity matrix
|
219
|
+
attach_function :matrix_identity, :MatrixIdentity, [], Matrix.by_value
|
220
|
+
|
221
|
+
# Add two matrices
|
222
|
+
attach_function :matrix_add, :MatrixAdd, [Matrix.by_value, Matrix.by_value], Matrix.by_value
|
223
|
+
|
224
|
+
# Subtract two matrices (left - right)
|
225
|
+
attach_function :matrix_subtract, :MatrixSubtract, [Matrix.by_value, Matrix.by_value], Matrix.by_value
|
226
|
+
|
227
|
+
# Get two matrix multiplication
|
228
|
+
attach_function :matrix_multiply, :MatrixMultiply, [Matrix.by_value, Matrix.by_value], Matrix.by_value
|
229
|
+
|
230
|
+
# Get translation matrix
|
231
|
+
attach_function :matrix_translate, :MatrixTranslate, [:float, :float, :float], Matrix.by_value
|
232
|
+
|
233
|
+
# Create rotation matrix from axis and angle
|
234
|
+
attach_function :matrix_rotate, :MatrixRotate, [Vector3.by_value, :float], Matrix.by_value
|
235
|
+
|
236
|
+
# Get x-rotation matrix
|
237
|
+
attach_function :matrix_rotate_x, :MatrixRotateX, [:float], Matrix.by_value
|
238
|
+
|
239
|
+
# Get y-rotation matrix
|
240
|
+
attach_function :matrix_rotate_y, :MatrixRotateY, [:float], Matrix.by_value
|
241
|
+
|
242
|
+
# Get z-rotation matrix
|
243
|
+
attach_function :matrix_rotate_z, :MatrixRotateZ, [:float], Matrix.by_value
|
244
|
+
|
245
|
+
# Get xyz-rotation matrix
|
246
|
+
attach_function :matrix_rotate_xyz, :MatrixRotateXYZ, [Vector3.by_value], Matrix.by_value
|
247
|
+
|
248
|
+
# Get zyx-rotation matrix
|
249
|
+
attach_function :matrix_rotate_zyx, :MatrixRotateZYX, [Vector3.by_value], Matrix.by_value
|
250
|
+
|
251
|
+
# Get scaling matrix
|
252
|
+
attach_function :matrix_scale, :MatrixScale, [:float, :float, :float], Matrix.by_value
|
253
|
+
|
254
|
+
# Get perspective projection matrix
|
255
|
+
attach_function :matrix_frustum, :MatrixFrustum, [:double, :double, :double, :double, :double, :double], Matrix.by_value
|
256
|
+
|
257
|
+
# Get perspective projection matrix
|
258
|
+
attach_function :matrix_perspective, :MatrixPerspective, [:double, :double, :double, :double], Matrix.by_value
|
259
|
+
|
260
|
+
# Get orthographic projection matrix
|
261
|
+
attach_function :matrix_ortho, :MatrixOrtho, [:double, :double, :double, :double, :double, :double], Matrix.by_value
|
262
|
+
|
263
|
+
# Get camera look-at matrix (view matrix)
|
264
|
+
attach_function :matrix_look_at, :MatrixLookAt, [Vector3.by_value, Vector3.by_value, Vector3.by_value], Matrix.by_value
|
265
|
+
|
266
|
+
# Get float array of matrix data
|
267
|
+
attach_function :matrix_to_float_v, :MatrixToFloatV, [Matrix.by_value], Float16.by_value
|
268
|
+
|
269
|
+
# Add two quaternions
|
270
|
+
attach_function :quaternion_add, :QuaternionAdd, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value
|
271
|
+
|
272
|
+
# Add quaternion and float value
|
273
|
+
attach_function :quaternion_add_value, :QuaternionAddValue, [Quaternion.by_value, :float], Quaternion.by_value
|
274
|
+
|
275
|
+
# Subtract two quaternions
|
276
|
+
attach_function :quaternion_subtract, :QuaternionSubtract, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value
|
277
|
+
|
278
|
+
# Subtract quaternion and float value
|
279
|
+
attach_function :quaternion_subtract_value, :QuaternionSubtractValue, [Quaternion.by_value, :float], Quaternion.by_value
|
280
|
+
|
281
|
+
# Get identity quaternion
|
282
|
+
attach_function :quaternion_identity, :QuaternionIdentity, [], Quaternion.by_value
|
283
|
+
|
284
|
+
# Computes the length of a quaternion
|
285
|
+
attach_function :quaternion_length, :QuaternionLength, [Quaternion.by_value], :float
|
286
|
+
|
287
|
+
# Normalize provided quaternion
|
288
|
+
attach_function :quaternion_normalize, :QuaternionNormalize, [Quaternion.by_value], Quaternion.by_value
|
289
|
+
|
290
|
+
# Invert provided quaternion
|
291
|
+
attach_function :quaternion_invert, :QuaternionInvert, [Quaternion.by_value], Quaternion.by_value
|
292
|
+
|
293
|
+
# Calculate two quaternion multiplication
|
294
|
+
attach_function :quaternion_multiply, :QuaternionMultiply, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value
|
295
|
+
|
296
|
+
# Scale quaternion by float value
|
297
|
+
attach_function :quaternion_scale, :QuaternionScale, [Quaternion.by_value, :float], Quaternion.by_value
|
298
|
+
|
299
|
+
# Divide two quaternions
|
300
|
+
attach_function :quaternion_divide, :QuaternionDivide, [Quaternion.by_value, Quaternion.by_value], Quaternion.by_value
|
301
|
+
|
302
|
+
# Calculate linear interpolation between two quaternions
|
303
|
+
attach_function :quaternion_lerp, :QuaternionLerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value
|
304
|
+
|
305
|
+
# Calculate slerp-optimized interpolation between two quaternions
|
306
|
+
attach_function :quaternion_nlerp, :QuaternionNlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value
|
307
|
+
|
308
|
+
# Calculates spherical linear interpolation between two quaternions
|
309
|
+
attach_function :quaternion_slerp, :QuaternionSlerp, [Quaternion.by_value, Quaternion.by_value, :float], Quaternion.by_value
|
310
|
+
|
311
|
+
# Calculate quaternion based on the rotation from one vector to another
|
312
|
+
attach_function :quaternion_from_vector3_to_vector3, :QuaternionFromVector3ToVector3, [Vector3.by_value, Vector3.by_value], Quaternion.by_value
|
313
|
+
|
314
|
+
# Get a quaternion for a given rotation matrix
|
315
|
+
attach_function :quaternion_from_matrix, :QuaternionFromMatrix, [Matrix.by_value], Quaternion.by_value
|
316
|
+
|
317
|
+
# Get a matrix for a given quaternion
|
318
|
+
attach_function :quaternion_to_matrix, :QuaternionToMatrix, [Quaternion.by_value], Matrix.by_value
|
319
|
+
|
320
|
+
# Get rotation quaternion for an angle and axis
|
321
|
+
attach_function :quaternion_from_axis_angle, :QuaternionFromAxisAngle, [Vector3.by_value, :float], Quaternion.by_value
|
322
|
+
|
323
|
+
# Get the rotation angle and axis for a given quaternion
|
324
|
+
attach_function :quaternion_to_axis_angle, :QuaternionToAxisAngle, [Quaternion.by_value, :pointer, :pointer], :void
|
325
|
+
|
326
|
+
# Get the quaternion equivalent to Euler angles
|
327
|
+
attach_function :quaternion_from_euler, :QuaternionFromEuler, [:float, :float, :float], Quaternion.by_value
|
328
|
+
|
329
|
+
# Get the Euler angles equivalent to quaternion (roll, pitch, yaw)
|
330
|
+
attach_function :quaternion_to_euler, :QuaternionToEuler, [Quaternion.by_value], Vector3.by_value
|
331
|
+
|
332
|
+
# Transform a quaternion given a transformation matrix
|
333
|
+
attach_function :quaternion_transform, :QuaternionTransform, [Quaternion.by_value, Matrix.by_value], Quaternion.by_value
|
334
|
+
|
335
|
+
# Check whether two given quaternions are almost equal
|
336
|
+
attach_function :quaternion_equals, :QuaternionEquals, [Quaternion.by_value, Quaternion.by_value], :int
|
337
|
+
end
|