Table of Contents

Component Physics

(NOTE) The PhysicsSpace is an "instance" of a world. This world manages and stores all of the other physical components of this world. PhysicSpaces act independently of each other.

Methods Properties Base Classes Derived Classes
AddHierarchyPairFilter AllowSleep component
AddPairFilter CollisionTable
CastAabb Deterministic
CastCollider DynamicBroadphaseType
CastFrustum Mode2D
CastRay PhysicsSolverConfig
CastRayFirst StaticBroadphaseType
CastSegment SubStepCount
CastSphere
CreateJoint
DispatchWithinAabb
DispatchWithinSphere
FlushPhysicsQueue
Constructor
RemoveHierarchyPairFilter
RemovePairFilter
SweepCollider
WhyAreTheyNotColliding

Properties


AllowSleep : boolean

Determines if anything in the space is allowed to fall sleep.

var AllowSleep : Boolean

CollisionTable : collisiontable

The collision table resource used to filter collisions in this space.

var CollisionTable : CollisionTable

Deterministic : boolean

Performs extra work to help enforce determinism in the simulation.

var Deterministic : Boolean

DynamicBroadphaseType : string

What kind of broadphase is used for dynamic objects (those with RigidBodies).

var DynamicBroadphaseType : String

Mode2D : boolean

The default 2D mode for this space. If a RigidBody is set to InheritFromSpace then it will use this value.

var Mode2D : Boolean

PhysicsSolverConfig : physicssolverconfig

The resource that controls how physics solves things. Mostly related to how collision is resolved.

var PhysicsSolverConfig : PhysicsSolverConfig

StaticBroadphaseType : string

What kind of broadphase is used for static objects (those without RigidBodies).

var StaticBroadphaseType : String

SubStepCount : integer

The number of iterations the physics space will take every frame. Used to achieve higher accuracy and increase visual results.

var SubStepCount : Integer

Methods


AddHierarchyPairFilter : Void

Adds a filter to ignore collision between both hierarchies passed in. See AddPairFilter for more info. |Name|Type|Description| |---|---|---| |cog1|cog| | |cog2|cog| |

function AddHierarchyPairFilter(cog1 : Cog, cog2 : Cog)

AddPairFilter : Void

Filters two cogs to not resolve collisions with each other. This is a runtime only feature and will not be saved. |Name|Type|Description| |---|---|---| |cog1|cog| | |cog2|cog| |

function AddPairFilter(cog1 : Cog, cog2 : Cog)

CastAabb : castresultsrange

Finds all colliders in the space that an Aabb hits using the given filter. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |aabb|aabb| | |maxCount|integer| | |filter|castfilter| |

function CastAabb(aabb : Aabb, maxCount : Integer, filter : CastFilter) : CastResultsRange

CastCollider : castresultsrange

Finds all colliders in the space that another collider hits using the given filter. The test collider's position can be offset to test at a different location. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |offset|real3| | |testCollider|collider| | |filter|castfilter| |

function CastCollider(offset : Real3, testCollider : Collider, filter : CastFilter) : CastResultsRange

CastFrustum : castresultsrange

Finds all colliders in the space that a Frustum hits using the given filter. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |frustum|frustum| | |maxCount|integer| | |filter|castfilter| |

function CastFrustum(frustum : Frustum, maxCount : Integer, filter : CastFilter) : CastResultsRange

CastRay : castresultsrange

Finds all colliders in the space that a ray hits. This returns up to maxCount number of objects. A default CastFilter will be used. |Name|Type|Description| |---|---|---| |worldRay|ray| | |maxCount|integer| |

function CastRay(worldRay : Ray, maxCount : Integer) : CastResultsRange

CastRay : castresultsrange

Finds all colliders in the space that a ray hits using the given filter. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |worldRay|ray| | |maxCount|integer| | |filter|castfilter| |

function CastRay(worldRay : Ray, maxCount : Integer, filter : CastFilter) : CastResultsRange

CastRayFirst : castresult

Finds the first collider that a ray hits. A default CastFilter will be used. |Name|Type|Description| |---|---|---| |worldRay|ray| |

function CastRayFirst(worldRay : Ray) : CastResult

CastRayFirst : castresult

Finds the first collider that a ray hits using the given filter. |Name|Type|Description| |---|---|---| |worldRay|ray| | |filter|castfilter| |

