Class HammerEntityVisuals
Namespace: ValveResourceFormat.Renderer.Editor.Entities
Assembly: Renderer.dll
Draws entities as Hammer shows them, using the helpers their classes declare for the editor of the game. These are the model, icon or box an entity is placed as, the lines its class draws to the entities it names, and a line along each entity I/O connection. The game shows none of them. It holds the helpers of every entity of a view, whether of a compiled map or a source map, so the shapes of a selected entity are drawn by the same helpers either way.
public sealed class HammerEntityVisuals : IEntityToolVisualsInheritance
object ← HammerEntityVisuals
Implements
Constructors
HammerEntityVisuals(IFileLoader, ILogger)
Initializes the visuals for the entities of a game.
public HammerEntityVisuals(IFileLoader fileLoader, ILogger logger)Parameters
fileLoader IFileLoader
The file loader of the view, which finds its game.
logger ILogger
The logger that reports which classes are used.
Fields
ConnectionsLayer
Visibility layer of the lines along entity I/O connections.
public static readonly WorldLayer ConnectionsLayerField Value
HelpersLayer
Visibility layer of the helpers drawn only while the editor shows helpers, such as lines to the entities an entity names, spheres of its radii and the edges of its volumes. Hiding it is the option to show no helpers. It also hides those helpers of a selected entity.
public static readonly WorldLayer HelpersLayerField Value
MarkerLayer
Visibility layer of what the editor draws for entities that the game does not show, such as the boxes, icons and models they stand in as. Hiding it is the option to show only what the game shows.
public static readonly WorldLayer MarkerLayerField Value
Properties
Classes
Gets the entity classes the entities are drawn by, loaded when they are first needed.
public EntityClassTable Classes { get; }Property Value
Methods
AddEntityRelations(Scene, IReadOnlyList<BaseEntity>)
Adds nodes relating the entities a world spawned into a scene, once all of them have spawned.
public void AddEntityRelations(Scene scene, IReadOnlyList<BaseEntity> entities)Parameters
scene Scene
The scene they spawned into.
entities IReadOnlyList<BaseEntity>
The spawned entities.
CreateCollisionVisuals(Scene, PhysAggregateData, string, BaseEntity?)
Builds nodes showing a collision, which the game does not draw, such as the tools materials it was built from. The nodes are not added to the scene, and are in the space of the collision.
public IEnumerable<SceneNode> CreateCollisionVisuals(Scene scene, PhysAggregateData physics, string name, BaseEntity? entity)Parameters
scene Scene
The scene the nodes are for.
physics PhysAggregateData
The collision.
name string
The name of the nodes.
entity BaseEntity?
The entity the collision belongs to, or null for the collision of the world.
Returns
The nodes.
CreateStandIn(BaseEntity, ObjectTypeFlags)
Builds the stand-in drawn for an entity that has nothing of its own to draw. It is not added to the scene: the entity owns and places it.
public SceneNode? CreateStandIn(BaseEntity entity, ObjectTypeFlags flags)Parameters
entity BaseEntity
The entity.
flags ObjectTypeFlags
Flags for the node.
Returns
The node, or null to draw nothing.
FindEntity(SceneNode)
Finds the entity a node is drawn for, with the helpers of its class.
public IHelperOwner? FindEntity(SceneNode node)Parameters
node SceneNode
A node of the view.
Returns
The entity, or null when the node is not drawn for one.
GetResourcesToPreload(string)
Gets the resources the stand-in for an entity of a class loads, so a world can load them alongside its own.
public IEnumerable<string> GetResourcesToPreload(string classname)Parameters
classname string
The entity classname.
Returns
IEnumerable<string>
The resource names.

