Class LightEntity
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
The light entities. Owns the SceneLight. Real-time lights (barn, rect, omni2) are re-binned every frame; slot-stored lights (omni, spot, ortho, environment) re-store the lighting uniforms on change.
public sealed class LightEntity : BaseEntityInheritance
object ← BaseEntity ← LightEntity
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.RigidTransform, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.SpawnGroup, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.SpawnTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.WorldOrigin, BaseEntity.WorldAngles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.IsShown, 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.
public bool IsEnabled { get; }Property Value
bool
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 the tool's stand-in, BaseEntity.CreateEditorNode(ObjectTypeFlags). A class with real geometry overrides this, so the stand-in is never built for one that has geometry.
DispatchInput(string, EntityInputData)
Runs the handler declared with EntityInputAttribute for an input.
protected override bool DispatchInput(string inputName, EntityInputData data)Parameters
inputName string
data EntityInputData
Returns
bool
true when a handler ran.
SetEnabled(bool)
Turns the light on or off.
public void SetEnabled(bool enabled)Parameters
enabled bool
Spawn()
Sets up the entity (model, class keyvalues, first think). Called once the entity's spawn group has created all entities of the group, after the move parent has spawned.
public override void Spawn()Remarks
An override calls this first: it builds the node from BaseEntity.CreateRootNode() and snaps the entity onto its parent's attachment, which the rest of the override reads.
Teleport(Vector3, Vector3?)
Moves the light with the entity; lights only move by teleport.
public override void Teleport(Vector3 origin, Vector3? angles)Parameters
origin Vector3
angles Vector3?
Think()
Runs when BaseEntity.NextThink comes due.
public override void Think()
