Search Results for

    Show / Hide Table of Contents

    Class Collision

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

    Inheritance
    System.Object
    Collision
    Implements
    System.Collections.Generic.IEnumerable<ContactPoint>
    System.Collections.IEnumerable
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public sealed class Collision : ValueType, 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 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 Collider OtherCollider { get; }
    Property Value
    Collider

    RelativeVelocity

    The relative linear velocity of the two colliding objects.

    Declaration
    public 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 Collider ThisCollider { get; }
    Property Value
    Collider

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat