Class LightEntity
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
The light entities. Owns the and steers it live: the real-time set (barn, rect, omni2) re-bins every frame so changes are plain property writes, while the slot-stored set (omni, spot, ortho, environment) re-stores the lighting uniforms on change. Light styles, color temperature and volumetric fog are not simulated.
public sealed class LightEntity : BaseEntityInheritance
object ← BaseEntity ← LightEntity
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.ParentTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.InPlayableWorld, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.AngleMod(float)
Constructors
LightEntity(EntitySystem, EntitySpawnInfo)
Initializes a light entity from its keyvalues.
public LightEntity(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
IsEnabled
Gets whether the light is on. A light turned off costs nothing to render.
public bool IsEnabled { get; }Property Value
Methods
CreateRootNode()
Builds the node this entity is drawn as, or returns null for one that draws nothing.
protected override SceneNode? CreateRootNode()Returns
The node, or null to own none.
Remarks
The default is what the loader draws for an unimplemented classname: the icon the entity's Hammer class names, or a box in its colour. A class with real geometry overrides this, so the icon is never built for one that has geometry.
SetEnabled(bool)
Turns the light on or off.
public void SetEnabled(bool enabled)Parameters
enabled bool
Spawn()
Sets up the entity: loads its model, reads class-specific keyvalues, and schedules its first think. Called by right after construction, before the entity enters the world.
public override void Spawn()Teleport(Vector3, Vector3?)
Moves the light with the entity; a teleport is the only movement a light has.
public override void Teleport(Vector3 origin, Vector3? angles)Parameters
origin Vector3
angles Vector3?

