TrueSync
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
TrueSync.TSPhysics2D Class Reference

Helpers for 2D physics. More...

Public Types

enum  TSCapsuleDirection2D { VERTICAL, HORIZONTAL }
 

Static Public Member Functions

static TSCollider2D OverlapCircle (TSVector2 point, FP radius)
 Returns the first TSCollider2D within a circular area. Returns null if there is none. More...
 
static TSCollider2D[] OverlapCircleAll (TSVector2 point, FP radius)
 Returns all TSCollider2D within a circular area. Returns null if there is none. More...
 
static object _OverlapArea (TSVector2 pointA, TSVector2 pointB, Physics2D.BodySpecialSensor sensorType)
 Returns the first TSCollider2D within a rectangular area. Returns null if there is none. More...
 
static TSCollider2D OverlapArea (TSVector2 pointA, TSVector2 pointB)
 Returns the first TSCollider2D within a rectangular area. Returns null if there is none. More...
 
static TSCollider2D[] OverlapAreaAll (TSVector2 pointA, TSVector2 pointB)
 Returns all TSCollider2D within a rectangular area. Returns null if there is none. More...
 
static TSCollider2D OverlapPoint (TSVector2 point)
 Returns the first TSCollider2D within a small circular area. Returns null if there is none. More...
 
static TSCollider2D[] OverlapPointAll (TSVector2 point)
 Returns all TSCollider2D within a small circular area. Returns null if there is none. More...
 
static TSCollider2D OverlapBox (TSVector2 point, TSVector2 size, FP angle)
 Returns the first TSCollider2D within a box area. Returns null if there is none. More...
 
static TSCollider2D[] OverlapBoxAll (TSVector2 point, TSVector2 size, FP angle)
 Returns all TSCollider2D within a box area. Returns null if there is none. More...
 
static TSCollider2D OverlapCapsule (TSVector2 point, TSVector2 size, TSCapsuleDirection2D direction, FP angle)
 Returns the first TSCollider2D within a capsule area. Returns null if there is none. More...
 
static TSCollider2D[] OverlapCapsuleAll (TSVector2 point, TSVector2 size, TSCapsuleDirection2D direction, FP angle)
 Returns all TSCollider2D within a capsule area. Returns null if there is none. More...
 
static object _CircleCast (TSVector2 origin, FP radius, TSVector2 direction, FP distance, Physics2D.BodySpecialSensor sensorType)
 
static TSRaycastHit2D CircleCast (TSVector2 origin, FP radius, TSVector2 direction, FP distance)
 Cast a circle and returns a TSRaycastHit2D with information about the first TSCollider2D found. Returns null if there is none. More...
 
static TSRaycastHit2D[] CircleCastAll (TSVector2 origin, FP radius, TSVector2 direction, FP distance)
 Cast a circle and returns an array TSRaycastHit2D with information about all TSCollider2D found. Returns null if there is none. More...
 

Static Public Attributes

static Physics2D.Body _testBody
 

Detailed Description

Helpers for 2D physics.

Definition at line 9 of file TSPhysics2D.cs.

Member Function Documentation

static object TrueSync.TSPhysics2D._OverlapArea ( TSVector2  pointA,
TSVector2  pointB,
Physics2D.BodySpecialSensor  sensorType 
)
static

Returns the first TSCollider2D within a rectangular area. Returns null if there is none.

Parameters
pointATop-left corner of the rectangle.
radiusBottom-right corner of the rectangle.

Definition at line 88 of file TSPhysics2D.cs.

static TSRaycastHit2D TrueSync.TSPhysics2D.CircleCast ( TSVector2  origin,
FP  radius,
TSVector2  direction,
FP  distance 
)
static

Cast a circle and returns a TSRaycastHit2D with information about the first TSCollider2D found. Returns null if there is none.

Parameters
originOrigin of the circle in world space.
radiusRadius of the circle.
directionDirection TSVector2 of the cast.
distanceMax distance to reach.

Definition at line 260 of file TSPhysics2D.cs.

static TSRaycastHit2D [] TrueSync.TSPhysics2D.CircleCastAll ( TSVector2  origin,
FP  radius,
TSVector2  direction,
FP  distance 
)
static

