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

Collider collision test. More...

Inheritance diagram for ColliderCollisionTest:

Public Member Functions

Constructors
ColliderCollisionTest new ()
 Create collider collision test. More...
 
ColliderCollisionTest new (ColliderCollisionTest collisionTest)
 Create copy of collider collision test. More...
 
ColliderCollisionTest new (CollisionFilter collisionFilter, Vector origin, Vector direction)
 Create collider collision test. More...
 
ColliderCollisionTest new (CollisionFilter collisionFilter, Component component, String bone, Vector origin, Vector direction)
 Create a collider collision test. More...
 
ColliderCollisionTest new (TouchSensor touchSensor, int shape, CollisionFilter collisionFilter, Vector origin, Vector direction)
 Create collider collision test. More...
 
ColliderCollisionTest new (TouchSensor touchSensor, int shape, CollisionFilter collisionFilter, Component component, String bone, Vector origin, Vector direction)
 Create a collider collision test. More...
 
Test Configuration
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...
 
Collider getCollider ()
 Collider or null to test using a ray. More...
 
void setCollider (Collider collider)
 Set collider or null to test using a ray. More...
 
CollisionFilter getCollisionFilter ()
 Collision filter. More...
 
void setCollisionFilter (CollisionFilter collisionFilter)
 Set collision filter. More...
 
Component getComponent ()
 Component to use to retrieve bone position from or NULL if not used. More...
 
void setComponent (Component component)
 Set component to use to retrieve bone position from or NULL if not used. More...
 
String getBone ()
 Bone to apply origin to for testing or empty string to use parent collider position. More...
 
void setBone (String name)
 Set bone to apply origin to for testing or empty string to use parent collider position. More...
 
Vector getOrigin ()
 Cast origin. More...
 
void setOrigin (Vector origin)
 Set cast origin. More...
 
Vector getDirection ()
 Cast direction. More...
 
void setDirection (Vector direction)
 Set cast direction. More...
 
bool getLocalDirection ()
 Local direction. More...
 
void setLocalDirection (bool localDirection)
 Set if direction is local. More...
 
bool getEnabled ()
 Collision tets is enabled. More...
 
void setEnabled (bool enabled)
 Set if collision test is enabled. More...
 
Test Result
bool getHasCollision ()
 Collision has been found. More...
 
void setHasCollision (bool hasCollision)
 Set if collision has been found. More...
 
DVector getTestOrigin ()
 Test origin used by physics module during the last update. More...
 
DVector getTestDirection ()
 Test direction used by physics module during the last update. More...
 
CollisionInfo getCollisionInfo ()
 Collision info or null if no collision has been found. More...
 
float hitDistance ()
 Direction length multiplied by hit distance. More...
 
float hitDistance (float defaultHitDistance)
 Direction length multiplied by hit distance. More...
 
Vector hitPointCollider ()
 Hit point in collider space. More...
 
Vector hitPointCollider (float defaultHitDistance)
 Hit point in collider space. More...
 
DVector hitPointWorld ()
 Hit point in world space. More...
 
DVector hitPointWorld (float defaultHitDistance)
 Hit point in world space. More...
 
Vector hitNormalCollider ()
 Hit normal in collider space or null if no hit is found. More...
 
Vector hitNormalWorld ()
 Hit normal in world space or null if no hit is found. More...
 
Collider hitCollider ()
 Hit collider or null if no hit is found or the hit object is not a collider. More...
 
int hitBone ()
 Hit bone or -1 if no hit is found or the hit object is not a collider. More...
 
void reset ()
 Clears hit information reverting test to no collision found state. More...
 

Detailed Description

Collider collision test.

Collision test to perform by the physics module after parent collider has been moved. This allows to perform repeated collision tests in high performance way. Multiple collision tests can be assigned to a collider at any time even during collision response. The physics module performs these tests whenever collider simulation is finished. Typical usage for tests are testing ground after actor moved to plant it firmly on the ground. After physics simulation is finished the result can be obtained from the collision test object. The collision test always contains the last collision result. Physics modules redo collision tests if they figure out something changed and a new test would potentially provide different results. It is thus not guaranteed these tests are done every frame so do not modify the results only the test parameters.

This is a native class.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ getBone()

String getBone ( )

Bone to apply origin to for testing or empty string to use parent collider position.

