Class PhysicsUtilities
Various physics utilities
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
public static class PhysicsUtilities
Methods
HasPhysicsTag(in PhysicsWorld, int, CustomPhysicsBodyTags)
Determines if the specified physics body has a given physics body tag
Declaration
public static bool HasPhysicsTag(in PhysicsWorld physicsWorld, int bodyIndex, CustomPhysicsBodyTags tag)
Parameters
Type | Name | Description |
---|---|---|
PhysicsWorld | physicsWorld | The Physics World of the body |
int | bodyIndex | The body index |
CustomPhysicsBodyTags | tag | The physics body tag to check for |
Returns
Type | Description |
---|---|
bool | True if the body has the physics tag |
SetCollisionFilterAll(ref PhysicsCollider, CollisionFilter)
Sets the collision filter of a physics collider, including all child colliders if it's a compound collider. Note that if the collider is not made unique, this will affect all instances of the collider.
Declaration
public static void SetCollisionFilterAll(ref PhysicsCollider physicsCollider, CollisionFilter filter)
Parameters
Type | Name | Description |
---|---|---|
PhysicsCollider | physicsCollider | The physics collider to change |
CollisionFilter | filter | The collision filter to apply |
SetCollisionResponseAll(ref PhysicsCollider, CollisionResponsePolicy)
Sets the collision response of a physics collider, including all child colliders if it's a compound collider. Note that if the collider is not made unique, this will affect all instances of the collider.
Declaration
public static void SetCollisionResponseAll(ref PhysicsCollider physicsCollider, CollisionResponsePolicy policy)
Parameters
Type | Name | Description |
---|---|---|
PhysicsCollider | physicsCollider | The physics collider to change |
CollisionResponsePolicy | policy | The collision response policy to apply |