I didn't commit the change oop
This commit is contained in:
parent
5c38244ce4
commit
5cb4c54757
|
@ -47,8 +47,8 @@ namespace SHADE
|
||||||
|
|
||||||
bool SHCollision::ConvexVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
bool SHCollision::ConvexVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
||||||
{
|
{
|
||||||
const SHConvexPolyhedron& POLY_A = dynamic_cast<const SHConvexPolyhedron&>(A);
|
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
|
||||||
const SHConvexPolyhedron& POLY_B = dynamic_cast<const SHConvexPolyhedron&>(B);
|
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
||||||
|
|
||||||
const SHCollisionUtils::SHCollisionUtils::FaceQuery FACE_QUERY_A = queryFaceDirections(POLY_A, POLY_B);
|
const SHCollisionUtils::SHCollisionUtils::FaceQuery FACE_QUERY_A = queryFaceDirections(POLY_A, POLY_B);
|
||||||
if (FACE_QUERY_A.bestDistance > 0.0f)
|
if (FACE_QUERY_A.bestDistance > 0.0f)
|
||||||
|
@ -70,8 +70,8 @@ namespace SHADE
|
||||||
static constexpr float ABSOLUTE_TOLERANCE = 0.01f;
|
static constexpr float ABSOLUTE_TOLERANCE = 0.01f;
|
||||||
static constexpr float RELATIVE_TOLERANCE = 0.95f;
|
static constexpr float RELATIVE_TOLERANCE = 0.95f;
|
||||||
|
|
||||||
const SHConvexPolyhedron& POLY_A = dynamic_cast<const SHConvexPolyhedron&>(A);
|
const SHConvexPolyhedron& POLY_A = reinterpret_cast<const SHConvexPolyhedron&>(A);
|
||||||
const SHConvexPolyhedron& POLY_B = dynamic_cast<const SHConvexPolyhedron&>(B);
|
const SHConvexPolyhedron& POLY_B = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
||||||
|
|
||||||
const SHCollisionUtils::ShapeTransform TF_A { POLY_A.GetWorldCentroid(), POLY_A.GetWorldOrientation() };
|
const SHCollisionUtils::ShapeTransform TF_A { POLY_A.GetWorldCentroid(), POLY_A.GetWorldOrientation() };
|
||||||
const SHCollisionUtils::ShapeTransform TF_B { POLY_B.GetWorldCentroid(), POLY_B.GetWorldOrientation() };
|
const SHCollisionUtils::ShapeTransform TF_B { POLY_B.GetWorldCentroid(), POLY_B.GetWorldOrientation() };
|
||||||
|
|
|
@ -42,8 +42,8 @@ namespace SHADE
|
||||||
|
|
||||||
bool SHCollision::SphereVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
bool SHCollision::SphereVsConvex(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
||||||
{
|
{
|
||||||
const SHSphere& SPHERE = dynamic_cast<const SHSphere&>(A);
|
const SHSphere& SPHERE = reinterpret_cast<const SHSphere&>(A);
|
||||||
const SHConvexPolyhedron& POLYHEDRON = dynamic_cast<const SHConvexPolyhedron&>(B);
|
const SHConvexPolyhedron& POLYHEDRON = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
||||||
|
|
||||||
const SHVec3 CENTER = SPHERE.Center;
|
const SHVec3 CENTER = SPHERE.Center;
|
||||||
const float RADIUS = SPHERE.GetWorldRadius();
|
const float RADIUS = SPHERE.GetWorldRadius();
|
||||||
|
@ -90,8 +90,8 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
// Convert to underlying types
|
// Convert to underlying types
|
||||||
// For the convex, we only need the convex polyhedron shape since the get vertex is pure virtual.
|
// 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 SHSphere& SPHERE = reinterpret_cast<const SHSphere&>(A);
|
||||||
const SHConvexPolyhedron& POLY = dynamic_cast<const SHConvexPolyhedron&>(B);
|
const SHConvexPolyhedron& POLY = reinterpret_cast<const SHConvexPolyhedron&>(B);
|
||||||
|
|
||||||
const SHVec3 CENTER = SPHERE.Center;
|
const SHVec3 CENTER = SPHERE.Center;
|
||||||
const float RADIUS = SPHERE.GetWorldRadius();
|
const float RADIUS = SPHERE.GetWorldRadius();
|
||||||
|
|
|
@ -26,8 +26,8 @@ namespace SHADE
|
||||||
|
|
||||||
bool SHCollision::SphereVsSphere(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
bool SHCollision::SphereVsSphere(const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
||||||
{
|
{
|
||||||
const SHSphere& SPHERE_A = dynamic_cast<const SHSphere&>(A);
|
const SHSphere& SPHERE_A = reinterpret_cast<const SHSphere&>(A);
|
||||||
const SHSphere& SPHERE_B = dynamic_cast<const SHSphere&>(B);
|
const SHSphere& SPHERE_B = reinterpret_cast<const SHSphere&>(B);
|
||||||
|
|
||||||
const SHVec3 CENTER_A = SPHERE_A.Center;
|
const SHVec3 CENTER_A = SPHERE_A.Center;
|
||||||
const float RADIUS_A = SPHERE_A.Radius;
|
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
|
bool SHCollision::SphereVsSphere(SHManifold& manifold, const SHCollisionShape& A, const SHCollisionShape& B) noexcept
|
||||||
{
|
{
|
||||||
// Convert to underlying types
|
// Convert to underlying types
|
||||||
const SHSphere& SPHERE_A = dynamic_cast<const SHSphere&>(A);
|
const SHSphere& SPHERE_A = reinterpret_cast<const SHSphere&>(A);
|
||||||
const SHSphere& SPHERE_B = dynamic_cast<const SHSphere&>(B);
|
const SHSphere& SPHERE_B = reinterpret_cast<const SHSphere&>(B);
|
||||||
|
|
||||||
const SHVec3 CENTER_A = SPHERE_A.Center;
|
const SHVec3 CENTER_A = SPHERE_A.Center;
|
||||||
const float RADIUS_A = SPHERE_A.Radius;
|
const float RADIUS_A = SPHERE_A.Radius;
|
||||||
|
|
|
@ -338,7 +338,7 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
case SHCollisionShape::Type::BOX:
|
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
|
const SHBoxCreateInfo BOX_CREATE_INFO
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
case SHCollisionShape::Type::SPHERE:
|
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
|
const SHSphereCreateInfo SPHERE_CREATE_INFO
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,12 +209,12 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
case SHCollisionShape::Type::SPHERE:
|
case SHCollisionShape::Type::SPHERE:
|
||||||
{
|
{
|
||||||
baseResult = dynamic_cast<const SHSphere*>(SHAPE)->Raycast(info.ray);
|
baseResult = reinterpret_cast<const SHSphere*>(SHAPE)->Raycast(info.ray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SHCollisionShape::Type::BOX:
|
case SHCollisionShape::Type::BOX:
|
||||||
{
|
{
|
||||||
baseResult = dynamic_cast<const SHBox*>(SHAPE)->Raycast(info.ray);
|
baseResult = reinterpret_cast<const SHBox*>(SHAPE)->Raycast(info.ray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SHCollisionShape::Type::CAPSULE:
|
case SHCollisionShape::Type::CAPSULE:
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace SHADE
|
||||||
if (!shape || shape->GetType() == SHCollisionShape::Type::INVALID)
|
if (!shape || shape->GetType() == SHCollisionShape::Type::INVALID)
|
||||||
throw gcnew System::InvalidOperationException("Attempted to retrieve invalid CollisionShape.");
|
throw gcnew System::InvalidOperationException("Attempted to retrieve invalid CollisionShape.");
|
||||||
|
|
||||||
return dynamic_cast<CollisionShapeType&>(*shape);
|
return reinterpret_cast<CollisionShapeType&>(*shape);
|
||||||
}
|
}
|
||||||
catch (std::invalid_argument&)
|
catch (std::invalid_argument&)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue