Class: Engine::PolygonMesh
- Inherits:
-
Object
- Object
- Engine::PolygonMesh
- Defined in:
- lib/engine/polygon_mesh.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#uvs ⇒ Object
readonly
Returns the value of attribute uvs.
Instance Method Summary collapse
- #index_data ⇒ Object
-
#initialize(points, uvs) ⇒ PolygonMesh
constructor
A new instance of PolygonMesh.
- #vertex_data ⇒ Object
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
#points ⇒ Object (readonly)
Returns the value of attribute points.
5 6 7 |
# File 'lib/engine/polygon_mesh.rb', line 5 def points @points end |
#uvs ⇒ Object (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_data ⇒ Object
16 17 18 |
# File 'lib/engine/polygon_mesh.rb', line 16 def index_data @index_data ||= (0..vertices.length - 1).to_a end |
#vertex_data ⇒ Object
12 13 14 |
# File 'lib/engine/polygon_mesh.rb', line 12 def vertex_data @vertex_data ||= generate_vertex_data end |