From cb262c791e95a959f015e3231f61912024c88818 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Wed, 8 Apr 2020 22:29:02 +0300 Subject: Finished CExplosion --- src/vehicles/Bike.h | 15 +++++++++++++++ src/vehicles/Vehicle.h | 1 + 2 files changed, 16 insertions(+) create mode 100644 src/vehicles/Bike.h (limited to 'src/vehicles') diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h new file mode 100644 index 00000000..00aa259c --- /dev/null +++ b/src/vehicles/Bike.h @@ -0,0 +1,15 @@ +#pragma once + +// some miami bike leftovers + +enum eBikeNodes { + BIKE_NODE_NONE, + BIKE_CHASSIS, + BIKE_FORKS_FRONT, + BIKE_FORKS_REAR, + BIKE_WHEEL_FRONT, + BIKE_WHEEL_REAR, + BIKE_MUDGUARD, + BIKE_HANDLEBARS, + BIKE_NUM_NODES +}; \ No newline at end of file diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 4639f3e1..c7be3674 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -238,6 +238,7 @@ public: bool IsTrain(void) { return m_vehType == VEHICLE_TYPE_TRAIN; } bool IsHeli(void) { return m_vehType == VEHICLE_TYPE_HELI; } bool IsPlane(void) { return m_vehType == VEHICLE_TYPE_PLANE; } + bool IsBike(void) { return m_vehType == VEHICLE_TYPE_BIKE; } void FlyingControl(eFlightModel flightModel); void ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelContactSpeed, CVector &wheelContactPoint, -- cgit v1.2.3 From 6225e5072309e69e98246f59222ba82ddf6a418a Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 9 Apr 2020 16:35:24 +0200 Subject: fixed questionable RW usage; changed radar mask to PS2 techinque --- src/vehicles/Automobile.cpp | 10 ++++----- src/vehicles/Boat.cpp | 54 +++++++++++++-------------------------------- 2 files changed, 20 insertions(+), 44 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 0c8f0dd4..1c0d673e 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -182,17 +182,17 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy) m_weaponDoorTimerRight = m_weaponDoorTimerLeft; if(GetModelIndex() == MI_DODO){ - RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0); + RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0); CMatrix mat1; mat1.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_RF])); CMatrix mat2(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LF])); mat1.GetPosition() += CVector(mat2.GetPosition().x + 0.1f, 0.0f, mat2.GetPosition().z); mat1.UpdateRW(); }else if(GetModelIndex() == MI_MIAMI_SPARROW || GetModelIndex() == MI_MIAMI_RCRAIDER){ - RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0); - RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0); - RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0); - RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_RB]), 0); + RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0); + RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0); + RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0); + RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RB]), 0); }else if(GetModelIndex() == MI_RHINO){ bExplosionProof = true; bBulletProof = true; diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 6d584017..9c7cbb4f 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -94,7 +94,7 @@ CBoat::GetComponentWorldPosition(int32 component, CVector &pos) pos = *RwMatrixGetPos(RwFrameGetLTM(m_aBoatNodes[component])); } -RxObjSpace3DVertex KeepWaterOutVertices[4]; +RwIm3DVertex KeepWaterOutVertices[4]; RwImVertexIndex KeepWaterOutIndices[6]; void @@ -103,7 +103,7 @@ CBoat::Render() CMatrix matrix; if (m_aBoatNodes[1] != nil) { - matrix.Attach(&m_aBoatNodes[1]->modelling); + matrix.Attach(RwFrameGetMatrix(m_aBoatNodes[1])); CVector pos = matrix.GetPosition(); matrix.SetRotateZ(m_fMovingHiRotation); @@ -111,7 +111,7 @@ CBoat::Render() matrix.UpdateRW(); if (CVehicle::bWheelsOnlyCheat) { - RpAtomicRenderMacro((RpAtomic*)GetFirstObject(m_aBoatNodes[1])); + RpAtomicRender((RpAtomic*)GetFirstObject(m_aBoatNodes[1])); } } m_fMovingHiRotation += 0.05f; @@ -130,47 +130,23 @@ CBoat::Render() KeepWaterOutIndices[5] = 3; switch (GetModelIndex()) { case MI_SPEEDER: - KeepWaterOutVertices[0].objVertex.x = -1.15f; - KeepWaterOutVertices[0].objVertex.y = 3.61f; - KeepWaterOutVertices[0].objVertex.z = 1.03f; - KeepWaterOutVertices[1].objVertex.x = 1.15f; - KeepWaterOutVertices[1].objVertex.y = 3.61f; - KeepWaterOutVertices[1].objVertex.z = 1.03f; - KeepWaterOutVertices[2].objVertex.x = -1.15f; - KeepWaterOutVertices[2].objVertex.y = 0.06f; - KeepWaterOutVertices[2].objVertex.z = 1.03f; - KeepWaterOutVertices[3].objVertex.x = 1.15f; - KeepWaterOutVertices[3].objVertex.y = 0.06f; - KeepWaterOutVertices[3].objVertex.z = 1.03f; + RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.15f, 3.61f, 1.03f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.15f, 3.61f, 1.03f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.15f, 0.06f, 1.03f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.15f, 0.06f, 1.03f); break; case MI_REEFER: - KeepWaterOutVertices[2].objVertex.x = -1.9f; - KeepWaterOutVertices[2].objVertex.y = 2.83f; - KeepWaterOutVertices[2].objVertex.z = 1.0f; - KeepWaterOutVertices[3].objVertex.x = 1.9f; - KeepWaterOutVertices[3].objVertex.y = 2.83f; - KeepWaterOutVertices[3].objVertex.z = 1.0f; - KeepWaterOutVertices[0].objVertex.x = -1.66f; - KeepWaterOutVertices[0].objVertex.y = -4.48f; - KeepWaterOutVertices[0].objVertex.z = 0.83f; - KeepWaterOutVertices[1].objVertex.x = 1.66f; - KeepWaterOutVertices[1].objVertex.y = -4.48f; - KeepWaterOutVertices[1].objVertex.z = 0.83f; + RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.9f, 2.83f, 1.0f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.9f, 2.83f, 1.0f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.66f, -4.48f, 0.83f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.66f, -4.48f, 0.83f); break; case MI_PREDATOR: default: - KeepWaterOutVertices[0].objVertex.x = -1.45f; - KeepWaterOutVertices[0].objVertex.y = 1.9f; - KeepWaterOutVertices[0].objVertex.z = 0.96f; - KeepWaterOutVertices[1].objVertex.x = 1.45f; - KeepWaterOutVertices[1].objVertex.y = 1.9f; - KeepWaterOutVertices[1].objVertex.z = 0.96f; - KeepWaterOutVertices[2].objVertex.x = -1.45f; - KeepWaterOutVertices[2].objVertex.y = -3.75f; - KeepWaterOutVertices[2].objVertex.z = 0.96f; - KeepWaterOutVertices[3].objVertex.x = 1.45f; - KeepWaterOutVertices[3].objVertex.y = -3.75f; - KeepWaterOutVertices[3].objVertex.z = 0.96f; + RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.45f, 1.9f, 0.96f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.45f, 1.9f, 0.96f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.45f, -3.75f, 0.96f); + RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.45f, -3.75f, 0.96f); break; } KeepWaterOutVertices[0].u = 0.0f; -- cgit v1.2.3 From 34349c4df2683fca35be37ec626aaa8eef2ddaee Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 9 Apr 2020 20:50:24 +0200 Subject: normalized line endings to LF --- src/vehicles/Bike.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h index 00aa259c..4e7e5a0e 100644 --- a/src/vehicles/Bike.h +++ b/src/vehicles/Bike.h @@ -1,15 +1,15 @@ -#pragma once - -// some miami bike leftovers - -enum eBikeNodes { - BIKE_NODE_NONE, - BIKE_CHASSIS, - BIKE_FORKS_FRONT, - BIKE_FORKS_REAR, - BIKE_WHEEL_FRONT, - BIKE_WHEEL_REAR, - BIKE_MUDGUARD, - BIKE_HANDLEBARS, - BIKE_NUM_NODES +#pragma once + +// some miami bike leftovers + +enum eBikeNodes { + BIKE_NODE_NONE, + BIKE_CHASSIS, + BIKE_FORKS_FRONT, + BIKE_FORKS_REAR, + BIKE_WHEEL_FRONT, + BIKE_WHEEL_REAR, + BIKE_MUDGUARD, + BIKE_HANDLEBARS, + BIKE_NUM_NODES }; \ No newline at end of file -- cgit v1.2.3