| 828 | } |
| 829 | |
| 830 | void afxCamera::interpolateTick(F32 dt) |
| 831 | { |
| 832 | Parent::interpolateTick(dt); |
| 833 | |
| 834 | if (mMode == ThirdPersonMode) |
| 835 | return; |
| 836 | |
| 837 | Point3F rot = mDelta.rot + mDelta.rotVec * dt; |
| 838 | |
| 839 | if(mMode == OrbitObjectMode || mMode == OrbitPointMode) |
| 840 | { |
| 841 | if(mMode == OrbitObjectMode && bool(mOrbitObject)) |
| 842 | { |
| 843 | // If this is a shapebase, use its render eye transform |
| 844 | // to avoid jittering. |
| 845 | GameBase *castObj = mOrbitObject; |
| 846 | ShapeBase* shape = dynamic_cast<ShapeBase*>(castObj); |
| 847 | if( shape != NULL ) |
| 848 | { |
| 849 | MatrixF ret; |
| 850 | shape->getRenderEyeTransform( &ret ); |
| 851 | mPosition = ret.getPosition(); |
| 852 | } |
| 853 | else |
| 854 | { |
| 855 | // Hopefully this is a static object that doesn't move, |
| 856 | // because the worldbox doesn't get updated between ticks. |
| 857 | mOrbitObject->getWorldBox().getCenter(&mPosition); |
| 858 | } |
| 859 | } |
| 860 | set_cam_pos(mPosition, rot); |
| 861 | validateEyePoint(1.0f, &mObjToWorld); |
| 862 | } |
| 863 | else |
| 864 | { |
| 865 | // NOTE - posVec is 0,0,0 unless cam is control-object and process tick is |
| 866 | // updating the delta |
| 867 | Point3F pos = mDelta.pos + mDelta.posVec * dt; |
| 868 | set_cam_pos(pos,rot); |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | void afxCamera::writePacketData(GameConnection *connection, BitStream *bstream) |
| 873 | { |
nothing calls this directly
no test coverage detected