HammeriteAudioPortalProperties
Audio. Inherits RefCounted
Authored acoustic values on a portal, stored on the face the aperture is punched from.
Portals are derived: the compiler works out where two rooms open into each other on every recompile, and a HammeritePortal object does not survive the next edit. So a portal's identity cannot live on the portal. It lives on the authored thing underneath - the coplanar HammeriteFace the aperture is cut from - which is stable across recompiles, moves with the brush when the room is nudged, and is duplicated along with it when the room is copied. That identity is what makes a doorway addressable at runtime: a door entity carries a portal name and calls HammeriteAudioNodeGraph.set_portal_occlusion_by_name() as it swings, and the sound through that opening closes with it. The NAME itself is core's, and asked of core: HammeritePortal.get_portal_name() and HammeritePortal.set_portal_name(), because an opening is one opening - the same window a door names for sound is the one navigation climbs through, and two addons each storing their own name for it would eventually disagree. This class used to forward to both, which was two supported spellings of one thing (#235). What is acoustic - how much a closed door attenuates, how occluded it stands - lives here. An aperture is cut from a PAIR of coplanar faces, one in each room, and which of them the compiler calls "a" falls out of brush iteration order rather than anything an author can see - so reads go through HammeritePortal.get_face_property(), which checks both.
Methods
| Returns | Method |
|---|---|
float | get_max_attenuation_db(portal: HammeritePortal) static |
bool | set_max_attenuation_db(portal: HammeritePortal, db: float) static |
float | get_occlusion(portal: HammeritePortal) static |
bool | set_occlusion(portal: HammeritePortal, value: float) static |
Constants
NAMESPACE
const NAMESPACE = &"portal"
Namespace for the keys below. Owned by HammeritePortal - the key shape is shared with every other consumer of an opening, and there is only one of it.
DEFAULT_MAX_ATTENUATION_DB
const DEFAULT_MAX_ATTENUATION_DB = 40.0
What an opening costs a sound when fully closed, in dB, unless the author set it.
DEFAULT_OCCLUSION
const DEFAULT_OCCLUSION = 0.0
Standing occlusion of an opening the author left alone: open.
Method descriptions
get_max_attenuation_db()
static func get_max_attenuation_db(portal: HammeritePortal) -> float
Closed-state attenuation for portal, in dB.
set_max_attenuation_db()
static func set_max_attenuation_db(portal: HammeritePortal, db: float) -> bool
Set the closed-state attenuation, or reset it to the default when db is the default. False on an overlap portal, which has no face to write to.
get_occlusion()
static func get_occlusion(portal: HammeritePortal) -> float
Standing occlusion for portal, 0 open .. 1 closed.
set_occlusion()
static func set_occlusion(portal: HammeritePortal, value: float) -> bool
Set the standing occlusion, or reset it to the default when value is the default. False on an overlap portal, which has no face to write to.