From 080bbf68fdfece5ed2ad184c9018682e065ef1bc Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Wed, 4 Dec 2013 11:42:11 +0100 Subject: [PATCH] Collideables fixed Missing returns --- Code/OysterPhysics3D/Point.cpp | 2 +- Code/OysterPhysics3D/Ray.cpp | 2 +- Code/OysterPhysics3D/Sphere.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/OysterPhysics3D/Point.cpp b/Code/OysterPhysics3D/Point.cpp index cf1186c9..d81c91a3 100644 --- a/Code/OysterPhysics3D/Point.cpp +++ b/Code/OysterPhysics3D/Point.cpp @@ -38,7 +38,7 @@ bool Point::Intersects( const ICollideable &target ) const case Type_universe: return true; case Type_point: return Utility::Intersect( *this, *(Point*)&target ); case Type_ray: return Utility::Intersect( *(Ray*)&target, *this, ((Ray*)&target)->collisionDistance ); - case Type_sphere: Utility::Intersect( *(Sphere*)&target, *this ); + case Type_sphere: return Utility::Intersect( *(Sphere*)&target, *this ); case Type_plane: return Utility::Intersect( *(Plane*)&target, *this ); //case Type_triangle: return false; // TODO: case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this ); diff --git a/Code/OysterPhysics3D/Ray.cpp b/Code/OysterPhysics3D/Ray.cpp index 09fb13ec..79e4dbd5 100644 --- a/Code/OysterPhysics3D/Ray.cpp +++ b/Code/OysterPhysics3D/Ray.cpp @@ -60,7 +60,7 @@ bool Ray::Contains( const ICollideable &target ) const switch( target.type ) { case Type_point: return Utility::Intersect( *this, *(Point*)&target, this->collisionDistance ); - case Type_ray: Utility::Contains( *this, *(Ray*)&target ); + case Type_ray: return Utility::Contains( *this, *(Ray*)&target ); default: return false; } } \ No newline at end of file diff --git a/Code/OysterPhysics3D/Sphere.cpp b/Code/OysterPhysics3D/Sphere.cpp index 0cc8bc3b..4f6f76f7 100644 --- a/Code/OysterPhysics3D/Sphere.cpp +++ b/Code/OysterPhysics3D/Sphere.cpp @@ -35,7 +35,7 @@ bool Sphere::Intersects( const ICollideable &target ) const case Type_universe: return true; case Type_point: return Utility::Intersect( *this, *(Point*)&target ); case Type_ray: return Utility::Intersect( *this, *(Ray*)&target, ((Ray*)&target)->collisionDistance ); - case Type_sphere: Utility::Intersect( *this, *(Sphere*)&target ); + case Type_sphere: return Utility::Intersect( *this, *(Sphere*)&target ); case Type_plane: return Utility::Intersect( *(Plane*)&target, *this ); // case Type_triangle: return false; // TODO: case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this );