Class BaseTrigger
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
The base of the trigger volumes, Source's CBaseTrigger. A trigger is a brush you pass through that reports what is inside it, so every trigger shares the same setup and the same pair of outputs; only what it does on a touch differs.
public abstract class BaseTrigger : BaseModelEntityInheritance
object ← BaseEntity ← BaseModelEntity ← BaseTrigger
Derived
Inherited Members
BaseModelEntity.ModelNode, BaseModelEntity.CreateRootNode(), BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.KeyValues, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.ParentTransform, 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.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.CreateRootNode(), BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.AcceptsTouchFrom(BaseEntity), BaseEntity.OnStartTouch(BaseEntity), BaseEntity.OnTouch(BaseEntity), BaseEntity.OnEndTouch(BaseEntity), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.InputKill(EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.PhysicsSimulate(float), BaseEntity.TurnBody(Vector3, Vector3), BaseEntity.SetOriginAndAngles(Vector3, Vector3), BaseEntity.AddNode(SceneNode), BaseEntity.OnRemove(), BaseEntity.UpdateTransform(), BaseEntity.UpdateColliderTransform(), BaseEntity.UpdateRenderTransform(float), BaseEntity.SnapInterpolation(), BaseEntity.AngleMod(float)
Remarks
is the shared half ofSpawn, as in the engine: a trigger's ownSpawn calls it instead of repeating the model and solidity setup. Unlike the engine, the volume stays visible, since showing a map's triggers is the point. They use tools materials, so the tools-material toggle still hides them.
Constructors
BaseTrigger(EntitySystem, EntitySpawnInfo)
Initializes a trigger from its keyvalues.
protected BaseTrigger(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Methods
AcceptsTouchFrom(BaseEntity)
Whether other is the kind of thing this trigger reacts to, from its spawnflags. Source's PassesTriggerFilters, without the filtername entity filters.
protected override bool AcceptsTouchFrom(BaseEntity other)Parameters
other BaseEntity
Returns
true when the touch should register.
Remarks
A trigger reacts only to what its spawnflags name, like the engine's, so one that names nothing it accepts never fires. The player is the only thing here that can enter a volume, so only "everything" and "clients" can pass; a trigger for NPCs, pushables or physics props stays shut. filtername filters are not read, so passing the flags is enough.
InitTrigger()
The setup every trigger shares: take the brush volume from the authored model, and stand aside from movement so things pass through instead of colliding. Source's InitTrigger.
protected void InitTrigger()OnEndTouch(BaseEntity)
Runs on the tick other leaves this entity's volume. Source's EndTouch.
protected override void OnEndTouch(BaseEntity other)Parameters
other BaseEntity
OnStartTouch(BaseEntity)
Runs on the tick other enters this entity's volume. Source's StartTouch.
protected override void OnStartTouch(BaseEntity other)Parameters
other BaseEntity

