Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsHandle

An abstract handle that can be used for custom purposes such as handling miscellaneous physics object types abstractly. You can create a handle with PhysicsHandle.Create or PhysicsHandle.CreateBatch. You can destroy a handle with PhysicsHandle.Destroy or PhysicsHandle.DestroyBatch. You can also get a handle from one of the following physics objects: _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle _physicsHandle NOTE: When retrieving the handle from another physics object, the object type is not encoded so that must be handled separately. Because of this, it's entirely possible for two handles to be equal, differing only by the type they came from so care must be taken or the object type explicitly stored against handles.
Read time 2 minutesLast updated 6 days ago

Definition

public readonly struct PhysicsHandle : IEquatable<PhysicsHandle>

Properties

Property

Description

generationGet the handle generation.
indexGet the handle index.
isPoolHandleChecks if the physics handle is from the physics handle pool or not. This will return false unless thePhysicsHandle was explicitly created with PhysicsHandle.Create or PhysicsHandle.CreateBatch.
isValidChecks if the physics handle is valid in the physics handle pool. This will only work correctly if the PhysicsHandle was explicitly created with PhysicsHandle.Create or PhysicsHandle.CreateBatch. If the handle comes from another physics object, it will not validate that object and a warning will be issued.

Methods

Method

Description

DestroyDestroy the handle. This will only work correctly if the PhysicsHandle was explicitly created with PhysicsHandle.Create or PhysicsHandle.CreateBatch.

Static Methods

Method

Description

CreateCreate a PhysicsHandle.
CreateBatchCreate a batch of PhysicsHandle.
DestroyBatchDestroy the specified span of PhysicsHandle.