Drag[en]gine Game Engine
1.21
|
Touch Sensor Resource. More...
#include <deTouchSensor.h>
Public Types | |
typedef deTObjectReference< deTouchSensor > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deResource | |
typedef deTObjectReference< deResource > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
Type holding strong reference. More... | |
Public Member Functions | |
Management | |
const decDVector & | GetPosition () const |
Position. More... | |
void | SetPosition (const decDVector &position) |
Set position. More... | |
const decQuaternion & | GetOrientation () const |
Orientation. More... | |
void | SetOrientation (const decQuaternion &orientation) |
Set orientation. More... | |
const decCollisionFilter & | GetCollisionFilter () const |
Collision filter. More... | |
void | SetCollisionFilter (const decCollisionFilter &collisionFilter) |
Set collision filter. More... | |
bool | GetTrackEnterLeave () const |
Touch sensor tracks objects entering and leaving shapes. More... | |
void | SetTrackEnterLeave (bool trackEnterLeave) |
Set if touch sensor tracks objects entering and leaving shapes. More... | |
bool | GetEnabled () const |
Touch sensor is enabled. More... | |
void | SetEnabled (bool enabled) |
Set if touch sensor is enabled. More... | |
const decShapeList & | GetShape () const |
Shape. More... | |
void | SetShape (const decShapeList &shape) |
Set shape. More... | |
bool | IsEmpty () const |
Touch sensor contains colliders. More... | |
int | GetColliderCount () const |
Number of colliders in touch sensor. More... | |
deCollider * | GetColliderAt (int collider) const |
Collider at index in touch sensor. More... | |
void | NotifyColliderEntered (deCollider *collider) |
Notify scripting module peer collider entered touch sensor. More... | |
void | NotifyColliderLeft (deCollider *collider) |
Notify scripting module peer collider left touch sensor. More... | |
Ignore colliders | |
int | GetIgnoreColliderCount () const |
Number of colliders to ignore. More... | |
deCollider * | GetIgnoreColliderAt (int index) const |
Collider to ignore at index. More... | |
bool | HasIgnoreCollider (deCollider *collider) const |
Collider to ignore is present. More... | |
void | AddIgnoreCollider (deCollider *collider) |
Add collider to ignore. More... | |
void | RemoveIgnoreCollider (deCollider *collider) |
Remove collider to ignore. More... | |
void | RemoveAllIgnoreColliders () |
Remove all colliders to ignore. More... | |
Collision Detection | |
bool | PointInside (const decDVector &point) |
Test if a point is located inside the touch sensor. More... | |
void | AllHits (deBaseScriptingCollider *listener) |
Visit all touching elements with listener. More... | |
void | RayHits (const decDVector &rayOrigin, const decVector &rayDirection, deBaseScriptingCollider *listener) |
Test ray for collision with the element in the given shape. More... | |
void | ColliderHits (deCollider *collider, deBaseScriptingCollider *listener) |
Test collider for collision with scene elements. More... | |
void | ColliderMoveHits (deCollider *collider, const decVector &displacement, deBaseScriptingCollider *listener) |
Test moving collider for collision with scene elements. More... | |
void | ColliderRotateHits (deCollider *collider, const decVector &rotation, deBaseScriptingCollider *listener) |
Test rotating collider for collision with scene elements. More... | |
void | ColliderMoveRotateHits (deCollider *collider, const decVector &displacement, const decVector &rotation, deBaseScriptingCollider *listener) |
Test moving and rotating collider for collision with scene elements. More... | |
System Peers | |
deBasePhysicsTouchSensor * | GetPeerPhysics () const |
Physics system peer. More... | |
void | SetPeerPhysics (deBasePhysicsTouchSensor *peer) |
Set physics system peer. More... | |
deBaseScriptingTouchSensor * | GetPeerScripting () const |
Scripting system peer. More... | |
void | SetPeerScripting (deBaseScriptingTouchSensor *peer) |
Set scripting system peer. More... | |
Linked List | |
deWorld * | GetParentWorld () const |
Parent world or NULL. More... | |
void | SetParentWorld (deWorld *world) |
Set parent world or NULL. More... | |
deTouchSensor * | GetLLWorldPrev () const |
Previous touch sensor in the parent world linked list. More... | |
void | SetLLWorldPrev (deTouchSensor *touchSensor) |
Set next touch sensor in the parent world linked list. More... | |
deTouchSensor * | GetLLWorldNext () const |
Next touch sensor in the parent world linked list. More... | |
void | SetLLWorldNext (deTouchSensor *touchSensor) |
Set next touch sensor in the parent world linked list. More... | |
Public Member Functions inherited from deResource | |
deResourceManager * | GetResourceManager () const |
Resource manager or NULL if resource is leaking. More... | |
deEngine * | GetEngine () const |
Game engine object from resource manager. More... | |
deResource * | GetLLManagerPrev () const |
Previous resource in the resource manager linked list. More... | |
void | SetLLManagerPrev (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
deResource * | GetLLManagerNext () const |
Next resource in the resource manager linked list. More... | |
void | SetLLManagerNext (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
void | MarkLeaking () |
Marks the resource leaking. More... | |
deResource (deResourceManager *resourceManager) | |
Create resource. More... | |
Public Member Functions inherited from deObject | |
int | GetRefCount () const |
Reference count. More... | |
void | AddReference () |
Add reference increasing reference count by 1. More... | |
void | FreeReference () |
Decrease reference count by one and delete object if count reaches 0. More... | |
deObject () | |
Create object with reference count of 1. More... | |
Constructors and Destructors | |
deTouchSensor (deTouchSensorManager *manager) | |
Create touch sensor. More... | |
virtual | ~deTouchSensor () |
Clean up lumimeter. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from deResource | |
virtual | ~deResource () |
Clean up resource. More... | |
Protected Member Functions inherited from deObject | |
virtual | ~deObject () |
Clean up object. More... | |
Touch Sensor Resource.
Touch sensors detect the presence of colliders in a set of collision shapes. The touch sensor groups in fact multiple sensors in one object. This grouping improves performance since the shapes share a close spatial relationship which reduces greatly the number of collision tests required. Whenever a collider enters or leaves one of the shapes a notification is send to the scripting module peer. The touch sensor itself does not store the colliders and faces in contact with any of the shapes. This is the responsability of the scripting module peer. The reason for this design choice is that game scripts usually require only a subset of the encountered colliders for further processing. In addition actual game actions tend to be linked to colliders entering or leaving a given location in space. Iterating a list each frame update would be too time consuming in large worlds. Like colliders touch sensors too use a layer mask and group number to determine what colliders can be tracked.
Type holding strong reference.
deTouchSensor::deTouchSensor | ( | deTouchSensorManager * | manager | ) |
Create touch sensor.
|
protectedvirtual |
Clean up lumimeter.
void deTouchSensor::AddIgnoreCollider | ( | deCollider * | collider | ) |
Add collider to ignore.
deeInvalidParam | collider is present. |
void deTouchSensor::AllHits | ( | deBaseScriptingCollider * | listener | ) |
Visit all touching elements with listener.
To stop testing set StopTesting in the provided collision information object to true.
void deTouchSensor::ColliderHits | ( | deCollider * | collider, |
deBaseScriptingCollider * | listener | ||
) |
Test collider for collision with scene elements.
For each collision the collisionResponse function of the listener assigned to the collider is called. To stop testing set StopTesting in the provided collision information object to true.
void deTouchSensor::ColliderMoveHits | ( | deCollider * | collider, |
const decVector & | displacement, | ||
deBaseScriptingCollider * | listener | ||
) |
Test moving collider for collision with scene elements.
For each collision starting with the earliest the collisionResponse function of the listener assigned to the collider is called. To stop testing set StopTesting in the provided collision information object to true.
void deTouchSensor::ColliderMoveRotateHits | ( | deCollider * | collider, |
const decVector & | displacement, | ||
const decVector & | rotation, | ||
deBaseScriptingCollider * | listener | ||
) |
Test moving and rotating collider for collision with scene elements.
For each collision starting with the earliest the collisionResponse function of the listener assigned to the collider is called. To stop testing set StopTesting in the provided collision information object to true.
void deTouchSensor::ColliderRotateHits | ( | deCollider * | collider, |
const decVector & | rotation, | ||
deBaseScriptingCollider * | listener | ||
) |
Test rotating collider for collision with scene elements.
For each collision starting with the earliest the collisionResponse function of the listener assigned to the collider is called. To stop testing set StopTesting in the provided collision information object to true.
deCollider* deTouchSensor::GetColliderAt | ( | int | collider | ) | const |
Collider at index in touch sensor.
collider | Index of the collider retrieve from the shape. |
int deTouchSensor::GetColliderCount | ( | ) | const |
Number of colliders in touch sensor.
|
inline |
Collision filter.
|
inline |
Touch sensor is enabled.
deCollider* deTouchSensor::GetIgnoreColliderAt | ( | int | index | ) | const |
Collider to ignore at index.
deeInvalidParam | index is less than 0. |
deeInvalidParam | index is greater or equal than GetIgnoreColliderCount()-1. |
int deTouchSensor::GetIgnoreColliderCount | ( | ) | const |
Number of colliders to ignore.
|
inline |
Next touch sensor in the parent world linked list.
|
inline |
Previous touch sensor in the parent world linked list.
|
inline |
Orientation.
|
inline |
Parent world or NULL.
|
inline |
Physics system peer.
|
inline |
Scripting system peer.
|
inline |
Position.
|
inline |
Shape.
|
inline |
Touch sensor tracks objects entering and leaving shapes.
bool deTouchSensor::HasIgnoreCollider | ( | deCollider * | collider | ) | const |
Collider to ignore is present.
bool deTouchSensor::IsEmpty | ( | ) | const |
Touch sensor contains colliders.
void deTouchSensor::NotifyColliderEntered | ( | deCollider * | collider | ) |
Notify scripting module peer collider entered touch sensor.
collider | Collider entering the shape. |
void deTouchSensor::NotifyColliderLeft | ( | deCollider * | collider | ) |
Notify scripting module peer collider left touch sensor.
collider | Collider entering the shape. |
bool deTouchSensor::PointInside | ( | const decDVector & | point | ) |
Test if a point is located inside the touch sensor.
void deTouchSensor::RayHits | ( | const decDVector & | rayOrigin, |
const decVector & | rayDirection, | ||
deBaseScriptingCollider * | listener | ||
) |
Test ray for collision with the element in the given shape.
For each collision the collisionResponse function the given listener is called. To stop testing set StopTesting in the provided collision information object to true. The distance parameter in the collision response represents the actual distance to the ray origin along the ray direction.
void deTouchSensor::RemoveAllIgnoreColliders | ( | ) |
Remove all colliders to ignore.
void deTouchSensor::RemoveIgnoreCollider | ( | deCollider * | collider | ) |
Remove collider to ignore.
deeInvalidParam | collider is absent. |
void deTouchSensor::SetCollisionFilter | ( | const decCollisionFilter & | collisionFilter | ) |
Set collision filter.
void deTouchSensor::SetEnabled | ( | bool | enabled | ) |
Set if touch sensor is enabled.
void deTouchSensor::SetLLWorldNext | ( | deTouchSensor * | touchSensor | ) |
Set next touch sensor in the parent world linked list.
void deTouchSensor::SetLLWorldPrev | ( | deTouchSensor * | touchSensor | ) |
Set next touch sensor in the parent world linked list.
void deTouchSensor::SetOrientation | ( | const decQuaternion & | orientation | ) |
Set orientation.
void deTouchSensor::SetParentWorld | ( | deWorld * | world | ) |
Set parent world or NULL.
void deTouchSensor::SetPeerPhysics | ( | deBasePhysicsTouchSensor * | peer | ) |
Set physics system peer.
void deTouchSensor::SetPeerScripting | ( | deBaseScriptingTouchSensor * | peer | ) |
Set scripting system peer.
void deTouchSensor::SetPosition | ( | const decDVector & | position | ) |
Set position.
void deTouchSensor::SetShape | ( | const decShapeList & | shape | ) |
Set shape.
void deTouchSensor::SetTrackEnterLeave | ( | bool | trackEnterLeave | ) |
Set if touch sensor tracks objects entering and leaving shapes.