//----------------------------------------------------------------------------- // Copyright(c), HL Rally: Source, 2004, All rights reserved. // The contents of this file may only be used / distributed in accordance // with the conditions listed in the supplied license, or with written // permission of the respective authors listed. // // Based off c_vehicle_jeep.h from sourcesdk //----------------------------------------------------------------------------- #ifndef C_ENTITYPROPVEHICLEJEEP_H #define C_ENTITYPROPVEHICLEJEEP_H #define JEEP_DELTA_LENGTH_MAX 12.0f // 1 foot #define JEEP_FRAMETIME_MIN 1e-6 #define JEEP_HEADLIGHT_DISTANCE 1000 #include "c_EntityPropVehicle.h" #include "HLRally2/VehiclePhysics.h" #include "HLRally2/CCameraModeABC.h" #include "HLRally2/CameraExterior.h" #include "HLRally2/CameraInterior.h" class CHeadlightEffect; class C_PropJeepSimulation { public: C_PropJeepSimulation *pNext; float fTime; Vector vecPosition; QAngle angAngles; int nButtons; float fSideMove; float fForwardMove; }; //----------------------------------------------------------------------------- // Client-side vehicle //----------------------------------------------------------------------------- class C_PropJeep : public C_PropVehicleDriveable { DECLARE_CLASS( C_PropJeep, C_PropVehicleDriveable ); public: DECLARE_CLIENTCLASS(); //DECLARE_INTERPOLATION(); C_PropJeep(); ~C_PropJeep(); // Overrides to get the vehicle rendering at the right location virtual const Vector &GetRenderOrigin(); virtual const QAngle &GetRenderAngles(); int VPhysicsGetObjectList( IPhysicsObject **pList, int listMax ); void VehiclePhysicsClientSetup(); void VPhysicsUpdate(IPhysicsObject *pPhysics); void OnEnteredVehicle( C_BaseCombatCharacter *pPlayer ); void Simulate(); void Teleport( const Vector *newPosition, const QAngle *newAngles, const Vector *newVelocity, const AngularImpulse *newAngularChassis ); int DrawModel(int flags); virtual CStudioHdr *OnNewModel( void ); void ChangeCameraMode(); void RestrictView( float *pYawBounds, float *pPitchBounds, float *pRollBounds, QAngle &vecViewAngles ); void UpdateViewAngles( C_BasePlayer *pLocalPlayer, CUserCmd *pCmd ); virtual void GetVehicleViewPosition( int nRole, Vector *pOrigin, QAngle *pAngles ); virtual void ProcessMovement( C_BasePlayer *pPlayer, CMoveData *pMoveData ); void RecordSimulation(CMoveData *pMoveData, float fTime, C_PropJeepSimulation **pHead, C_PropJeepSimulation **pTail); void IN_FlipVehicle(); // Client pose parameters // virtual float GetSequenceCycleRate( CStudioHdr *pStudioHdr, int iSequence ); virtual float GetSequenceMoveDist( CStudioHdr *pStudioHdr, int iSequence ); virtual void GetSequenceLinearMotion( int iSequence, Vector *pVec ); virtual float SequenceDuration( int iSequence ); virtual float SetPoseParameter( CStudioHdr *pStudioHdr, int iParameter, float flValue ); virtual void GetPoseParameters( CStudioHdr *pStudioHdr, float poseParameter[MAXSTUDIOPOSEPARAM] ); CVehiclePhysics *GetPhysics(); // Camera stuffs int m_iLastCameraMode; CCameraModeABC *m_pCameraMode; Vector m_vecInteriorCamOrigin; Vector m_vecWheelCamOrigin; Vector m_vecBonnetCamOrigin; int m_iLastEyeFrame; int m_iLastFrameOrigin; int m_iLastFrameAngles; private: void Correction(); // Client side vehicle CVehiclePhysics m_VehiclePhysics; bool m_bVehiclePhysicsSetup; C_PropJeepSimulation *m_pSimulationHead; C_PropJeepSimulation *m_pSimulationTail; float m_fServerTime; Vector m_vecLast; float m_fLastSendTime; int m_iUpdatePacketID; bool m_bCorrectionInterpolatingPos; bool m_bCorrectionInterpolatingAng; bool m_bCorrectionInterpolating; Vector m_vecCorrectionOrigin; Vector m_vecCorrectionOffset; QAngle m_angCorrectionOffset; Vector m_vecOriginPhysics; Vector m_vecOriginFrame; QAngle m_angAnglesPhysics; QAngle m_angAnglesFrame; Vector m_vecOldVelocity; AngularImpulse m_aiOldImpulse; AngularImpulse m_aiAngularVelocityChassis; Vector m_vecVelocity; QAngle m_angEyeAngles; Vector m_vecLastEyePos; Vector m_vecLastEyeTarget; Vector m_vecEyeSpeed; Vector m_vecTargetSpeed; float m_flViewAngleDeltaTime; float m_flJeepFOV; CHeadlightEffect *m_pHeadlight; bool m_bHeadlightIsOn; CNetworkVar(int, m_iTeleportCount); int m_iLastTeleportCount; // Client-side pose parameters float m_flPoseParameterClient[MAXSTUDIOPOSEPARAM]; CInterpolatedVarArray< float, MAXSTUDIOPOSEPARAM > m_iv_flPoseParameterClient; }; #endif