Photon Quantum 2.1.1

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

Info about two entities that were colliding in the 2D Physics. More...

Public Attributes

bool IsStatic => _staticIndex >= 0
 If the Entity was touching a static collider. If so, Other has an EntityRef.None value and the static collider data can be accessed through StaticData. More...
 
StaticColliderData StaticData => _staticIndex >= 0 ? _map.StaticColliders2D[_staticIndex].StaticData : default
 The StaticColliderData of the static collider if the Entity was colliding with a static (check IsStatic). More...
 

Properties

EntityRef Entity [get]
 The main entity that was involved in the collision. More...
 
EntityRef Other [get]
 The other entity that was involved in the collision if the Entity was NOT colliding with a static (check IsStatic). More...
 

Detailed Description

Info about two entities that were colliding in the 2D Physics.

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 CollisionInfo2D for 2D collisions and TriggerInfo2D for 2D trigger collisions.

Member Data Documentation

◆ IsStatic

bool Quantum.ExitInfo2D.IsStatic => _staticIndex >= 0

If the Entity was 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; }

◆ StaticData

StaticColliderData Quantum.ExitInfo2D.StaticData => _staticIndex >= 0 ? _map.StaticColliders2D[_staticIndex].StaticData : default

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

Property Documentation

◆ Entity

EntityRef Quantum.ExitInfo2D.Entity
get

The main entity that was 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.

◆ Other

EntityRef Quantum.ExitInfo2D.Other
get

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

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