Physics
A toolbox for anything Physics related.
To get the Physics class, you must get its handler.
let Physics = instance.GetHandler("Physics")
You can then use the Physics
property to access the Physics class.
Methods
Method Name | Return Type | Parameters | Description |
---|---|---|---|
CheckBox | bool | float3, float3, float4¹ | Check whether the given box overlaps with other colliders or not |
CheckCapsule | bool | float3, float3, float | Checks if any colliders overlap a capsule-shaped volume in world space |
CheckSphere | bool | float3, float | Returns true if there are any colliders overlapping the sphere defined by position and radius in world coordinates |
ClosestPoint | float3 | float3, Collider, float3, float4 | Returns a point on the given collider that is closest to the specified location |
ComputePenetration | PenetrationResult | Collider, float3, float4, Collider, float3. float4 | Computes the minimal translation required to separate the given colliders apart at specified poses. |
SetCollisionIgnore | void | Collider, Collider, bool | Sets ability to collide between two colliders |
Linecast | bool | float3, float3 | Returns true if there is any collider intersecting the line between start and end |
OverlapBox | Collider[] | float3, float3, float4¹ | Finds all colliders touching inside of the given box |
OverlapCapsule | Collider[] | float3, float3, float | Checks the given capsule against the physics world and returns all overlapping colliders |
OverlapSphere | Collider[] | float3, float | Computes colliders touching or that are inside the sphere |
Raycast | RaycastHit[] | Ray, float ² | Casts a ray through the Scene and returns all hits |
RaycastAll | RaycastHit[] | Ray, float ² | Casts a ray through the Scene and returns all hits |
SphereCast | RaycastHit[] | float3, float , float3, float ² | Casts a sphere along the direction and returns all hits |
SphereCastAll | RaycastHit[] | float3, float , float3, float ² | Casts a sphere along the direction and returns all hits |
Properties
Property Name | Type | Description |
---|---|---|
gravity | float3 | The current gravity in a world |
¹ Optional Parameter