summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelinfo')
-rw-r--r--src/modelinfo/PedModelInfo.cpp27
-rw-r--r--src/modelinfo/WeaponModelInfo.cpp4
-rw-r--r--src/modelinfo/WeaponModelInfo.h3
3 files changed, 12 insertions, 22 deletions
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index e4758a96..bd515391 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -78,7 +78,6 @@ ColNodeInfo m_pColNodeInfos[NUMPEDINFONODES] = {
void
CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
{
- CVector center;
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(clump);
CColModel *colmodel = new CColModel;
CColSphere *spheres = (CColSphere*)RwMalloc(NUMPEDINFONODES*sizeof(CColSphere));
@@ -97,23 +96,17 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
RwV3d pos = { 0.0f, 0.0f, 0.0f };
RwV3dTransformPoints(&pos, &pos, 1, mat);
- 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_PED, m_pColNodeInfos[i].pieceType);
+ spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z);
+ spheres[i].radius = m_pColNodeInfos[i].radius;
+ spheres[i].surface = SURFACE_PED;
+ spheres[i].piece = m_pColNodeInfos[i].pieceType;
}
RwMatrixDestroy(invmat);
RwMatrixDestroy(mat);
colmodel->spheres = spheres;
colmodel->numSpheres = NUMPEDINFONODES;
- center.x = center.y = center.z = 0.0f;
- colmodel->boundingSphere.Set(2.0f, center);
- CVector min, max;
- min.x = min.y = -0.5f;
- min.z = -1.2f;
- max.x = max.y = 0.5f;
- max.z = 1.2f;
- colmodel->boundingBox.Set(min, max);
+ colmodel->boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f));
+ colmodel->boundingBox.Set(CVector(-0.5f, -0.5f, -1.2f), CVector(0.5f, 0.5f, 1.2f));
colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
@@ -141,9 +134,7 @@ CPedModelInfo::AnimatePedColModelSkinned(RpClump *clump)
RwV3d pos = { 0.0f, 0.0f, 0.0f };
RwV3dTransformPoints(&pos, &pos, 1, mat);
- spheres[i].center.x = pos.x + m_pColNodeInfos[i].x;
- spheres[i].center.y = pos.y + 0.0f;
- spheres[i].center.z = pos.z + m_pColNodeInfos[i].z;
+ spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z);
}
RwMatrixDestroy(invmat);
RwMatrixDestroy(mat);
@@ -167,9 +158,7 @@ CPedModelInfo::AnimatePedColModelSkinnedWorld(RpClump *clump)
RwV3d pos = { 0.0f, 0.0f, 0.0f };
RwV3dTransformPoints(&pos, &pos, 1, mat);
- spheres[i].center.x = pos.x + m_pColNodeInfos[i].x;
- spheres[i].center.y = pos.y + 0.0f;
- spheres[i].center.z = pos.z + m_pColNodeInfos[i].z;
+ spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z);
}
return m_hitColModel;
}
diff --git a/src/modelinfo/WeaponModelInfo.cpp b/src/modelinfo/WeaponModelInfo.cpp
index 2a79fada..bd8f5cb8 100644
--- a/src/modelinfo/WeaponModelInfo.cpp
+++ b/src/modelinfo/WeaponModelInfo.cpp
@@ -40,10 +40,10 @@ CWeaponModelInfo::SetWeaponInfo(int32 weaponId)
m_atomics[2] = (RpAtomic*)weaponId;
}
-int32
+eWeaponType
CWeaponModelInfo::GetWeaponInfo(void)
{
- return (int32)(uintptr)m_atomics[2];
+ return (eWeaponType)(uintptr)m_atomics[2];
}
void
diff --git a/src/modelinfo/WeaponModelInfo.h b/src/modelinfo/WeaponModelInfo.h
index 5c690c29..548bf8a6 100644
--- a/src/modelinfo/WeaponModelInfo.h
+++ b/src/modelinfo/WeaponModelInfo.h
@@ -1,6 +1,7 @@
#pragma once
#include "SimpleModelInfo.h"
+#include "WeaponType.h"
class CWeaponModelInfo : public CSimpleModelInfo
{
@@ -18,5 +19,5 @@ public:
void Init(void);
void SetWeaponInfo(int32 weaponId);
- int32 GetWeaponInfo(void);
+ eWeaponType GetWeaponInfo(void);
};