HammeriteBrushEntityNode3D

Core: entities. Inherits Node3D

Base for the node of an entity made of brushes: a door, a volume of water, a trigger.

Built by HammeriteMap3D as HammeritePointEntityNode3D is, and with the same hooks: only set_editor_active() and apply_entity_property() must be written. set_entity() also gives the node a MeshInstance3D per brush of the entity (get_brush_meshes()), as children, kept up to date as the brushes are edited; their geometry is in the map's space, so the node itself stays at the map's origin. A plain Node3D holds no body, so it builds no collision shapes: extend HammeriteBrushEntityStaticBody3D for brushwork that is solid, or HammeriteBrushEntityArea3D for brushwork that notices what is inside it, and each brush gets one (get_brush_shapes()).

Properties

TypeNameDefault
HammeriteBrushEntityentitynull

Methods

ReturnsMethod
HammeriteBrushEntityget_entity()
voidset_entity(new_entity: HammeriteBrushEntity)
voidrequest_rebuild()
voidupdate_properties()
boolshould_create_meshes()
boolshould_create_colliders()
voidset_editor_active(active: bool) abstract
voiddraw_editor_gizmos(_gizmos: HammeriteGizmoBuffer)
booldraws_editor_gizmos_only_when_picked()
HammeriteEditorHandle[]get_editor_handles()
voidmove_editor_handle(_handle_id: StringName, _to: Vector3)
AABBget_aabb()
HammeriteBrushEntityLightingget_lighting()
voidhand_over_to_probes()
voidhand_back_to_lightmap()
Dictionary[int, MeshInstance3D]get_brush_meshes()
Dictionary[int, CollisionShape3D]get_brush_shapes()
boolcan_simulate()
voidstart_simulation()
voidstop_simulation()
voidreset_simulation()
Dictionary[StringName, Variant]get_runtime_properties()
Variantget_runtime_property(key: StringName, default_value = null)
voidset_runtime_property(_key: StringName, _value)
voidreset_runtime_properties()
boolcan_trigger()
voidtrigger(_impulse = null)
Dictionary[StringName, String]get_actions()
voidrun_action(action_id: StringName)
voidapply_entity_property(prop_name: StringName, value) abstract

Signals

rebuild_requested

signal rebuild_requested()

Emitted when the entity's classname changes, and by request_rebuild(). HammeriteMap3D answers by freeing this node and building it again from the entity.

Property descriptions

entity

var entity: HammeriteBrushEntity = null

The authored brush entity this node stands for. Null until set_entity().

Method descriptions

get_entity()

func get_entity() -> HammeriteBrushEntity

Getter of entity.

set_entity()

func set_entity(new_entity: HammeriteBrushEntity) -> void

Bind this node to new_entity: build a mesh and a collision shape for each of its brushes, follow its property, visibility and drag-preview signals, and apply every property through update_properties(). HammeriteMap3D calls it once; an override must call super().

request_rebuild()

func request_rebuild() -> void

Emit rebuild_requested, so the node is built again - which also rebuilds the brush meshes and colliders from the entity's current brushes.

update_properties()

func update_properties() -> void

Every property the entity's type declares, as the entity holds it or as the type defaults it: a map saved before a property existed has no key for it, and its entities read the type's default.

should_create_meshes()

func should_create_meshes() -> bool

Whether set_entity() builds a mesh for each brush. Override to build none - a volume that is never drawn.

should_create_colliders()

func should_create_colliders() -> bool

Whether set_entity() builds a collision shape for each brush. Under a plain Node3D no body holds the shapes, so they would collide with nothing: off by default.

set_editor_active()

abstract func set_editor_active(active: bool) -> void

As HammeritePointEntityNode3D.set_editor_active(): show or hide what only an author should see, and nothing to do with whether the world is running. A trigger volume, say, shows its brushes only while this is on.

draw_editor_gizmos()

func draw_editor_gizmos(_gizmos: HammeriteGizmoBuffer) -> void

Draw what the author should see of this entity - its bounds, where it points, how far it reaches - into gizmos. The editor calls it every frame it is up and the entity is visible; the default draws nothing.

draws_editor_gizmos_only_when_picked()

func draws_editor_gizmos_only_when_picked() -> bool

As HammeritePointEntityNode3D.draws_editor_gizmos_only_when_picked().

get_editor_handles()

func get_editor_handles() -> HammeriteEditorHandle[]

