Class: Collada::Conversion::Mesh
- Inherits:
-
Object
- Object
- Collada::Conversion::Mesh
- Defined in:
- lib/collada/conversion/mesh.rb
Instance Attribute Summary collapse
-
#indexed ⇒ Object
readonly
Returns the value of attribute indexed.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#vertices ⇒ Object
readonly
Returns the value of attribute vertices.
Instance Method Summary collapse
- #<<(vertex) ⇒ Object
-
#initialize ⇒ Mesh
constructor
A new instance of Mesh.
- #size ⇒ Object
Constructor Details
#initialize ⇒ Mesh
Returns a new instance of Mesh.
114 115 116 117 118 119 120 121 122 |
# File 'lib/collada/conversion/mesh.rb', line 114 def initialize @indices = [] # vertex -> index @vertices = {} # index -> vertex @indexed = [] end |
Instance Attribute Details
#indexed ⇒ Object (readonly)
Returns the value of attribute indexed.
126 127 128 |
# File 'lib/collada/conversion/mesh.rb', line 126 def indexed @indexed end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
124 125 126 |
# File 'lib/collada/conversion/mesh.rb', line 124 def indices @indices end |
#vertices ⇒ Object (readonly)
Returns the value of attribute vertices.
125 126 127 |
# File 'lib/collada/conversion/mesh.rb', line 125 def vertices @vertices end |
Instance Method Details
#<<(vertex) ⇒ Object
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/collada/conversion/mesh.rb', line 132 def << vertex if index = vertices[vertex] @indices << index else @vertices[vertex] = self.size @indices << self.size @indexed << vertex end end |
#size ⇒ Object
128 129 130 |
# File 'lib/collada/conversion/mesh.rb', line 128 def size @indexed.size end |