Cast a circle and returns an array TSRaycastHit2D with information about all TSCollider2D found. Returns null if there is none.

Parameters
originOrigin of the circle in world space.
radiusRadius of the circle.
directionDirection TSVector2 of the cast.
distanceMax distance to reach.

Definition at line 272 of file TSPhysics2D.cs.

static TSCollider2D TrueSync.TSPhysics2D.OverlapArea ( TSVector2  pointA,
TSVector2  pointB 
)
static

Returns the first TSCollider2D within a rectangular area. Returns null if there is none.

Parameters
pointATop-left corner of the rectangle.
radiusBottom-right corner of the rectangle.

Definition at line 108 of file TSPhysics2D.cs.

static TSCollider2D [] TrueSync.TSPhysics2D.OverlapAreaAll ( TSVector2  pointA,
TSVector2  pointB 
)
static

Returns all TSCollider2D within a rectangular area. Returns null if there is none.

Parameters
pointATop-left corner of the rectangle.
radiusBottom-right corner of the rectangle.

Definition at line 118 of file TSPhysics2D.cs.

static TSCollider2D TrueSync.TSPhysics2D.OverlapBox ( TSVector2  point,
TSVector2  size,
FP  angle 
)
static

Returns the first TSCollider2D within a box area. Returns null if there is none.

Parameters
pointCenter of the box in world space.
sizeSize of the box.
angleRotation angle in degrees of the box.

Definition at line 154 of file TSPhysics2D.cs.

static TSCollider2D [] TrueSync.TSPhysics2D.OverlapBoxAll ( TSVector2  point,
TSVector2  size,
FP  angle 
)
static

Returns all TSCollider2D within a box area. Returns null if there is none.

Parameters
pointCenter of the box in world space.
sizeSize of the box.
angleRotation angle in degrees of the box.

Definition at line 165 of file TSPhysics2D.cs.

static TSCollider2D TrueSync.TSPhysics2D.OverlapCapsule ( TSVector2  point,
TSVector2  size,
TSCapsuleDirection2D  direction,
FP  angle 
)
static

Returns the first TSCollider2D within a capsule area. Returns null if there is none.

Parameters
pointCenter of the capsule in world space.
sizeSize of the capsule.
directionIf it is a vertical or horizontal capsule.
angleRotation angle in degrees of the capsule.

Definition at line 194 of file TSPhysics2D.cs.

static TSCollider2D [] TrueSync.TSPhysics2D.OverlapCapsuleAll ( TSVector2  point,
TSVector2  size,
TSCapsuleDirection2D  direction,
FP  angle 
)
static

Returns all TSCollider2D within a capsule area. Returns null if there is none.

Parameters
pointCenter of the capsule in world space.
sizeSize of the capsule.
directionIf it is a vertical or horizontal capsule.
angleRotation angle in degrees of the capsule.

Definition at line 206 of file TSPhysics2D.cs.

static TSCollider2D TrueSync.TSPhysics2D.OverlapCircle ( TSVector2  point,
FP  radius 
)
static

Returns the first TSCollider2D within a circular area. Returns null if there is none.

Parameters
pointCenter of the circle in world space.
radiusRadius of the circle.

Definition at line 68 of file TSPhysics2D.cs.

static TSCollider2D [] TrueSync.TSPhysics2D.OverlapCircleAll ( TSVector2  point,
FP  radius 
)
static

Returns all TSCollider2D within a circular area. Returns null if there is none.

Parameters
pointCenter of the circle in world space.
radiusRadius of the circle.

Definition at line 78 of file TSPhysics2D.cs.

static TSCollider2D TrueSync.TSPhysics2D.OverlapPoint ( TSVector2  point)
static

Returns the first TSCollider2D within a small circular area. Returns null if there is none.

Parameters
pointCenter of the point in world space.

Definition at line 127 of file TSPhysics2D.cs.

static TSCollider2D [] TrueSync.TSPhysics2D.OverlapPointAll ( TSVector2  point)
static

Returns all TSCollider2D within a small circular area. Returns null if there is none.

Parameters
pointCenter of the point in world space.

Definition at line 136 of file TSPhysics2D.cs.


The documentation for this class was generated from the following file: