docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ColliderCastHit

    A hit from a collider cast query.

    Implements
    IQueryResult
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Physics
    Assembly: Unity.Physics.dll
    Syntax
    public struct ColliderCastHit : IQueryResult

    Fields

    QueryColliderKey

    Collider key of the query collider.

    Declaration
    public ColliderKey QueryColliderKey
    Field Value
    Type Description
    ColliderKey

    If the query input uses composite collider, this field will have the collider key of it's leaf which participated in the hit, otherwise the value will be undefined.

    Properties

    ColliderKey

    Gets or sets the collider key.

    Declaration
    public ColliderKey ColliderKey { readonly get; set; }
    Property Value
    Type Description
    ColliderKey

    Returns ColliderKey of queried leaf collider.

    Entity

    Gets or sets the entity.

    Declaration
    public Entity Entity { readonly get; set; }
    Property Value
    Type Description
    Entity

    Returns Entity of queried body.

    Fraction

    Fraction of the distance along the Ray where the hit occurred.

    Declaration
    public float Fraction { readonly get; set; }
    Property Value
    Type Description
    float

    Returns a value between 0 and 1.

    Material

    Gets or sets the material.

    Declaration
    public Material Material { readonly get; set; }
    Property Value
    Type Description
    Material

    Returns Material of queried leaf collider.

    Position

    The point in query space where the hit occurred.

    Declaration
    public float3 Position { readonly get; set; }
    Property Value
    Type Description
    float3

    Returns the position of the point where the hit occurred.

    RigidBodyIndex

    Gets or sets the zero-based index of the rigid body.

    Declaration
    public int RigidBodyIndex { readonly get; set; }
    Property Value
    Type Description
    int

    Returns RigidBodyIndex of queried body.

    SurfaceNormal

    Gets or sets the surface normal.

    Declaration
    public float3 SurfaceNormal { readonly get; set; }
    Property Value
    Type Description
    float3

    Returns the normal of the point where the hit occurred.

    Methods

    ToString()

    Convert this object into a string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents this object.

    Overrides
    ValueType.ToString()

    Implements

    IQueryResult
    In This Article
    Back to top
    Copyright © 2024 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)