Struct SkyTransform ​
Namespace: ValveResourceFormat.Renderer.World
Assembly: Renderer.dll
Maps between world space and the sky space of a 3D sky.
public readonly record struct SkyTransform : IEquatable<SkyTransform>Implements ​
Remarks ​
The sky geometry is never scaled; the sky_camera scale only moves the camera, so
Constructors ​
SkyTransform(Vector3, Vector3, float) ​
Initializes a new instance of the struct.
public SkyTransform(Vector3 reference, Vector3 origin, float scale)Parameters ​
reference Vector3
origin Vector3
scale float
Properties ​
FogSpace ​
Gets the conversion of fog authored in world units into sky space.
public FogSpace FogSpace { get; }Property Value ​
Origin ​
Gets the sky_camera position in sky space.
public Vector3 Origin { get; }Property Value ​
Reference ​
Gets the skybox_reference position in world space, which lines up with .
public Vector3 Reference { get; }Property Value ​
Scale ​
Gets how many world units one sky unit stands for. Always positive.
public float Scale { get; }Property Value ​
SkyToWorld ​
Gets the transform from sky space to world space.
public Matrix4x4 SkyToWorld { get; }Property Value ​
Methods ​
ConfigureCamera(Camera, Camera) ​
Sets camera up to view the sky from the sky space position matching from.
public void ConfigureCamera(Camera camera, Camera from)Parameters ​
camera Camera
from Camera
Remarks ​
Clip planes are divided by the scale too, so sky depth matches a sky scaled up to world size.
FromEntities(Vector3, SkyCamera?) ​
Creates the transform from entity positions only, so neither entity rotates the view. Without a sky_camera the sky is seen from its origin at 1:1.
public static SkyTransform FromEntities(Vector3 reference, SkyCamera? skyCamera)Parameters ​
reference Vector3
skyCamera SkyCamera?
Returns ​
ToSky(Vector3) ​
Maps a world position to sky space.
public Vector3 ToSky(Vector3 worldPosition)Parameters ​
worldPosition Vector3
Returns ​
ToWorld(Vector3) ​
Maps a sky space position to world space.
public Vector3 ToWorld(Vector3 skyPosition)Parameters ​
skyPosition Vector3

