{!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 Collider | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct Collider

    Base struct common to all colliders. Dispatches the interface methods to appropriate implementations for the collider type.

    Implements
    ICollider
    ICollidable
    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
    public struct Collider : ICollider, ICollidable

    Properties

    Name Description
    CollisionType

    Gets the type of the collision.

    IsUnique

    Indicates whether this collider is unique, i.e., not shared between rigid bodies.

    MassProperties

    Gets the mass properties.

    MemorySize

    Gets the memory size.

    NumColliderKeyBits

    Gets the number of collider key bits.

    TotalNumColliderKeyBits

    Gets the total number of number collider key bits.

    Type

    Gets the collider type.

    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.

    CalculateAabb()

    Calculate a bounding box around this collider.

    CalculateAabb(RigidTransform, float)

    Calculate a bounding box around this collider, at the given transform.

    CalculateDistance(ColliderDistanceInput)

    Calculate the distance from another collider to this one.

    CalculateDistance(ColliderDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    CalculateDistance(ColliderDistanceInput, out DistanceHit)

    Calculates the distance.

    CalculateDistance(PointDistanceInput)

    Calculate the distance from a point to this collider.

    CalculateDistance(PointDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    CalculateDistance(PointDistanceInput, out DistanceHit)

    Calculates the distance.

    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(ColliderCastInput)

    Cast another collider against this one.

    CastCollider(ColliderCastInput, ref NativeList<ColliderCastHit>)

    Cast collider.

    CastCollider(ColliderCastInput, out ColliderCastHit)

    Cast collider.

    CastCollider<T>(ColliderCastInput, ref T)

    Cast collider.

    CastRay(RaycastInput)

    Cast a ray against this collider.

    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)

    Checks if a sphere overlaps this collider.

    Clone()

    This function clones the Collider and wraps it in a BlobAssetReference. The caller is responsible for appropriately calling Dispose on the result. Returned collider is guaranteed to be unique.

    GetChild(ref ColliderKey, out ChildCollider)

    Gets a child of this collider.

    GetCollisionFilter()

    Get the collision filter. In case of a CompoundCollider, returns the root filter.

    GetCollisionFilter(ColliderKey)

    Gets the collision filter specified by the collider key. The key is only read in case the collider is CompoundCollider, otherwise it is ignored and will behave as GetCollisionFilter().

    GetCollisionResponse()

    Gets the collision response. In case of a CompoundCollider, this behaves as GetCollisionResponse(ColliderKey) with ColliderKey.Zero passed in.

    GetCollisionResponse(ColliderKey)

    Gets collision response of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as GetCollisionResponse() . In case of CompoundCollider if the colider key is empty, it will return the collision response of the first child.

    GetFriction()

    Gets the friction. In case of a CompoundCollider, this behaves as GetFriction(ColliderKey) with ColliderKey.Zero passed in.

    GetFriction(ColliderKey)

    Gets the friction of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as GetFriction() . In case of CompoundCollider if the colider key is empty, it will return the friction of the first child.

    GetLeaf(ColliderKey, out ChildCollider)

    Gets a leaf collider.

    GetLeafCollider(out ChildCollider, Collider*, ColliderKey, RigidTransform, float)

    Get a leaf of a collider hierarchy. Return false if the key is not valid for the collider.

    GetLeaves<T>(ref T)

    Gets the leaf colliders of this collider .

    GetRestitution()

    Gets the restitution. In case of a CompoundCollider, this behaves as GetRestitution(ColliderKey) with ColliderKey.Zero passed in

    GetRestitution(ColliderKey)

    Gets a restitution of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as GetRestitution() . In case of CompoundCollider if the colider key is empty, it will return the restitution of the first child.

    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.

    SetCollisionFilter(CollisionFilter)

    Sets the collision filter. In case of a CompoundCollider sets the root filter.

    SetCollisionFilter(CollisionFilter, ColliderKey)

    Sets the collision filter of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as SetCollisionFilter(CollisionFilter)

    SetCollisionResponse(CollisionResponsePolicy)

    Sets collision response. In case of a CompoundCollider, this behaves as SetCollisionResponse(CollisionResponsePolicy, ColliderKey) with ColliderKey.Zero passed in.

    SetCollisionResponse(CollisionResponsePolicy, ColliderKey)

    Sets collision response of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as SetCollisionResponse(CollisionResponsePolicy) . In case of CompoundCollider if the collider key is empty, it will set the collision response of the all children.

    SetFriction(float)

    Sets the friction. In case of a CompoundCollider, this behaves as SetFriction(float, ColliderKey) with ColliderKey.Zero passed in.

    SetFriction(float, ColliderKey)

    Sets the friction of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as SetFriction(float) . In case of CompoundCollider if the collider key is empty, it will set the friction of the all children.

    SetRestitution(float)

    Sets the restitution. In case of a CompoundCollider, this behaves as SetRestitution(float, ColliderKey) with ColliderKey.Zero passed in.

    SetRestitution(float, ColliderKey)

    Sets the restitution of a child specified by the collider key. Collider key is only read in case of CompoundCollider, otherwise it is ignored and will behave as SetRestitution(float) . In case of CompoundCollider if the collider key is empty, it will set the restitution of the all children.

    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.

    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)