Changeset 6234 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/weapons/guided_missile.cc
- Timestamp:
- Dec 21, 2005, 3:14:00 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/weapons/guided_missile.cc
r6222 r6234 146 146 { 147 147 148 if (this->target != NULL && this->target->getParent() != PNode::getNullParent()) 148 149 if (this->target != NULL && this->target->getParent() != PNode::getNullParent()) 149 150 { 150 151 speed = velocity.len(); … … 152 153 153 154 if(velocity.dot(diffVector) != 0) 154 {155 { 155 156 correctionVector = (( ( diffVector * (speed * speed/( velocity.dot(diffVector ) ) )) - velocity).getNormalized()) * agility; 156 157 … … 159 160 else if (velocity.dot(diffVector) < 0) 160 161 velocity -= correctionVector; 161 }162 } 162 163 else 163 164 velocity += diffVector * agility;
Note: See TracChangeset
for help on using the changeset viewer.