Gas Station Marker
Marker class for gas station / charging station pump areas. Renders floating fuel/charge icons at each pump, detects OBB overlap with the vehicle, and supports interaction prompts for refueling.
Marker class for gas station / charging station pump areas. Renders floating fuel/charge icons at each pump, detects OBB overlap with the vehicle, and supports interaction prompts for refueling.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | () | Sets visible = true |
C:setup | (cluster) | Reads pump scene objects (area + icon pairs), computes OBB axes, creates pump icons |
C:update | (data) | Checks OBB overlap for each pump at sub-cruising speed; fades icons with LOS raycasting |
C:createObjects | () | Creates/finds BeamNGWorldIconsRenderer singleton |
C:hide | () | Zeroes all pump icon alphas |
C:show | () | Sets visible true |
C:clearObjects | () | Removes all pump icons from renderer |
C:interactInPlayMode | (interactData, elements) | Adds elemData when any pump overlaps |
C:drawOnMinimap | (td) | Draws circles at each pump's icon position |
C:drawAxisBox | (corner,x,y,z,clr?) | Debug: draws OBB with filled faces |
Module Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
create | (...) | marker | Creates a new gas station marker instance |
cluster | (pois, allClusters) | nil | One cluster per POI (no grouping) |
Internals
Pump Data Structure
Each pump is defined by a pair of scene object names [areaObject, iconObject]:
pumpData = {
areaPos = pos,
xVec = rot*vecX*scl.x,
yVec = rot*vecY*scl.y,
zVec = rot*vecZ*scl.z,
iconPos = iconObject:getPosition(),
iconPosSmoother, iconAlphaSmoother,
overlap = false,
iconId, iconInfo,
}Overlap Detection
Uses overlapsOBB_OBB(vehicleBB, pumpBB) - only checked when cruisingSpeedFactor < 1 (below cruising speed). Each pump is checked independently.
Icon Behavior
- Icons lift 0.25 units when overlapping
- Alpha fades via LOS raycast:
castRayStaticfrom camera to icon position - Alpha is smoothed with
newTemporalSmoothingNonLinear(30,30) - Only updates alpha when needed (
alphaNeedsUpdateoptimization)
Icon Types
- Standard stations:
poi_fuel_round - Electric stations (
cluster.electric = true):poi_charge_round
How It Works
- Cluster setup reads pump area/icon scene objects and computes OBB data
- Each frame: checks OBB overlap at each pump, raycasts for icon visibility
- When any pump overlaps at parking speed: shows interaction prompt
- Icons smoothly appear/disappear based on proximity and line of sight
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Drift Line Marker - Related reference
- Gameplay Systems Guide - Guide
Drift Line Marker
Marker class for freeroam drift start lines. Shows/hides scene objects that form the visual start line. Detects when the player drives through the line to trigger a drift challenge.
Inspect Vehicle Marker
Marker class for vehicle inspection/interaction points. Renders a floating icon with distance-based height scaling, supports navigation focus with bounce animation, and detects player proximity for in