Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.Collider Class Reference

Collider. More...

Inheritance diagram for Dragengine.Scenery.Collider:
Dragengine.Scenery.ColliderRig Dragengine.Scenery.ColliderVolume Dragengine.Scenery.ColliderComponent

Public Member Functions

Attachments
int getAttachmentCount ()
 Number of attachments.
Object getAttachedResource (int index)
 Resource of attachment at index.
void attachStatic (Object resource)
 Attach resource using static mode relative to current position.
void attachStatic (Object resource, Vector position, Quaternion orientation)
 Attach resource using static mode with specific position.
void attachRelativeMovement (Object resource)
 Attach collider keeping relative position and orientation.
void detach (Object resource)
 Detach resource.
void detachAll ()
 Detach all resources.
void attachmentsForceUpdate ()
 Force update of all attachments.
Constraints
int getConstraintCount ()
 Number of constraints.
void addConstraint (ColliderConstraint constraint)
 Add constraint from a collider constraint.
bool hasConstraint (ColliderConstraint constraint)
 Constraint with same bone, target collider and target bone is present.
int indexOfConstraint (ColliderConstraint constraint)
 Index of constraint with same bone, target collider and target bone or -1 if absent.
ColliderConstraint getConstraintAt (int index)
 Constraint at index.
void setConstraintAt (int index, ColliderConstraint constraint)
 Set constraint from a collider constraint.
void removeConstraint (ColliderConstraint constraint)
 Remove constraint with same bone, target collider and target bone.
void removeConstraintFrom (int index)
 Remove constraint from index.
void removeAllConstraints ()
 Remove all constraints.
Ignore colliders
int getIgnoreColliderCount ()
 Number of colliders to ignore.
Collider getIgnoreColliderAt (int index)
 Ignore collider at index.
bool hasIgnoreCollider (Collider collider)
 Ignore collider is present.
void addIgnoreCollider (Collider collider)
 Add collider to ignore.
void removeIgnoreCollider (Collider collider)
 Remove collider to ignore.
void removeAllIgnoreColliders ()
 Remove all colliders to ignore.
Post physics collision tests
int getCollisionTestCount ()
 Number of post physics collision tests.
ColliderCollisionTest getCollisionTestAt (int index)
 Post physics collision test at index.
void addCollisionTest (ColliderCollisionTest collisionTest)
 Add post physics collision test.
void removeCollisionTest (ColliderCollisionTest collisionTest)
 Remove post physics collision test.
void removeAllCollisionTests ()
 Remove all post physics collision tests.
Force and Impuls
void applyImpuls (Vector impuls)
 Apply impulse at central mass point.
void applyImpulsAt (Vector impuls, Vector position)
 Apply impulse at position.
void applyTorque (Vector torque)
 Apply torque at central mass point.
void applyTorqueImpuls (Vector torqueImpuls)
 Apply torque and impulse at center mass point.
void applyForce (Vector force)
 Apply force at central mass point.
void applyForceAt (Vector force, Vector position)
 Apply force at position.
Notifications
ColliderListener getColliderListener ()
 Collider listener or null if not set.
void setColliderListener (ColliderListener listener)
 Set collider listener or null to clear.
bool colliderListenerGetCustomCanHit ()
 Custom can hit callback is enabled.
void colliderListenerSetCustomCanHit (bool customCanHit)
 Set if custom can hit callback is enabled.
ColliderBreakingListener getBreakingListener ()
 Breaking listener or null if not set.
void setBreakingListener (ColliderBreakingListener listener)
 Set breaking listener or null if not set.
Collision detection
bool pointInside (DVector point)
 Point is inside collider.
void rayHits (DVector rayOrigin, Vector rayDirection, ColliderListener listener)
 Ray cast intersection test.
void rayHitsClosest (DVector rayOrigin, Vector rayDirection, ColliderListener listener)
 Closest ray cast intersection test.
void colliderHits (Collider collider, ColliderListener listener)
 Test collider for intersection.
void colliderMoveHits (Collider collider, Vector displacement, ColliderListener listener)
 Tests moving collider for collision.
void colliderMoveHitsClosest (Collider collider, Vector displacement, ColliderListener listener)
 Tests moving collider for collision.
