Class: Engine::PolygonMesh

Inherits:
Object
  • Object
show all
Defined in:
lib/engine/polygon_mesh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(points, uvs) ⇒ PolygonMesh

Returns a new instance of PolygonMesh.



7
8
9
10
# File 'lib/engine/polygon_mesh.rb', line 7

def initialize(points, uvs)
  @points = points
  @uvs = uvs
end

Instance Attribute Details

#pointsObject (readonly)

Returns the value of attribute points.



5
6
7
# File 'lib/engine/polygon_mesh.rb', line 5

def points
  @points
end

#uvsObject (readonly)

Returns the value of attribute uvs.



5
6
7
# File 'lib/engine/polygon_mesh.rb', line 5

def uvs
  @uvs
end

Instance Method Details

#index_dataObject



16
17
18
# File 'lib/engine/polygon_mesh.rb', line 16

def index_data
  @index_data ||= (0..vertices.length - 1).to_a
end

#vertex_dataObject



12
13
14
# File 'lib/engine/polygon_mesh.rb', line 12

def vertex_data
  @vertex_data ||= generate_vertex_data
end