- Timestamp:
- May 23, 2009, 7:04:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gametypes/src/orxonox/objects/worldentities/ForceField.cc
r3019 r3020 53 53 { 54 54 SUPER(ForceField, XMLPort, xmlelement, mode); 55 55 56 56 //For correct xml import use: position, direction, velocity, scale 57 57 … … 60 60 XMLPortParam(ForceField, "length" , setLength , getLength , xmlelement, mode).defaultValues(2000); 61 61 } 62 62 63 63 void ForceField::tick(float dt) 64 64 { 65 65 66 66 for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it) 67 67 { 68 69 //calculate from 68 69 //calculate from 70 70 Vector3 directionVec = this->getOrientation() * WorldEntity::FRONT; 71 71 directionVec.normalise(); … … 81 81 it->applyCentralForce(((diameter_ / 2 - distFromCenterVec) / (diameter_ / 2)) * directionVec * velocity_); 82 82 } 83 83 84 84 } 85 85 }
Note: See TracChangeset
for help on using the changeset viewer.