Photon Quantum 2.1.1

Public Attributes | Properties | List of all members
Quantum.CollisionInfo2D Struct Reference

Info about a collision between two 2D physics colliders. More...

Public Attributes

ContactPointIterator2D ContactPoints
 Data about the contact points of the collision. More...
 

Properties

FPVector2ContactNormal [get]
 The contact normal, from the Entity perspective. More...
 
EntityRefEntity [get]
 The main entity involved in the collision. More...
 
UInt16? EntityShapeUserTag [get]
 The Shape2D.UserTag of the entity's shape involved in the collision. More...
 
Boolean IgnoreCollision [get, set]
 If the collision should be ignored by the physics engine. More...
 
bool IsStatic [get]
 If the Entity is touching a static collider. If so, Other has an EntityRef.None value and the static collider data can be accessed through StaticData. More...
 
EntityRefOther [get]
 The other entity involved in the collision if the Entity is NOT colliding with a static (check IsStatic). More...
 
UInt16?? OtherShapeUserTag [get]
 The Shape2D.UserTag of the other entity's shape involved in the collision. Returns default value if the this is a static collision. More...
 
FP Penetration [get]
 The collision penetration in the ContactNormal direction. More...
 
StaticColliderData StaticData [get]
 The StaticColliderData of the static collider if the Entity is colliding with a static (check IsStatic). More...
 

Detailed Description

Info about a collision between two 2D physics colliders.

The info is taken from the perspective of the entity that has subscribed to the callback with PhysicsEngine2D.SetCallbacks.

If both entities involved in a collision have subscribed to this collision type callback, it will be called twice, each time carrying information from the perspective of one of the entities.

See CollisionInfo3D for 3D collisions and TriggerInfo2D for 2D trigger collisions.

Member Data Documentation

◆ ContactPoints

ContactPointIterator2D Quantum.CollisionInfo2D.ContactPoints

Data about the contact points of the collision.

Property Documentation

◆ IgnoreCollision

Boolean Quantum.CollisionInfo2D.IgnoreCollision
getset

If the collision should be ignored by the physics engine.

◆ ContactNormal

FPVector2? Quantum.CollisionInfo2D.ContactNormal
get

The contact normal, from the Entity perspective.

◆ Penetration

FP Quantum.CollisionInfo2D.Penetration
get

The collision penetration in the ContactNormal direction.

◆ IsStatic

bool Quantum.CollisionInfo2D.IsStatic
get

If the Entity is touching a static collider. If so, Other has an EntityRef.None value and the static collider data can be accessed through StaticData.

if (info.IsStatic) { var otherStaticData = info.StaticData; } else { var otherEntity = info.Other; }

◆ Entity

EntityRef? Quantum.CollisionInfo2D.Entity
get

The main entity involved in the collision.

The info is taken from the perspective of this entity, which has subscribed to the callback with PhysicsEngine2D.SetCallbacks.

If both entities involved in a collision have subscribed to this collision type callback, it will be called twice, each time carrying information from the perspective of one of the entities.

◆ EntityShapeUserTag

UInt16? Quantum.CollisionInfo2D.EntityShapeUserTag
get

The Shape2D.UserTag of the entity's shape involved in the collision.

◆ Other

EntityRef? Quantum.CollisionInfo2D.Other
get

The other entity involved in the collision if the Entity is NOT colliding with a static (check IsStatic).

If the Entity is colliding with a static, Other has EntityRef.None value.

◆ OtherShapeUserTag

UInt16?? Quantum.CollisionInfo2D.OtherShapeUserTag
get

The Shape2D.UserTag of the other entity's shape involved in the collision. Returns default value if the this is a static collision.

◆ StaticData

StaticColliderData Quantum.CollisionInfo2D.StaticData
get

The StaticColliderData of the static collider if the Entity is colliding with a static (check IsStatic).