Class: Collada::Parser::Geometry::Mesh::PolyList
- Inherits:
-
Object
- Object
- Collada::Parser::Geometry::Mesh::PolyList
- Defined in:
- lib/collada/parser/geometry.rb
Overview
Vertices are organised as arbitrary ngons.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(counts) ⇒ PolyList
constructor
A new instance of PolyList.
- #vertex_count(index) ⇒ Object
Constructor Details
#initialize(counts) ⇒ PolyList
Returns a new instance of PolyList.
72 73 74 |
# File 'lib/collada/parser/geometry.rb', line 72 def initialize(counts) @counts = counts end |
Class Method Details
.parse(doc, element) ⇒ Object
80 81 82 83 84 |
# File 'lib/collada/parser/geometry.rb', line 80 def self.parse(doc, element) counts = element.elements['vcount'].text.strip.split(/\s+/).collect &:to_i self.new(counts) end |
Instance Method Details
#vertex_count(index) ⇒ Object
76 77 78 |
# File 'lib/collada/parser/geometry.rb', line 76 def vertex_count index @counts[index] end |