HammeritePropModel
Core: entities. Inherits HammeritePointEntityNode3D < Node3D
A model placed in a map (entity type prop_model): a crate, a statue, a barrel.
Its model is a name looked up in HammeriteModelLibrary; collision gives it a trimesh collider; it turns about all three axes and can be sized. It is drawn with the brush shader and lit by a lightmap of its own from the bake, at lightmap_scale units a texel. A model material may be dressed per prop through a TEXTURE_KEY_PREFIX property. HammeriteMap3D hides its mesh while no room it stands in is in view; its collider stays. Loading a model writes its bounds into the entity's _aabb, unsignalled: the box is the model's to say, and picking, the 2D views and the navigation bake read it from the entity, with no node to ask - so it is saved with the map, and a map opened where the model is missing still has props that can be found and picked.
Methods
| Returns | Method |
|---|---|
void | set_map_3d(map_3d: HammeriteMap3D) |
void | set_entity(new_entity: HammeriteEntity) |
void | set_editor_active(_active: bool) |
bool | draws_editor_gizmos_only_when_picked() |
void | draw_editor_gizmos(gizmos: HammeriteGizmoBuffer) |
AABB | get_aabb() |
void | apply_entity_property(prop_name: StringName, value) |
Mesh | get_mesh() |
MeshInstance3D | get_mesh_instance() |
Constants
BRUSH_MATERIAL
const BRUSH_MATERIAL = <Object>
The brush shader material each of the model's surfaces is drawn with a copy of.
TEXTURE_KEY_PREFIX
const TEXTURE_KEY_PREFIX = "texture/"
What a prop names another texture for one of its model's materials under: texture/ and the material's name, lower-case and without an extension - texture/replace0 for a material called REPLACE0.GIF. A model made to be dressed differently wherever it stands - a door, a banner, a painting - has such a material, and each prop says what goes on it; the value is a texture's name, as a face's is.
Method descriptions
set_map_3d()
func set_map_3d(map_3d: HammeriteMap3D) -> void
Taken from HammeriteMap3D as the node is built: where the prop's baked UV2 and lightmap are read from, and who is told when it moves.
set_entity()
func set_entity(new_entity: HammeriteEntity) -> void
Overrides
HammeritePointEntityNode3D.set_entity()
set_editor_active()
func set_editor_active(_active: bool) -> void
Overrides
HammeritePointEntityNode3D.set_editor_active()
draws_editor_gizmos_only_when_picked()
func draws_editor_gizmos_only_when_picked() -> bool
Overrides
HammeritePointEntityNode3D.draws_editor_gizmos_only_when_picked()
draw_editor_gizmos()
func draw_editor_gizmos(gizmos: HammeriteGizmoBuffer) -> void
Overrides
HammeritePointEntityNode3D.draw_editor_gizmos()
get_aabb()
func get_aabb() -> AABB
The loaded model's bounds, turned, sized and placed as the entity is, in map space; the type's registered box until a model has loaded.
apply_entity_property()
func apply_entity_property(prop_name: StringName, value) -> void
Overrides
HammeritePointEntityNode3D.apply_entity_property()
get_mesh()
func get_mesh() -> Mesh
The model as HammeriteModelLibrary found it, or null before one loads: the one mesh every prop of that model shares, so read it and do not change it. What the bake lays the prop's lightmap over.
get_mesh_instance()
func get_mesh_instance() -> MeshInstance3D
The node the model is drawn by: get_mesh() with the prop's lightmap UVs added once it is baked, under a material per surface shared with props of the same model and atlas.