Changeset 9615 in orxonox.OLD for branches/proxy/src/world_entities/weapons/aiming_turret.cc
- Timestamp:
- Jul 30, 2006, 12:51:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/world_entities/weapons/aiming_turret.cc
r9406 r9615 38 38 */ 39 39 AimingTurret::AimingTurret () 40 : Weapon() 40 : Weapon(), target(this) 41 41 { 42 42 this->init(); … … 46 46 47 47 AimingTurret::AimingTurret(const TiXmlElement* root) 48 : target(this) 48 49 { 49 50 this->init(); … … 91 92 //this->getProjectileFactory()->prepare(100); 92 93 93 this->target = new Aim(this);94 this->target ->setVisibility(false);95 this->target ->setRange(400);96 this->target ->setAngle(M_PI_2);94 this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE); 95 this->target.setVisibility(false); 96 this->target.setRange(400); 97 this->target.setAngle(M_PI_2); 97 98 98 99 this->setActionSound(WA_SHOOT, "sound/explosions/explosion_3.wav"); … … 110 111 void AimingTurret::activate() 111 112 { 112 this->target ->setVisibility(true);113 this->target.setVisibility(true); 113 114 } 114 115 115 116 void AimingTurret::deactivate() 116 117 { 117 this->target ->setVisibility(false);118 this->target.setVisibility(false); 118 119 } 119 120 … … 123 124 return; 124 125 Quaternion quat; 125 Vector direction = this->target ->getAbsCoor() - this->getAbsCoor();126 Vector direction = this->target.getAbsCoor() - this->getAbsCoor(); 126 127 127 128 direction.normalize(); … … 134 135 this->setAbsDirSoft(quat, 5); 135 136 136 this->target ->tick(dt);137 this->target.tick(dt); 137 138 } 138 139 … … 144 145 145 146 pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13) 146 /*target ->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());147 /*target.getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 147 148 148 149 pj->setParent(PNode::getNullParent());
Note: See TracChangeset
for help on using the changeset viewer.