summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelinfo')
-rw-r--r--src/modelinfo/ModelInfo.cpp4
-rw-r--r--src/modelinfo/PedModelInfo.cpp8
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp7
-rw-r--r--src/modelinfo/VehicleModelInfo.cpp21
-rw-r--r--src/modelinfo/VehicleModelInfo.h38
5 files changed, 63 insertions, 15 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index da09bdfa..d6fb0102 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -217,6 +217,7 @@ CModelInfo::IsBikeModel(int32 id)
void
CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
int i;
CBaseModelInfo *mi;
CColModel *colmodel;
@@ -225,10 +226,11 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
mi = GetModelInfo(i);
if(mi){
colmodel = mi->GetColModel();
- if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level)
+ if(colmodel && colmodel->level != LEVEL_GENERIC && colmodel->level != level)
colmodel->RemoveCollisionVolumes();
}
}
+#endif
}
void
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 473e8b63..60c63114 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -251,7 +251,7 @@ CPedModelInfo::CreateHitColModel(void)
center.x = mat->pos.x + m_pColNodeInfos[i].x;
center.y = mat->pos.y + 0.0f;
center.z = mat->pos.z + m_pColNodeInfos[i].z;
- spheres[i].Set(radius, center, SURFACE_FLESH, m_pColNodeInfos[i].pieceType);
+ spheres[i].Set(radius, center, SURFACE_PED, m_pColNodeInfos[i].pieceType);
}
}
RwMatrixDestroy(mat);
@@ -265,7 +265,7 @@ CPedModelInfo::CreateHitColModel(void)
max.x = max.y = 0.5f;
max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0);
- colmodel->level = LEVEL_NONE;
+ colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
@@ -335,7 +335,7 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
center.x = pos.x + m_pColNodeInfos[i].x;
center.y = pos.y + 0.0f;
center.z = pos.z + m_pColNodeInfos[i].z;
- spheres[i].Set(m_pColNodeInfos[i].radius, center, SURFACE_FLESH, m_pColNodeInfos[i].pieceType);
+ spheres[i].Set(m_pColNodeInfos[i].radius, center, SURFACE_PED, m_pColNodeInfos[i].pieceType);
}
RwMatrixDestroy(invmat);
RwMatrixDestroy(mat);
@@ -349,7 +349,7 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
max.x = max.y = 0.5f;
max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0);
- colmodel->level = LEVEL_NONE;
+ colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index a781cf58..32204500 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -157,6 +157,13 @@ CSimpleModelInfo::SetupBigBuilding(void)
if(related)
m_lodDistances[2] = related->GetLargestLodDistance()/TheCamera.LODDistMultiplier;
else
+#ifdef FIX_BUGS
+ if(toupper(m_name[0]) == 'L' && toupper(m_name[1]) == 'O' && toupper(m_name[2]) == 'D')
m_lodDistances[2] = 100.0f;
+ else
+ m_lodDistances[2] = 0.0f;
+#else
+ m_lodDistances[2] = 100.0f;
+#endif
}
}
diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp
index 74285c19..d8b388d5 100644
--- a/src/modelinfo/VehicleModelInfo.cpp
+++ b/src/modelinfo/VehicleModelInfo.cpp
@@ -16,6 +16,7 @@
#include "Train.h"
#include "Plane.h"
#include "Heli.h"
+#include "Bike.h"
#include "ModelIndices.h"
#include "ModelInfo.h"
@@ -120,16 +121,16 @@ RwObjectNameIdAssocation planeIds[] = {
};
RwObjectNameIdAssocation bikeIds[] = {
- { "chassis_dummy", 1, 0 },
- { "forks_front", 2, 0 },
- { "forks_rear", 3, 0 },
- { "wheel_front", 4, 0 },
- { "wheel_rear", 5, 0 },
- { "mudguard", 6, 0 },
- { "ped_frontseat", 2, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "headlights", 0, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "taillights", 1, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "exhaust", 9, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "chassis_dummy", BIKE_CHASSIS, 0 },
+ { "forks_front", BIKE_FORKS_FRONT, 0 },
+ { "forks_rear", BIKE_FORKS_REAR, 0 },
+ { "wheel_front", BIKE_WHEEL_FRONT, 0 },
+ { "wheel_rear", BIKE_WHEEL_REAR, 0 },
+ { "mudguard", BIKE_MUDGUARD, 0 },
+ { "ped_frontseat", CAR_POS_FRONTSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "headlights", CAR_POS_HEADLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "taillights", CAR_POS_TAILLIGHTS, 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 },
{ "extra2", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
{ "extra3", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h
index ba25d3cd..e6ba576d 100644
--- a/src/modelinfo/VehicleModelInfo.h
+++ b/src/modelinfo/VehicleModelInfo.h
@@ -35,6 +35,43 @@ enum eVehicleType {
NUM_VEHICLE_TYPES
};
+enum eCarPositions
+{
+ CAR_POS_HEADLIGHTS,
+ CAR_POS_TAILLIGHTS,
+ CAR_POS_FRONTSEAT,
+ CAR_POS_BACKSEAT,
+ // these are unused so we don't know the actual values
+ CAR_POS_REVERSELIGHTS,
+ CAR_POS_BRAKELIGHTS,
+ CAR_POS_INDICATORS_FRONT,
+ CAR_POS_INDICATORS_BACK,
+ CAR_POS_STEERWHEEL,
+ //
+ 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 {
NUM_VEHICLE_POSITIONS = 10
};
@@ -100,6 +137,7 @@ public:
void SetVehicleComponentFlags(RwFrame *frame, uint32 flags);
void PreprocessHierarchy(void);
void GetWheelPosn(int32 n, CVector &pos);
+ const CVector &GetFrontSeatPosn(void) { return m_vehicleType == VEHICLE_TYPE_BOAT ? m_positions[BOAT_POS_FRONTSEAT] : m_positions[CAR_POS_FRONTSEAT]; }
int32 ChooseComponent(void);
int32 ChooseSecondComponent(void);