Table of Contents

Class CartographyUtility

Namespace
Uncreated.Warfare.Util
Assembly
Uncreated.Warfare.dll

Utilities for transforming from map to world coordinates and vice-versa.

public static class CartographyUtility
Inheritance
CartographyUtility
Inherited Members

Properties

MapImageSize

The size in pixels of the outputted image.

public static Vector2Int MapImageSize { get; }

Property Value

Vector2Int

MapToWorld

Transforms coordinates from normalized map position [-1 to 1] (x, y, 0) to world position (x, y, z).

public static ref Matrix4x4 MapToWorld { get; }

Property Value

Matrix4x4

Remarks

Use UnityEngine.Matrix4x4.MultiplyPoint3x4(UnityEngine.Vector3) to transform a point.

UsesLegacyCartography

If this level is using the legacy mapping boundaries instead of a SDG.Unturned.CartographyVolume.

public static bool UsesLegacyCartography { get; }

Property Value

bool

WorldCaptureAreaDimensions

The size of the rectangular area that gets captured in world coordiantes.

public static Vector2 WorldCaptureAreaDimensions { get; }

Property Value

Vector2

Remarks

This shouldn't be assumed to be axis-aligned.

WorldToMap

Transforms coordinates from normalized world position (x, y, z) to map position [-1 to 1] (x, y, 0).

public static ref Matrix4x4 WorldToMap { get; }

Property Value

Matrix4x4

Remarks

Use UnityEngine.Matrix4x4.MultiplyPoint3x4(UnityEngine.Vector3) to transform a point.

Methods

DenormalizeMapCoordinates(Vector2)

Converts normalized map coordinates [-1 to 1] to pixel map coodinates [0 to MapImageSize], where (0, 0) is lower left of the image.

public static Vector2 DenormalizeMapCoordinates(Vector2 mapCoordinates)

Parameters

mapCoordinates Vector2

Returns

Vector2

NormalizeMapCoordinates(Vector2)

Converts pixel map coodinates [0 to MapImageSize] to normalized map coordinates [-1 to 1].

public static Vector2 NormalizeMapCoordinates(Vector2 mapPixelCoodinates)

Parameters

mapPixelCoodinates Vector2

Returns

Vector2