I didn't commit the change oop

This commit is contained in:
Diren D Bharwani 2023-03-03 21:16:44 +08:00
parent 5c38244ce4
commit 5cb4c54757
6 changed files with 17 additions and 17 deletions

View File

@ -47,8 +47,8 @@ namespace SHADE
bool SHCollision::ConvexVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
{
const SHConvexPolyhedron& POLY_A = dynamic_cast<const SHConvexPolyhedron&>(A);
const SHConvexPolyhedron& POLY_B = dynamic_cast<const SHConvexPolyhedron&>(B);
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
const SHCollisionUtils::SHCollisionUtils::FaceQuery FACE_QUERY_A = queryFaceDirections(POLY_A, POLY_B);
if (FACE_QUERY_A.bestDistance > 0.0f)
@ -70,8 +70,8 @@ namespace SHADE
static constexpr float ABSOLUTE_TOLERANCE = 0.01f;
static constexpr float RELATIVE_TOLERANCE = 0.95f;
const SHConvexPolyhedron& POLY_A = dynamic_cast<const SHConvexPolyhedron&>(A);
const SHConvexPolyhedron& POLY_B = dynamic_cast<const SHConvexPolyhedron&>(B);
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
const SHCollisionUtils::ShapeTransform TF_A { POLY_A.GetWorldCentroid(), POLY_A.GetWorldOrientation() };
const SHCollisionUtils::ShapeTransform TF_B { POLY_B.GetWorldCentroid(), POLY_B.GetWorldOrientation() };

View File

@ -42,8 +42,8 @@ namespace SHADE
bool SHCollision::SphereVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
{
const SHSphere& SPHERE = dynamic_cast<const SHSphere&>(A);
const SHConvexPolyhedron& POLYHEDRON = dynamic_cast<const SHConvexPolyhedron&>(B);
const SHSphere& SPHERE = reinterpret_cast<const SHSphere&>(A);
const SHConvexPolyhedron& POLYHEDRON = reinterpret_cast<const SHConvexPolyhedron&>(B);
const SHVec3 CENTER = SPHERE.Center;
const float RADIUS = SPHERE.GetWorldRadius();
@ -90,8 +90,8 @@ namespace SHADE
{
// Convert to underlying types
// For the convex, we only need the convex polyhedron shape since the get vertex is pure virtual.
const SHSphere& SPHERE = dynamic_cast<const SHSphere&>(A);
const SHConvexPolyhedron& POLY = dynamic_cast<const SHConvexPolyhedron&>(B);
const SHSphere& SPHERE = reinterpret_cast<const SHSphere&>(A);
const SHConvexPolyhedron& POLY = reinterpret_cast<const SHConvexPolyhedron&>(B);
const SHVec3 CENTER = SPHERE.Center;
const float RADIUS = SPHERE.GetWorldRadius();

View File

@ -26,8 +26,8 @@ namespace SHADE
bool SHCollision::SphereVsSphere(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
{
const SHSphere& SPHERE_A = dynamic_cast<const SHSphere&>(A);
const SHSphere& SPHERE_B = dynamic_cast<const SHSphere&>(B);
const SHSphere& SPHERE_A = reinterpret_cast<const SHSphere&>(A);
const SHSphere& SPHERE_B = reinterpret_cast<const SHSphere&>(B);
const SHVec3 CENTER_A = SPHERE_A.Center;
const float RADIUS_A = SPHERE_A.Radius;
@ -48,8 +48,8 @@ namespace SHADE
bool SHCollision::SphereVsSphere(SHManifold& manifold, const SHCollisionShape& A, const SHCollisionShape& B) noexcept
{
// Convert to underlying types
const SHSphere& SPHERE_A = dynamic_cast<const SHSphere&>(A);
const SHSphere& SPHERE_B = dynamic_cast<const SHSphere&>(B);
const SHSphere& SPHERE_A = reinterpret_cast<const SHSphere&>(A);
const SHSphere& SPHERE_B = reinterpret_cast<const SHSphere&>(B);
const SHVec3 CENTER_A = SPHERE_A.Center;
const float RADIUS_A = SPHERE_A.Radius;

View File

@ -338,7 +338,7 @@ namespace SHADE
{
case SHCollisionShape::Type::BOX:
{
const SHBox* RHS_BOX = dynamic_cast<const SHBox*>(shape);
const SHBox* RHS_BOX = reinterpret_cast<const SHBox*>(shape);
const SHBoxCreateInfo BOX_CREATE_INFO
{
@ -361,7 +361,7 @@ namespace SHADE
}
case SHCollisionShape::Type::SPHERE:
{
const SHSphere* RHS_SPHERE = dynamic_cast<const SHSphere*>(shape);
const SHSphere* RHS_SPHERE = reinterpret_cast<const SHSphere*>(shape);
const SHSphereCreateInfo SPHERE_CREATE_INFO
{

View File

@ -209,12 +209,12 @@ namespace SHADE
{
case SHCollisionShape::Type::SPHERE:
{
baseResult = dynamic_cast<const SHSphere*>(SHAPE)->Raycast(info.ray);
baseResult = reinterpret_cast<const SHSphere*>(SHAPE)->Raycast(info.ray);
break;
}
case SHCollisionShape::Type::BOX:
{
baseResult = dynamic_cast<const SHBox*>(SHAPE)->Raycast(info.ray);
baseResult = reinterpret_cast<const SHBox*>(SHAPE)->Raycast(info.ray);
break;
}
case SHCollisionShape::Type::CAPSULE:

View File

@ -31,7 +31,7 @@ namespace SHADE
if (!shape || shape->GetType() == SHCollisionShape::Type::INVALID)
throw gcnew System::InvalidOperationException("Attempted to retrieve invalid CollisionShape.");
return dynamic_cast<CollisionShapeType&>(*shape);
return reinterpret_cast<CollisionShapeType&>(*shape);
}
catch (std::invalid_argument&)
{