Changeset 9945 for code/trunk/src/modules/objects
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (11 years ago)
- Location:
- code/trunk/src/modules/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/ForceField.cc
r9939 r9945 203 203 else if(this->mode_ == forceFieldMode::homogen) 204 204 { 205 206 207 208 209 210 211 212 213 214 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 59 orxout()<< "Turret rotate Pitch"<< endl; 60 60 61 62 61 const Quaternion& orient = this->getOrientation(); 62 Radian pitch = orient.getPitch(); 63 63 64 65 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 71 this->controller_->setAlertnessRadius(value); 72 72 } 73 73 float Turret::getAlertnessRadius() 74 74 { 75 75 return this->controller_->getAlertnessRadius(); 76 76 } 77 77
Note: See TracChangeset
for help on using the changeset viewer.