|
group2 0.1.0
CSE 125 Group 2
|
Surface-material classification shared across collision, raycasts, VFX, SFX, and damage falloff. More...
#include <cstdint>#include <string_view>Go to the source code of this file.
Enumerations | |
| enum class | SurfaceType : uint8_t { Metal = 0 , Concrete = 1 , Flesh = 2 , Wood = 3 , Energy = 4 , Count = 5 } |
| Surface material hit by a projectile / hitscan / contact. More... | |
Functions | |
| constexpr SurfaceType | surfaceTypeFromMaterialName (std::string_view name) noexcept |
| Parse a Blender material name into a SurfaceType. | |
| constexpr std::string_view | surfaceTypeName (SurfaceType s) noexcept |
| Display name for a SurfaceType. Used in debug UI / logging. | |
Surface-material classification shared across collision, raycasts, VFX, SFX, and damage falloff.
Lives in the physics layer because primitives carry a per-instance SurfaceType (cooked from Blender material names) that drives the downstream gameplay systems. Projectile.hpp re-includes this header to preserve the existing #include "Projectile.hpp" paths that read the enum.
|
strong |
Surface material hit by a projectile / hitscan / contact.
Cook-time mapping (Blender material name → enum, case-insensitive):
Unknown / unprefixed materials fall back to Concrete, matching the hard-coded behaviour of the original (pre-Phase-3) raycast code.
| Enumerator | |
|---|---|
| Metal | |
| Concrete | |
| Flesh | |
| Wood | |
| Energy | |
| Count | |
|
nodiscardconstexprnoexcept |
Parse a Blender material name into a SurfaceType.
Accepts either the bare suffix ("metal") or the mat_ prefix ("mat_metal"). Case-insensitive. Returns Concrete for unrecognised input — matches the pre-Phase-3 default behaviour so missing material tags never break a map.
|
nodiscardconstexprnoexcept |
Display name for a SurfaceType. Used in debug UI / logging.