Fixed bug where collisions were reported in the wrong state

This commit is contained in:
Diren D Bharwani 2022-11-01 14:08:47 +08:00
parent 9ec9411ce3
commit 68be65f341
2 changed files with 3 additions and 8 deletions

View File

@ -28,11 +28,6 @@
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* Concepts */
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* Type Definitions */

View File

@ -42,6 +42,9 @@ namespace SHADE
SHCollisionEvent cInfo;
// Update collision state
cInfo.collisionState = static_cast<SHCollisionEvent::State>(cp.getEventType());
// Match body and collider for collision event
const rp3d::Entity body1 = cp.getBody1()->getEntity();
const rp3d::Entity body2 = cp.getBody2()->getEntity();
@ -76,9 +79,6 @@ namespace SHADE
return cInfo;
}
// Update collision state
cInfo.collisionState = static_cast<SHCollisionEvent::State>(cp.getEventType());
return cInfo;
}
} // namespace SHADE