| 86 | } |
| 87 | |
| 88 | void PhysicsForce::attach( const Point3F &start, const Point3F &direction, F32 maxDist ) |
| 89 | { |
| 90 | detach(); |
| 91 | |
| 92 | // If there is no physics world then we cannot apply any forces. |
| 93 | if ( !mWorld ) |
| 94 | return; |
| 95 | |
| 96 | PhysicsBody *body = mWorld->castRay( start, start + ( direction * maxDist ), PhysicsWorld::BT_Dynamic ); |
| 97 | if ( !body ) |
| 98 | return; |
| 99 | |
| 100 | mBody = body; |
| 101 | } |
| 102 | |
| 103 | void PhysicsForce::detach( const Point3F &force ) |
| 104 | { |