Struct RectangleGeometry
The geometry of a closed rectangle. When this is used in the low level phyiscs 2D API calls it is converted to a polygon geometry
This allows it to use the same exact API already built in.
See LowLevelPhysics2D.PhysicsBody.CreateShape.
Assembly: cs.temp.dll.dll
Syntax
public struct RectangleGeometry
Constructors
RectangleGeometry(Vector2, Single, Boolean)
Declaration
public RectangleGeometry(Vector2 size, float cornerRadius = 0.5F, bool inscribeRadius = false)
Parameters
| Type |
Name |
Description |
| Vector2 |
size |
|
| System.Single |
cornerRadius |
|
| System.Boolean |
inscribeRadius |
|
Fields
Centroid
Declaration
Field Value
CornerRadius
Declaration
public float CornerRadius
Field Value
| Type |
Description |
| System.Single |
|
DefaultGeometry
Get the default Rectangle.
Declaration
public static readonly RectangleGeometry DefaultGeometry
Field Value
InscribeRadius
When creating the physics shape should the corner radius be inscribed during the
method call.
Declaration
public bool InscribeRadius
Field Value
| Type |
Description |
| System.Boolean |
|
Normals
The geometry normal stored in a LowLevelPhysics2D.PhysicsShape.ShapeArray.
Declaration
public PhysicsShape.ShapeArray Normals
Field Value
| Type |
Description |
| PhysicsShape.ShapeArray |
|
Polygon
The backing that supports the RectangleGeometry.
Declaration
public PolygonGeometry Polygon
Field Value
| Type |
Description |
| PolygonGeometry |
|
Size
Declaration
Field Value
Vertices
The geometry vertices stored in a LowLevelPhysics2D.PhysicsShape.ShapeArray.
Declaration
public PhysicsShape.ShapeArray Vertices
Field Value
| Type |
Description |
| PhysicsShape.ShapeArray |
|
Properties
IsValid
Declaration
public readonly bool IsValid { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
Deconstruct(out Vector2, out Single)
Deconstructs the properties of the RectangleGeometry
and passes them out of the method call.
Declaration
public void Deconstruct(out Vector2 size, out float cornerRadius)
Parameters
| Type |
Name |
Description |
| Vector2 |
size |
|
| System.Single |
cornerRadius |
|
Operators
Implicit(RectangleGeometry to PolygonGeometry)
Declaration
public static implicit operator PolygonGeometry(RectangleGeometry rectangleGeometry)
Parameters
Returns
| Type |
Description |
| PolygonGeometry |
|