void colliderRotateHits (Collider collider, ColliderListener listener)
 Test rotating collider for collision.
void colliderRotateHitsClosest (Collider collider, ColliderListener listener)
 Test rotating collider for collision.
void colliderMoveRotateHits (Collider collider, Vector displacement, ColliderListener listener)
 Test moving and rotating collider for collision.
void colliderMoveRotateHitsClosest (Collider collider, Vector displacement, ColliderListener listener)
 Test moving and rotating collider for collision.

Protected Member Functions

Constructors
Collider new ()
 Create collider.

Management

DVector getPosition ()
 Position.
void setPosition (DVector position)
 Set position.
Quaternion getOrientation ()
 Oorientation.
void setOrientation (Quaternion orientation)
 Set orientation.
Vector getScale ()
 Scale.
void setScale (Vector scale)
 Set scale.
void setGeometry (DVector position, Quaternion orientation)
 Set position and orientation at the same time.
void setGeometry (DVector position, Quaternion orientation, Vector scale)
 Set position and orientation at the same time.
Vector getView ()
 View direction.
Vector getUp ()
 Up direction.
Vector getRight ()
 Right direction.
DMatrix getMatrix ()
 Get matrix.
DMatrix getInverseMatrix ()
 Get inverse matrix.
World getParentWorld ()
 Parent world or null if not added to a world.
Vector getLinearVelocity ()
 Linear velocity in m/s.
void setLinearVelocity (Vector linVelo)
 Set linear velocity in m/s.
Vector getAngularVelocity ()
 Angular velocity in degrees/s.
void setAngularVelocity (Vector angVelo)
 Set angular velocity degrees/s.
float getMass ()
 Mass in kg.
void setMass (float mass)
 Set mass in kg.
Vector getGravity ()
 Constant acceleration in N/s^2.
void setGravity (Vector force)
 Set constant acceleration in N/s^2.
bool getEnabled ()
 Collider is enabled.
void setEnabled (bool enabled)
 Set if collider is enabled.
CollisionResponse getResponseType ()
 Response type.
void setResponseType (CollisionResponse responseType)
 Set response type.
bool getUseLocalGravity ()
 Collider defined gravity is used instead of World gravity.
void setUseLocalGravity (bool useLocalGravity)
 Set if collider defined gravity is used instead of World gravity.
Object getOwner ()
 Object owning the collider for interaction or null if not used.
void setOwner (Object owner)
 Set object owning the collider for interaction or null if not used.
float getForceFieldDirect ()
 Factor for direct type force fields.
void setForceFieldDirect (float factor)
 Set factor for direct type force fields.
float getForceFieldSurface ()
 Factor for surface type force fields.
void setForceFieldSurface (float factor)
 Set factor for surface type force fields.
float getForceFieldMass ()
 Factor for mass type force fields.
void setForceFieldMass (float factor)
 Set factor for mass type force fields.
float getForceFieldSpeed ()
 Factor for speed type force fields.
void setForceFieldSpeed (float factor)
 Set factor for speed type force fields.
CollisionFilter getCollisionFilter ()
 Collision filter.
void setCollisionFilter (CollisionFilter collisionFilter)
 Set collision filter.
bool equals (Object other)
 Collider is equal to another object.
int hashCode ()
 Hash code for use as dictionary keys.
static bool equals (Collider collider1, Collider collider2)
 Two colliders are equal.

Detailed Description

Collider.

Colliders provide collision detection and physical simulation to world objects. Colliders can be static (where they do not move), kinematic (where the game scripts provide physics response) or dynamic (where the physics module provides the physics response). Colliders can be a shape (ColliderVolume) or a articulated (ColliderRig or ColliderComponent). Colliders can be linked to other colliders using constraints (ColliderConstraint). ColliderRig and ColliderComponent use also rig defined constraints which are automatically created while external constraints are created by the game scripts.

Attachments

All resources with a position and orientation can be attached to a collider or bone if articulated. The following resources can be attached:

This is a native class.

Member Function Documentation

◆ addCollisionTest()

void Dragengine.Scenery.Collider.addCollisionTest ( ColliderCollisionTest collisionTest)

Add post physics collision test.

