Table of Contents

Class M2Light

Namespace
WoWLib.Formats.M2.Root.Record
Assembly
WoWLib.dll

One placed light. Abstract over the client version; construct a concrete version with M2Light.ForVersion / for_version.

public class M2Light : IDisposable
Inheritance
M2Light
Implements
Derived
Inherited Members

Constructors

M2Light()

public M2Light()

M2Light(M2Light)

Copy-construct: a deep copy of other (the C++ copy constructor).

public M2Light(M2Light other)

Parameters

other M2Light

Properties

AmbientColor

RGB ambient color (no alpha).

public M2TrackC3Vector AmbientColor { get; set; }

Property Value

M2TrackC3Vector

AmbientIntensity

Multiplies the ambient color; defaults to 1.0.

public M2TrackFloat AmbientIntensity { get; set; }

Property Value

M2TrackFloat

AttenuationEnd

Distance where the light fades out entirely.

public M2TrackFloat AttenuationEnd { get; set; }

Property Value

M2TrackFloat

AttenuationStart

Distance where attenuation begins.

public M2TrackFloat AttenuationStart { get; set; }

Property Value

M2TrackFloat

Bone

Bone to attach to, -1 for none.

public short Bone { get; set; }

Property Value

short

DiffuseColor

RGB diffuse color (no alpha).

public M2TrackC3Vector DiffuseColor { get; set; }

Property Value

M2TrackC3Vector

DiffuseIntensity

Multiplies the diffuse color; defaults to 1.0.

public M2TrackFloat DiffuseIntensity { get; set; }

Property Value

M2TrackFloat

Position

Relative to the bone, if any.

public C3Vector Position { get; set; }

Property Value

C3Vector

Type

0 directional, 1 point.

public ushort Type { get; set; }

Property Value

ushort

Visibility

Bool track: the light is enabled.

public M2TrackUInt8 Visibility { get; set; }

Property Value

M2TrackUInt8

Methods

Dispose()

Release the native object now. Optional: the finalizer releases it on collection anyway - dispose (or using) when you want native memory back promptly.

public virtual void Dispose()

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ForVersion(ClientVersion)

A fresh M2Light for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.

public static M2Light ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

M2Light

ForVersion(Expansion)

A fresh M2Light for the given era, as the family base — the dynamic twin of the typed Era factories.

public static M2Light ForVersion(Expansion era)

Parameters

era Expansion

Returns

M2Light

GetHashCode()

Reference-identity hash (the C++ type has no hash to mirror).

public override int GetHashCode()

Returns

int

Operators

operator ==(M2Light?, M2Light?)

public static bool operator ==(M2Light? l, M2Light? r)

Parameters

l M2Light
r M2Light

Returns

bool

operator !=(M2Light?, M2Light?)

public static bool operator !=(M2Light? l, M2Light? r)

Parameters

l M2Light
r M2Light

Returns

bool