mirror of
https://github.com/halpz/re3.git
synced 2025-07-03 07:20:48 +00:00
some CBike code; vehicle cleanup
This commit is contained in:
@ -175,8 +175,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
|
||||
for(i = 0; i < 4; i++){
|
||||
m_aGroundPhysical[i] = nil;
|
||||
m_aGroundOffset[i] = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_aSuspensionSpringRatio[i] = 1.0f;
|
||||
m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i];
|
||||
m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i] = 1.0f;
|
||||
m_aWheelTimer[i] = 0.0f;
|
||||
m_aWheelRotation[i] = 0.0f;
|
||||
m_aWheelSpeed[i] = 0.0f;
|
||||
@ -4850,8 +4849,8 @@ CAutomobile::BurstTyre(uint8 wheel, bool applyForces)
|
||||
}
|
||||
|
||||
if(applyForces){
|
||||
ApplyMoveForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f));
|
||||
ApplyTurnForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f), GetForward());
|
||||
ApplyMoveForce(GetRight() * m_fMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f));
|
||||
ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f), GetForward());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4867,10 +4866,10 @@ CAutomobile::IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset)
|
||||
CVector seatPos;
|
||||
switch(component){
|
||||
case CAR_DOOR_RF:
|
||||
seatPos = mi->m_positions[mi->m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT];
|
||||
seatPos = mi->GetFrontSeatPosn();
|
||||
break;
|
||||
case CAR_DOOR_LF:
|
||||
seatPos = mi->m_positions[mi->m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT];
|
||||
seatPos = mi->GetFrontSeatPosn();
|
||||
seatPos.x = -seatPos.x;
|
||||
break;
|
||||
case CAR_DOOR_RR:
|
||||
@ -4898,7 +4897,7 @@ CAutomobile::IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset)
|
||||
|
||||
CVector dist = doorPos - seatPos;
|
||||
|
||||
// Removing that makes this func. return false for van doors.
|
||||
// Removing that makes thiProcessEntityCollisions func. return false for van doors.
|
||||
doorPos.z += 0.5f;
|
||||
float length = dist.Magnitude();
|
||||
CVector pedPos = seatPos + dist*((length+0.6f)/length);
|
||||
@ -5519,7 +5518,7 @@ CAutomobile::SetupModelNodes(void)
|
||||
int i;
|
||||
for(i = 0; i < NUM_CAR_NODES; i++)
|
||||
m_aCarNodes[i] = nil;
|
||||
CClumpModelInfo::FillFrameArray((RpClump*)m_rwObject, m_aCarNodes);
|
||||
CClumpModelInfo::FillFrameArray(GetClump(), m_aCarNodes);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -31,15 +31,6 @@ enum eCarNodes
|
||||
NUM_CAR_NODES,
|
||||
};
|
||||
|
||||
enum eCarPositions
|
||||
{
|
||||
CAR_POS_HEADLIGHTS,
|
||||
CAR_POS_TAILLIGHTS,
|
||||
CAR_POS_FRONTSEAT,
|
||||
CAR_POS_BACKSEAT,
|
||||
CAR_POS_EXHAUST
|
||||
};
|
||||
|
||||
// These are used for all the wheel arrays
|
||||
// DON'T confuse with VEHWHEEL, which are vehicle components
|
||||
enum {
|
||||
@ -49,16 +40,6 @@ enum {
|
||||
CARWHEEL_REAR_RIGHT
|
||||
};
|
||||
|
||||
enum eBombType
|
||||
{
|
||||
CARBOMB_NONE,
|
||||
CARBOMB_TIMED,
|
||||
CARBOMB_ONIGNITION,
|
||||
CARBOMB_REMOTE,
|
||||
CARBOMB_TIMEDACTIVE,
|
||||
CARBOMB_ONIGNITIONACTIVE,
|
||||
};
|
||||
|
||||
enum {
|
||||
CAR_DOOR_FLAG_UNKNOWN = 0x0,
|
||||
CAR_DOOR_FLAG_LF = 0x1,
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Vehicle.h"
|
||||
#include "Skidmarks.h"
|
||||
|
||||
enum eBikeNodes {
|
||||
@ -14,20 +15,23 @@ enum eBikeNodes {
|
||||
BIKE_NUM_NODES
|
||||
};
|
||||
|
||||
enum eBikePositions
|
||||
{
|
||||
BIKE_POS_HEADLIGHTS,
|
||||
BIKE_POS_TAILLIGHTS,
|
||||
BIKE_POS_FRONTSEAT,
|
||||
BIKE_POS_BACKSEAT,
|
||||
BIKE_POS_EXHAUST
|
||||
enum {
|
||||
BIKEWHEEL_FRONT,
|
||||
BIKEWHEEL_REAR,
|
||||
};
|
||||
|
||||
enum {
|
||||
BIKESUSP_FRONT_1,
|
||||
BIKESUSP_FRONT_2,
|
||||
BIKESUSP_REAR_1,
|
||||
BIKESUSP_REAR_2,
|
||||
};
|
||||
|
||||
class CBike : public CVehicle
|
||||
{
|
||||
public:
|
||||
RwFrame *m_aBikeNodes[BIKE_NUM_NODES];
|
||||
bool m_bLeanMatrixCalculated;
|
||||
bool bLeanMatrixClean;
|
||||
CMatrix m_leanMatrix;
|
||||
CVector wheelieNormal;
|
||||
CVector wheelieRight;
|
||||
@ -83,4 +87,43 @@ public:
|
||||
uint8 m_nDriveWheelsOnGroundPrev;
|
||||
float m_fGasPedalAudio;
|
||||
tWheelState m_aWheelState[2];
|
||||
|
||||
CBike(int32 id, uint8 CreatedBy);
|
||||
|
||||
// from CEntity
|
||||
void SetModelIndex(uint32 id);
|
||||
void ProcessControl(void);
|
||||
void Teleport(CVector v);
|
||||
void PreRender(void);
|
||||
void Render(void);
|
||||
|
||||
// from CPhysical
|
||||
int32 ProcessEntityCollision(CEntity *ent, CColPoint *colpoints);
|
||||
|
||||
// from CVehicle
|
||||
void ProcessControlInputs(uint8);
|
||||
void GetComponentWorldPosition(int32 component, CVector &pos);
|
||||
bool IsComponentPresent(int32 component);
|
||||
void SetComponentRotation(int32 component, CVector rotation);
|
||||
bool IsDoorReady(eDoors door);
|
||||
bool IsDoorFullyOpen(eDoors door);
|
||||
bool IsDoorClosed(eDoors door);
|
||||
bool IsDoorMissing(eDoors door);
|
||||
void RemoveRefsToVehicle(CEntity *ent);
|
||||
void BlowUpCar(CEntity *ent);
|
||||
bool SetUpWheelColModel(CColModel *colModel);
|
||||
void BurstTyre(uint8 tyre, bool applyForces);
|
||||
bool IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset);
|
||||
float GetHeightAboveRoad(void);
|
||||
void PlayCarHorn(void);
|
||||
|
||||
void PlayHornIfNecessary(void);
|
||||
void ResetSuspension(void);
|
||||
void SetupSuspensionLines(void);
|
||||
void CalculateLeanMatrix(void);
|
||||
void GetCorrectedWorldDoorPosition(CVector &pos, CVector p1, CVector p2);
|
||||
|
||||
void Fix(void);
|
||||
void SetupModelNodes(void);
|
||||
void ReduceHornCounter(void);
|
||||
};
|
||||
|
@ -9,13 +9,6 @@ enum ePlaneNodes
|
||||
NUM_PLANE_NODES
|
||||
};
|
||||
|
||||
enum ePlanePositions
|
||||
{
|
||||
PLANE_POS_LIGHT_LEFT,
|
||||
PLANE_POS_LIGHT_RIGHT,
|
||||
PLANE_POS_LIGHT_TAIL,
|
||||
};
|
||||
|
||||
struct CPlaneNode
|
||||
{
|
||||
CVector p; // position
|
||||
|
@ -24,15 +24,6 @@ enum eTrainNodes
|
||||
NUM_TRAIN_NODES
|
||||
};
|
||||
|
||||
enum eTrainPositions
|
||||
{
|
||||
TRAIN_POS_LIGHT_FRONT,
|
||||
TRAIN_POS_LIGHT_REAR,
|
||||
TRAIN_POS_LEFT_ENTRY,
|
||||
TRAIN_POS_MID_ENTRY,
|
||||
TRAIN_POS_RIGHT_ENTRY
|
||||
};
|
||||
|
||||
struct CTrainNode
|
||||
{
|
||||
CVector p; // position
|
||||
|
@ -31,10 +31,14 @@ enum eCarLock {
|
||||
CARLOCK_SKIP_SHUT_DOORS
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
enum eBombType
|
||||
{
|
||||
BOAT_POS_FRONTSEAT
|
||||
CARBOMB_NONE,
|
||||
CARBOMB_TIMED,
|
||||
CARBOMB_ONIGNITION,
|
||||
CARBOMB_REMOTE,
|
||||
CARBOMB_TIMEDACTIVE,
|
||||
CARBOMB_ONIGNITIONACTIVE,
|
||||
};
|
||||
|
||||
enum eDoors
|
||||
|
Reference in New Issue
Block a user