Class: LibSL::LLVector3
- Inherits:
-
Object
- Object
- LibSL::LLVector3
- Defined in:
- lib/types.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(x, y, z) ⇒ LLVector3
constructor
A new instance of LLVector3.
Constructor Details
#initialize(x, y, z) ⇒ LLVector3
Returns a new instance of LLVector3.
326 327 328 |
# File 'lib/types.rb', line 326 def initialize(x, y, z) @x, @y, @z = x, y, z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
325 326 327 |
# File 'lib/types.rb', line 325 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
325 326 327 |
# File 'lib/types.rb', line 325 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
325 326 327 |
# File 'lib/types.rb', line 325 def z @z end |
Class Method Details
.decode(data) ⇒ Object
316 317 318 319 |
# File 'lib/types.rb', line 316 def self.decode(data) data = data.unpack('e3a*') return self.new(data[0], data[1], data[2]), data[3] end |
Instance Method Details
#encode ⇒ Object
321 322 323 |
# File 'lib/types.rb', line 321 def encode() [@x, @y, @z].pack('e3') end |