PlaneMesh
Rectangular grid with selectable normal axis and local center.
PlaneMesh generates one rectangular surface. Orientation selects the normal axis, Size gives the two dimensions and CenterOffset shifts vertices. With w = SubdivideWidth and d = SubdivideDepth the grid has (w + 2) * (d + 2) vertices and 2 * (w + 1) * (d + 1) triangles.
This is not automatically a double-sided or infinite surface. Material, AddUV2 and UV2Padding are inherited from PrimitiveMesh. See LightmapGI for lighting; representing thickness in volumetric GI requires additional geometry.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PlaneMeshConstructor
public PlaneMesh();Creates a 2×2 XZ rectangle with normal +Y, centered at (0, 0, 0). Without subdivisions it has 4 vertices and 2 triangles. It has zero thickness; a wall, physics shape or closed volume needs the corresponding additional setup.
Properties5
CenterOffsetProperty
public Vector3 CenterOffset { get; set; }Local offset applied to every vertex, default (0, 0, 0). Changes geometry and its Aabb within the resource, not MeshInstance3D Position. A shared resource applies the change to every instance.
OrientationProperty
public PlaneMesh.OrientationEnum Orientation { get; set; }Positive normal axis: X, Y or Z; defaults to Y. Y creates an XZ plane, X a YZ plane and Z an XY plane. Changes resource geometry, not instance Transform. Supply a valid enum value; back-side visibility and double-sided rendering depend on orientation and material.
SizeProperty
public Vector2 Size { get; set; }Two full rectangle dimensions, default (2, 2). With Orientation Y, size X maps to local X and size Y to local Z; with X they map to Z and Y; with Z to X and Y. These are resource-local axes, not the Entity world rotation. Use finite positive dimensions. Changes update geometry and the lightmap hint when AddUV2 is enabled.
SubdivideDepthProperty
public int SubdivideDepth { get; set; }Additional cuts along the second Size.Y direction, default 0. Negative input is stored as 0. This is not necessarily local Z: with Orientation X or Z the second direction is Y. Segment count is value + 1.
SubdivideWidthProperty
public int SubdivideWidth { get; set; }Additional cuts along the first Size.X direction, default 0. Negative input is stored as 0. Segment count is value + 1; the corresponding local XYZ axis depends on Orientation. Regenerates geometry without changing dimensions.
Methods10
GetCenterOffsetVector3
public Vector3 GetCenterOffset();Returns CenterOffset. Local offset applied to every vertex, default (0, 0, 0). Changes geometry and its Aabb within the resource, not MeshInstance3D Position. A shared resource applies the change to every instance.
Vector3Current CenterOffset in the mesh resource.
GetOrientationPlaneMesh.OrientationEnum
public PlaneMesh.OrientationEnum GetOrientation();Returns Orientation. Positive normal axis: X, Y or Z; defaults to Y. Y creates an XZ plane, X a YZ plane and Z an XY plane. Changes resource geometry, not instance Transform. Supply a valid enum value; back-side visibility and double-sided rendering depend on orientation and material.
PlaneMesh.OrientationEnumCurrent Orientation in the mesh resource.
GetSizeVector2
public Vector2 GetSize();Returns Size. Two full rectangle dimensions, default (2, 2). With Orientation Y, size X maps to local X and size Y to local Z; with X they map to Z and Y; with Z to X and Y. These are resource-local axes, not the Entity world rotation. Use finite positive dimensions. Changes update geometry and the lightmap hint when AddUV2 is enabled.
Vector2Current Size in the mesh resource.
GetSubdivideDepthint
public int GetSubdivideDepth();Returns SubdivideDepth. Additional cuts along the second Size.Y direction, default 0. Negative input is stored as 0. This is not necessarily local Z: with Orientation X or Z the second direction is Y. Segment count is value + 1.
intCurrent SubdivideDepth in the mesh resource.
GetSubdivideWidthint
public int GetSubdivideWidth();Returns SubdivideWidth. Additional cuts along the first Size.X direction, default 0. Negative input is stored as 0. Segment count is value + 1; the corresponding local XYZ axis depends on Orientation. Regenerates geometry without changing dimensions.
intCurrent SubdivideWidth in the mesh resource.
SetCenterOffsetvoid
public void SetCenterOffset(Vector3 offset);Sets CenterOffset. Local offset applied to every vertex, default (0, 0, 0). Changes geometry and its Aabb within the resource, not MeshInstance3D Position. A shared resource applies the change to every instance.
| Name | Type | Default |
|---|---|---|
offset | Vector3 | — |
offsetNew CenterOffset value, applied to the resource rather than one instance.
SetOrientationvoid
public void SetOrientation(PlaneMesh.OrientationEnum orientation);Sets Orientation. Positive normal axis: X, Y or Z; defaults to Y. Y creates an XZ plane, X a YZ plane and Z an XY plane. Changes resource geometry, not instance Transform. Supply a valid enum value; back-side visibility and double-sided rendering depend on orientation and material.
| Name | Type | Default |
|---|---|---|
orientation | PlaneMesh.OrientationEnum | — |
orientationNew Orientation value, applied to the resource rather than one instance.
SetSizevoid
public void SetSize(Vector2 size);Sets Size. Two full rectangle dimensions, default (2, 2). With Orientation Y, size X maps to local X and size Y to local Z; with X they map to Z and Y; with Z to X and Y. These are resource-local axes, not the Entity world rotation. Use finite positive dimensions. Changes update geometry and the lightmap hint when AddUV2 is enabled.
| Name | Type | Default |
|---|---|---|
size | Vector2 | — |
sizeNew Size value, applied to the resource rather than one instance.
SetSubdivideDepthvoid
public void SetSubdivideDepth(int subdivide);Sets SubdivideDepth. Additional cuts along the second Size.Y direction, default 0. Negative input is stored as 0. This is not necessarily local Z: with Orientation X or Z the second direction is Y. Segment count is value + 1.
| Name | Type | Default |
|---|---|---|
subdivide | int | — |
subdivideNew SubdivideDepth value, applied to the resource rather than one instance.
SetSubdivideWidthvoid
public void SetSubdivideWidth(int subdivide);Sets SubdivideWidth. Additional cuts along the first Size.X direction, default 0. Negative input is stored as 0. Segment count is value + 1; the corresponding local XYZ axis depends on Orientation. Regenerates geometry without changing dimensions.
| Name | Type | Default |
|---|---|---|
subdivide | int | — |
subdivideNew SubdivideWidth value, applied to the resource rather than one instance.