Referenced by colliderMoveRotateHitsClosest().

◆ addConstraint()

void Dragengine.Scenery.Collider.addConstraint ( ColliderConstraint constraint)

Add constraint from a collider constraint.

Exceptions
EInvalidParamConstraint with same bone, target collider and target bone is present.

Referenced by getCollisionTestCount().

◆ addIgnoreCollider()

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

Add collider to ignore.

References attachmentsForceUpdate().

Referenced by rayHitsClosest().

◆ applyForce()

void Dragengine.Scenery.Collider.applyForce ( Vector force)

Apply force at central mass point.

Referenced by colliderMoveRotateHitsClosest().

◆ applyForceAt()

void Dragengine.Scenery.Collider.applyForceAt ( Vector force,
Vector position )

Apply force at position.

References removeConstraint().

Referenced by colliderMoveRotateHitsClosest().

◆ applyImpuls()

void Dragengine.Scenery.Collider.applyImpuls ( Vector impuls)

Apply impulse at central mass point.

References getConstraintAt().

Referenced by colliderMoveRotateHitsClosest().

◆ applyImpulsAt()

void Dragengine.Scenery.Collider.applyImpulsAt ( Vector impuls,
Vector position )

Apply impulse at position.

Referenced by colliderMoveRotateHitsClosest().

◆ applyTorque()

void Dragengine.Scenery.Collider.applyTorque ( Vector torque)

Apply torque at central mass point.

Referenced by colliderMoveRotateHitsClosest().

◆ applyTorqueImpuls()

void Dragengine.Scenery.Collider.applyTorqueImpuls ( Vector torqueImpuls)

Apply torque and impulse at center mass point.

References setConstraintAt().

Referenced by colliderMoveRotateHitsClosest().

◆ attachmentsForceUpdate()

void Dragengine.Scenery.Collider.attachmentsForceUpdate ( )

Force update of all attachments.

You have to call this if want to reset colliders and components to a predefined state like after warping or resetting objects. This requires an attachment update outside the regular physics simulation run by the physics module to prevent exploding behavior.

Referenced by addIgnoreCollider().

◆ attachRelativeMovement()

void Dragengine.Scenery.Collider.attachRelativeMovement ( Object resource)

Attach collider keeping relative position and orientation.

Referenced by removeAllConstraints().

◆ attachStatic() [1/2]

void Dragengine.Scenery.Collider.attachStatic ( Object resource)

Attach resource using static mode relative to current position.

References setForceFieldMass().

Referenced by removeConstraint(), and removeConstraintFrom().

◆ attachStatic() [2/2]

void Dragengine.Scenery.Collider.attachStatic ( Object resource,
Vector position,
Quaternion orientation )

Attach resource using static mode with specific position.

References getForceFieldSpeed().

◆ colliderHits()

void Dragengine.Scenery.Collider.colliderHits ( Collider collider,
ColliderListener listener )

Test collider for intersection.

Referenced by colliderMoveRotateHitsClosest().

◆ colliderListenerGetCustomCanHit()

bool Dragengine.Scenery.Collider.colliderListenerGetCustomCanHit ( )

Custom can hit callback is enabled.

Referenced by colliderMoveRotateHitsClosest().

◆ colliderListenerSetCustomCanHit()

void Dragengine.Scenery.Collider.colliderListenerSetCustomCanHit ( bool customCanHit)

Set if custom can hit callback is enabled.

Referenced by colliderMoveRotateHitsClosest().

◆ colliderMoveHits()

void Dragengine.Scenery.Collider.colliderMoveHits ( Collider collider,
Vector displacement,
ColliderListener listener )

Tests moving collider for collision.

References removeIgnoreCollider().

Referenced by colliderMoveRotateHitsClosest().

◆ colliderMoveHitsClosest()

void Dragengine.Scenery.Collider.colliderMoveHitsClosest ( Collider collider,
Vector displacement,
ColliderListener listener )

Tests moving collider for collision.

References removeAllIgnoreColliders().

Referenced by colliderMoveRotateHitsClosest().

◆ colliderMoveRotateHits()

void Dragengine.Scenery.Collider.colliderMoveRotateHits ( Collider collider,
Vector displacement,
ColliderListener listener )

