{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct CollisionWorld | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct CollisionWorld

    A collection of rigid bodies wrapped by a bounding volume hierarchy. This allows to do collision queries such as raycasting, overlap testing, etc.

    Implements
    ICollidable
    IAspectQueryable
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Physics
    Assembly: solution.dll
    Syntax
    [NoAlias]
    public struct CollisionWorld : ICollidable, IAspectQueryable, IDisposable

    Constructors

    Name Description
    CollisionWorld(int, int)

    Construct a collision world with the given number of uninitialized rigid bodies.

    Properties

    Name Description
    Bodies

    Gets the bodies.

    CollisionTolerance

    Contacts are always created between rigid bodies if they are closer than this distance threshold.

    DynamicBodies

    Gets the dynamic bodies.

    NumBodies

    Gets the number of bodies.

    NumDynamicBodies

    Gets the number of dynamic bodies.

    NumStaticBodies

    Gets the number of static bodies.

    StaticBodies

    Gets the static bodies.

    Methods

    Name Description
    BoxCast(float3, quaternion, float3, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)

    Box cast.

    BoxCast(float3, quaternion, float3, float3, float, CollisionFilter, QueryInteraction)

    Box cast.

    BoxCastAll(float3, quaternion, float3, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)

    Box cast all.

    BoxCastCustom<T>(float3, quaternion, float3, float3, float, ref T, CollisionFilter, QueryInteraction)

    Box cast custom.

    BuildBroadphase(ref PhysicsWorld, float, float3, bool)

    Build the broadphase based on the given world.

    CalculateAabb()

    Calculates the aabb.

    CalculateDistance(in ColliderAspect, float, ref NativeList<DistanceHit>, QueryInteraction)

    Calculates the distance from the collider aspect.

    CalculateDistance(in ColliderAspect, float, out DistanceHit, QueryInteraction)

    Calculates the distance from the collider aspect.

    CalculateDistance(in ColliderAspect, float, QueryInteraction)

    Calculates the distance from the collider aspect.

    CalculateDistance(ColliderDistanceInput)

    Calculates the distance.

    CalculateDistance(ColliderDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    CalculateDistance(ColliderDistanceInput, out DistanceHit)

    Calculates the distance.

    CalculateDistance(PointDistanceInput)

    Calculates the distance.

    CalculateDistance(PointDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    CalculateDistance(PointDistanceInput, out DistanceHit)

    Calculates the distance.

    CalculateDistance<T>(in ColliderAspect, float, ref T, QueryInteraction)

    Calculates the distance from the collider aspect.

    CalculateDistance<T>(ColliderDistanceInput, ref T)

    Calculates the distance.

    CalculateDistance<T>(PointDistanceInput, ref T)

    Calculates the distance.

    CapsuleCast(float3, float3, float, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)

    Capsule cast.

    CapsuleCast(float3, float3, float, float3, float, CollisionFilter, QueryInteraction)

    Capsule cast.

    CapsuleCastAll(float3, float3, float, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)

    Capsule cast all.

    CapsuleCastCustom<T>(float3, float3, float, float3, float, ref T, CollisionFilter, QueryInteraction)

    Capsule cast custom.

    CastCollider(in ColliderAspect, float3, float, ref NativeList<ColliderCastHit>, QueryInteraction)

    Cast a collider aspect against this CollisionWorld.

    CastCollider(in ColliderAspect, float3, float, out ColliderCastHit, QueryInteraction)

    Cast a collider aspect against this CollisionWorld.

    CastCollider(in ColliderAspect, float3, float, QueryInteraction)

    Cast a collider aspect against this CollisionWorld.

    CastCollider(ColliderCastInput)

    Cast collider.

    CastCollider(ColliderCastInput, ref NativeList<ColliderCastHit>)

    Cast collider.

    CastCollider(ColliderCastInput, out ColliderCastHit)

    Cast collider.

    CastCollider<T>(in ColliderAspect, float3, float, ref T, QueryInteraction)

    Cast a collider aspect against this CollisionWorld.

    CastCollider<T>(ColliderCastInput, ref T)

    Cast collider.

    CastRay(RaycastInput)

    Cast ray.

    CastRay(RaycastInput, ref NativeList<RaycastHit>)

    Cast ray.

    CastRay(RaycastInput, out RaycastHit)

    Cast ray.

    CastRay<T>(RaycastInput, ref T)

    Cast ray.

    CheckBox(float3, quaternion, float3, CollisionFilter, QueryInteraction)

    Check box.

    CheckCapsule(float3, float3, float, CollisionFilter, QueryInteraction)

    Check capsule.

    CheckSphere(float3, float, CollisionFilter, QueryInteraction)

    Interfaces that represent queries that exist in the GameObjects world.

    Clone()

    Clone the world. Bodies and Broadphase are deep copied. Colliders are shallow copied.

    Dispose()

    Free internal memory.

    FindOverlaps(ref Writer, ref Writer)

    Write all overlapping body pairs to the given streams, where at least one of the bodies is dynamic. The results are unsorted.

    GetRigidBodyIndex(Entity)

    Gets the zero-based index of the rigid body.

    OverlapAabb(OverlapAabbInput, ref NativeList<int>)

    Test input against the broadphase tree, filling allHits with the body indices of every overlap. Returns true if there was at least overlap.

    OverlapBox(float3, quaternion, float3, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)

    Overlap box.

    OverlapBoxCustom<T>(float3, quaternion, float3, ref T, CollisionFilter, QueryInteraction)

    Overlap box custom.

    OverlapCapsule(float3, float3, float, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)

    Overlap capsule.

    OverlapCapsuleCustom<T>(float3, float3, float, ref T, CollisionFilter, QueryInteraction)

    Overlap capsule custom.

    OverlapSphere(float3, float, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)

    Overlap sphere.

    OverlapSphereCustom<T>(float3, float, ref T, CollisionFilter, QueryInteraction)

    Overlap sphere custom.

    Reset(int, int)

    Resets this object.

    ScheduleBuildBroadphaseJobs(ref PhysicsWorld, float, float3, ReadOnly, JobHandle, bool)

    Schedule a set of jobs to build the broadphase based on the given world.

    ScheduleFindOverlapsJobs(out NativeStream, out NativeStream, JobHandle, bool)

    Schedule a set of jobs which will write all overlapping body pairs to the given steam, where at least one of the bodies is dynamic. The results are unsorted.

    ScheduleUpdateDynamicTree(ref PhysicsWorld, float, float3, JobHandle, bool)

    Schedule a set of jobs to synchronize the collision world with the dynamics world.

    SphereCast(float3, float, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)

    Sphere cast.

    SphereCast(float3, float, float3, float, CollisionFilter, QueryInteraction)

    Sphere cast.

    SphereCastAll(float3, float, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)

    Sphere cast all.

    SphereCastCustom<T>(float3, float, float3, float, ref T, CollisionFilter, QueryInteraction)

    Sphere cast custom.

    UpdateBodyIndexMap()

    Updates the body index map.

    UpdateDynamicTree(ref PhysicsWorld, float, float3)

    Synchronize the collision world with the dynamics world.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)