Class: Collada::Parser::Geometry::Mesh::PolyList

Inherits:
Object
  • Object
show all
Defined in:
lib/collada/parser/geometry.rb

Overview

Vertices are organised as arbitrary ngons.

Class Method Summary collapse

Instance Method Summary collapse

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