Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math::Sphere Class Reference

#include <Sphere.h>

Inheritance diagram for kge::math::Sphere:
kge::math::Shape

Public Member Functions

 Sphere ()
 Constructor.
 ~Sphere ()
 Destructor.
void AddPoint (const gfx::Vertex3 *vPoint)
 Add an internal point to calculate the bounding sphere.
void AddPoint (const Vector &v)
 Add an internal point to calculate the bounding sphere.
void AddSphere (const Sphere *sphere)
 Add an internal sphere to calculate the bounding sphere.
void AddBox (const AABB &aabb)
 Adds a AABB to calculate the bounding sphere.
CollisionType Collision (const Plane *pPlane) const
 Checks the sphere collision with a plane and returns ECT_Behind , ECT_Front or ECT_Intersect.
bool Inside (const math::Vector &point) const
 Returns true if point is inside the sphere.
const VectorGetCenter () const
 Returns the sphere center point.
float GetRadius () const
 Returns the sphere radius.
float GetDistance (const Plane *pPlane) const
 Returns the distance of the plane.
void SetCenter (const Vector &v)
 Sets the sphere center.
void SetRadius (float f)
 Sets the sphere center.
int getType () const
- Public Member Functions inherited from kge::math::Shape
 Shape ()
 Constructor.
virtual ~Shape ()
 Distructor.

Public Attributes

Vector m_vCenter
Vector m_vMax
Vector m_vMin
float m_fRadius

Protected Attributes

bool m_bFirstPoint
int m_iType

Detailed Description

Definition at line 20 of file Sphere.h.

Constructor & Destructor Documentation

kge::math::Sphere::Sphere ( )

Constructor.

kge::math::Sphere::~Sphere ( )
inline

Destructor.

Definition at line 28 of file Sphere.h.

Member Function Documentation

void kge::math::Sphere::AddBox ( const AABB aabb)

Adds a AABB to calculate the bounding sphere.

void kge::math::Sphere::AddPoint ( const gfx::Vertex3 vPoint)

Add an internal point to calculate the bounding sphere.

void kge::math::Sphere::AddPoint ( const Vector v)

Add an internal point to calculate the bounding sphere.

void kge::math::Sphere::AddSphere ( const Sphere sphere)

Add an internal sphere to calculate the bounding sphere.

CollisionType kge::math::Sphere::Collision ( const Plane pPlane) const

Checks the sphere collision with a plane and returns ECT_Behind , ECT_Front or ECT_Intersect.

const Vector& kge::math::Sphere::GetCenter ( ) const
inline

Returns the sphere center point.

Definition at line 49 of file Sphere.h.

float kge::math::Sphere::GetDistance ( const Plane pPlane) const

Returns the distance of the plane.

float kge::math::Sphere::GetRadius ( ) const
inline

Returns the sphere radius.

Definition at line 52 of file Sphere.h.

int kge::math::Sphere::getType ( void  ) const
inlinevirtual

Implements kge::math::Shape.

Definition at line 63 of file Sphere.h.

bool kge::math::Sphere::Inside ( const math::Vector point) const

Returns true if point is inside the sphere.

void kge::math::Sphere::SetCenter ( const Vector v)
inline

Sets the sphere center.

Definition at line 58 of file Sphere.h.

void kge::math::Sphere::SetRadius ( float  f)
inline

Sets the sphere center.

Definition at line 61 of file Sphere.h.

Member Data Documentation

bool kge::math::Sphere::m_bFirstPoint
protected

Check for first point recive.

Definition at line 71 of file Sphere.h.

float kge::math::Sphere::m_fRadius

The sphere radius.

Definition at line 68 of file Sphere.h.

int kge::math::Sphere::m_iType
protected

Definition at line 72 of file Sphere.h.

Vector kge::math::Sphere::m_vCenter

The center of the sphere.

Definition at line 65 of file Sphere.h.

Vector kge::math::Sphere::m_vMax

The max point uses by AddPoint function.

Definition at line 65 of file Sphere.h.

Vector kge::math::Sphere::m_vMin

The min point uses by AddPoint function.

Definition at line 65 of file Sphere.h.


The documentation for this class was generated from the following file: