Photon Quantum 2.1.1

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

Info about two entities that were colliding in the 3D 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.StaticColliders3D[_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 3D Physics.

The info is taken from the perspective of the entity that has subscribed to the callback with Physics3D.PhysicsEngine3D.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 TriggerInfo3D for 3D trigger collisions.

Member Data Documentation

◆ IsStatic

bool Quantum.ExitInfo3D.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.ExitInfo3D.StaticData => _staticIndex >= 0 ? _map.StaticColliders3D[_staticIndex].StaticData : default

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

Property Documentation

◆ Entity

EntityRef Quantum.ExitInfo3D.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 Physics3D.PhysicsEngine3D.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.ExitInfo3D.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.