Changeset 9945 for code/trunk/src/modules/objects/ForceField.cc
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (10 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.