function CastRayFirst(worldRay : Ray, filter : CastFilter) : CastResult

CastSegment : castresultsrange

Finds all colliders in the space that a line segment hits. This returns up to maxCount number of objects. A default CastFilter will be used. |Name|Type|Description| |---|---|---| |segment|segment| | |maxCount|integer| |

function CastSegment(segment : Segment, maxCount : Integer) : CastResultsRange

CastSegment : castresultsrange

Finds all colliders in the space that a line segment hits using the given filter. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |segment|segment| | |maxCount|integer| | |filter|castfilter| |

function CastSegment(segment : Segment, maxCount : Integer, filter : CastFilter) : CastResultsRange

CastSphere : castresultsrange

Finds all colliders in the space that a Sphere hits using the given filter. This returns up to maxCount number of objects. |Name|Type|Description| |---|---|---| |sphere|sphere| | |maxCount|integer| | |filter|castfilter| |

function CastSphere(sphere : Sphere, maxCount : Integer, filter : CastFilter) : CastResultsRange

CreateJoint : cog

Creates a joint by name (e.g. StickJoint) between two cogs. The world points of the joint are both set to worldPoint. |Name|Type|Description| |---|---|---| |cog0|cog| | |cog1|cog| | |jointName|string| | |worldPoint|real3| |

function CreateJoint(cog0 : Cog, cog1 : Cog, jointName : String, worldPoint : Real3) : Cog

DispatchWithinAabb : Void

Dispatches an event to all objects within the given aabb using the provided cast filter. |Name|Type|Description| |---|---|---| |aabb|aabb| | |filter|castfilter| | |eventName|string| | |toSend|event| |

function DispatchWithinAabb(aabb : Aabb, filter : CastFilter, eventName : String, toSend : Event)

DispatchWithinAabb : Void

Dispatches an event to all objects within the given aabb. Uses the default cast filter. |Name|Type|Description| |---|---|---| |aabb|aabb| | |eventName|string| | |toSend|event| |

function DispatchWithinAabb(aabb : Aabb, eventName : String, toSend : Event)

DispatchWithinSphere : Void

Dispatches an event to all objects within the given sphere using the provided cast filter. |Name|Type|Description| |---|---|---| |sphere|sphere| | |filter|castfilter| | |eventName|string| | |toSend|event| |

function DispatchWithinSphere(sphere : Sphere, filter : CastFilter, eventName : String, toSend : Event)

DispatchWithinSphere : Void

Dispatches an event to all objects within the given sphere. Uses the default cast filter. |Name|Type|Description| |---|---|---| |sphere|sphere| | |eventName|string| | |toSend|event| |

function DispatchWithinSphere(sphere : Sphere, eventName : String, toSend : Event)

FlushPhysicsQueue : Void

Forces all queued computations in physics to be updated now. Should only be used for debugging. |Name|Type|Description| |---|---|---|

function FlushPhysicsQueue()

PhysicsSpace : Void

constructor

Name Type Description
function PhysicsSpace()

RemoveHierarchyPairFilter : Void

Removes the filters between both hierarchies. See RemovePairFilter for more info. |Name|Type|Description| |---|---|---| |cog1|cog| | |cog2|cog| |

function RemoveHierarchyPairFilter(cog1 : Cog, cog2 : Cog)

RemovePairFilter : Void

Removes the filter between two cogs allowing collisions to be computed as normal. |Name|Type|Description| |---|---|---| |cog1|cog| | |cog2|cog| |

function RemovePairFilter(cog1 : Cog, cog2 : Cog)

SweepCollider : sweepresultrange

Performs a swept cast with a collider's shape and a given velocity. Returns a range of all objects the collider could've hit within 'dt' time. |Name|Type|Description| |---|---|---| |collider|collider| | |velocity|real3| | |dt|real| | |filter|castfilter| |

function SweepCollider(collider : Collider, velocity : Real3, dt : Real, filter : CastFilter) : SweepResultRange

WhyAreTheyNotColliding : string

Returns a debug string stating why physics does or doesn't think these two objects should be colliding. |Name|Type|Description| |---|---|---| |cog1|cog| | |cog2|cog| |

function WhyAreTheyNotColliding(cog1 : Cog, cog2 : Cog) : String