Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.CollisionTester Class Reference

Collision tester. More...

Inheritance diagram for Dragengine.Scenery.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...
 
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.

Member Function Documentation

◆ addIgnoreCollider()

void Dragengine.Scenery.CollisionTester.addIgnoreCollider ( Collider  collider)

Add collider to ignore during collision testing if not present.

◆ colliderHits() [1/2]

bool Dragengine.Scenery.CollisionTester.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 Dragengine.Scenery.CollisionTester.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 Dragengine.Scenery.CollisionTester.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.

◆ colliderMoveHits() [2/2]

bool Dragengine.Scenery.CollisionTester.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.

◆ colliderMoveRotateHits() [1/2]

bool Dragengine.Scenery.CollisionTester.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.

◆ colliderMoveRotateHits() [2/2]

bool Dragengine.Scenery.CollisionTester.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.

◆ colliderRotateHits() [1/2]

bool Dragengine.Scenery.CollisionTester.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.

◆ colliderRotateHits() [2/2]

bool Dragengine.Scenery.CollisionTester.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.

◆ getColliderListener()

ColliderListener Dragengine.Scenery.CollisionTester.getColliderListener ( )

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

◆ getCollisionFilter()

CollisionFilter Dragengine.Scenery.CollisionTester.getCollisionFilter ( )

Collision filter.

◆ getHitBone()

int Dragengine.Scenery.CollisionTester.getHitBone ( )

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

Only valid if hasCollision() returns true.

◆ getHitCollider()

Collider Dragengine.Scenery.CollisionTester.getHitCollider ( )

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

Only valid if hasCollision() returns true.

◆ getHitDistance()

float Dragengine.Scenery.CollisionTester.getHitDistance ( )

Hit distance.

Only valid if hasCollision() returns true.

◆ getTestDirection()

Vector Dragengine.Scenery.CollisionTester.getTestDirection ( )

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

◆ getTouchSensor()

TouchSensor Dragengine.Scenery.CollisionTester.getTouchSensor ( )

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

◆ getWorld()

World Dragengine.Scenery.CollisionTester.getWorld ( )

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

◆ hasCollision()

bool Dragengine.Scenery.CollisionTester.hasCollision ( )

Collision has been found.

◆ new() [1/2]

CollisionTester Dragengine.Scenery.CollisionTester.new ( )

Create collision tester.

◆ new() [2/2]

CollisionTester Dragengine.Scenery.CollisionTester.new ( CollisionTester  collisionTester)

Creates copy of collision tester.

◆ rayHits()

bool Dragengine.Scenery.CollisionTester.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 Dragengine.Scenery.CollisionTester.removeAllIgnoreColliders ( )

Remove all ignored colliders.

◆ removeIgnoreCollider()

void Dragengine.Scenery.CollisionTester.removeIgnoreCollider ( Collider  collider)

Remove collider to ignore during collision testing if present.

◆ reset()

void Dragengine.Scenery.CollisionTester.reset ( )

Reset collision result.

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

◆ setColliderListener()

void Dragengine.Scenery.CollisionTester.setColliderListener ( ColliderListener  listener)

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

◆ setCollisionFilter()

void Dragengine.Scenery.CollisionTester.setCollisionFilter ( CollisionFilter  collisionFilter)

Set collision filter.

◆ setCollisionRay()

void Dragengine.Scenery.CollisionTester.setCollisionRay ( )

Set collision testing to use a ray test.

◆ setCollisionShape()

void Dragengine.Scenery.CollisionTester.setCollisionShape ( ShapeList  shape)

Set collision testing to use a collision volume.

◆ setTestDirection()

void Dragengine.Scenery.CollisionTester.setTestDirection ( Vector  direction)

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

◆ setTouchSensor()

void Dragengine.Scenery.CollisionTester.setTouchSensor ( TouchSensor  touchSensor)

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

◆ setWorld()

void Dragengine.Scenery.CollisionTester.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: