#include <spCollisionSphere.hpp>
Public Member Functions | |
| CollisionSphere (CollisionMaterial *Material, SceneNode *Node, f32 Radius) | |
| ~CollisionSphere () | |
| s32 | getSupportFlags () const |
| f32 | getMaxMovement () const |
| bool | checkIntersection (const dim::line3df &Line, SIntersectionContact &Contact) const |
| bool | checkIntersection (const dim::line3df &Line, bool ExcludeCorners=false) const |
| void | setRadius (f32 Radius) |
| Sets the sphere's radius. | |
| f32 | getRadius () const |
| Returns the sphere's radius. | |
CollisionSphere is one of the collision models and represents a perfect sphere with only a position and a radius. Rotations and scaling does not effect the collision model.
| sp::scene::CollisionSphere::CollisionSphere | ( | CollisionMaterial * | Material, | |
| SceneNode * | Node, | |||
| f32 | Radius | |||
| ) |
| sp::scene::CollisionSphere::~CollisionSphere | ( | ) |
| bool sp::scene::CollisionSphere::checkIntersection | ( | const dim::line3df & | Line, | |
| SIntersectionContact & | Contact | |||
| ) | const [virtual] |
Checks for an intersection between this collision object and the given line and stores the result in the specified contact structure.
| Line,: | Specifies the line which could intersect this object. | |
| Contact,: | Specifies the structure where the intersection result will be stored. |
Reimplemented from sp::scene::CollisionNode.
| bool sp::scene::CollisionSphere::checkIntersection | ( | const dim::line3df & | Line, | |
| bool | ExcludeCorners = false | |||
| ) | const [virtual] |
Returns true if an intersection between this collision object and the given line exists but does not return any further information.
| Line,: | Specifies the line which could intersect this object. | |
| ExcludeCorners,: | Specifies whether the line's corners should be ingored. This can be useful for ray-tracing or lightmapping to avoid self-shadowing. |
Reimplemented from sp::scene::CollisionNode.
| f32 sp::scene::CollisionSphere::getMaxMovement | ( | ) | const [virtual] |
Returns the maximal movement (e.g. for a sphere it's the radius). This is used internally. A collision node can still be moved faster than this value.
Implements sp::scene::CollisionNode.
| f32 sp::scene::CollisionSphere::getRadius | ( | ) | const [inline] |
Returns the sphere's radius.
| s32 sp::scene::CollisionSphere::getSupportFlags | ( | ) | const [virtual] |
Implements sp::scene::CollisionNode.
| void sp::scene::CollisionSphere::setRadius | ( | f32 | Radius | ) | [inline] |
Sets the sphere's radius.
1.7.1