Vixen
02b45cc4
csharp
public readonly record struct HeightFieldPlacement

Where a height field's samples sit in the body's space.

Read the guide page for this →

Remarks

The surface is Offset + Scale * (x, height[z * SampleCount + x], z) for integer x and z in [0, SampleCount) — which is Jolt's own definition, kept literally so that a value copied out of its documentation means the same thing here.

⚠ SampleCount samples span SampleCount − 1 quads. A tile of 127 quads is 128 samples, and 128 is the number that has to be a power of two. This is the same constraint Unreal states as "a power of two value minus one" for its section sizes, arrived at from the other end.

Fields and properties (4)

  • public int SampleCount

    How many samples along each of X and Z. The grid is square.

  • public Vector3 Offset

    Where sample (0, 0) sits, before the height is added.

  • public Vector3 Scale

    The spacing between samples in X and Z, and what one unit of a sample means in Y.

  • public int QuadCount

    How many quads the grid spans along each axis.

Methods (3)

  • public HeightFieldPlacement(int SampleCount, Vector3 Offset, Vector3 Scale)

    Where a height field's samples sit in the body's space.

  • public Vector3 PositionOf(int x, int z, float height)

    Where one sample sits, given its height.

  • public BoundingBox BoundsOf(float minHeight, float maxHeight)

    Everything the grid occupies, given the range of its samples.

Used by (3)

  • HeightFieldShapeTestsVixen.Physics.Tests
  • PhysicsShapesVixen.Physics
  • Vixen_Physics_Shapes_HeightFieldPlacementSerializerVixen.Physics