Class HitBox2DSystem
This system tests for overlaps between all components under all cameras
in the world.
Inheritance
System.Object
HitBox2DSystem
Syntax
public class HitBox2DSystem : ComponentSystem
Fields
cppWrapper
Declaration
protected IntPtr cppWrapper
Field Value
| Type |
Description |
| System.IntPtr |
|
Methods
DeinitNative()
Declaration
protected static void DeinitNative()
Returns a 2D convex polygon outline of the intersection between two
hit boxes. This can be rendered as a Shape2D component.
Declaration
public NativeArray<float2> DetailedHitBoxOverlapInformation(Entity e, HitBoxOverlap overlap, Allocator allocator = null)
Parameters
| Type |
Name |
Description |
| Entity |
e |
|
| HitBoxOverlap |
overlap |
|
| Allocator |
allocator |
|
Returns
| Type |
Description |
| NativeArray<float2> |
|
Declaration
protected static int DetailedOverlapInformationNative(IntPtr emr, Entity e, HitBoxOverlap overlap, float2*result)
Parameters
| Type |
Name |
Description |
| System.IntPtr |
emr |
|
| Entity |
e |
|
| HitBoxOverlap |
overlap |
|
| float2* |
result |
|
Returns
| Type |
Description |
| System.Int32 |
|
GetSweepResultsNative(Entity**, HitBoxOverlap**)
Declaration
protected static int GetSweepResultsNative(Entity**e, HitBoxOverlap**outPtr)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
HitTest(float3, Entity)
Find the entity under hitPoint for the given camera.
Declaration
public HitTestResult HitTest(float3 hitPoint, Entity camera)
Parameters
| Type |
Name |
Description |
| float3 |
hitPoint |
|
| Entity |
camera |
|
Returns
HitTestCamera(float3)
Return an Entity that has a DisplayListCamera that contains point hitPoint, or Null
if none matches.
Declaration
public Entity HitTestCamera(float3 hitPoint)
Parameters
| Type |
Name |
Description |
| float3 |
hitPoint |
|
Returns
HitTestNative(IntPtr, float3, Entity, ref HitTestResult)
Declaration
protected static void HitTestNative(IntPtr emr, float3 hitPoint, Entity camera, ref HitTestResult result)
Parameters
| Type |
Name |
Description |
| System.IntPtr |
emr |
|
| float3 |
hitPoint |
|
| Entity |
camera |
|
| HitTestResult |
result |
|
InitNative()
Declaration
protected static void InitNative()
OnCreate()
Declaration
protected override void OnCreate()
OnDestroy()
Declaration
protected override void OnDestroy()
OnUpdate()
Declaration
protected override void OnUpdate()
RayCast(float3, float3, Entity)
Declaration
public RayCastResult RayCast(float3 startPoint, float3 endPoint, Entity camera)
Parameters
| Type |
Name |
Description |
| float3 |
startPoint |
|
| float3 |
endPoint |
|
| Entity |
camera |
|
Returns
RayCastNative(IntPtr, float3, float3, Entity, ref RayCastResult)
Declaration
protected static void RayCastNative(IntPtr emr, float3 startPoint, float3 endPoint, Entity camera, ref RayCastResult result)
Parameters
| Type |
Name |
Description |
| System.IntPtr |
emr |
|
| float3 |
startPoint |
|
| float3 |
endPoint |
|
| Entity |
camera |
|
| RayCastResult |
result |
|
SweepLineNative(IntPtr, Entity, Camera2D)
Declaration
protected static void SweepLineNative(IntPtr emr, Entity e, Camera2D cam)
Parameters
| Type |
Name |
Description |
| System.IntPtr |
emr |
|
| Entity |
e |
|
| Camera2D |
cam |
|