Class: Collada::Conversion::Vertex

Inherits:
Object
  • Object
show all
Defined in:
lib/collada/conversion/mesh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes, format) ⇒ Vertex

The format provided here is used purely to calculate unique vertices.



89
90
91
92
# File 'lib/collada/conversion/mesh.rb', line 89

def initialize(attributes, format)
	@attributes = Parser::Attribute.to_hash(attributes)
	@format = format
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



94
95
96
# File 'lib/collada/conversion/mesh.rb', line 94

def attributes
  @attributes
end

Instance Method Details

#<=>(other) ⇒ Object



100
101
102
# File 'lib/collada/conversion/mesh.rb', line 100

def <=>(other)
	to_a <=> other.to_a
end

#hashObject



108
109
110
# File 'lib/collada/conversion/mesh.rb', line 108

def hash
	to_a.hash
end

#indexObject



104
105
106
# File 'lib/collada/conversion/mesh.rb', line 104

def index
	@attributes[:vertex][:index]
end

#to_a(format = @format) ⇒ Object



96
97
98
# File 'lib/collada/conversion/mesh.rb', line 96

def to_a(format = @format)
	format.call(@attributes)
end