Class: Raylib::Mesh
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Mesh
- Defined in:
- lib/raylib/core/structs/mesh.rb
Overview
Mesh, vertex data and vao/vbo
Class Method Summary collapse
Instance Method Summary collapse
-
#anim_normals ⇒ float *
Animated normals (after bones transformations).
-
#anim_normals=(new_anim_normals) ⇒ Object
Sets Animated normals (after bones transformations).
-
#anim_vertices ⇒ float *
Animated vertex positions (after bones transformations).
-
#anim_vertices=(new_anim_vertices) ⇒ Object
Sets Animated vertex positions (after bones transformations).
-
#bone_ids ⇒ unsigned char *
Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning).
-
#bone_ids=(new_bone_ids) ⇒ Object
Sets Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning).
-
#bone_weights ⇒ float *
Vertex bone weight, up to 4 bones influence by vertex (skinning).
-
#bone_weights=(new_bone_weights) ⇒ Object
Sets Vertex bone weight, up to 4 bones influence by vertex (skinning).
-
#colors ⇒ unsigned char *
Vertex colors (RGBA - 4 components per vertex) (shader-location = 3).
-
#colors=(new_colors) ⇒ Object
Sets Vertex colors (RGBA - 4 components per vertex) (shader-location = 3).
-
#indices ⇒ unsigned short *
Vertex indices (in case vertex data comes indexed).
-
#indices=(new_indices) ⇒ Object
Sets Vertex indices (in case vertex data comes indexed).
-
#normals ⇒ float *
Vertex normals (XYZ - 3 components per vertex) (shader-location = 2).
-
#normals=(new_normals) ⇒ Object
Sets Vertex normals (XYZ - 3 components per vertex) (shader-location = 2).
-
#tangents ⇒ float *
Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4).
-
#tangents=(new_tangents) ⇒ Object
Sets Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4).
-
#texcoords ⇒ float *
Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1).
-
#texcoords2 ⇒ float *
Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5).
-
#texcoords2=(new_texcoords2) ⇒ Object
Sets Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5).
-
#texcoords=(new_texcoords) ⇒ Object
Sets Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1).
- #to_s ⇒ Object
-
#triangle_count ⇒ Integer
Number of triangles stored (indexed or not).
-
#triangle_count=(new_triangle_count) ⇒ Object
Sets Number of triangles stored (indexed or not).
-
#vao_id ⇒ Integer
OpenGL Vertex Array Object id.
-
#vao_id=(new_vao_id) ⇒ Object
Sets OpenGL Vertex Array Object id.
-
#vbo_id ⇒ unsigned int *
OpenGL Vertex Buffer Objects id (default vertex data).
-
#vbo_id=(new_vbo_id) ⇒ Object
Sets OpenGL Vertex Buffer Objects id (default vertex data).
-
#vertex_count ⇒ Integer
Number of vertices stored in arrays.
-
#vertex_count=(new_vertex_count) ⇒ Object
Sets Number of vertices stored in arrays.
-
#vertices ⇒ float *
Vertex position (XYZ - 3 components per vertex) (shader-location = 0).
-
#vertices=(new_vertices) ⇒ Object
Sets Vertex position (XYZ - 3 components per vertex) (shader-location = 0).
Class Method Details
.create(vertex_count, triangle_count, vertices, texcoords, texcoords2, normals, tangents, colors, indices, anim_vertices, anim_normals, bone_ids, bone_weights, vao_id, vbo_id) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/raylib/core/structs/mesh.rb', line 22 def self.create(vertex_count, triangle_count, vertices, texcoords, texcoords2, normals, tangents, colors, indices, anim_vertices, anim_normals, bone_ids, bone_weights, vao_id, vbo_id) new.tap do |instance| instance[:vertexCount] = vertex_count instance[:triangleCount] = triangle_count instance[:vertices] = vertices instance[:texcoords] = texcoords instance[:texcoords2] = texcoords2 instance[:normals] = normals instance[:tangents] = tangents instance[:colors] = colors instance[:indices] = indices instance[:animVertices] = anim_vertices instance[:animNormals] = anim_normals instance[:boneIds] = bone_ids instance[:boneWeights] = bone_weights instance[:vaoId] = vao_id instance[:vboId] = vbo_id end end |
Instance Method Details
#anim_normals ⇒ float *
Animated normals (after bones transformations)
138 |
# File 'lib/raylib/core/structs/mesh.rb', line 138 def anim_normals = self[:animNormals] |
#anim_normals=(new_anim_normals) ⇒ Object
Sets Animated normals (after bones transformations)
141 142 143 |
# File 'lib/raylib/core/structs/mesh.rb', line 141 def anim_normals=(new_anim_normals) self[:animNormals] = new_anim_normals end |
#anim_vertices ⇒ float *
Animated vertex positions (after bones transformations)
129 |
# File 'lib/raylib/core/structs/mesh.rb', line 129 def anim_vertices = self[:animVertices] |
#anim_vertices=(new_anim_vertices) ⇒ Object
Sets Animated vertex positions (after bones transformations)
132 133 134 |
# File 'lib/raylib/core/structs/mesh.rb', line 132 def anim_vertices=(new_anim_vertices) self[:animVertices] = new_anim_vertices end |
#bone_ids ⇒ unsigned char *
Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)
147 |
# File 'lib/raylib/core/structs/mesh.rb', line 147 def bone_ids = self[:boneIds] |
#bone_ids=(new_bone_ids) ⇒ Object
Sets Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)
150 151 152 |
# File 'lib/raylib/core/structs/mesh.rb', line 150 def bone_ids=(new_bone_ids) self[:boneIds] = new_bone_ids end |
#bone_weights ⇒ float *
Vertex bone weight, up to 4 bones influence by vertex (skinning)
156 |
# File 'lib/raylib/core/structs/mesh.rb', line 156 def bone_weights = self[:boneWeights] |
#bone_weights=(new_bone_weights) ⇒ Object
Sets Vertex bone weight, up to 4 bones influence by vertex (skinning)
159 160 161 |
# File 'lib/raylib/core/structs/mesh.rb', line 159 def bone_weights=(new_bone_weights) self[:boneWeights] = new_bone_weights end |
#colors ⇒ unsigned char *
Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
111 |
# File 'lib/raylib/core/structs/mesh.rb', line 111 def colors = self[:colors] |
#colors=(new_colors) ⇒ Object
Sets Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
114 115 116 |
# File 'lib/raylib/core/structs/mesh.rb', line 114 def colors=(new_colors) self[:colors] = new_colors end |
#indices ⇒ unsigned short *
Vertex indices (in case vertex data comes indexed)
120 |
# File 'lib/raylib/core/structs/mesh.rb', line 120 def indices = self[:indices] |
#indices=(new_indices) ⇒ Object
Sets Vertex indices (in case vertex data comes indexed)
123 124 125 |
# File 'lib/raylib/core/structs/mesh.rb', line 123 def indices=(new_indices) self[:indices] = new_indices end |
#normals ⇒ float *
Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
93 |
# File 'lib/raylib/core/structs/mesh.rb', line 93 def normals = self[:normals] |
#normals=(new_normals) ⇒ Object
Sets Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
96 97 98 |
# File 'lib/raylib/core/structs/mesh.rb', line 96 def normals=(new_normals) self[:normals] = new_normals end |
#tangents ⇒ float *
Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
102 |
# File 'lib/raylib/core/structs/mesh.rb', line 102 def tangents = self[:tangents] |
#tangents=(new_tangents) ⇒ Object
Sets Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
105 106 107 |
# File 'lib/raylib/core/structs/mesh.rb', line 105 def tangents=(new_tangents) self[:tangents] = new_tangents end |
#texcoords ⇒ float *
Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
75 |
# File 'lib/raylib/core/structs/mesh.rb', line 75 def texcoords = self[:texcoords] |
#texcoords2 ⇒ float *
Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
84 |
# File 'lib/raylib/core/structs/mesh.rb', line 84 def texcoords2 = self[:texcoords2] |
#texcoords2=(new_texcoords2) ⇒ Object
Sets Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
87 88 89 |
# File 'lib/raylib/core/structs/mesh.rb', line 87 def texcoords2=(new_texcoords2) self[:texcoords2] = new_texcoords2 end |
#texcoords=(new_texcoords) ⇒ Object
Sets Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
78 79 80 |
# File 'lib/raylib/core/structs/mesh.rb', line 78 def texcoords=(new_texcoords) self[:texcoords] = new_texcoords end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/raylib/core/structs/mesh.rb', line 42 def to_s "Raylib::Mesh##{object_id} vertex_count=#{vertex_count} triangle_count=#{triangle_count} vertices=#{vertices} texcoords=#{texcoords} texcoords2=#{texcoords2} normals=#{normals} tangents=#{tangents} colors=#{colors} indices=#{indices} anim_vertices=#{anim_vertices} anim_normals=#{anim_normals} bone_ids=#{bone_ids} bone_weights=#{bone_weights} vao_id=#{vao_id} vbo_id=#{vbo_id}" end |
#triangle_count ⇒ Integer
Number of triangles stored (indexed or not)
57 |
# File 'lib/raylib/core/structs/mesh.rb', line 57 def triangle_count = self[:triangleCount] |
#triangle_count=(new_triangle_count) ⇒ Object
Sets Number of triangles stored (indexed or not)
60 61 62 |
# File 'lib/raylib/core/structs/mesh.rb', line 60 def triangle_count=(new_triangle_count) self[:triangleCount] = new_triangle_count end |
#vao_id ⇒ Integer
OpenGL Vertex Array Object id
165 |
# File 'lib/raylib/core/structs/mesh.rb', line 165 def vao_id = self[:vaoId] |
#vao_id=(new_vao_id) ⇒ Object
Sets OpenGL Vertex Array Object id
168 169 170 |
# File 'lib/raylib/core/structs/mesh.rb', line 168 def vao_id=(new_vao_id) self[:vaoId] = new_vao_id end |
#vbo_id ⇒ unsigned int *
OpenGL Vertex Buffer Objects id (default vertex data)
174 |
# File 'lib/raylib/core/structs/mesh.rb', line 174 def vbo_id = self[:vboId] |
#vbo_id=(new_vbo_id) ⇒ Object
Sets OpenGL Vertex Buffer Objects id (default vertex data)
177 178 179 |
# File 'lib/raylib/core/structs/mesh.rb', line 177 def vbo_id=(new_vbo_id) self[:vboId] = new_vbo_id end |
#vertex_count ⇒ Integer
Number of vertices stored in arrays
48 |
# File 'lib/raylib/core/structs/mesh.rb', line 48 def vertex_count = self[:vertexCount] |
#vertex_count=(new_vertex_count) ⇒ Object
Sets Number of vertices stored in arrays
51 52 53 |
# File 'lib/raylib/core/structs/mesh.rb', line 51 def vertex_count=(new_vertex_count) self[:vertexCount] = new_vertex_count end |
#vertices ⇒ float *
Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
66 |
# File 'lib/raylib/core/structs/mesh.rb', line 66 def vertices = self[:vertices] |
#vertices=(new_vertices) ⇒ Object
Sets Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
69 70 71 |
# File 'lib/raylib/core/structs/mesh.rb', line 69 def vertices=(new_vertices) self[:vertices] = new_vertices end |