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

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

Defined Under Namespace

Classes: PolyList, PolygonVertices, Polygons, TriangleVertices, Triangles, Vertices

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sources, vertices, polygons) ⇒ Mesh

Returns a new instance of Mesh.



172
173
174
175
# File 'lib/collada/parser/scene.rb', line 172

def initialize(sources, polygons)
	@sources = sources
	@polygons = polygons
end

Instance Attribute Details

#polygonsObject (readonly)

Returns the value of attribute polygons.



178
179
180
# File 'lib/collada/parser/scene.rb', line 178

def polygons
  @polygons
end

#sourcesObject (readonly)

Returns the value of attribute sources.



177
178
179
# File 'lib/collada/parser/scene.rb', line 177

def sources
  @sources
end

#verticesObject (readonly)

Returns the value of attribute vertices.



187
188
189
# File 'lib/collada/parser/geometry.rb', line 187

def vertices
  @vertices
end

Class Method Details

.parse(doc, element) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/collada/parser/scene.rb', line 180

def self.parse(doc, element)
	arrays = Source.parse_arrays(doc, element)
	
	sources = OrderedMap.parse(element, 'source') do |source_element|
		Source.parse(doc, source_element, arrays)
	end
	
	if (polygons_element = element.elements['triangles | polylist'])
		polygons = Polygons.parse(doc, polygons_element, sources)
	end
	
	self.new(sources, polygons)
end