Drag[en]gine Script Module DragonScript
1.23
|
Collision tester. More...
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... | |
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.
void Dragengine.Scenery.CollisionTester.addIgnoreCollider | ( | Collider | collider | ) |
Add collider to ignore during collision testing if not present.
bool Dragengine.Scenery.CollisionTester.colliderHits | ( | DVector | position | ) |
Test collider hits collision.
bool Dragengine.Scenery.CollisionTester.colliderHits | ( | DVector | position, |
Quaternion | orientation | ||
) |
Test collider hits collision.
bool Dragengine.Scenery.CollisionTester.colliderMoveHits | ( | DVector | position, |
Quaternion | orientation, | ||
Vector | direction | ||
) |
Test collider move hits collision.
Test collider move hits collision.
bool Dragengine.Scenery.CollisionTester.colliderMoveRotateHits | ( | DVector | position, |
Quaternion | orientation, | ||
Vector | direction, | ||
Vector | rotation | ||
) |
Test collider move rotate hits collision.
bool Dragengine.Scenery.CollisionTester.colliderMoveRotateHits | ( | DVector | position, |
Vector | direction, | ||
Vector | rotation | ||
) |
Test collider move rotate hits collision.
bool Dragengine.Scenery.CollisionTester.colliderRotateHits | ( | DVector | position, |
Quaternion | orientation, | ||
Vector | rotation | ||
) |
Test collider rotate hits collision.
Test collider rotate hits collision.
ColliderListener Dragengine.Scenery.CollisionTester.getColliderListener | ( | ) |
Collision listener used to test if a collision is possible or null to only use collision filtering.
CollisionFilter Dragengine.Scenery.CollisionTester.getCollisionFilter | ( | ) |
Collision filter.
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.
Collider Dragengine.Scenery.CollisionTester.getHitCollider | ( | ) |
Hit collider or null if something else than a collider has been hit.
Only valid if hasCollision() returns true.
float Dragengine.Scenery.CollisionTester.getHitDistance | ( | ) |
Hit distance.
Only valid if hasCollision() returns true.
Vector Dragengine.Scenery.CollisionTester.getTestDirection | ( | ) |
Test direction for moving collision testing or null for hit collision testing.
TouchSensor Dragengine.Scenery.CollisionTester.getTouchSensor | ( | ) |
Touch sensor to use for testing collisions or null if not set.
World Dragengine.Scenery.CollisionTester.getWorld | ( | ) |
World to use for collision testing or null if not set.
bool Dragengine.Scenery.CollisionTester.hasCollision | ( | ) |
Collision has been found.
CollisionTester Dragengine.Scenery.CollisionTester.new | ( | ) |
Create collision tester.
CollisionTester Dragengine.Scenery.CollisionTester.new | ( | CollisionTester | collisionTester | ) |
Creates copy of collision tester.
Test ray collision.
void Dragengine.Scenery.CollisionTester.removeAllIgnoreColliders | ( | ) |
Remove all ignored colliders.
void Dragengine.Scenery.CollisionTester.removeIgnoreCollider | ( | Collider | collider | ) |
Remove collider to ignore during collision testing if present.
void Dragengine.Scenery.CollisionTester.reset | ( | ) |
Reset collision result.
After this call hasCollision() returns false and collision results are undefined.
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.
void Dragengine.Scenery.CollisionTester.setCollisionFilter | ( | CollisionFilter | collisionFilter | ) |
Set collision filter.
void Dragengine.Scenery.CollisionTester.setCollisionRay | ( | ) |
Set collision testing to use a ray test.
void Dragengine.Scenery.CollisionTester.setCollisionShape | ( | ShapeList | shape | ) |
Set collision testing to use a collision volume.
void Dragengine.Scenery.CollisionTester.setTestDirection | ( | Vector | direction | ) |
Set test direction for moving collision testing or null for hit collision testing.
void Dragengine.Scenery.CollisionTester.setTouchSensor | ( | TouchSensor | touchSensor | ) |
Set touch sensor to use for testing collisions or null if not set.
void Dragengine.Scenery.CollisionTester.setWorld | ( | World | world | ) |
Set world to use for collision testing or null if not set.