Photon Quantum 2.1.1

Classes | Public Member Functions | Public Attributes | List of all members
Quantum.Shape2D Struct Reference

Defines a 2D shape with Type and data disposed in a union-like structure. All shapes have a UserTag, BroadRadius and Centroid. All non-compound shapes have a LocalTransform and their Centroid always match their local transform position. More...

Classes

struct  CompoundShape2D
 A 2D shape type that can reference a group of other 2D shapes (including other compounds). Compound shape overlaps and physics colliders with compound shapes are supported. More...
 

Public Member Functions

FPVector2 GetLocalSupport (FrameBase f, FPVector2 localDir, bool skipNormalize=false)
 Computes a point on the shape which has the highest dot product in a given direction (localDir ), both in the local space of the shape. More...
 

Public Attributes

UInt16 UserTag
 Set a number tag to identify a shape. More...
 

Detailed Description

Defines a 2D shape with Type and data disposed in a union-like structure. All shapes have a UserTag, BroadRadius and Centroid. All non-compound shapes have a LocalTransform and their Centroid always match their local transform position.

Member Function Documentation

◆ GetLocalSupport()

FPVector2 Quantum.Shape2D.GetLocalSupport ( FrameBase  f,
FPVector2  localDir,
bool  skipNormalize = false 
)
inline

Computes a point on the shape which has the highest dot product in a given direction (localDir ), both in the local space of the shape.

Parameters
fCurrent frame.
localDirThe direction, in local space, in which to compute the support point.
skipNormalizeIf the provided direction is already normalized.
Returns
A point, in the local space of the shape, which has the highest dot product in the given direction.

Member Data Documentation

◆ UserTag

UInt16 Quantum.Shape2D.UserTag

Set a number tag to identify a shape.