Table of Contents

Class TESExtensions

Namespace
SkyrimForge.Game
Assembly
SkyrimForge.Game.dll

Provides extension members for TES.

public static class TESExtensions
Inheritance
TESExtensions
Inherited Members

Methods

DisableVegetation(TES, NiPoint3, float, IReadOnlyCollection<FormId<TESBoundObject>>?)

Disables every reference within radius of center whose base object is vegetation, as determines, except actors and the references whose base object is in excludedBaseObjectIds.

public static IReadOnlyList<ObjectReference> DisableVegetation(this TES tes, NiPoint3 center, float radius, IReadOnlyCollection<FormId<TESBoundObject>>? excludedBaseObjectIds = null)

Parameters

tes TES
center NiPoint3
radius float
excludedBaseObjectIds IReadOnlyCollection<FormId<TESBoundObject>>

Returns

IReadOnlyList<ObjectReference>

The references disabled. The save records them as disabled.

DisableVegetation(TES, PackIn, NiPoint3)

Disables the vegetation within DisabledVegetationRadius of origin, except the bases of packIn's parts.

public static IReadOnlyList<ObjectReference> DisableVegetation(this TES tes, PackIn packIn, NiPoint3 origin)

Parameters

tes TES
packIn PackIn
origin NiPoint3

Returns

IReadOnlyList<ObjectReference>

The references disabled.

Exceptions

ArgumentNullException

packIn is null.

GetCellsInRange(TES, NiPoint3, float)

Returns the loaded exterior cells within radius of center, or the interior cell the player is in.

public static IReadOnlyList<Cell> GetCellsInRange(this TES tes, NiPoint3 center, float radius)

Parameters

tes TES
center NiPoint3
radius float

Returns

IReadOnlyList<Cell>

Remarks

CommonLib's overload that takes a reference returns only the first cell in range.

GetLandAngle(TES, NiPoint3, float, float)

Returns the angles in radians that lay an object of width span flush on the terrain under position, with the heading yaw given in degrees. The result is null where the land at any of the four edges is not loaded.

public static NiPoint3? GetLandAngle(this TES tes, NiPoint3 position, float yaw, float span)

Parameters

tes TES
position NiPoint3
yaw float
span float

Returns

NiPoint3?

GetPositionOnGround(TES, NiPoint3, float, float)

Returns position with its Z at the higher of the collision surface and the terrain beneath it. The result is null where neither is loaded.

public static NiPoint3? GetPositionOnGround(this TES tes, NiPoint3 position, float rayStartHeight, float rayEndDepth)

Parameters

tes TES
position NiPoint3
rayStartHeight float
rayEndDepth float

Returns

NiPoint3?

Remarks

The ray strikes actors, as GetSurfaceUnder(TES, NiPoint3, float, float, COL_LAYER) describes.

GetPositionOnLand(TES, NiPoint3)

Returns position with its Z at the height of the terrain, which lies beneath roads, bridges, and ruin floors.

public static NiPoint3 GetPositionOnLand(this TES tes, NiPoint3 position)

Parameters

tes TES
position NiPoint3

Returns

NiPoint3

Exceptions

InvalidOperationException

The land at position is not loaded.

GetReferencesInRange(TES, NiPoint3, float)

Returns every reference within radius of center, across every loaded cell in range.

public static IReadOnlyList<ObjectReference> GetReferencesInRange(this TES tes, NiPoint3 center, float radius)

Parameters

tes TES
center NiPoint3
radius float

Returns

IReadOnlyList<ObjectReference>

GetReferencesInRange<TCenter>(TES, TCenter, float)

Returns every reference within radius of center, across every loaded cell in range.

public static IReadOnlyList<ObjectReference> GetReferencesInRange<TCenter>(this TES tes, TCenter center, float radius) where TCenter : notnull, IObjectReference

Parameters

tes TES
center TCenter
radius float

Returns

IReadOnlyList<ObjectReference>

Type Parameters

TCenter

GetSurfaceAngle(TES, NiPoint3, float, float, float, float, COL_LAYER)

Returns the angles in radians that lay an object of width span flush on the surface under position, with the heading yaw given in degrees. The result is null where a ray at any of the four edges strikes nothing.

public static NiPoint3? GetSurfaceAngle(this TES tes, NiPoint3 position, float yaw, float span, float rayStartHeight, float rayEndDepth, COL_LAYER layer = COL_LAYER.kLOS)

Parameters

tes TES
position NiPoint3
yaw float
span float
rayStartHeight float
rayEndDepth float
layer COL_LAYER

Returns

NiPoint3?

Remarks

The rays strike actors, as GetSurfaceUnder(TES, NiPoint3, float, float, COL_LAYER) describes.

GetSurfaceTilt(TES, NiPoint3, float, float, float)

Returns the steeper of the north and east tilts of the surface under position, in degrees. The result is null where a ray at any of the four edges strikes nothing.

public static float? GetSurfaceTilt(this TES tes, NiPoint3 position, float span, float rayStartHeight, float rayEndDepth)

Parameters

tes TES
position NiPoint3
span float
rayStartHeight float
rayEndDepth float

Returns

float?

Remarks

The rays strike actors, as GetSurfaceUnder(TES, NiPoint3, float, float, COL_LAYER) describes.

GetSurfaceUnder(TES, NiPoint3, float, float, COL_LAYER)

Casts a ray down through position and returns the point it strikes and that face's normal. The result is null where the ray strikes nothing or the position is in no loaded cell.

public static SurfaceHit? GetSurfaceUnder(this TES tes, NiPoint3 position, float rayStartHeight, float rayEndDepth, COL_LAYER layer = COL_LAYER.kLOS)

Parameters

tes TES
position NiPoint3
rayStartHeight float
rayEndDepth float
layer COL_LAYER

Returns

SurfaceHit?

Remarks

The ray strikes actors on every layer tested, so a ray through the player's position returns a point on the player.