Test moving and rotating collider for collision.

Referenced by colliderMoveRotateHitsClosest().

◆ colliderMoveRotateHitsClosest()

◆ colliderRotateHits()

void Dragengine.Scenery.Collider.colliderRotateHits ( Collider collider,
ColliderListener listener )

Test rotating collider for collision.

Referenced by colliderMoveRotateHitsClosest().

◆ colliderRotateHitsClosest()

void Dragengine.Scenery.Collider.colliderRotateHitsClosest ( Collider collider,
ColliderListener listener )

Test rotating collider for collision.

Referenced by colliderMoveRotateHitsClosest().

◆ detach()

void Dragengine.Scenery.Collider.detach ( Object resource)

Detach resource.

References setForceFieldSpeed().

Referenced by removeAllConstraints().

◆ detachAll()

void Dragengine.Scenery.Collider.detachAll ( )

Detach all resources.

References getCollisionFilter(), and setCollisionFilter().

Referenced by getIgnoreColliderCount().

◆ equals() [1/2]

bool Dragengine.Scenery.Collider.equals ( Collider collider1,
Collider collider2 )
static

Two colliders are equal.

This is an extended version of equals() accepting also null for collider1 and collider2. equals() would thrown an exception if null is compared to anything. This call though allows to compare null against colliders or even null itself. If collider1 or collider2 is null false is returned. If both are null true is returned.

Reimplemented in Dragengine.Scenery.ColliderComponent, Dragengine.Scenery.ColliderRig, and Dragengine.Scenery.ColliderVolume.

References getForceFieldDirect(), and setForceFieldDirect().

◆ equals() [2/2]

bool Dragengine.Scenery.Collider.equals ( Object other)

Collider is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Collider and both point to the same engine collider.

Reimplemented in Dragengine.Scenery.ColliderComponent, Dragengine.Scenery.ColliderRig, and Dragengine.Scenery.ColliderVolume.

References setOwner().

Referenced by getConstraintCount(), and hasConstraint().

◆ getAngularVelocity()

Vector Dragengine.Scenery.Collider.getAngularVelocity ( )

Angular velocity in degrees/s.

Referenced by setResponseType().

◆ getAttachedResource()

Object Dragengine.Scenery.Collider.getAttachedResource ( int index)

Resource of attachment at index.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getAttachmentCount().

Referenced by setConstraintAt().

◆ getAttachmentCount()

int Dragengine.Scenery.Collider.getAttachmentCount ( )

Number of attachments.

References getForceFieldMass(), and setForceFieldSurface().

Referenced by getConstraintAt().

◆ getBreakingListener()

ColliderBreakingListener Dragengine.Scenery.Collider.getBreakingListener ( )

Breaking listener or null if not set.

References getIgnoreColliderCount().

Referenced by colliderMoveRotateHitsClosest().

◆ getColliderListener()

ColliderListener Dragengine.Scenery.Collider.getColliderListener ( )

Collider listener or null if not set.

References removeConstraintFrom().

Referenced by colliderMoveRotateHitsClosest().

◆ getCollisionFilter()

CollisionFilter Dragengine.Scenery.Collider.getCollisionFilter ( )

Collision filter.

References getUseLocalGravity().

Referenced by detachAll().

◆ getCollisionTestAt()

ColliderCollisionTest Dragengine.Scenery.Collider.getCollisionTestAt ( int index)

Post physics collision test at index.

Exceptions
deeInvalidParamindex is less than 0 or equal than or equal to getCollisionTestCount().

References hasConstraint().

Referenced by colliderMoveRotateHitsClosest().

◆ getCollisionTestCount()

int Dragengine.Scenery.Collider.getCollisionTestCount ( )

Number of post physics collision tests.

References addConstraint().

Referenced by colliderMoveRotateHitsClosest().

◆ getConstraintAt()

ColliderConstraint Dragengine.Scenery.Collider.getConstraintAt ( int index)

Constraint at index.

Version
1.13
Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getConstraintCount().

References getAttachmentCount().

Referenced by applyImpuls().

◆ getConstraintCount()

int Dragengine.Scenery.Collider.getConstraintCount ( )

