Class: Wavefront::Vec3
- Inherits:
-
Object
- Object
- Wavefront::Vec3
- Defined in:
- lib/wavefront/vec3.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
-
#z ⇒ Object
readonly
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Vec3
constructor
A new instance of Vec3.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Vec3
Returns a new instance of Vec3.
5 6 7 8 9 |
# File 'lib/wavefront/vec3.rb', line 5 def initialize *args @x = args[0] if args.size > 0 @y = args[1] if args.size > 1 @z = args[2] if args.size > 2 end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
3 4 5 |
# File 'lib/wavefront/vec3.rb', line 3 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
3 4 5 |
# File 'lib/wavefront/vec3.rb', line 3 def y @y end |
#z ⇒ Object (readonly)
Returns the value of attribute z.
3 4 5 |
# File 'lib/wavefront/vec3.rb', line 3 def z @z end |