The points of this entity an author may take hold of in the viewport, or nothing where it offers none. Drawn and picked by the editor while the entity is selected; see HammeriteEditorHandle.

move_editor_handle()

func move_editor_handle(_handle_id: StringName, _to: Vector3) -> void

One of get_editor_handles() has been dragged to to, snapped to the grid. Read the position as whatever the value it stands for actually is.

get_aabb()

func get_aabb() -> AABB

The box round its brushwork, in map space: its brush meshes', where they are drawn - so it follows a drag preview. Empty for an entity that builds no meshes (should_create_meshes()); override for one that knows its extent some other way.

get_lighting()

func get_lighting() -> HammeriteBrushEntityLighting

What hands this brushwork over from its lightmap to the light probes when it moves, and back: made the first time it is asked for, and driving itself from then on.

hand_over_to_probes()

func hand_over_to_probes() -> void

Light this brushwork from the probes from now on: call it as the movement starts, so the blend (HammeriteBrushEntityLighting.BLEND_SECONDS) happens under the motion.

hand_back_to_lightmap()

func hand_back_to_lightmap() -> void

Light it from its lightmap again, for brushwork that returns flush to where it was baked.

get_brush_meshes()

func get_brush_meshes() -> Dictionary[int, MeshInstance3D]

The mesh drawn for each of the entity's brushes, by brush id: a copy of the node's own record.

get_brush_shapes()

func get_brush_shapes() -> Dictionary[int, CollisionShape3D]

The collision shape built for each of the entity's brushes, by brush id: a copy of the node's own record.

can_simulate()

func can_simulate() -> bool

Whether the editor offers to run this entity, and whether HammeriteMap3D.start_simulation() starts it. The default does nothing when run, so offers nothing.

start_simulation()

func start_simulation() -> void

Start or resume whatever this entity does over time, if can_simulate() says it does anything. Called through HammeriteMap3D.start_simulation(): once the map is built unless the editor is up over it, as the node is built into a world already running, and when the editor hands the view back.

stop_simulation()

func stop_simulation() -> void

Pause, keeping the state reached, so a later start_simulation() resumes. The editor stops the world when it opens.

reset_simulation()

func reset_simulation() -> void

Put the running thing back the way the map built it.

get_runtime_properties()

func get_runtime_properties() -> Dictionary[StringName, Variant]

What the inspector shows of the RUNNING thing, beside its authored properties - which are entity's, read with HammeriteEntity.get_property().

get_runtime_property()

func get_runtime_property(key: StringName, default_value = null) -> Variant

One of get_runtime_properties(), or default_value where there is none of that name. Not HammeriteEntity.get_property(), which reads an authored value.

set_runtime_property()

func set_runtime_property(_key: StringName, _value) -> void

Set a runtime property, changing the running node to match. The editor's inspector sets only those get_runtime_properties() lists, and undoes one by setting the old value back. Not saved with the map; reset_simulation() puts it back.

reset_runtime_properties()

func reset_runtime_properties() -> void

Put every runtime property back to what it was when the map was built.

can_trigger()

func can_trigger() -> bool

Whether something - the editor's Trigger, a HammeriteTrigger, the game - may trigger() it.

trigger()

func trigger(_impulse = null) -> void

Do whatever this entity does when triggered. impulse is whatever the one triggering it handed over - null from the editor's Trigger, a HammeriteTrigger's target_impulse - and what it means is the entity's to say: a light might read a bool as on or off and toggle on null, a lift a floor number.

get_actions()

func get_actions() -> Dictionary[StringName, String]

The actions this entity offers in the editor's runtime panel, as id -> label. An action is a thing done TO a running entity, not a value set on it: it belongs beside the runtime properties because that is what it acts on, and it is not undoable because there is nothing authored to put back. Every entity that says it can be triggered gets Trigger for nothing. Override to add more, and call super() unless you mean to drop it.

run_action()

func run_action(action_id: StringName) -> void

Do one of get_actions(). Override alongside it.

apply_entity_property()

abstract func apply_entity_property(prop_name: StringName, value) -> void

Apply one property to the node: each as the entity is built - the entity's value, or its type's default where the entity has none - and each time the author changes one. prop_name is never classname. Nothing is applied for you - a brush entity's origin, where it has one, moves nothing unless this moves it.

Hammerite 1.0 · built from a6dd634, 2026-10-10