Changeset 9945 for code/trunk/src/modules/objects
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (12 years ago)
- Location:
- code/trunk/src/modules/objects
- Files:
-
- 2 edited
-
ForceField.cc (modified) (1 diff)
-
Turret.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/ForceField.cc
r9939 r9945 203 203 else if(this->mode_ == forceFieldMode::homogen) 204 204 { 205 // Iterate over all objects that could possibly be affected by the ForceField.206 for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)207 {208 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();209 float distance = distanceVector.length();210 if (distance < this->radius_ && distance > this->massRadius_)211 {212 // Add a Acceleration in forceDirection_.213 // Vector3(0,0,0) is the direction, where the force should work.214 it->addAcceleration(forceDirection_ , Vector3(0,0,0));215 }216 }205 // Iterate over all objects that could possibly be affected by the ForceField. 206 for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it) 207 { 208 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition(); 209 float distance = distanceVector.length(); 210 if (distance < this->radius_ && distance > this->massRadius_) 211 { 212 // Add a Acceleration in forceDirection_. 213 // Vector3(0,0,0) is the direction, where the force should work. 214 it->addAcceleration(forceDirection_ , Vector3(0,0,0)); 215 } 216 } 217 217 } 218 218 } -
code/trunk/src/modules/objects/Turret.cc
r9667 r9945 57 57 void Turret::rotatePitch(const Vector2& value) 58 58 { 59 orxout()<< "Turret rotate Pitch"<< endl;59 orxout()<< "Turret rotate Pitch"<< endl; 60 60 61 const Quaternion& orient = this->getOrientation();62 Radian pitch = orient.getPitch();61 const Quaternion& orient = this->getOrientation(); 62 Radian pitch = orient.getPitch(); 63 63 64 if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))65 SpaceShip::rotatePitch(value);64 if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0))) 65 SpaceShip::rotatePitch(value); 66 66 } 67 67 … … 69 69 void Turret::setAlertnessRadius(float value) 70 70 { 71 this->controller_->setAlertnessRadius(value);71 this->controller_->setAlertnessRadius(value); 72 72 } 73 73 float Turret::getAlertnessRadius() 74 74 { 75 return this->controller_->getAlertnessRadius();75 return this->controller_->getAlertnessRadius(); 76 76 } 77 77
Note: See TracChangeset
for help on using the changeset viewer.










