Changeset 9639 in orxonox.OLD for branches/proxy/src/world_entities/weapons
- Timestamp:
- Jul 31, 2006, 9:30:52 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/world_entities/weapons/aiming_turret.cc
r9617 r9639 38 38 */ 39 39 AimingTurret::AimingTurret () 40 : Weapon(), target(this)40 : Weapon(), target(this) 41 41 { 42 42 this->init(); … … 46 46 47 47 AimingTurret::AimingTurret(const TiXmlElement* root) 48 : target(this)48 : target(this) 49 49 { 50 50 this->init(); … … 59 59 { 60 60 // model will be deleted from WorldEntity-destructor 61 // delete this->target;61 // delete this->target; 62 62 } 63 63 … … 129 129 130 130 if (likely (this->getParent() != NULL)) 131 quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 131 //quat = Quaternion(direction, this->getParent()->getAbsDirY()) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 132 quat = Quaternion ( M_PI_2, this->getParent()->getAbsDirY()) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), this->getParent()->getAbsDirY()); 132 133 else 133 quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 134 //quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 135 quat = Quaternion ( M_PI_2, Vector(0,1,0)) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), Vector(0,1,0)); 134 136 135 137 this->setAbsDirSoft(quat, 5); … … 144 146 return; 145 147 146 pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir ().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(4)147 /*target.getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());148 pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDirX()*250.0 + VECTOR_RAND(4) 149 /*target.getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 148 150 149 151 pj->setParent(PNode::getNullParent());
Note: See TracChangeset
for help on using the changeset viewer.