HammeritePointEntityRigidBody3D
Core: entities. Inherits RigidBody3D
A point entity the PHYSICS decides where to put: a crate, a bottle, anything that can be knocked over, picked up or thrown.
Same interface as HammeritePointEntityNode3D, on a body that falls. Reach for it when where the thing ends up is not something the map can say - HammeritePointEntityAnimatableBody3D is for what is driven from script, and HammeritePointEntityNode3D for what only needs to be somewhere. It starts asleep where it was authored. A physics body placed in a map and left running settles, drifts and ends up somewhere nobody put it - in the editor, where an author is still looking at it, and in the seconds after a level loads. Asleep it stays exactly where it was placed, and the first thing to touch it wakes it, which is the moment the physics starts being worth having. What it costs is that a prop authored in mid-air hangs there until something disturbs it. It is not sized for you, for HammeritePointEntityAnimatableBody3D's reason: a type that can be sized hands scale to apply_entity_property(), and the subclass sizes its own meshes and collision shapes.
Properties
| Type | Name | Default |
|---|---|---|
HammeriteEntity | entity | null |
Methods
| Returns | Method |
|---|---|
HammeriteEntity | get_entity() |
void | set_entity(new_entity: HammeriteEntity) |
void | place_at(where: Transform3D) |
void | update_properties() |
void | request_rebuild() |
void | set_editor_active(active: bool) abstract |
void | draw_editor_gizmos(_gizmos: HammeriteGizmoBuffer) |
bool | draws_editor_gizmos_only_when_picked() |
HammeriteEditorHandle[] | get_editor_handles() |
void | move_editor_handle(_handle_id: StringName, _to: Vector3) |
AABB | get_aabb() |
bool | can_simulate() |
void | start_simulation() |
void | stop_simulation() |
void | reset_simulation() |
Dictionary[StringName, Variant] | get_runtime_properties() |
Variant | get_runtime_property(key: StringName, default_value = null) |
void | set_runtime_property(_key: StringName, _value) |
void | reset_runtime_properties() |
bool | can_trigger() |
void | trigger(_impulse = null) |
Dictionary[StringName, String] | get_actions() |
void | run_action(action_id: StringName) |
void | apply_entity_property(prop_name: StringName, value) abstract |
void | set_light_modulation(modulation: float) |
Signals
rebuild_requested
signal rebuild_requested()
As HammeritePointEntityNode3D.rebuild_requested.
Property descriptions
entity
var entity: HammeriteEntity = null
As HammeritePointEntityNode3D.entity.
Method descriptions
get_entity()
func get_entity() -> HammeriteEntity
Getter of entity.
set_entity()
func set_entity(new_entity: HammeriteEntity) -> void
As HammeritePointEntityNode3D.set_entity().
place_at()
func place_at(where: Transform3D) -> void
Put it somewhere and let it rest there, whatever the physics was in the middle of. The one way to move one of these from script. Anything that assigns to global_transform is writing to a value the physics server owns and will overwrite, which is a body that does not move and a bug that looks like the caller being ignored. where is in world space. An authored origin or turn is in the map's, so one put here from the entity has to be carried through the HammeriteMap3D's transform first.
update_properties()
func update_properties() -> void
Apply 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. set_entity() calls it. Override it, calling super(), for what wants every property applied first - gathering the probes that light the node once it knows where it stands.
request_rebuild()
func request_rebuild() -> void
Emit rebuild_requested, so HammeriteMap3D frees this node and builds it again from the entity.
set_editor_active()
abstract func set_editor_active(active: bool) -> void
As HammeritePointEntityNode3D.set_editor_active().
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
As HammeritePointEntityNode3D.get_aabb().
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
As HammeritePointEntityNode3D.start_simulation().
stop_simulation()
func stop_simulation() -> void
As HammeritePointEntityNode3D.stop_simulation().
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
As HammeritePointEntityNode3D.get_runtime_property().
set_runtime_property()
func set_runtime_property(_key: StringName, _value) -> void
As HammeritePointEntityNode3D.set_runtime_property().
reset_runtime_properties()
func reset_runtime_properties() -> void
As HammeritePointEntityNode3D.reset_runtime_properties().
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. 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
As HammeritePointEntityNode3D.apply_entity_property(). rotation has been applied through place_at() before this is told, if the body is in the tree; scale never is. Move the body with place_at() here too, not by assigning its transform.
set_light_modulation()
func set_light_modulation(modulation: float) -> void