Changeset 5001 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons
- Timestamp:
- Aug 13, 2005, 10:08:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/turret.cc
r5000 r5001 116 116 void Turret::tick(float dt) 117 117 { 118 Quaternion quat; 118 119 Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor(); 120 119 121 direction.normalize(); 122 120 123 if (likely (this->getParent() != NULL)) 121 { 122 Quaternion quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 123 this->setAbsDir(quat); 124 } 124 quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 125 125 else 126 { 127 Quaternion quat = Quaternion(direction, this->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 128 this->setAbsDir(quat); 129 } 126 quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 127 128 this->setAbsDir(quat); 130 129 } 131 130
Note: See TracChangeset
for help on using the changeset viewer.