Class: Teien::Quaternion
- Inherits:
-
Bullet::BtQuaternion
- Object
- Bullet::BtQuaternion
- Teien::Quaternion
- Defined in:
- lib/teien/core/tools.rb
Class Method Summary collapse
- ._load(source) ⇒ Object
- .to_bullet(ogre) ⇒ Object
- .to_ogre(bullet) ⇒ Object
- .to_self(qt) ⇒ Object
- .to_string(qt) ⇒ Object
Instance Method Summary collapse
Class Method Details
._load(source) ⇒ Object
91 92 93 94 |
# File 'lib/teien/core/tools.rb', line 91 def self._load(source) array = source.unpack("ffff") return Quaternion.new(array[0], array[1], array[2], array[3]) end |
.to_bullet(ogre) ⇒ Object
75 76 77 |
# File 'lib/teien/core/tools.rb', line 75 def self.to_bullet(ogre) return Bullet::BtQuaternion.new(ogre.x, ogre.y, ogre.z, ogre.w) end |
.to_ogre(bullet) ⇒ Object
71 72 73 |
# File 'lib/teien/core/tools.rb', line 71 def self.to_ogre(bullet) return Ogre::Quaternion.new(bullet.w, bullet.x, bullet.y, bullet.z) end |
.to_self(qt) ⇒ Object
79 80 81 |
# File 'lib/teien/core/tools.rb', line 79 def self.to_self(qt) return Quaternion.new(qt.x, qt.y, qt.z, qt.w) end |
.to_string(qt) ⇒ Object
83 84 85 |
# File 'lib/teien/core/tools.rb', line 83 def self.to_string(qt) return sprintf("(%f, %f, %f, %f)", qt.x, qt.y, qt.z, qt.w) end |
Instance Method Details
#_dump(limit) ⇒ Object
87 88 89 |
# File 'lib/teien/core/tools.rb', line 87 def _dump(limit) return [x(), y(), z(), w()].pack("ffff") end |
#copy(qt) ⇒ Object
96 97 98 |
# File 'lib/teien/core/tools.rb', line 96 def copy(qt) set_value(qt.x, qt.y, qt.z, qt.w) end |