mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-11-05 13:55:54 +00:00
some CBike code; vehicle cleanup
This commit is contained in:
parent
2e3cb77702
commit
2ca3c50463
|
@ -8,10 +8,10 @@ enum AssocGroupId
|
||||||
ASSOCGRP_STD,
|
ASSOCGRP_STD,
|
||||||
ASSOCGRP_VAN,
|
ASSOCGRP_VAN,
|
||||||
ASSOCGRP_COACH,
|
ASSOCGRP_COACH,
|
||||||
ASSOCGRP_BIKES,
|
ASSOCGRP_BIKE_STANDARD,
|
||||||
ASSOCGRP_BIKEV,
|
ASSOCGRP_BIKE_VESPA,
|
||||||
ASSOCGRP_BIKEH,
|
ASSOCGRP_BIKE_HARLEY,
|
||||||
ASSOCGRP_BIKED,
|
ASSOCGRP_BIKE_DIRT,
|
||||||
ASSOCGRP_UNARMED,
|
ASSOCGRP_UNARMED,
|
||||||
ASSOCGRP_SCREWDRIVER,
|
ASSOCGRP_SCREWDRIVER,
|
||||||
ASSOCGRP_KNIFE,
|
ASSOCGRP_KNIFE,
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "Automobile.h"
|
#include "Automobile.h"
|
||||||
|
#include "Boat.h"
|
||||||
#include "Ped.h"
|
#include "Ped.h"
|
||||||
#include "PlayerPed.h"
|
#include "PlayerPed.h"
|
||||||
#include "CopPed.h"
|
#include "CopPed.h"
|
||||||
|
@ -2718,7 +2719,7 @@ CCam::Process_1stPerson(const CVector &CameraTarget, float TargetOrientation, fl
|
||||||
}else{
|
}else{
|
||||||
assert(CamTargetEntity->IsVehicle());
|
assert(CamTargetEntity->IsVehicle());
|
||||||
CVehicleModelInfo *mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(CamTargetEntity->GetModelIndex());
|
CVehicleModelInfo *mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(CamTargetEntity->GetModelIndex());
|
||||||
CVector CamPos = mi->m_vehicleType == VEHICLE_TYPE_BOAT ? mi->m_positions[BOAT_POS_FRONTSEAT] : mi->m_positions[CAR_POS_FRONTSEAT];
|
CVector CamPos = mi->GetFrontSeatPosn();
|
||||||
CamPos.x = 0.0f;
|
CamPos.x = 0.0f;
|
||||||
CamPos.y += -0.08f;
|
CamPos.y += -0.08f;
|
||||||
CamPos.z += 0.62f;
|
CamPos.z += 0.62f;
|
||||||
|
|
|
@ -122,7 +122,7 @@ struct sRadarTrace
|
||||||
|
|
||||||
// Values for screen space
|
// Values for screen space
|
||||||
#define RADAR_LEFT (40.0f)
|
#define RADAR_LEFT (40.0f)
|
||||||
#define RADAR_BOTTOM (47.0f)
|
#define RADAR_BOTTOM (40.0f)
|
||||||
#define RADAR_WIDTH (94.0f)
|
#define RADAR_WIDTH (94.0f)
|
||||||
#define RADAR_HEIGHT (76.0f)
|
#define RADAR_HEIGHT (76.0f)
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "Boat.h"
|
#include "Boat.h"
|
||||||
#include "Heli.h"
|
#include "Heli.h"
|
||||||
#include "Automobile.h"
|
#include "Automobile.h"
|
||||||
|
#include "Bike.h"
|
||||||
#include "Ped.h"
|
#include "Ped.h"
|
||||||
#include "Particle.h"
|
#include "Particle.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
@ -112,6 +113,8 @@ SpawnCar(int id)
|
||||||
CVehicle *v;
|
CVehicle *v;
|
||||||
if(CModelInfo::IsBoatModel(id))
|
if(CModelInfo::IsBoatModel(id))
|
||||||
v = new CBoat(id, RANDOM_VEHICLE);
|
v = new CBoat(id, RANDOM_VEHICLE);
|
||||||
|
if(CModelInfo::IsBikeModel(id))
|
||||||
|
v = new CBike(id, RANDOM_VEHICLE);
|
||||||
else
|
else
|
||||||
v = new CAutomobile(id, RANDOM_VEHICLE);
|
v = new CAutomobile(id, RANDOM_VEHICLE);
|
||||||
|
|
||||||
|
@ -141,10 +144,12 @@ FixCar(void)
|
||||||
if(veh == nil)
|
if(veh == nil)
|
||||||
return;
|
return;
|
||||||
veh->m_fHealth = 1000.0f;
|
veh->m_fHealth = 1000.0f;
|
||||||
if(!veh->IsCar())
|
if(veh->IsCar()){
|
||||||
return;
|
((CAutomobile*)veh)->Damage.SetEngineStatus(0);
|
||||||
((CAutomobile*)veh)->Damage.SetEngineStatus(0);
|
((CAutomobile*)veh)->Fix();
|
||||||
((CAutomobile*)veh)->Fix();
|
}else if(veh->IsBike()){
|
||||||
|
((CBike*)veh)->Fix();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MENU_MAP
|
#ifdef MENU_MAP
|
||||||
|
@ -355,6 +360,7 @@ DebugMenuPopulate(void)
|
||||||
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
|
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
|
||||||
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
|
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
|
||||||
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });
|
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });
|
||||||
|
DebugMenuAddCmd("Spawn", "Spawn PCJ 600", [](){ SpawnCar(MI_PCJ600); });
|
||||||
|
|
||||||
DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil);
|
DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil);
|
||||||
DebugMenuAddVarBool8("Render", "Backface Culling", &gBackfaceCulling, nil);
|
DebugMenuAddVarBool8("Render", "Backface Culling", &gBackfaceCulling, nil);
|
||||||
|
|
|
@ -133,11 +133,11 @@ RwObjectNameIdAssocation bikeIds[] = {
|
||||||
{ "wheel_rear", BIKE_WHEEL_REAR, 0 },
|
{ "wheel_rear", BIKE_WHEEL_REAR, 0 },
|
||||||
{ "mudguard", BIKE_MUDGUARD, 0 },
|
{ "mudguard", BIKE_MUDGUARD, 0 },
|
||||||
{ "handlebars", BIKE_HANDLEBARS, 0 },
|
{ "handlebars", BIKE_HANDLEBARS, 0 },
|
||||||
{ "ped_frontseat", BIKE_POS_FRONTSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
{ "ped_frontseat", CAR_POS_FRONTSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "ped_backseat", BIKE_POS_BACKSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
{ "ped_backseat", CAR_POS_BACKSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "headlights", BIKE_POS_HEADLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
{ "headlights", CAR_POS_HEADLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "taillights", BIKE_POS_TAILLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
{ "taillights", CAR_POS_TAILLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "exhaust", BIKE_POS_EXHAUST, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
{ "exhaust", CAR_POS_EXHAUST, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "extra1", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
{ "extra1", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "extra2", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
{ "extra2", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
||||||
{ "extra3", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
{ "extra3", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
|
||||||
|
|
|
@ -34,6 +34,36 @@ enum eVehicleType {
|
||||||
NUM_VEHICLE_TYPES
|
NUM_VEHICLE_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum eCarPositions
|
||||||
|
{
|
||||||
|
CAR_POS_HEADLIGHTS,
|
||||||
|
CAR_POS_TAILLIGHTS,
|
||||||
|
CAR_POS_FRONTSEAT,
|
||||||
|
CAR_POS_BACKSEAT,
|
||||||
|
CAR_POS_EXHAUST
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eBoatPositions
|
||||||
|
{
|
||||||
|
BOAT_POS_FRONTSEAT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eTrainPositions
|
||||||
|
{
|
||||||
|
TRAIN_POS_LIGHT_FRONT,
|
||||||
|
TRAIN_POS_LIGHT_REAR,
|
||||||
|
TRAIN_POS_LEFT_ENTRY,
|
||||||
|
TRAIN_POS_MID_ENTRY,
|
||||||
|
TRAIN_POS_RIGHT_ENTRY
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ePlanePositions
|
||||||
|
{
|
||||||
|
PLANE_POS_LIGHT_LEFT,
|
||||||
|
PLANE_POS_LIGHT_RIGHT,
|
||||||
|
PLANE_POS_LIGHT_TAIL,
|
||||||
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
NUM_VEHICLE_POSITIONS = 5
|
NUM_VEHICLE_POSITIONS = 5
|
||||||
};
|
};
|
||||||
|
@ -107,6 +137,7 @@ public:
|
||||||
void SetVehicleComponentFlags(RwFrame *frame, uint32 flags);
|
void SetVehicleComponentFlags(RwFrame *frame, uint32 flags);
|
||||||
void PreprocessHierarchy(void);
|
void PreprocessHierarchy(void);
|
||||||
void GetWheelPosn(int32 n, CVector &pos);
|
void GetWheelPosn(int32 n, CVector &pos);
|
||||||
|
CVector GetFrontSeatPosn(void) { return m_positions[m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT]; };
|
||||||
|
|
||||||
int32 ChooseComponent(void);
|
int32 ChooseComponent(void);
|
||||||
int32 ChooseSecondComponent(void);
|
int32 ChooseSecondComponent(void);
|
||||||
|
|
|
@ -2059,11 +2059,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
|
||||||
|
|
||||||
switch (component) {
|
switch (component) {
|
||||||
case CAR_DOOR_RF:
|
case CAR_DOOR_RF:
|
||||||
if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
vehDoorPos = vehModel->GetFrontSeatPosn();
|
||||||
vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
|
|
||||||
vehDoorPos.x += seatOffset;
|
vehDoorPos.x += seatOffset;
|
||||||
vehDoorOffset.x = -vehDoorOffset.x;
|
vehDoorOffset.x = -vehDoorOffset.x;
|
||||||
break;
|
break;
|
||||||
|
@ -2075,11 +2071,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAR_DOOR_LF:
|
case CAR_DOOR_LF:
|
||||||
if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
vehDoorPos = vehModel->GetFrontSeatPosn();
|
||||||
vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
|
|
||||||
vehDoorPos.x = -(vehDoorPos.x + seatOffset);
|
vehDoorPos.x = -(vehDoorPos.x + seatOffset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2089,11 +2081,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
vehDoorPos = vehModel->GetFrontSeatPosn();
|
||||||
vehDoorPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
vehDoorPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
|
|
||||||
vehDoorOffset = CVector(0.0f, 0.0f, 0.0f);
|
vehDoorOffset = CVector(0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
return vehDoorPos - vehDoorOffset;
|
return vehDoorPos - vehDoorOffset;
|
||||||
|
@ -15678,11 +15666,7 @@ CPed::SeekBoatPosition(void)
|
||||||
CVehicleModelInfo *boatModel = m_carInObjective->GetModelInfo();
|
CVehicleModelInfo *boatModel = m_carInObjective->GetModelInfo();
|
||||||
|
|
||||||
CVector enterOffset;
|
CVector enterOffset;
|
||||||
if (boatModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
enterOffset = boatModel->GetFrontSeatPosn();
|
||||||
enterOffset = boatModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
enterOffset = boatModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
|
|
||||||
enterOffset.x = 0.0f;
|
enterOffset.x = 0.0f;
|
||||||
CMatrix boatMat(m_carInObjective->GetMatrix());
|
CMatrix boatMat(m_carInObjective->GetMatrix());
|
||||||
SetMoveState(PEDMOVE_WALK);
|
SetMoveState(PEDMOVE_WALK);
|
||||||
|
@ -17480,29 +17464,20 @@ CPed::SetPedPositionInCar(void)
|
||||||
CMatrix newMat(m_pMyVehicle->GetMatrix());
|
CMatrix newMat(m_pMyVehicle->GetMatrix());
|
||||||
CVector seatPos;
|
CVector seatPos;
|
||||||
if (m_pMyVehicle->pDriver == this) {
|
if (m_pMyVehicle->pDriver == this) {
|
||||||
if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
seatPos = vehModel->GetFrontSeatPosn();
|
||||||
seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
|
|
||||||
if (!m_pMyVehicle->IsBoat() && m_pMyVehicle->m_vehType != VEHICLE_TYPE_BIKE)
|
if (!m_pMyVehicle->IsBoat() && m_pMyVehicle->m_vehType != VEHICLE_TYPE_BIKE)
|
||||||
seatPos.x = -seatPos.x;
|
seatPos.x = -seatPos.x;
|
||||||
|
|
||||||
} else if (m_pMyVehicle->pPassengers[0] == this) {
|
} else if (m_pMyVehicle->pPassengers[0] == this) {
|
||||||
if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT)
|
seatPos = vehModel->GetFrontSeatPosn();
|
||||||
seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
else
|
|
||||||
seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
|
||||||
} else if (m_pMyVehicle->pPassengers[1] == this) {
|
} else if (m_pMyVehicle->pPassengers[1] == this) {
|
||||||
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
||||||
seatPos.x = -seatPos.x;
|
seatPos.x = -seatPos.x;
|
||||||
} else {
|
} else {
|
||||||
if (m_pMyVehicle->pPassengers[2] == this) {
|
if (m_pMyVehicle->pPassengers[2] == this) {
|
||||||
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
seatPos = vehModel->m_positions[CAR_POS_BACKSEAT];
|
||||||
} else if (vehModel->m_vehicleType == VEHICLE_TYPE_BOAT) {
|
|
||||||
seatPos = vehModel->m_positions[BOAT_POS_FRONTSEAT];
|
|
||||||
} else {
|
} else {
|
||||||
seatPos = vehModel->m_positions[CAR_POS_FRONTSEAT];
|
seatPos = vehModel->GetFrontSeatPosn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newMat.GetPosition() += Multiply3x3(newMat, seatPos);
|
newMat.GetPosition() += Multiply3x3(newMat, seatPos);
|
||||||
|
|
|
@ -175,8 +175,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
|
||||||
for(i = 0; i < 4; i++){
|
for(i = 0; i < 4; i++){
|
||||||
m_aGroundPhysical[i] = nil;
|
m_aGroundPhysical[i] = nil;
|
||||||
m_aGroundOffset[i] = CVector(0.0f, 0.0f, 0.0f);
|
m_aGroundOffset[i] = CVector(0.0f, 0.0f, 0.0f);
|
||||||
m_aSuspensionSpringRatio[i] = 1.0f;
|
m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i] = 1.0f;
|
||||||
m_aSuspensionSpringRatioPrev[i] = m_aSuspensionSpringRatio[i];
|
|
||||||
m_aWheelTimer[i] = 0.0f;
|
m_aWheelTimer[i] = 0.0f;
|
||||||
m_aWheelRotation[i] = 0.0f;
|
m_aWheelRotation[i] = 0.0f;
|
||||||
m_aWheelSpeed[i] = 0.0f;
|
m_aWheelSpeed[i] = 0.0f;
|
||||||
|
@ -4850,8 +4849,8 @@ CAutomobile::BurstTyre(uint8 wheel, bool applyForces)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(applyForces){
|
if(applyForces){
|
||||||
ApplyMoveForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f));
|
ApplyMoveForce(GetRight() * m_fMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f));
|
||||||
ApplyTurnForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f), GetForward());
|
ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f), GetForward());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4867,10 +4866,10 @@ CAutomobile::IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset)
|
||||||
CVector seatPos;
|
CVector seatPos;
|
||||||
switch(component){
|
switch(component){
|
||||||
case CAR_DOOR_RF:
|
case CAR_DOOR_RF:
|
||||||
seatPos = mi->m_positions[mi->m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT];
|
seatPos = mi->GetFrontSeatPosn();
|
||||||
break;
|
break;
|
||||||
case CAR_DOOR_LF:
|
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;
|
seatPos.x = -seatPos.x;
|
||||||
break;
|
break;
|
||||||
case CAR_DOOR_RR:
|
case CAR_DOOR_RR:
|
||||||
|
@ -4898,7 +4897,7 @@ CAutomobile::IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset)
|
||||||
|
|
||||||
CVector dist = doorPos - seatPos;
|
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;
|
doorPos.z += 0.5f;
|
||||||
float length = dist.Magnitude();
|
float length = dist.Magnitude();
|
||||||
CVector pedPos = seatPos + dist*((length+0.6f)/length);
|
CVector pedPos = seatPos + dist*((length+0.6f)/length);
|
||||||
|
@ -5519,7 +5518,7 @@ CAutomobile::SetupModelNodes(void)
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < NUM_CAR_NODES; i++)
|
for(i = 0; i < NUM_CAR_NODES; i++)
|
||||||
m_aCarNodes[i] = nil;
|
m_aCarNodes[i] = nil;
|
||||||
CClumpModelInfo::FillFrameArray((RpClump*)m_rwObject, m_aCarNodes);
|
CClumpModelInfo::FillFrameArray(GetClump(), m_aCarNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -31,15 +31,6 @@ enum eCarNodes
|
||||||
NUM_CAR_NODES,
|
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
|
// These are used for all the wheel arrays
|
||||||
// DON'T confuse with VEHWHEEL, which are vehicle components
|
// DON'T confuse with VEHWHEEL, which are vehicle components
|
||||||
enum {
|
enum {
|
||||||
|
@ -49,16 +40,6 @@ enum {
|
||||||
CARWHEEL_REAR_RIGHT
|
CARWHEEL_REAR_RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eBombType
|
|
||||||
{
|
|
||||||
CARBOMB_NONE,
|
|
||||||
CARBOMB_TIMED,
|
|
||||||
CARBOMB_ONIGNITION,
|
|
||||||
CARBOMB_REMOTE,
|
|
||||||
CARBOMB_TIMEDACTIVE,
|
|
||||||
CARBOMB_ONIGNITIONACTIVE,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CAR_DOOR_FLAG_UNKNOWN = 0x0,
|
CAR_DOOR_FLAG_UNKNOWN = 0x0,
|
||||||
CAR_DOOR_FLAG_LF = 0x1,
|
CAR_DOOR_FLAG_LF = 0x1,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Vehicle.h"
|
||||||
#include "Skidmarks.h"
|
#include "Skidmarks.h"
|
||||||
|
|
||||||
enum eBikeNodes {
|
enum eBikeNodes {
|
||||||
|
@ -14,20 +15,23 @@ enum eBikeNodes {
|
||||||
BIKE_NUM_NODES
|
BIKE_NUM_NODES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eBikePositions
|
enum {
|
||||||
{
|
BIKEWHEEL_FRONT,
|
||||||
BIKE_POS_HEADLIGHTS,
|
BIKEWHEEL_REAR,
|
||||||
BIKE_POS_TAILLIGHTS,
|
};
|
||||||
BIKE_POS_FRONTSEAT,
|
|
||||||
BIKE_POS_BACKSEAT,
|
enum {
|
||||||
BIKE_POS_EXHAUST
|
BIKESUSP_FRONT_1,
|
||||||
|
BIKESUSP_FRONT_2,
|
||||||
|
BIKESUSP_REAR_1,
|
||||||
|
BIKESUSP_REAR_2,
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBike : public CVehicle
|
class CBike : public CVehicle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RwFrame *m_aBikeNodes[BIKE_NUM_NODES];
|
RwFrame *m_aBikeNodes[BIKE_NUM_NODES];
|
||||||
bool m_bLeanMatrixCalculated;
|
bool bLeanMatrixClean;
|
||||||
CMatrix m_leanMatrix;
|
CMatrix m_leanMatrix;
|
||||||
CVector wheelieNormal;
|
CVector wheelieNormal;
|
||||||
CVector wheelieRight;
|
CVector wheelieRight;
|
||||||
|
@ -83,4 +87,43 @@ public:
|
||||||
uint8 m_nDriveWheelsOnGroundPrev;
|
uint8 m_nDriveWheelsOnGroundPrev;
|
||||||
float m_fGasPedalAudio;
|
float m_fGasPedalAudio;
|
||||||
tWheelState m_aWheelState[2];
|
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
|
NUM_PLANE_NODES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ePlanePositions
|
|
||||||
{
|
|
||||||
PLANE_POS_LIGHT_LEFT,
|
|
||||||
PLANE_POS_LIGHT_RIGHT,
|
|
||||||
PLANE_POS_LIGHT_TAIL,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CPlaneNode
|
struct CPlaneNode
|
||||||
{
|
{
|
||||||
CVector p; // position
|
CVector p; // position
|
||||||
|
|
|
@ -24,15 +24,6 @@ enum eTrainNodes
|
||||||
NUM_TRAIN_NODES
|
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
|
struct CTrainNode
|
||||||
{
|
{
|
||||||
CVector p; // position
|
CVector p; // position
|
||||||
|
|
|
@ -31,10 +31,14 @@ enum eCarLock {
|
||||||
CARLOCK_SKIP_SHUT_DOORS
|
CARLOCK_SKIP_SHUT_DOORS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum eBombType
|
||||||
enum
|
|
||||||
{
|
{
|
||||||
BOAT_POS_FRONTSEAT
|
CARBOMB_NONE,
|
||||||
|
CARBOMB_TIMED,
|
||||||
|
CARBOMB_ONIGNITION,
|
||||||
|
CARBOMB_REMOTE,
|
||||||
|
CARBOMB_TIMEDACTIVE,
|
||||||
|
CARBOMB_ONIGNITIONACTIVE,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eDoors
|
enum eDoors
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
#include "Stats.h"
|
#include "Stats.h"
|
||||||
#include "TempColModels.h"
|
#include "TempColModels.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Vehicle.h"
|
#include "Automobile.h"
|
||||||
|
#include "Boat.h"
|
||||||
#include "WaterLevel.h"
|
#include "WaterLevel.h"
|
||||||
#include "WeaponInfo.h"
|
#include "WeaponInfo.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
@ -2056,31 +2057,29 @@ CWeapon::FireInstantHitFromCar(CVehicle *shooter, bool left)
|
||||||
|
|
||||||
CVehicleModelInfo *modelInfo = shooter->GetModelInfo();
|
CVehicleModelInfo *modelInfo = shooter->GetModelInfo();
|
||||||
|
|
||||||
#define FRONTSEATPOS() (&(shooter->IsBoat() ? modelInfo->m_positions[BOAT_POS_FRONTSEAT] : modelInfo->m_positions[CAR_POS_FRONTSEAT]))
|
|
||||||
|
|
||||||
CVector source, target;
|
CVector source, target;
|
||||||
if ( left )
|
if ( left )
|
||||||
{
|
{
|
||||||
source = shooter->GetMatrix() * CVector(-shooter->GetColModel()->boundingBox.max.x + -0.2f,
|
source = shooter->GetMatrix() * CVector(-shooter->GetColModel()->boundingBox.max.x + -0.2f,
|
||||||
float(CGeneral::GetRandomNumber() & 255) * 0.001f + FRONTSEATPOS()->y,
|
float(CGeneral::GetRandomNumber() & 255) * 0.001f + modelInfo->GetFrontSeatPosn().y,
|
||||||
FRONTSEATPOS()->z + 0.5f);
|
modelInfo->GetFrontSeatPosn().z + 0.5f);
|
||||||
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
|
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
|
||||||
|
|
||||||
|
|
||||||
target = shooter->GetMatrix() * CVector(-info->m_fRange,
|
target = shooter->GetMatrix() * CVector(-info->m_fRange,
|
||||||
FRONTSEATPOS()->y,
|
modelInfo->GetFrontSeatPosn().y,
|
||||||
FRONTSEATPOS()->z + 0.5f);
|
modelInfo->GetFrontSeatPosn().z + 0.5f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
source = shooter->GetMatrix() * CVector(shooter->GetColModel()->boundingBox.max.x + 0.2f,
|
source = shooter->GetMatrix() * CVector(shooter->GetColModel()->boundingBox.max.x + 0.2f,
|
||||||
float(CGeneral::GetRandomNumber() & 255) * 0.001f + FRONTSEATPOS()->y,
|
float(CGeneral::GetRandomNumber() & 255) * 0.001f + modelInfo->GetFrontSeatPosn().y,
|
||||||
FRONTSEATPOS()->z + 0.5f);
|
modelInfo->GetFrontSeatPosn().z + 0.5f);
|
||||||
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
|
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
|
||||||
|
|
||||||
target = shooter->GetMatrix() * CVector(info->m_fRange,
|
target = shooter->GetMatrix() * CVector(info->m_fRange,
|
||||||
FRONTSEATPOS()->y,
|
modelInfo->GetFrontSeatPosn().y,
|
||||||
FRONTSEATPOS()->z + 0.5f);
|
modelInfo->GetFrontSeatPosn().z + 0.5f);
|
||||||
}
|
}
|
||||||
#undef FRONTSEATPOS
|
#undef FRONTSEATPOS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue