parent
1d94ed0ddc
commit
080bbf68fd
|
@ -38,7 +38,7 @@ bool Point::Intersects( const ICollideable &target ) const
|
||||||
case Type_universe: return true;
|
case Type_universe: return true;
|
||||||
case Type_point: return Utility::Intersect( *this, *(Point*)&target );
|
case Type_point: return Utility::Intersect( *this, *(Point*)&target );
|
||||||
case Type_ray: return Utility::Intersect( *(Ray*)&target, *this, ((Ray*)&target)->collisionDistance );
|
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_plane: return Utility::Intersect( *(Plane*)&target, *this );
|
||||||
//case Type_triangle: return false; // TODO:
|
//case Type_triangle: return false; // TODO:
|
||||||
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this );
|
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this );
|
||||||
|
|
|
@ -60,7 +60,7 @@ bool Ray::Contains( const ICollideable &target ) const
|
||||||
switch( target.type )
|
switch( target.type )
|
||||||
{
|
{
|
||||||
case Type_point: return Utility::Intersect( *this, *(Point*)&target, this->collisionDistance );
|
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;
|
default: return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -35,7 +35,7 @@ bool Sphere::Intersects( const ICollideable &target ) const
|
||||||
case Type_universe: return true;
|
case Type_universe: return true;
|
||||||
case Type_point: return Utility::Intersect( *this, *(Point*)&target );
|
case Type_point: return Utility::Intersect( *this, *(Point*)&target );
|
||||||
case Type_ray: return Utility::Intersect( *this, *(Ray*)&target, ((Ray*)&target)->collisionDistance );
|
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_plane: return Utility::Intersect( *(Plane*)&target, *this );
|
||||||
// case Type_triangle: return false; // TODO:
|
// case Type_triangle: return false; // TODO:
|
||||||
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this );
|
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this );
|
||||||
|
|
Loading…
Reference in New Issue