Class: OBJ::Mesh

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vertices: 0, normals: 0, text_coords: 0, faces: 0) ⇒ Mesh

Returns a new instance of Mesh.



7
8
9
10
11
12
# File 'lib/obj.rb', line 7

def initialize(vertices: 0, normals: 0, text_coords: 0, faces: 0)
  @vertices = 0
  @normals = 0
  @text_coords = 0
  @faces = 0
end

Instance Attribute Details

#facesObject

Returns the value of attribute faces.



5
6
7
# File 'lib/obj.rb', line 5

def faces
  @faces
end

#normalsObject

Returns the value of attribute normals.



5
6
7
# File 'lib/obj.rb', line 5

def normals
  @normals
end

#text_coordsObject

Returns the value of attribute text_coords.



5
6
7
# File 'lib/obj.rb', line 5

def text_coords
  @text_coords
end

#verticesObject

Returns the value of attribute vertices.



5
6
7
# File 'lib/obj.rb', line 5

def vertices
  @vertices
end

Instance Method Details

#to_sObject



14
15
16
17
# File 'lib/obj.rb', line 14

def to_s
  "<#{self.class} vertices: #{@vertices} normals: #{@normals}" \
  " text_coords: #{@text_coords} faces: #{@faces}>"
end