#include <spherecollisioncomponent.h>
Classes | |
class | SphereCollisionComponentPrivate |
Public Slots | |
void | setCollisionGroup (int group) |
void | setRadius (float radius) |
void | componentDestroyed (QObject *obj) |
void | addComponent (SphereCollisionComponent *comp) |
Public Member Functions | |
Q_INVOKABLE | SphereCollisionComponent (QObject *parent=0) |
~SphereCollisionComponent () | |
virtual QString | category () const |
virtual void | start () |
virtual void | stop () |
virtual void | update (int elapsedMilliseconds) |
int | collisionGroup () const |
float | radius () const |
Q_INVOKABLE bool | isColliding () const |
Q_INVOKABLE QObject * | collidesWith () const |
Properties | |
int | collisionGroup |
float | radius |
This class handles simple sphere-based collision. Spherical collision is the most simple algorithm for collision detection and thus also the fastest.
Collision components use simple integer-based grouping to exclude/include other components to collide with.
Definition at line 36 of file spherecollisioncomponent.h.
SphereCollisionComponent::SphereCollisionComponent | ( | QObject * | parent = 0 |
) |
Constructor.
Definition at line 52 of file spherecollisioncomponent.cpp.
SphereCollisionComponent::~SphereCollisionComponent | ( | ) |
Destructor.
Definition at line 60 of file spherecollisioncomponent.cpp.
void SphereCollisionComponent::addComponent | ( | SphereCollisionComponent * | comp | ) | [slot] |
Definition at line 178 of file spherecollisioncomponent.cpp.
QString SphereCollisionComponent::category | ( | ) | const [virtual] |
Return the category of the component. Meta-data used for filtering and sorting components
Reimplemented from GluonEngine::Component.
Definition at line 65 of file spherecollisioncomponent.cpp.
QObject * SphereCollisionComponent::collidesWith | ( | ) | const |
Retrieve the object this object is colliding with.
Definition at line 153 of file spherecollisioncomponent.cpp.
int GluonEngine::SphereCollisionComponent::collisionGroup | ( | ) | const |
The collision group this object belongs to.
void SphereCollisionComponent::componentDestroyed | ( | QObject * | obj | ) | [slot] |
Definition at line 168 of file spherecollisioncomponent.cpp.
bool SphereCollisionComponent::isColliding | ( | ) | const |
Is this object colliding with something?
Definition at line 148 of file spherecollisioncomponent.cpp.
float GluonEngine::SphereCollisionComponent::radius | ( | ) | const |
The radius of this object.
void SphereCollisionComponent::setCollisionGroup | ( | int | group | ) | [slot] |
Set the group this object belongs to.
Definition at line 158 of file spherecollisioncomponent.cpp.
void SphereCollisionComponent::setRadius | ( | float | radius | ) | [slot] |
Set the radius of this object.
Definition at line 163 of file spherecollisioncomponent.cpp.
void SphereCollisionComponent::start | ( | ) | [virtual] |
The start function is run once after each scene change, immediately before the first update
Reimplemented from GluonEngine::Component.
Definition at line 70 of file spherecollisioncomponent.cpp.
void SphereCollisionComponent::stop | ( | ) | [virtual] |
The stop function is run once when the gameloop is stopped. Use it for removing temporary data between runs. Reimplement this function if you have something that needs cleaning up between runs.
Reimplemented from GluonEngine::Component.
Definition at line 134 of file spherecollisioncomponent.cpp.
void SphereCollisionComponent::update | ( | int | elapsedMilliseconds | ) | [virtual] |
Update method. This method does the actual collision calculation.
Reimplemented from GluonEngine::Component.
Definition at line 81 of file spherecollisioncomponent.cpp.
int SphereCollisionComponent::collisionGroup [read, write] |
Definition at line 42 of file spherecollisioncomponent.h.
float SphereCollisionComponent::radius [read, write] |
Definition at line 43 of file spherecollisioncomponent.h.