Skip to main content

Interface: TerrainSegment

Defined in: physics/shapes/terrain-shape.ts:18

A single span of ground between two consecutive TerrainShape surface points, closed off into a convex quadrilateral by a flat bottom edge. vertices/normals follow this engine's canonical winding (see PolygonShape's constructor): top-left, top-right, bottom-right, bottom-left, with outward-facing normals in the same order. All fields are in the terrain's local space.

Properties

maxX

maxX: number

Defined in: physics/shapes/terrain-shape.ts:42

The greater of the segment's two surface points' x-coordinates.


minX

minX: number

Defined in: physics/shapes/terrain-shape.ts:37

The lesser of the segment's two surface points' x-coordinates. Used to cheaply filter candidate segments before running narrow-phase collision checks against them.


normals

normals: readonly Vector2[]

Defined in: physics/shapes/terrain-shape.ts:30

The segment's four outward-facing edge normals, in local space, corresponding to the edges between consecutive vertices.


vertices

vertices: readonly Vector2[]

Defined in: physics/shapes/terrain-shape.ts:24

The segment's four vertices, in local space: the two surface points followed by their corresponding points on the terrain's flat bottom edge.