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
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 interaction.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | () | Assigns unique id, creates position/alpha/cruising/distance smoothers |
C:setup | (cluster) | Sets position, radius, icon, focus state; creates icon in renderer |
C:update | (data) | Computes icon height, screen-clamping, alpha, LOS; detects area enter/exit |
C:createObjects | () | Creates/finds BeamNGWorldIconsRenderer singleton |
C:clearObjects | () | Removes icon from renderer |
C:hide | () | Zeroes icon alpha |
C:show | () | Sets visible true |
C:interactInPlayMode | (interactData, elements) | Adds cluster.data when player is inside radius |
Module Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
create | (...) | marker | Creates a new inspect vehicle marker |
cluster | (pois, allClusters) | nil | One cluster per POI (no grouping) |
Internals
Icon Height Modes
Non-focused (normal markers):
- Inside area: raises to vehicle top + offset
- Within 60m: stays at
iconHeightBottom(1.0) - Beyond 60m: hides (height → 0)
- Modulated by cruising speed factor
Focused (navigation target):
- Uses
distanceToHeight(dist)scaling up to 500m high at 700m distance - Clamped to screen top via camera FOV plane projection
- Bounce animation via easing function
- Scale decreases at distance:
linearScale(dist, 100, 1000, 1, 0.65)
Screen Clamping (Focus Mode)
Projects icon position onto a plane at the camera's upper screen edge to prevent the icon from going off-screen. Uses intersectsRay_Plane with a normal computed from camera FOV.
Alpha and LOS
- Alpha faded via
iconAlphaSmoother - Line-of-sight check:
castRayStatic(iconPos, camDir, rayLength)- hidden if ray hits geometry - Focused markers maintain 0.35 alpha when off-screen (within 750m)
Area Detection
Simple squared-distance check against self.radius. Tracks isInAreaChanged as "in" or "out" for the interaction system.
How It Works
- POI system provides inspection points with position, radius, icon, and focus state
- Each frame: computes height based on distance/mode, checks LOS, updates icon
- Focused markers stay visible at greater distances with bounce animation
- At parking speed + inside radius: triggers interaction prompt
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Drift Line Marker - Related reference
- Gameplay Systems Guide - Guide
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.
Invisible Marker
Minimal no-op marker class. Has no visual representation or interaction behavior. Used as a placeholder or base marker when no visual or interaction is needed.