Number of constraints.

References equals().

Referenced by removeAllIgnoreColliders().

◆ getEnabled()

bool Dragengine.Scenery.Collider.getEnabled ( )

Collider is enabled.

References getLinearVelocity().

Referenced by getForceFieldSurface().

◆ getForceFieldDirect()

float Dragengine.Scenery.Collider.getForceFieldDirect ( )

Factor for direct type force fields.

Referenced by equals().

◆ getForceFieldMass()

float Dragengine.Scenery.Collider.getForceFieldMass ( )

Factor for mass type force fields.

References setEnabled().

Referenced by getAttachmentCount().

◆ getForceFieldSpeed()

float Dragengine.Scenery.Collider.getForceFieldSpeed ( )

Factor for speed type force fields.

Referenced by attachStatic().

◆ getForceFieldSurface()

float Dragengine.Scenery.Collider.getForceFieldSurface ( )

Factor for surface type force fields.

References getEnabled().

Referenced by hashCode().

◆ getGravity()

Vector Dragengine.Scenery.Collider.getGravity ( )

Constant acceleration in N/s^2.

Referenced by setOwner().

◆ getIgnoreColliderAt()

Collider Dragengine.Scenery.Collider.getIgnoreColliderAt ( int index)

Ignore collider at index.

Exceptions
deeInvalidParamindex is less than 0 or equal than or equal to getIgnoreColliderCount().

Referenced by setBreakingListener().

◆ getIgnoreColliderCount()

int Dragengine.Scenery.Collider.getIgnoreColliderCount ( )

Number of colliders to ignore.

References detachAll().

Referenced by getBreakingListener().

◆ getInverseMatrix()

DMatrix Dragengine.Scenery.Collider.getInverseMatrix ( )

Get inverse matrix.

References getUp(), and getView().

Referenced by setAngularVelocity().

◆ getLinearVelocity()

Vector Dragengine.Scenery.Collider.getLinearVelocity ( )

Linear velocity in m/s.

Referenced by getEnabled().

◆ getMass()

float Dragengine.Scenery.Collider.getMass ( )

Mass in kg.

Referenced by setUseLocalGravity().

◆ getMatrix()

DMatrix Dragengine.Scenery.Collider.getMatrix ( )

Get matrix.

Referenced by setLinearVelocity().

◆ getOrientation()

Quaternion Dragengine.Scenery.Collider.getOrientation ( )

Oorientation.

References setPosition().

Referenced by setOrientation().

◆ getOwner()

Object Dragengine.Scenery.Collider.getOwner ( )

Object owning the collider for interaction or null if not used.

Referenced by setCollisionFilter().

◆ getParentWorld()

World Dragengine.Scenery.Collider.getParentWorld ( )

Parent world or null if not added to a world.

Version
1.29

References getRight().

Referenced by setMass().

◆ getPosition()

DVector Dragengine.Scenery.Collider.getPosition ( )

Position.

References getPosition().

Referenced by getPosition().

◆ getResponseType()

CollisionResponse Dragengine.Scenery.Collider.getResponseType ( )

Response type.

Referenced by setForceFieldMass().

◆ getRight()

Vector Dragengine.Scenery.Collider.getRight ( )

Right direction.

References setGeometry().

Referenced by getParentWorld().

◆ getScale()

Vector Dragengine.Scenery.Collider.getScale ( )

Scale.

References getScale(), and setOrientation().

Referenced by getScale().

◆ getUp()

Vector Dragengine.Scenery.Collider.getUp ( )

Up direction.

Referenced by getInverseMatrix().

◆ getUseLocalGravity()

bool Dragengine.Scenery.Collider.getUseLocalGravity ( )

Collider defined gravity is used instead of World gravity.

References setAngularVelocity().

Referenced by getCollisionFilter().

◆ getView()

Vector Dragengine.Scenery.Collider.getView ( )

View direction.

Referenced by getInverseMatrix().

◆ hasConstraint()

bool Dragengine.Scenery.Collider.hasConstraint ( ColliderConstraint constraint)

Constraint with same bone, target collider and target bone is present.

Version
1.13

References equals().

Referenced by getCollisionTestAt().

◆ hashCode()

