API reference

SpaceMap Class

Extends MonoBehaviour
Space Map generates a 2D top-down texture of the room’s layout.
Parameters are exposed for complete RGBA control of the texture creation.

Fields

CreateOnStart : MRUK.RoomFilter
Signature
MRUK.RoomFilter CreateOnStart
InnerBorder : float
Signature
float InnerBorder
MapBorder : float
Signature
float MapBorder
MapGradient : Gradient
Signature
Gradient MapGradient
OuterBorder : float
Signature
float OuterBorder
TextureMap : Texture2D
Signature
Texture2D TextureMap

Properties

Offset : Vector2
[Get]
The center of the texture.
Note that Offset.y aligns with Unity's Z.
Signature
Vector2 Offset
Scale : Vector2
[Get]
The dimensions of the texture, including the MapBorder.
Note that Scale.y aligns with Unity's Z.
Signature
Vector2 Scale

Methods

CalculateMap ( room )
Calculates the space map for the specified room or all rooms if no room is specified.
Initializes map values, starts the pixel calculation process, and updates global shader properties.
Signature
void CalculateMap(MRUKRoom room=null)
Parameters
room: MRUKRoom  The room to calculate the map for. If null, calculates for all rooms.
Returns
void
GetColorAtPosition ( worldPosition , getBilinear )
Color clamps to edge color if worldPosition is off-grid.
getBilinear blends the color between pixels.
Signature
Color GetColorAtPosition(Vector3 worldPosition, bool getBilinear=true)
Parameters
worldPosition: Vector3  The world position to get the color for.
getBilinear: bool  If true, blends the color between pixels. If false, clamps to the nearest pixel color.
Returns
Color  The color at the specified position.
GetSurfaceDistance ( room , worldPosition )
A surface-relative value of how far a position is from all SceneAPI surfaces negative values are behind the surface i.e.
outside of the room or inside a volume
Signature
float GetSurfaceDistance(MRUKRoom room, Vector3 worldPosition)
Parameters
room: MRUKRoom  The room to check the surface distance in.
worldPosition: Vector3  The world position to check.
Returns
float  The distance to the nearest surface.
ResetFreespace ()
Resets the pixel colors of the space map to black, effectively clearing any previously calculated data.
Signature
void ResetFreespace()
Returns
void