§ getCollider()

Collider getCollider ( )

Collider or null to test using a ray.

§ getCollisionFilter()

CollisionFilter getCollisionFilter ( )

Collision filter.

§ getCollisionInfo()

CollisionInfo getCollisionInfo ( )

Collision info or null if no collision has been found.

§ getComponent()

Component getComponent ( )

Component to use to retrieve bone position from or NULL if not used.

§ getDirection()

Vector getDirection ( )

Cast direction.

§ getEnabled()

bool getEnabled ( )

Collision tets is enabled.

§ getHasCollision()

bool getHasCollision ( )

Collision has been found.

§ getLocalDirection()

bool getLocalDirection ( )

Local direction.

§ getOrigin()

Vector getOrigin ( )

Cast origin.

§ getTestDirection()

DVector getTestDirection ( )

Test direction used by physics module during the last update.

§ getTestOrigin()

DVector getTestOrigin ( )

Test origin used by physics module during the last update.

§ 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.

§ hitBone()

int hitBone ( )

Hit bone or -1 if no hit is found or the hit object is not a collider.

§ hitCollider()

Collider hitCollider ( )

Hit collider or null if no hit is found or the hit object is not a collider.

§ hitDistance() [1/2]

float hitDistance ( )

Direction length multiplied by hit distance.

If no hit is found a hit distance of 1 is used.

§ hitDistance() [2/2]

float hitDistance ( float  defaultHitDistance)

Direction length multiplied by hit distance.

If no hit is found a use default hit distance.

§ hitNormalCollider()

Vector hitNormalCollider ( )

Hit normal in collider space or null if no hit is found.

§ hitNormalWorld()

Vector hitNormalWorld ( )

Hit normal in world space or null if no hit is found.

§ hitPointCollider() [1/2]

Vector hitPointCollider ( )

Hit point in collider space.

If no hit is found the entire direction is applied.

§ hitPointCollider() [2/2]

Vector hitPointCollider ( float  defaultHitDistance)

Hit point in collider space.

If no hit is found use default hit distance.

§ hitPointWorld() [1/2]

DVector hitPointWorld ( )

Hit point in world space.

If no hit is found the entire direction is applied.

§ hitPointWorld() [2/2]

DVector hitPointWorld ( float  defaultHitDistance)

Hit point in world space.

If no hit is found use default hit distance.

§ new() [1/6]

Create collider collision test.

§ new() [2/6]

Create copy of collider collision test.

§ new() [3/6]

ColliderCollisionTest new ( CollisionFilter  collisionFilter,
Vector  origin,
Vector  direction 
)

Create collider collision test.

§ new() [4/6]

ColliderCollisionTest new ( CollisionFilter  collisionFilter,
Component  component,
String  bone,
Vector  origin,
Vector  direction 
)

Create a collider collision test.

§ new() [5/6]

ColliderCollisionTest new ( TouchSensor  touchSensor,
int  shape,
CollisionFilter  collisionFilter,
Vector  origin,
Vector  direction 
)

Create collider collision test.

§ new() [6/6]

ColliderCollisionTest new ( TouchSensor  touchSensor,
int  shape,
CollisionFilter  collisionFilter,
Component  component,
String  bone,
Vector  origin,
Vector  direction 
)

Create a collider collision test.

§ reset()

void reset ( )

Clears hit information reverting test to no collision found state.

§ setBone()

void setBone ( String  name)

Set bone to apply origin to for testing or empty string to use parent collider position.

§ setCollider()

void setCollider ( Collider  collider)

Set collider or null to test using a ray.

§ setCollisionFilter()

void setCollisionFilter ( CollisionFilter  collisionFilter)

Set collision filter.

§ setComponent()

void setComponent ( Component  component)

Set component to use to retrieve bone position from or NULL if not used.

§ setDirection()

void setDirection ( Vector  direction)

Set cast direction.

§ setEnabled()

void setEnabled ( bool  enabled)

Set if collision test is enabled.

§ setHasCollision()

void setHasCollision ( bool  hasCollision)

Set if collision has been found.

§ setLocalDirection()

void setLocalDirection ( bool  localDirection)

Set if direction is local.

§ setOrigin()

void setOrigin ( Vector  origin)

Set cast origin.

§ 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.


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