Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsSpace

Provides the ability to store and query information in a spatial database.
Read time 2 minutesLast updated 11 days ago

Definition

public readonly struct PhysicsSpace : IEquatable<PhysicsSpace>

Properties

Property

Description

isValidCheck if a Physics Space is valid.
memoryAllocatedGet the total memory allocated for the space, in bytes.
proxyCountGet the proxy count in the space.
rootAABBGet the root bounds that contain all the AABB proxies.

Methods

Method

Description

CastRayFind proxies that intersect the specified ray. The results indicate that the proxy AABB intersect the specified cast ray, in no specific order.
CastShapeFind proxies that intersect the specified shape. The results indicate that the proxy AABB intersect the specified cast shape, in no specific order.
ClearProxiesClear all space proxies. You should no longer use any previously returned PhysicsSpace.ProxyHandle as they may be invalid or direct to the wrong proxy in the future. The space will continue with a similar proxy capacity therefore if full de-allocation is required, the space should be destroyed and a new one created.
CloneClear any existing proxies and clone all PhysicsShape found in the specified PhysicsWorld. Each proxy created will have a user-handle assigned as _physicsHandle. This means you can get the referenced shape by using PhysicsShape.
CreateProxyCreate a space proxy.
DestroyDestroy the Physics Space.
DestroyProxyDestroy a space proxy.
GetProxyAABBSet the proxy physics AABB.
GetProxyCategoriesGet the proxy categories.
GetProxyUserHandleGet the proxy user handle.
OverlapAABBFind proxies that overlap the specified AABB. The results indicate that the proxy AABB overlap the specified AABB, in no specific order.
OverlapPointFind proxies that overlap the specified point. The results indicate that the proxy AABB overlap the specified point, in no specific order.
SetProxyAABBSet the proxy AABB.
SetProxyCategoriesSet the proxy categories. This can be an expensive operation as all ancestors need to be recalculated.
SetProxyUserHandleSet the proxy user handle.

Static Methods

Method

Description

CreateCreate a Physics Space.
DestroyAllDestroy all active Physics Space.
GetSpacesGet all the currently active spaces.

Classes

Class

Description

PhysicsSpace.ShapeSpaceQuery a PhysicsSpace assuming the PhysicsSpace.ProxyHandle are all PhysicsShape.

Structs

Struct

Description

PhysicsSpace.CastResultThe narrowphase cast results.
PhysicsSpace.ProxyHandleA proxy identity added to the space.
PhysicsSpace.ProxyResultA space result from PhysicsSpace.OverlapAABB, PhysicsSpace.CastRay or PhysicsSpace.CastShape.