Fixed const problem

This commit is contained in:
Robin Engman 2013-12-16 09:55:59 +01:00 committed by Dander7BD
parent 5f305b7086
commit 61e1d20748
10 changed files with 27 additions and 27 deletions

View File

@ -348,7 +348,7 @@ namespace Oyster { namespace Collision3D { namespace Utility
bool Intersect( const Sphere &sphereA, const Sphere &sphereB, const ::Oyster::Math::Float3& worldPointOfContact )
{
//Ray sphereRay(sphereA, Float3(sphereB.center-sphereA.center).Normalize());
Ray sphereRay(sphereA.center, Float3(sphereB.center-sphereA.center).Normalize());
return false;

View File

@ -25,28 +25,28 @@ namespace Oyster { namespace Collision3D { namespace Utility
void Compare( ::Oyster::Math::Float &connectOffset, const Plane &plane, const Point &point );
bool Intersect( const Point &pointA, const Point &pointB );
bool Intersect( const Point &pointA, const Point &pointB, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Point &pointA, const Point &pointB, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Ray &ray, const Point &point, ::Oyster::Math::Float &connectDistance );
bool Intersect( const Ray &rayA, const Ray &rayB, ::Oyster::Math::Float &connectDistanceA, ::Oyster::Math::Float &connectDistanceB );
bool Intersect( const Ray &ray, const Point &point, ::Oyster::Math::Float &connectDistance, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Ray &rayA, const Ray &rayB, ::Oyster::Math::Float &connectDistanceA, ::Oyster::Math::Float &connectDistanceB, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Ray &ray, const Point &point, ::Oyster::Math::Float &connectDistance, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Ray &rayA, const Ray &rayB, ::Oyster::Math::Float &connectDistanceA, ::Oyster::Math::Float &connectDistanceB, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphere, const Point &point );
bool Intersect( const Sphere &sphere, const Ray &ray, ::Oyster::Math::Float &connectDistance );
bool Intersect( const Sphere &sphereA, const Sphere &sphereB );
bool Intersect( const Sphere &sphere, const Point &point, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphere, const Ray &ray, ::Oyster::Math::Float &connectDistance, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphereA, const Sphere &sphereB, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphere, const Point &point, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphere, const Ray &ray, ::Oyster::Math::Float &connectDistance, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Sphere &sphereA, const Sphere &sphereB, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Point &point );
bool Intersect( const Plane &plane, const Ray &ray, ::Oyster::Math::Float &connectDistance );
bool Intersect( const Plane &plane, const Sphere &sphere );
bool Intersect( const Plane &planeA, const Plane &planeB );
bool Intersect( const Plane &plane, const Point &point, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Ray &ray, ::Oyster::Math::Float &connectDistance, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Sphere &sphere, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &planeA, const Plane &planeB, const ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Point &point, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Ray &ray, ::Oyster::Math::Float &connectDistance, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &plane, const Sphere &sphere, ::Oyster::Math::Float3& worldPointOfContact );
bool Intersect( const Plane &planeA, const Plane &planeB, ::Oyster::Math::Float3& worldPointOfContact );
// bool Intersect( const Triangle &triangle, const Point &point, ? );
// bool Intersect( const Triangle &triangle, const Ray &ray, ? );

View File

@ -50,7 +50,7 @@ bool Plane::Intersects( const ICollideable &target ) const
}
}
bool Plane::Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const
bool Plane::Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const
{
switch( target.type )
{

View File

@ -29,7 +29,7 @@ namespace Oyster { namespace Collision3D
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
bool Intersects( const ICollideable &target ) const;
bool Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Contains( const ICollideable &target ) const;
};
} }

View File

@ -48,14 +48,14 @@ bool Point::Intersects( const ICollideable &target ) const
}
}
bool Point::Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const
bool Point::Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const
{
switch( target.type )
{
case Type_universe: return true;
case Type_point: return Utility::Intersect( *this, *(Point*)&target, worldPointOfContact );
case Type_ray: return Utility::Intersect( *this, *(Ray*)&target, ((Ray*)&target)->collisionDistance, worldPointOfContact );
case Type_sphere: return Utility::Intersect( *this, *(Sphere*)&target, worldPointOfContact );
case Type_ray: return Utility::Intersect( *(Ray*)&target, *this, ((Ray*)&target)->collisionDistance, worldPointOfContact );
case Type_sphere: return Utility::Intersect( *(Sphere*)&target, *this, worldPointOfContact );
case Type_plane: return Utility::Intersect( *(Plane*)&target, *this, worldPointOfContact );
// case Type_triangle: return false; // TODO:
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this, worldPointOfContact );

View File

@ -28,7 +28,7 @@ namespace Oyster { namespace Collision3D
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
bool Intersects( const ICollideable &target ) const;
bool Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Contains( const ICollideable &target ) const;
};
} }

View File

@ -55,20 +55,20 @@ bool Ray::Intersects( const ICollideable &target ) const
}
}
bool Ray::Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const
bool Ray::Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const
{
switch( target.type )
{
case Type_universe:
this->collisionDistance = 0.0f;
return true;
case Type_point: return Utility::Intersect( *this, *(Point*)&target, worldPointOfContact );
case Type_ray: return Utility::Intersect( *this, *(Ray*)&target, ((Ray*)&target)->collisionDistance, worldPointOfContact );
case Type_sphere: return Utility::Intersect( *this, *(Sphere*)&target, worldPointOfContact );
case Type_plane: return Utility::Intersect( *(Plane*)&target, *this, worldPointOfContact );
case Type_point: return Utility::Intersect( *this, *(Point*)&target, this->collisionDistance, worldPointOfContact );
case Type_ray: return Utility::Intersect( *this, *(Ray*)&target, this->collisionDistance, ((Ray*)&target)->collisionDistance, worldPointOfContact );
case Type_sphere: return Utility::Intersect( *(Sphere*)&target, *this, this->collisionDistance, worldPointOfContact );
case Type_plane: return Utility::Intersect( *(Plane*)&target, *this, this->collisionDistance, worldPointOfContact );
// case Type_triangle: return false; // TODO:
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this, worldPointOfContact );
case Type_box: return Utility::Intersect( *(Box*)&target, *this, worldPointOfContact );
case Type_box_axis_aligned: return Utility::Intersect( *(BoxAxisAligned*)&target, *this, this->collisionDistance, worldPointOfContact );
case Type_box: return Utility::Intersect( *(Box*)&target, *this, this->collisionDistance, worldPointOfContact );
case Type_frustrum: return false; // TODO:
default: worldPointOfContact = NULL;
return false;

View File

@ -37,7 +37,7 @@ namespace Oyster { namespace Collision3D
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
bool Intersects( const ICollideable &target ) const;
bool Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Contains( const ICollideable &target ) const;
};
} }

View File

@ -45,7 +45,7 @@ bool Sphere::Intersects( const ICollideable &target ) const
}
}
bool Sphere::Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const
bool Sphere::Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const
{
switch( target.type )
{

View File

@ -28,7 +28,7 @@ namespace Oyster { namespace Collision3D
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
bool Intersects( const ICollideable &target ) const;
bool Intersects( const ICollideable &target, const ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Intersects( const ICollideable &target, ::Oyster::Math::Float3 &worldPointOfContact ) const;
bool Contains( const ICollideable &target ) const;
};
} }