Skip to content

Documentation / @sw-file-lib/geometry / FlattenedSurfaceData

Interface: FlattenedSurfaceData ​

ts
interface FlattenedSurfaceData {
  readonly color?: ReadonlyColor;
  readonly matrix: ReadonlyMat3;
  readonly position: ReadonlyVec3;
  readonly shape: number;
}

Defined in: surface/types.ts:16

A flattened Stormworks surface with its final transform applied.

Unlike the <surface> element in a component definition, SurfaceData stores the surface position and orientation after the component hierarchy has been resolved.

This representation is used for operations that work across multiple components, such as surface culling (cullSurfaces) and vehicle mesh generation (buildSurfacesGeometry).

Properties ​

PropertyModifierTypeDescription

color?

readonly

ReadonlyColor

Surface color.

matrix

readonly

ReadonlyMat3

Vehicle-space orientation matrix of the surface.

position

readonly

ReadonlyVec3

Vehicle-space position of the surface.

shape

readonly

number

Stormworks surface shape ID.

This is the same numeric value as the shape attribute of a <surface> element.