Search Results for

    Show / Hide Table of Contents

    Struct Collision

    Contains a collision information passed to the OnCollisionEnter/OnCollisionExit events.

    Implements
    System.Collections.Generic.IEnumerable<ContactPoint>
    System.Collections.IEnumerable
    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public struct Collision : IEnumerable<ContactPoint>, IEnumerable

    Fields

    ContactsCount

    The amount of valid contact points (less or equal to COLLISION_NAX_CONTACT_POINTS).

    Declaration
    public int ContactsCount
    Field Value
    System.Int32

    Impulse

    The total impulse applied to this contact pair to resolve the collision.

    Declaration
    public Vector3 Impulse
    Field Value
    Vector3

    Remarks

    The total impulse is obtained by summing up impulses applied at all contact points in this collision pair.

    OtherActor

    The second collider (other instance).

    Declaration
    public PhysicsColliderActor OtherActor
    Field Value
    PhysicsColliderActor

    OtherVelocity

    The linear velocity of the second colliding object (other instance).

    Declaration
    public Vector3 OtherVelocity
    Field Value
    Vector3

    ThisActor

    The first collider (this instance).

    Declaration
    public PhysicsColliderActor ThisActor
    Field Value
    PhysicsColliderActor

    ThisVelocity

    The linear velocity of the first colliding object (this instance).

    Declaration
    public Vector3 ThisVelocity
    Field Value
    Vector3

    Properties

    Contacts

    The contacts locations.

    Declaration
    public readonly ContactPoint[] Contacts { get; }
    Property Value
    ContactPoint[]

    Remarks

    This property allocates an array of contact points.

    OtherCollider

    The second collider (other instance). It may be null if this actor is not the Collider (eg. Terrain).

    Declaration
    public readonly Collider OtherCollider { get; }
    Property Value
    Collider

    RelativeVelocity

    The relative linear velocity of the two colliding objects.

    Declaration
    public readonly Vector3 RelativeVelocity { get; }
    Property Value
    Vector3

    Remarks

    Can be used to detect stronger collisions.

    ThisCollider

    The first collider (this instance). It may be null if this actor is not the Collider (eg. Terrain).

    Declaration
    public readonly Collider ThisCollider { get; }
    Property Value
    Collider

    Explicit Interface Implementations

    IEnumerable<ContactPoint>.GetEnumerator()

    Declaration
    IEnumerator<ContactPoint> IEnumerable<ContactPoint>.GetEnumerator()
    Returns
    System.Collections.Generic.IEnumerator<ContactPoint>

    Implements
    System.Collections.Generic.IEnumerable<T>.GetEnumerator()

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    System.Collections.IEnumerator

    Implements
    System.Collections.IEnumerable.GetEnumerator()

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    Extensions.ForEach<T>(IEnumerable<T>, Action<T>)
    In This Article
    Back to top Copyright © 2012-2021 Wojciech Figat