Struct Collision
A pair of component colliding with each other. Pair of [b,a] is considered equal to [a,b].
public readonly struct Collision : IEquatable<Collision>
- Implements
- Inherited Members
Constructors
Collision(PhysicsComponent, PhysicsComponent)
public Collision(PhysicsComponent a, PhysicsComponent b)
Parameters
Fields
ColliderA
public readonly PhysicsComponent ColliderA
Field Value
ColliderB
public readonly PhysicsComponent ColliderB
Field Value
Properties
AreColliding
public bool AreColliding { get; }
Property Value
Contacts
public HashSet<ContactPoint> Contacts { get; }
Property Value
HasEndedFromComponentRemoval
True if the collision has ended because one of the colliders has been removed, either by removing the entity from the scene or by removing physics component from the entity.
public bool HasEndedFromComponentRemoval { get; }
Property Value
Remarks
If true, it is not safe to invoke further actions on the colliders. Only use colliders information to identify the entity that has been removed.
Methods
ContactChanged()
The returned collection contains the previous contacts, new contacts are under Contacts
public ChannelMicroThreadAwaiter<HashSet<ContactPoint>> ContactChanged()
Returns
Ended()
public Task Ended()
Returns
Equals(Collision)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Collision other)
Parameters
other
CollisionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(in Collision, in Collision)
public static bool operator ==(in Collision a, in Collision b)
Parameters
Returns
operator !=(in Collision, in Collision)
public static bool operator !=(in Collision a, in Collision b)