int Dragengine.Scenery.Collider.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

Reimplemented in Dragengine.Scenery.ColliderComponent, Dragengine.Scenery.ColliderRig, and Dragengine.Scenery.ColliderVolume.

References getForceFieldSurface().

Referenced by indexOfConstraint().

◆ hasIgnoreCollider()

bool Dragengine.Scenery.Collider.hasIgnoreCollider ( Collider collider)

Ignore collider is present.

Referenced by rayHits().

◆ indexOfConstraint()

int Dragengine.Scenery.Collider.indexOfConstraint ( ColliderConstraint constraint)

Index of constraint with same bone, target collider and target bone or -1 if absent.

Version
1.13

References hashCode().

Referenced by removeCollisionTest().

◆ new()

Collider Dragengine.Scenery.Collider.new ( )
protected

Create collider.

Reimplemented in Dragengine.Scenery.ColliderComponent, Dragengine.Scenery.ColliderRig, and Dragengine.Scenery.ColliderVolume.

References new().

Referenced by new().

◆ pointInside()

bool Dragengine.Scenery.Collider.pointInside ( DVector point)

Point is inside collider.

Referenced by colliderMoveRotateHitsClosest().

◆ rayHits()

void Dragengine.Scenery.Collider.rayHits ( DVector rayOrigin,
Vector rayDirection,
ColliderListener listener )

Ray cast intersection test.

References hasIgnoreCollider().

Referenced by colliderMoveRotateHitsClosest().

◆ rayHitsClosest()

void Dragengine.Scenery.Collider.rayHitsClosest ( DVector rayOrigin,
Vector rayDirection,
ColliderListener listener )

Closest ray cast intersection test.

Only closest intersection is reported to listener. rayHits() reports all intersections.

References addIgnoreCollider().

Referenced by colliderMoveRotateHitsClosest().

◆ removeAllCollisionTests()

void Dragengine.Scenery.Collider.removeAllCollisionTests ( )

Remove all post physics collision tests.

Referenced by colliderMoveRotateHitsClosest().

◆ removeAllConstraints()

void Dragengine.Scenery.Collider.removeAllConstraints ( )

Remove all constraints.

References attachRelativeMovement(), and detach().

Referenced by setColliderListener().

◆ removeAllIgnoreColliders()

void Dragengine.Scenery.Collider.removeAllIgnoreColliders ( )

Remove all colliders to ignore.

References getConstraintCount().

Referenced by colliderMoveHitsClosest().

◆ removeCollisionTest()

void Dragengine.Scenery.Collider.removeCollisionTest ( ColliderCollisionTest collisionTest)

Remove post physics collision test.

Exceptions
deeInvalidParamcollisionTest is absent.

References indexOfConstraint().

Referenced by colliderMoveRotateHitsClosest().

◆ removeConstraint()

void Dragengine.Scenery.Collider.removeConstraint ( ColliderConstraint constraint)

Remove constraint with same bone, target collider and target bone.

Version
1.13
Exceptions
EInvalidParamMatching constraint is absent.

References attachStatic().

Referenced by applyForceAt().

◆ removeConstraintFrom()

void Dragengine.Scenery.Collider.removeConstraintFrom ( int index)

Remove constraint from index.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getConstraintCount().

References attachStatic().

Referenced by getColliderListener().

◆ removeIgnoreCollider()

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

Remove collider to ignore.

Exceptions
deeInvalidParamcollider is absent.

Referenced by colliderMoveHits().

◆ setAngularVelocity()

void Dragengine.Scenery.Collider.setAngularVelocity ( Vector angVelo)

Set angular velocity degrees/s.

References getInverseMatrix().

Referenced by getUseLocalGravity().

◆ setBreakingListener()

void Dragengine.Scenery.Collider.setBreakingListener ( ColliderBreakingListener listener)

Set breaking listener or null if not set.

References getIgnoreColliderAt().

Referenced by colliderMoveRotateHitsClosest().

◆ setColliderListener()

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

Set collider listener or null to clear.

References removeAllConstraints().

Referenced by colliderMoveRotateHitsClosest().

◆ setCollisionFilter()

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

Set collision filter.

References getOwner(), and setUseLocalGravity().

