-------------------------------------------------------------------------------- Description: Set the target object. Since this most liekly has changed, trigger the targetposition smoothing (interpolating) --------------------------------------------------------------------------------
| 57 | // the targetposition smoothing (interpolating) |
| 58 | // -------------------------------------------------------------------------------- |
| 59 | bool EveTurretTarget::SetTargetable( IRoot* object ) |
| 60 | { |
| 61 | // set new target object |
| 62 | ITriTargetablePtr newTarget; |
| 63 | if( !object->QueryInterface( BlueInterfaceIID<ITriTargetable>(), (void**)&newTarget ) ) |
| 64 | { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | IWorldPositionPtr newTargetPos; |
| 69 | if( !object->QueryInterface( BlueInterfaceIID<IWorldPosition>(), (void**)&newTargetPos ) ) |
| 70 | { |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | // only act on new targets |
| 75 | if( !m_object.IsEqualObject( newTarget ) ) |
| 76 | { |
| 77 | m_object = newTarget; |
| 78 | // and trigger a fade |
| 79 | m_positionOld = m_trackingPosition; |
| 80 | m_positionOldInfluence = 1.f; |
| 81 | |
| 82 | // set the position of the object |
| 83 | m_objectPos = newTargetPos; |
| 84 | } |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | // -------------------------------------------------------------------------------- |
| 89 | // Description: |
no test coverage detected