Drag[en]gine Script Module DragonScript Script API  1.0
CollisionTester Class Reference

Collision tester. More...

Inheritance diagram for CollisionTester:

Public Member Functions

Constructors
CollisionTester new ()
 Create collision tester. More...
 
CollisionTester new (CollisionTester collisionTester)
 Creates copy of collision tester. More...
 
Management
World getWorld ()
 World to use for collision testing or null if not set. More...
 
void setWorld (World world)
 Set world to use for collision testing or null if not set. More...
 
TouchSensor getTouchSensor ()
 Touch sensor to use for testing collisions or null if not set. More...
 
void setTouchSensor (TouchSensor touchSensor)
 Set touch sensor to use for testing collisions or null if not set. More...
 
int getTouchSensorShape ()
 Touch sensor shape to use for testing collisions. More...
 
void setTouchSensorShape (int shape)
 Set touch sensor shape to use for testing collisions. More...
 
void setCollisionRay ()
 Set collision testing to use a ray test. More...
 
void setCollisionShape (ShapeList shape)
 Set collision testing to use a collision volume. More...
 
Vector getTestDirection ()
 Test direction for moving collision testing or null for hit collision testing. More...
 
void setTestDirection (Vector direction)
 Set test direction for moving collision testing or null for hit collision testing. More...
 
CollisionFilter getCollisionFilter ()
 Collision filter. More...
 
void setCollisionFilter (CollisionFilter collisionFilter)
 Set collision filter. More...
 
ColliderListener getColliderListener ()
 Collision listener used to test if a collision is possible or null to only use collision filtering. More...
 
void setColliderListener (ColliderListener listener)
 Set collision listener used to test if a collision is possible or null to only use collision filtering. More...
 
void addIgnoreCollider (Collider collider)
 Add collider to ignore during collision testing if not present. More...
 
void removeIgnoreCollider (Collider collider)
 Remove collider to ignore during collision testing if present. More...
 
void removeAllIgnoreColliders ()
 Remove all ignored colliders. More...
 
Testing
void reset ()
 Reset collision result. More...
 
bool rayHits (DVector position, Vector direction)
 Test ray collision. More...
 
bool colliderHits (DVector position)
 Test collider hits collision. More...
 
bool colliderHits (DVector position, Quaternion orientation)
 Test collider hits collision. More...
 
bool colliderMoveHits (DVector position, Vector direction)
 Test collider move hits collision. More...
 
bool colliderMoveHits (DVector position, Quaternion orientation, Vector direction)
 Test collider move hits collision. More...
 
bool colliderRotateHits (DVector position, Vector rotation)
 Test collider rotate hits collision. More...
 
bool colliderRotateHits (DVector position, Quaternion orientation, Vector rotation)
 Test collider rotate hits collision. More...
 
bool colliderMoveRotateHits (DVector position, Vector direction, Vector rotation)
 Test collider move rotate hits collision. More...
 
bool colliderMoveRotateHits (DVector position, Quaternion orientation, Vector direction, Vector rotation)
 Test collider move rotate hits collision. More...
 
Result
bool hasCollision ()
 Collision has been found. More...
 
float getHitDistance ()
 Hit distance. More...
 
Collider getHitCollider ()
 Hit collider or null if something else than a collider has been hit. More...
 
int getHitBone ()
 Hit collider bone or -1 if something else than a collider has been hit. More...
 

Detailed Description

Collision tester.

Utility class simplifying repeated collision testing as well as defining collision tests to be conducted later, possibly by an unrelated script class. Stores the parameters of a collision test to conduct. The holder of the collision tester can then just run the collision test without bothering about the details. The result is also stored in the collision tester for repeated retrieval which is useful if the collision tester is held by multiple script objects.

This is a native class.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ addIgnoreCollider()

void addIgnoreCollider ( Collider  collider)

Add collider to ignore during collision testing if not present.

§ colliderHits() [1/2]

bool colliderHits ( DVector  position)

