Class: ObjParser::Point
- Inherits:
-
Object
- Object
- ObjParser::Point
- Defined in:
- lib/obj_parser/point.rb
Instance Attribute Summary collapse
-
#current_binormal ⇒ Object
Returns the value of attribute current_binormal.
-
#current_normal ⇒ Object
Returns the value of attribute current_normal.
-
#current_tangent ⇒ Object
Returns the value of attribute current_tangent.
-
#data ⇒ Object
Returns the value of attribute data.
-
#flag ⇒ Object
Returns the value of attribute flag.
-
#normals ⇒ Object
Returns the value of attribute normals.
-
#tangents ⇒ Object
Returns the value of attribute tangents.
-
#textures ⇒ Object
Returns the value of attribute textures.
Instance Method Summary collapse
- #binormal ⇒ Object
-
#initialize(point_data = [0, 0, 0]) ⇒ Point
constructor
A new instance of Point.
- #normal ⇒ Object
- #tangent ⇒ Object
- #u ⇒ Object
- #v ⇒ Object
- #x ⇒ Object
- #y ⇒ Object
- #z ⇒ Object
Constructor Details
#initialize(point_data = [0, 0, 0]) ⇒ Point
Returns a new instance of Point.
14 15 16 17 18 19 |
# File 'lib/obj_parser/point.rb', line 14 def initialize(point_data = [0, 0, 0]) self.data = point_data.map(&:to_f) self.textures = [] self.normals = [] self.tangents = [] end |
Instance Attribute Details
#current_binormal ⇒ Object
Returns the value of attribute current_binormal.
5 6 7 |
# File 'lib/obj_parser/point.rb', line 5 def current_binormal @current_binormal end |
#current_normal ⇒ Object
Returns the value of attribute current_normal.
6 7 8 |
# File 'lib/obj_parser/point.rb', line 6 def current_normal @current_normal end |
#current_tangent ⇒ Object
Returns the value of attribute current_tangent.
4 5 6 |
# File 'lib/obj_parser/point.rb', line 4 def current_tangent @current_tangent end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/obj_parser/point.rb', line 3 def data @data end |
#flag ⇒ Object
Returns the value of attribute flag.
12 13 14 |
# File 'lib/obj_parser/point.rb', line 12 def flag @flag end |
#normals ⇒ Object
Returns the value of attribute normals.
8 9 10 |
# File 'lib/obj_parser/point.rb', line 8 def normals @normals end |
#tangents ⇒ Object
Returns the value of attribute tangents.
10 11 12 |
# File 'lib/obj_parser/point.rb', line 10 def tangents @tangents end |
#textures ⇒ Object
Returns the value of attribute textures.
9 10 11 |
# File 'lib/obj_parser/point.rb', line 9 def textures @textures end |
Instance Method Details
#binormal ⇒ Object
25 26 27 |
# File 'lib/obj_parser/point.rb', line 25 def binormal self.current_binormal ||= Point.new end |
#normal ⇒ Object
29 30 31 |
# File 'lib/obj_parser/point.rb', line 29 def normal self.current_normal ||= Point.new end |
#tangent ⇒ Object
21 22 23 |
# File 'lib/obj_parser/point.rb', line 21 def tangent self.current_tangent ||= Point.new end |
#u ⇒ Object
37 |
# File 'lib/obj_parser/point.rb', line 37 def u; self.data[0]; end |
#v ⇒ Object
38 |
# File 'lib/obj_parser/point.rb', line 38 def v; self.data[1]; end |
#x ⇒ Object
33 |
# File 'lib/obj_parser/point.rb', line 33 def x; self.data[0]; end |
#y ⇒ Object
34 |
# File 'lib/obj_parser/point.rb', line 34 def y; self.data[1]; end |
#z ⇒ Object
35 |
# File 'lib/obj_parser/point.rb', line 35 def z; self.data[2]; end |