Table of Contents

Class Primitive2DEntityOptions

Namespace
Stride.CommunityToolkit.Engine
Assembly
Stride.CommunityToolkit.dll

Option set for creating a 2D primitive entity using the toolkit's code-only helpers.

public class Primitive2DEntityOptions : PrimitiveEntityOptionsBase
Inheritance
Primitive2DEntityOptions
Derived
Inherited Members

Remarks

Inherits common properties from PrimitiveEntityOptionsBase and adds sizing + thickness information suitable for 2D style content that still lives in a 3D world / physics space.

Properties

Depth

Gets or sets the depth (thickness) assigned to the generated 2D primitive. Defaults to 1.

public float Depth { get; set; }

Property Value

float

Remarks

Even "2D" primitives often exist in a 3D simulation. A small Z thickness can improve collision stability or simplify shared 3D physics pipelines; constraints can still lock motion/rotation axes to emulate 2D.

Size

Gets or sets the logical size values for the generated 2D primitive.

public Vector2? Size { get; set; }

Property Value

Vector2?

Remarks

When null, a shape-appropriate default is chosen by the creation helper. The meaning of Size components depends on the primitive type being created:

  • For rectangular shapes: X = width, Y = height.

  • For cylindrical shapes: X = radius, Y = length.

  • For regular polygons: X = radius, Y = number of sides.

Vertices

Gets or sets custom polygon vertices in the XY plane.

public Vector2[]? Vertices { get; set; }

Property Value

Vector2[]

Remarks

Used only with Polygon. When provided, vertices take precedence over Size. The polygon must contain at least 3 unique vertices and should be ordered around a convex outline.