diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-05-10 01:48:56 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-05-10 01:48:56 +0200 |
commit | 8f54093de1616d3a92ec39ad4e77e84d11d838cb (patch) | |
tree | 3ca9f2943e845953e38a1ea258766cb247cf8217 /src/entities | |
parent | Merge remote-tracking branch 'origin/miami' into lcs (diff) | |
parent | fix (diff) | |
download | re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.gz re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.bz2 re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.lz re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.xz re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.zst re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.zip |
Diffstat (limited to 'src/entities')
-rw-r--r-- | src/entities/Entity.cpp | 22 | ||||
-rw-r--r-- | src/entities/Physical.cpp | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index 7e2104e1..988649ef 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -122,9 +122,9 @@ CEntity::CreateRwObject(void) if(IsBuilding()) gBuildings++; if(RwObjectGetType(m_rwObject) == rpATOMIC) - m_matrix.AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false); + GetMatrix().AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic *)m_rwObject)), false); else if(RwObjectGetType(m_rwObject) == rpCLUMP) - m_matrix.AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false); + GetMatrix().AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump *)m_rwObject)), false); mi->AddRef(); } @@ -136,9 +136,9 @@ CEntity::AttachToRwObject(RwObject *obj) m_rwObject = obj; if(m_rwObject){ if(RwObjectGetType(m_rwObject) == rpATOMIC) - m_matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false); + GetMatrix().Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic *)m_rwObject)), false); else if(RwObjectGetType(m_rwObject) == rpCLUMP) - m_matrix.Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false); + GetMatrix().Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump *)m_rwObject)), false); CModelInfo::GetModelInfo(m_modelIndex)->AddRef(); } @@ -150,7 +150,7 @@ CEntity::DetachFromRwObject(void) if(m_rwObject) CModelInfo::GetModelInfo(m_modelIndex)->RemoveRef(); m_rwObject = nil; - m_matrix.Detach(); + GetMatrix().Detach(); } RpAtomic* @@ -178,7 +178,7 @@ CEntity::DeleteRwObject(void) { RwFrame *f; - m_matrix.Detach(); + GetMatrix().Detach(); if(m_rwObject){ if(RwObjectGetType(m_rwObject) == rpATOMIC){ f = RpAtomicGetFrame((RpAtomic*)m_rwObject); @@ -203,16 +203,16 @@ CEntity::GetBoundRect(void) CVector v; CColModel *col = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); - rect.ContainPoint(m_matrix * col->boundingBox.min); - rect.ContainPoint(m_matrix * col->boundingBox.max); + rect.ContainPoint(GetMatrix() * col->boundingBox.min); + rect.ContainPoint(GetMatrix() * col->boundingBox.max); v = col->boundingBox.min; v.x = col->boundingBox.max.x; - rect.ContainPoint(m_matrix * v); + rect.ContainPoint(GetMatrix() * v); v = col->boundingBox.max; v.x = col->boundingBox.min.x; - rect.ContainPoint(m_matrix * v); + rect.ContainPoint(GetMatrix() * v); return rect; } @@ -228,7 +228,7 @@ CEntity::GetBoundCentre(void) void CEntity::GetBoundCentre(CVector &out) { - out = m_matrix * CModelInfo::GetModelInfo(m_modelIndex)->GetColModel()->boundingSphere.center; + out = GetMatrix() * CModelInfo::GetModelInfo(m_modelIndex)->GetColModel()->boundingSphere.center; } float diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 7be5df23..08516b75 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -463,7 +463,7 @@ CPhysical::ApplyMoveForce(float jx, float jy, float jz) void CPhysical::ApplyTurnForce(float jx, float jy, float jz, float px, float py, float pz) { - CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass); + CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass); CVector turnimpulse = CrossProduct(CVector(px, py, pz)-com, CVector(jx, jy, jz)); m_vecTurnSpeed += turnimpulse*(1.0f/m_fTurnMass); m_vecTurnSpeed.x = clamp(m_vecTurnSpeed.x, -4.0f, 4.0f); @@ -482,7 +482,7 @@ CPhysical::ApplyFrictionMoveForce(float jx, float jy, float jz) void CPhysical::ApplyFrictionTurnForce(float jx, float jy, float jz, float px, float py, float pz) { - CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass); + CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass); CVector turnimpulse = CrossProduct(CVector(px, py, pz)-com, CVector(jx, jy, jz)); m_vecTurnFriction += turnimpulse*(1.0f/m_fTurnMass); } @@ -1046,7 +1046,7 @@ CPhysical::ApplyCollisionAlt(CEntity *B, CColPoint &colpoint, float &impulse, CV moveSpeed += vImpulse * (1.0f/m_fMass); // ApplyTurnForce - CVector com = Multiply3x3(m_matrix, m_vecCentreOfMass); + CVector com = Multiply3x3(GetMatrix(), m_vecCentreOfMass); CVector turnimpulse = CrossProduct(pointpos-com, vImpulse); turnSpeed += turnimpulse*(1.0f/m_fTurnMass); |