Test collider hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderHits() [2/2]

bool colliderHits ( DVector  position,
Quaternion  orientation 
)

Test collider hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderMoveHits() [1/2]

bool colliderMoveHits ( DVector  position,
Vector  direction 
)

Test collider move hits collision.

Returns
true if a collision has been detected or false if not or parameters are invalid.

§ colliderMoveHits() [2/2]

bool colliderMoveHits ( DVector  position,
Quaternion  orientation,
Vector  direction 
)

Test collider move hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderMoveRotateHits() [1/2]

bool colliderMoveRotateHits ( DVector  position,
Vector  direction,
Vector  rotation 
)

Test collider move rotate hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderMoveRotateHits() [2/2]

bool colliderMoveRotateHits ( DVector  position,
Quaternion  orientation,
Vector  direction,
Vector  rotation 
)

Test collider move rotate hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderRotateHits() [1/2]

bool colliderRotateHits ( DVector  position,
Vector  rotation 
)

Test collider rotate hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ colliderRotateHits() [2/2]

bool colliderRotateHits ( DVector  position,
Quaternion  orientation,
Vector  rotation 
)

Test collider rotate hits collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ getColliderListener()

ColliderListener getColliderListener ( )

Collision listener used to test if a collision is possible or null to only use collision filtering.

§ getCollisionFilter()

CollisionFilter getCollisionFilter ( )

Collision filter.

§ getHitBone()

int getHitBone ( )

Hit collider bone or -1 if something else than a collider has been hit.

Only valid if hasCollision() returns true.

§ getHitCollider()

Collider getHitCollider ( )

Hit collider or null if something else than a collider has been hit.

Only valid if hasCollision() returns true.

§ getHitDistance()

float getHitDistance ( )

Hit distance.

Only valid if hasCollision() returns true.

§ getTestDirection()

Vector getTestDirection ( )

Test direction for moving collision testing or null for hit collision testing.

§ getTouchSensor()

TouchSensor getTouchSensor ( )

Touch sensor to use for testing collisions or null if not set.

§ getTouchSensorShape()

int getTouchSensorShape ( )

Touch sensor shape to use for testing collisions.

§ getWorld()

World getWorld ( )

World to use for collision testing or null if not set.

§ hasCollision()

bool hasCollision ( )

Collision has been found.

§ new() [1/2]

CollisionTester new ( )

Create collision tester.

§ new() [2/2]

CollisionTester new ( CollisionTester  collisionTester)

Creates copy of collision tester.

§ rayHits()

bool rayHits ( DVector  position,
Vector  direction 
)

Test ray collision.

Returns
true if collision has been detected or false if not or parameters are invalid.

§ removeAllIgnoreColliders()

void removeAllIgnoreColliders ( )

Remove all ignored colliders.

§ removeIgnoreCollider()

void removeIgnoreCollider ( Collider  collider)

Remove collider to ignore during collision testing if present.

§ reset()

void reset ( )

Reset collision result.

After this call hasCollision() returns false and collision results are undefined.

§ setColliderListener()

void setColliderListener ( ColliderListener  listener)

Set collision listener used to test if a collision is possible or null to only use collision filtering.

§ setCollisionFilter()

void setCollisionFilter ( CollisionFilter  collisionFilter)

Set collision filter.

§ setCollisionRay()

void setCollisionRay ( )

Set collision testing to use a ray test.

§ setCollisionShape()

void setCollisionShape ( ShapeList  shape)

Set collision testing to use a collision volume.

§ setTestDirection()

void setTestDirection ( Vector  direction)

Set test direction for moving collision testing or null for hit collision testing.

§ setTouchSensor()

void setTouchSensor ( TouchSensor  touchSensor)

Set touch sensor to use for testing collisions or null if not set.

§ setTouchSensorShape()

void setTouchSensorShape ( int  shape)

Set touch sensor shape to use for testing collisions.

§ setWorld()

void setWorld ( World  world)

Set world to use for collision testing or null if not set.


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