Class: Raylib::Mesh

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/mesh.rb

Overview

Mesh, vertex data and vao/vbo

Class Method Summary collapse

Instance Method Summary collapse

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_normalsfloat *

Animated normals (after bones transformations)

Returns:

  • (float *)

    animNormals



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_verticesfloat *

Animated vertex positions (after bones transformations)

Returns:

  • (float *)

    animVertices



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_idsunsigned char *

Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)

Returns:

  • (unsigned char *)

    boneIds



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_weightsfloat *

Vertex bone weight, up to 4 bones influence by vertex (skinning)

Returns:

  • (float *)

    boneWeights



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

#colorsunsigned char *

Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)

Returns:

  • (unsigned char *)

    colors



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

#indicesunsigned short *

Vertex indices (in case vertex data comes indexed)

Returns:

  • (unsigned short *)

    indices



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

#normalsfloat *

Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)

Returns:

  • (float *)

    normals



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

#tangentsfloat *

Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)

Returns:

  • (float *)

    tangents



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

#texcoordsfloat *

Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)

Returns:

  • (float *)

    texcoords



75
# File 'lib/raylib/core/structs/mesh.rb', line 75

def texcoords = self[:texcoords]

#texcoords2float *

Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)

Returns:

  • (float *)

    texcoords2



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_sObject



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_countInteger

Number of triangles stored (indexed or not)

Returns:

  • (Integer)

    triangleCount



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_idInteger

OpenGL Vertex Array Object id

Returns:

  • (Integer)

    vaoId



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_idunsigned int *

OpenGL Vertex Buffer Objects id (default vertex data)

Returns:

  • (unsigned int *)

    vboId



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_countInteger

Number of vertices stored in arrays

Returns:

  • (Integer)

    vertexCount



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

#verticesfloat *

Vertex position (XYZ - 3 components per vertex) (shader-location = 0)

Returns:

  • (float *)

    vertices



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