Referenced by detachAll().

◆ setConstraintAt()

void Dragengine.Scenery.Collider.setConstraintAt ( int index,
ColliderConstraint constraint )

Set constraint from a collider constraint.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getConstraintCount().
EInvalidParamNew constraint has different bone, target collider or target bone.

References getAttachedResource().

Referenced by applyTorqueImpuls().

◆ setEnabled()

void Dragengine.Scenery.Collider.setEnabled ( bool enabled)

Set if collider is enabled.

References setLinearVelocity().

Referenced by getForceFieldMass().

◆ setForceFieldDirect()

void Dragengine.Scenery.Collider.setForceFieldDirect ( float factor)

Set factor for direct type force fields.

References setGravity().

Referenced by equals().

◆ setForceFieldMass()

void Dragengine.Scenery.Collider.setForceFieldMass ( float factor)

Set factor for mass type force fields.

References getResponseType().

Referenced by attachStatic().

◆ setForceFieldSpeed()

void Dragengine.Scenery.Collider.setForceFieldSpeed ( float factor)

Set factor for speed type force fields.

References setResponseType().

Referenced by detach().

◆ setForceFieldSurface()

void Dragengine.Scenery.Collider.setForceFieldSurface ( float factor)

Set factor for surface type force fields.

Referenced by getAttachmentCount().

◆ setGeometry() [1/2]

void Dragengine.Scenery.Collider.setGeometry ( DVector position,
Quaternion orientation )

Set position and orientation at the same time.

Colliders are the only resources supporting attachments. Using SetPosition() and SetOrientation() causes attachments to be repositions immediately. If many resources are attached to the collider (perhaps even nested) this can reduce performance since attachments are potentially repositioned twice. This call ensures attachments are only repositioned once improving performance.

References setGeometry().

Referenced by getRight(), and setGeometry().

◆ setGeometry() [2/2]

void Dragengine.Scenery.Collider.setGeometry ( DVector position,
Quaternion orientation,
Vector scale )

Set position and orientation at the same time.

Colliders are the only resources supporting attachments. Using SetPosition() and SetOrientation() causes attachments to be repositions immediately. If many resources are attached to the collider (perhaps even nested) this can reduce performance since attachments are potentially repositioned twice. This call ensures attachments are only repositioned once improving performance.

◆ setGravity()

void Dragengine.Scenery.Collider.setGravity ( Vector force)

Set constant acceleration in N/s^2.

Referenced by setForceFieldDirect().

◆ setLinearVelocity()

void Dragengine.Scenery.Collider.setLinearVelocity ( Vector linVelo)

Set linear velocity in m/s.

References getMatrix().

Referenced by setEnabled().

◆ setMass()

void Dragengine.Scenery.Collider.setMass ( float mass)

Set mass in kg.

References getParentWorld().

Referenced by setOwner().

◆ setOrientation()

void Dragengine.Scenery.Collider.setOrientation ( Quaternion orientation)

Set orientation.

References getOrientation().

Referenced by getScale().

◆ setOwner()

void Dragengine.Scenery.Collider.setOwner ( Object owner)

Set object owning the collider for interaction or null if not used.

References getGravity(), and setMass().

Referenced by equals().

◆ setPosition()

void Dragengine.Scenery.Collider.setPosition ( DVector position)

Set position.

Referenced by getOrientation().

◆ setResponseType()

void Dragengine.Scenery.Collider.setResponseType ( CollisionResponse responseType)

Set response type.

References getAngularVelocity().

Referenced by setForceFieldSpeed().

◆ setScale()

void Dragengine.Scenery.Collider.setScale ( Vector scale)

Set scale.

For deColliderComponent the scaling is used from the set deComponent in the first place. The collider scaling is applied on top of it. Hence if you use deColliderComponent with scaled components you do not have to set the scaling on the deColliderComponent. For deColliderVolume and deColliderRig using scaling is required.

References setScale().

Referenced by setScale().

◆ setUseLocalGravity()

void Dragengine.Scenery.Collider.setUseLocalGravity ( bool useLocalGravity)

Set if collider defined gravity is used instead of World gravity.

References getMass().

Referenced by setCollisionFilter().


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