Fixed const problem
This commit is contained in:
parent
5f305b7086
commit
61e1d20748
|
@ -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;
|
||||
|
|
|
@ -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, ? );
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
} }
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
} }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
} }
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
} }
|
||||
|
|
Loading…
Reference in New Issue