Class: MD2::Triangle

Inherits:
Object
  • Object
show all
Defined in:
lib/md2/triangle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Triangle

Returns a new instance of Triangle.



4
5
6
7
8
# File 'lib/md2/triangle.rb', line 4

def initialize(data)
  data = data.unpack("s6")
  @vertex_indices   = [data[0], data[1], data[2]]
  @texcoord_indices = [data[3], data[4], data[5]]
end

Instance Attribute Details

#texcoord_indicesObject (readonly)

Returns the value of attribute texcoord_indices.



2
3
4
# File 'lib/md2/triangle.rb', line 2

def texcoord_indices
  @texcoord_indices
end

#vertex_indicesObject (readonly)

Returns the value of attribute vertex_indices.



2
3
4
# File 'lib/md2/triangle.rb', line 2

def vertex_indices
  @vertex_indices
end