Namespace Unity.Physics
Classes
IBodyPairsJobExtensions
A body pairs job extensions.
ICollisionEventJobExtensions
A collision event job extensions.
IContactsJobExtensions
The contacts job extensions.
IImpulseEventJobExtensions
An extension class for scheduling ImpulseEventsJob.
IJacobiansJobExtensions
The jacobians job extensions.
ISimulationEventUtilities
A simulation event utility class.
ITriggerEventJobExtensions
A trigger event job extensions.
Integrator
Integrates world's motions.
Math
Helper functions.
Math.Constants
Constants.
SimplexSolver
A simplex solver.
Solver
A static class that exposes Solver configuration structures.
Structs
Aabb
An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object.
AllHitsCollector<T>
A collector which stores every hit.
AnyHitCollector<T>
A collector which exits the query as soon as any hit is detected.
BlobArray
Non-generic temporary stand-in for Unity BlobArray. This is to work around C# wanting to treat any struct containing the generic Unity.BlobArray<T> as a managed struct.
BlobArray.Accessor<T>
Generic accessor.
BlobArray.Accessor<T>.Enumerator
An enumerator.
BodyFrame
A target in the space of a rigid body that will align with a corresponding target in the space of the other body to which it is constrained.
BodyIndexPair
A pair of rigid body indices.
BoxCollider
A collider in the shape of a box.
BoxGeometry
A box geometry.
CapsuleCollider
A collider in the shape of a capsule.
CapsuleGeometry
A capsule geometry.
ChildCollider
A child/leaf collider.
ClosestHitCollector<T>
A collector which stores only the closest hit.
Collider
Base struct common to all colliders. Dispatches the interface methods to appropriate implementations for the collider type.
ColliderCastHit
A hit from a collider cast query.
ColliderCastInput
The input to collider cast queries consists of a Collider and its initial orientation, and the Start & End positions of a line segment the Collider is to be swept along.
ColliderDistanceInput
The input to collider distance queries.
ColliderKey
An opaque key which packs a path to a specific leaf of a collider hierarchy into a single integer.
ColliderKeyPair
A pair of collider keys.
ColliderKeyPath
Stores a ColliderKey along with the number of bits in it that are used. This is useful for building keys from root to leaf, the bit count shows where to place the child key bits.
CollisionEvent
An event raised when a pair of bodies have collided during solving.
CollisionEvent.Details
Extra details about a collision.
CollisionEvents
A stream of collision events. This is a value type, which means it can be used in Burst jobs (unlike IEnumerable<CollisionEvent>).
CollisionEvents.Enumerator
An enumerator.
CollisionFilter
Describes which other objects an object can collide with.
CollisionWorld
A collection of rigid bodies wrapped by a bounding volume hierarchy. This allows to do collision queries such as raycasting, overlap testing, etc.
CompoundCollider
A collider containing instances of other colliders.
CompoundCollider.Child
A child collider, within the same blob as the compound collider. Warning: This references the collider via a relative offset, so must always be passed by reference.
CompoundCollider.ColliderBlobInstance
Input to the compound collider creation function Create(NativeArray<ColliderBlobInstance>). Represents one child of the compound collider and its local transformation relative to the compound collider.
Constraint
A linear or angular constraint in 1, 2, or 3 dimensions.
ConstraintBlock3
A internal container holding the max number of constraints allowed per joint.
ContactJacAngAndVelToReachCp
A contact jacobian angle and velocity to reach the contact plane.
ContactJacobianAngular
A contact jacobian angular.
ContactPoint
A contact point in a manifold. All contacts share the same normal.
ConvexCollider
A collider in the shape of an arbitrary convex hull. Warning: This is just the header, it is followed by variable sized data in memory. Therefore this struct must always be passed by reference, never by value.
ConvexHullGenerationParameters
Convex hull generation parameters.
CustomPhysicsProxyDriver
Provide a link to an entity in the physics world the custom physics proxy is driven by.
CylinderCollider
A collider in the shape of a cylinder.
CylinderGeometry
A cylinder geometry.
DistanceHit
A hit from a distance query.
DynamicsWorld
A collection of motion information used during physics simulation.
ImpulseEvent
An impulse event.
ImpulseEvents
A stream of impulse events. This is a value type, which means it can be used in Burst jobs (unlike IEnumerable<ImpulseEvent>).
ImpulseEvents.Enumerator
An enumerator.
Joint
A runtime joint instance, attached to specific rigid bodies.
MassDistribution
Describes how mass is distributed within an object Represented by a transformed box inertia of unit mass.
MassFactors
The mass factors.
MassProperties
The mass properties of an object.
Material
Describes how an object should respond to collisions with other objects.
Math.FloatRange
Range of possible values for some constrained parameter.
Math.MTransform
A transform in matrix format
Math.ScaledMTransform
A transform in matrix format that includes scale.
MeshCollider
A collider representing a mesh comprised of triangles and quads. Warning: This is just the header, it is followed by variable sized data in memory. Therefore this struct must always be passed by reference, never by value.
ModifiableBodyPair
A modifiable body pair.
ModifiableContactHeader
A modifiable contact header.
ModifiableContactJacobian
A modifiable contact jacobian.
ModifiableContactPoint
A modifiable contact point.
ModifiableJacobianHeader
A modifiable jacobian header.
ModifiableTriggerJacobian
A modifiable trigger jacobian.
MotionData
A dynamic rigid body's "cold" motion data, used during Jacobian building and integration.
MotionVelocity
A dynamic rigid body's "hot" motion data, used during solving.
OverlapAabbHit
A hit from an overlap query.
OverlapAabbInput
The input to AABB overlap queries.
PhysicsCollider
The collision geometry of a rigid body. If not present, the rigid body cannot collide with anything.
PhysicsColliderKeyEntityPair
A buffer element which associates an original Unity.Entities.Entity with a child collider in a CompoundCollider through the child's ColliderKey.
This buffer is automatically added during baking to rigid body entities whose colliders are regrouped and baked into a compound collider. It contains one entry per child in the resultant compound collider, associating the original Unity.Entities.Entity which contained the collider before creation of the compound with the compound's child collider through the child's collider key.
.PhysicsConstrainedBodyPair
A pair of bodies with some constraint between them (either a joint or a motor)
PhysicsCustomTags
Optional custom tags attached to a rigid body. This will be copied to any contacts and Jacobians involving this rigid body, providing additional context to any user logic operating on those structures.
PhysicsDamping
Optional damping applied to the rigid body velocities during each simulation step. This scales the velocities using: math.clamp(1 - damping * Timestep, 0, 1)
PhysicsGravityFactor
Optional gravity factor applied to a rigid body during each simulation step. This scales the gravity vector supplied to the simulation step.
PhysicsJoint
A set of constraints on the relative motion of a PhysicsConstrainedBodyPair. Most joint types can be described with a single instance, but complex setups like ragdoll joints require more than one instance to stabilize. In these cases, you should associate multiple joints using PhysicsJointCompanion.
PhysicsJointCompanion
A buffer element to indicate additional entities in a complex joint configuration. Most joint types can be described with a single PhysicsJoint, but complex setups like ragdoll joints require more than one joint to stabilize. This component allows you to locate all of the other joints in such setups to facilitate group destruction, deactivation, and so on. Each joint entity in the group should have this component, with one element for each other joint in the group.
PhysicsMass
The mass properties of a rigid body. If not present, the rigid body has infinite mass and inertia.
PhysicsMassOverride
Add this component to a dynamic body if it needs to sometimes switch to being kinematic. This allows you to retain its dynamic mass properties on its PhysicsMass component, but have the physics solver temporarily treat it as if it were kinematic. Kinematic bodies will have infinite mass and inertia. They should also not be affected by gravity. Hence, if IsKinematic is non-zero the value in an associated PhysicsGravityFactor component is also ignored. If SetVelocityToZero is non-zero then the value in an associated PhysicsVelocity component is also ignored.
PhysicsStep
Parameters describing how to step the physics world. If none is present in the scene, default values will be used.
PhysicsVelocity
The velocity of a rigid body. If absent, the rigid body is static.
PhysicsWorld
A collection of rigid bodies and joints.
PhysicsWorldIndex
Shared component for entities that belong to a physics world. Default physics world is built in BuildPhysicsWorld, from entities that have Value of 0.
PhysicsWorldSingleton
The physics world singleton. Use it to access the PhysicsWorld used by simulation. If you want read only access to the world, use (SystemBase|SystemAPI|EntityQuery).GetSingleton<PhysicsWorldSingleton>(). If you want read write access to the world, use (SystemBase|SystemAPI|EntityQuery).GetSingletonRW< PhysicsWorldSingleton>().
Plane
A plane described by a normal and a negated distance from the origin.
PointDistanceInput
The input to point distance queries.
PolygonCollider
A flat convex collider with either 3 or 4 coplanar vertices (ie, a triangle or a quad)
Ray
This struct captures the information needed for ray casting. It is technically not a Ray as it includes a length. This is to avoid performance issues with infinite length Rays.
RaycastHit
A struct representing the hit from a RaycastQuery.
RaycastInput
The input to RayCastQueries consists of the Start and End positions of a line segment as well as a CollisionFilter to cull potential hits.
RigidBody
An instance of a collider in a physics world.
Simulation
Steps a physics world.
SimulationContext
Holds temporary data in a storage that lives as long as simulation lives and is only re- allocated if necessary.
SimulationJobHandles
Result of ISimulation.ScheduleStepJobs()
SimulationSingleton
A simulation singleton. Use it to get simulation used by the physics engine. Call (SystemBase|SystemAPI|EntityQuery).GetSingleton<SimulationSingleton() to get read-only access. Call (SystemBase|SystemAPI|EntityQuery).GetSingletonRW<SimulationSingleton() to get read-write access.
SimulationStepInput
Parameters for a simulation step.
Solver.StabilizationData
Data used for solver stabilization.
Solver.StabilizationHeuristicSettings
Settings for controlling the solver stabilization heuristic.
SphereCollider
A collider in the shape of a sphere.
SphereGeometry
A sphere geometry.
SurfaceConstraintInfo
Information about the surface constraint.
SurfaceVelocity
A velocity between the two contacting objects.
TerrainCollider
A collider representing a terrain described by a uniform grid of height samples. Warning: This is just the header, it is followed by variable sized data in memory. Therefore this struct must always be passed by reference, never by value.
TriggerEvent
An event raised when a pair of bodies involving a trigger material have overlapped during solving.
TriggerEvents
A stream of trigger events. This is a value type, which means it can be used in Burst jobs (unlike IEnumerable<TriggerEvent>).
TriggerEvents.Enumerator
An enumerator.
Interfaces
IAspectQueryable
Interface for objects that can be hit by aspect queries.
IBodyPairsJob
Interface for jobs that iterate through the list of potentially overlapping body pairs produced by the broad phase.
IBodyPairsJobBase
INTERNAL UnityPhysics interface for jobs that iterate through the list of potentially overlapping body pairs produced by the broad phase Important: Only use inside UnityPhysics code! Jobs in other projects should implement IBodyPairsJob.
ICollector<T>
Interface for collecting hits during a collision query.
ICollidable
Interface for objects that can be hit by physics queries.
ICollider
Interface for colliders.
ICollisionEventsJob
Interface for jobs that iterate through the list of collision events produced by the solver.
ICollisionEventsJobBase
INTERNAL UnityPhysics interface for jobs that iterate through the list of collision events produced by the solver. Important: Only use inside UnityPhysics code! Jobs in other projects should implement ICollisionEventsJob.
IContactsJob
Interface for jobs that iterate through the list of contact manifolds produced by the narrow phase.
IContactsJobBase
INTERNAL UnityPhysics interface for jobs that iterate through the list of contact manifolds produced by the narrow phase Important: Only use inside UnityPhysics code! Jobs in other projects should implement IContactsJob.
IImpulseEventsJob
Interface for impulse events job.
IImpulseEventsJobBase
Interface for impulse events job base.
IJacobiansJob
Interface for jobs that iterate through the list of Jacobians before they are solved.
IJacobiansJobBase
INTERNAL UnityPhysics interface for jobs that iterate through the list of Jacobians before they are solved Important: Only use inside UnityPhysics code! Jobs in other projects should implement IJacobiansJob.
ILeafColliderCollector
Interface for collecting leaf colliders.
IOverlapCollector
Interface for collecting hits from overlap queries.
IQueryResult
Interface for query results.
ISimulation
Interface for simulations.
ISimulationEvent<T>
An event raised when a pair of bodies interact during solving.
ITriggerEventsJob
Interface for jobs that iterate through the list of trigger events produced by the solver.
ITriggerEventsJobBase
INTERNAL UnityPhysics interface for jobs that iterate through the list of trigger events produced by the solver. Important: Only use inside UnityPhysics code! Jobs in other projects should implement ITriggerEventsJob.
Enums
ColliderType
The concrete type of a collider.
CollisionResponsePolicy
Defines the collision response policy of a collider.
CollisionType
The base type of a collider.
ConstraintType
Values that represent constraint types.
JacobianFlags
Flags which enable optional Jacobian behaviors.
JacobianType
Values that represent jacobian types.
JointType
A designation of one of several types of canonical joints.
Material.CombinePolicy
Defines how a value from a pair of materials should be combined.
QueryInteraction
Used as a way to provide queries with more filtering options, without creating collectors At the moment, IgnoreTriggers is the only option that is supported.
SimulationType
Implementations of ISimulation.
TerrainCollider.CollisionMethod
TerrainCollider offers two methods for rigid body collision with performance / quality tradeoffs.