mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 17:20:00 +00:00
sorted out object collision enums
This commit is contained in:
parent
b4bbd91921
commit
a2b89c6a18
|
@ -1847,7 +1847,7 @@ CPhysical::ProcessCollision(void)
|
||||||
step = savedTimeStep / n;
|
step = savedTimeStep / n;
|
||||||
}else if(IsObject()){
|
}else if(IsObject()){
|
||||||
int responsecase = ((CObject*)this)->m_nSpecialCollisionResponseCases;
|
int responsecase = ((CObject*)this)->m_nSpecialCollisionResponseCases;
|
||||||
if(responsecase == COLLRESPONSE_CHANGE_MODEL){
|
if(responsecase == COLLRESPONSE_LAMPOST){
|
||||||
CVector speedUp = { 0.0f, 0.0f, 0.0f };
|
CVector speedUp = { 0.0f, 0.0f, 0.0f };
|
||||||
CVector speedDown = { 0.0f, 0.0f, 0.0f };
|
CVector speedDown = { 0.0f, 0.0f, 0.0f };
|
||||||
speedUp.z = GetBoundRadius();
|
speedUp.z = GetBoundRadius();
|
||||||
|
@ -1866,7 +1866,7 @@ CPhysical::ProcessCollision(void)
|
||||||
n = NUMSTEPS(0.09f);
|
n = NUMSTEPS(0.09f);
|
||||||
step = savedTimeStep / n;
|
step = savedTimeStep / n;
|
||||||
}
|
}
|
||||||
}else if(responsecase == COLLRESPONSE_SPLIT_MODEL || responsecase == COLLRESPONSE_CHANGE_THEN_SMASH){
|
}else if(responsecase == COLLRESPONSE_SMALLBOX || responsecase == COLLRESPONSE_FENCEPART){
|
||||||
if(distSq >= sq(0.15f)){
|
if(distSq >= sq(0.15f)){
|
||||||
n = NUMSTEPS(0.15f);
|
n = NUMSTEPS(0.15f);
|
||||||
step = savedTimeStep / n;
|
step = savedTimeStep / n;
|
||||||
|
|
|
@ -173,12 +173,12 @@ CObject::ObjectDamage(float amount)
|
||||||
const float fDirectionZ = 0.0002f * amount;
|
const float fDirectionZ = 0.0002f * amount;
|
||||||
switch (m_nCollisionDamageEffect)
|
switch (m_nCollisionDamageEffect)
|
||||||
{
|
{
|
||||||
case COLLRESPONSE_CHANGE_MODEL:
|
case DAMAGE_EFFECT_CHANGE_MODEL:
|
||||||
bRenderDamaged = true;
|
bRenderDamaged = true;
|
||||||
break;
|
break;
|
||||||
case COLLRESPONSE_SPLIT_MODEL:
|
case DAMAGE_EFFECT_SPLIT_MODEL:
|
||||||
break;
|
break;
|
||||||
case COLLRESPONSE_SMASH_COMPLETELY:
|
case DAMAGE_EFFECT_SMASH_COMPLETELY:
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
bIsStatic = true;
|
||||||
|
@ -186,7 +186,7 @@ CObject::ObjectDamage(float amount)
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
break;
|
break;
|
||||||
case COLLRESPONSE_CHANGE_THEN_SMASH:
|
case DAMAGE_EFFECT_CHANGE_THEN_SMASH:
|
||||||
if (!bRenderDamaged) {
|
if (!bRenderDamaged) {
|
||||||
bRenderDamaged = true;
|
bRenderDamaged = true;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ CObject::ObjectDamage(float amount)
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
bIsStatic = true;
|
||||||
|
@ -222,7 +222,7 @@ CObject::ObjectDamage(float amount)
|
||||||
PlayOneShotScriptObject(_SCRSOUND_CARDBOARD_BOX_SMASH, vecPos);
|
PlayOneShotScriptObject(_SCRSOUND_CARDBOARD_BOX_SMASH, vecPos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
bIsStatic = true;
|
||||||
|
@ -245,7 +245,7 @@ CObject::ObjectDamage(float amount)
|
||||||
PlayOneShotScriptObject(_SCRSOUND_WOODEN_BOX_SMASH, vecPos);
|
PlayOneShotScriptObject(_SCRSOUND_WOODEN_BOX_SMASH, vecPos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
bIsStatic = true;
|
||||||
|
@ -270,7 +270,7 @@ CObject::ObjectDamage(float amount)
|
||||||
PlayOneShotScriptObject(_SCRSOUND_TYRE_BUMP, vecPos);
|
PlayOneShotScriptObject(_SCRSOUND_TYRE_BUMP, vecPos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COLLRESPONSE_SMASH_BARPOST_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
bIsStatic = true;
|
||||||
|
|
|
@ -10,19 +10,28 @@ enum {
|
||||||
CUTSCENE_OBJECT = 4,
|
CUTSCENE_OBJECT = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum CollisionSpecialResponseCase
|
||||||
|
{
|
||||||
COLLRESPONSE_NONE,
|
COLLRESPONSE_NONE,
|
||||||
COLLRESPONSE_CHANGE_MODEL,
|
COLLRESPONSE_LAMPOST,
|
||||||
COLLRESPONSE_SPLIT_MODEL,
|
COLLRESPONSE_SMALLBOX,
|
||||||
COLLRESPONSE_SMASH_COMPLETELY,
|
COLLRESPONSE_BIGBOX,
|
||||||
COLLRESPONSE_CHANGE_THEN_SMASH,
|
COLLRESPONSE_FENCEPART,
|
||||||
COLLRESPONSE_UNKNOWN5,
|
COLLRESPONSE_UNKNOWN5
|
||||||
|
};
|
||||||
|
|
||||||
COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY = 50,
|
enum CollisionDamageEffect
|
||||||
COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY = 60,
|
{
|
||||||
COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY = 70,
|
DAMAGE_EFFECT_NONE,
|
||||||
COLLRESPONSE_SMASH_BARPOST_COMPLETELY = 80,
|
DAMAGE_EFFECT_CHANGE_MODEL,
|
||||||
|
DAMAGE_EFFECT_SPLIT_MODEL,
|
||||||
|
DAMAGE_EFFECT_SMASH_COMPLETELY,
|
||||||
|
DAMAGE_EFFECT_CHANGE_THEN_SMASH,
|
||||||
|
|
||||||
|
DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY = 50,
|
||||||
|
DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY = 60,
|
||||||
|
DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY = 70,
|
||||||
|
DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY = 80
|
||||||
};
|
};
|
||||||
|
|
||||||
class CVehicle;
|
class CVehicle;
|
||||||
|
|
|
@ -9551,7 +9551,7 @@ CPed::ProcessControl(void)
|
||||||
{
|
{
|
||||||
CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex());
|
CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex());
|
||||||
CColModel *collidingCol = collidingModel->GetColModel();
|
CColModel *collidingCol = collidingModel->GetColModel();
|
||||||
if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_CHANGE_THEN_SMASH
|
if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_FENCEPART
|
||||||
|| collidingCol->boundingBox.max.x < 3.0f
|
|| collidingCol->boundingBox.max.x < 3.0f
|
||||||
&& collidingCol->boundingBox.max.y < 3.0f) {
|
&& collidingCol->boundingBox.max.y < 3.0f) {
|
||||||
|
|
||||||
|
@ -16934,7 +16934,7 @@ CPed::SpawnFlyingComponent(int pedNode, int8 direction)
|
||||||
obj->ObjectCreatedBy = TEMP_OBJECT;
|
obj->ObjectCreatedBy = TEMP_OBJECT;
|
||||||
obj->bIsStatic = false;
|
obj->bIsStatic = false;
|
||||||
obj->bIsPickup = false;
|
obj->bIsPickup = false;
|
||||||
obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SPLIT_MODEL;
|
obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SMALLBOX;
|
||||||
|
|
||||||
// life time - the more objects the are, the shorter this one will live
|
// life time - the more objects the are, the shorter this one will live
|
||||||
CObject::nNoTempObjects++;
|
CObject::nNoTempObjects++;
|
||||||
|
|
Loading…
Reference in a new issue