Sets per-entity slope override (custom slope behavior for specific surface entityHandle, overrides default).
Takes characterHandle (character controller), entityHandle (specific entity/surface for custom behavior), maxClimbXZ (walkable angle for this entity in degrees), maxSlide (slide start angle for this entity in degrees), friction (friction for this entity 0.0-1.0).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
characterHandleInt
entityHandleInt
maxClimbXZDouble
maxSlideDouble
frictionDouble
Returns
Void
Quick Summary
Sets per-entity slope override (custom slope behavior for specific surface entityHandle, overrides default).
Takes characterHandle (character controller), entityHandle (specific entity/surface for custom behavior), maxClimbXZ (walkable angle for this entity in degrees), maxSlide (slide start angle for this entity in degrees), friction (friction for this entity 0.0-1.0).
Returns nothing.
Technical Exegesis...
Sets per-entity slope override (custom slope behavior for specific surface entityHandle, overrides default). Takes characterHandle (character controller), entityHandle (specific entity/surface for custom behavior), maxClimbXZ (walkable angle for this entity in degrees), maxSlide (slide start angle for this entity in degrees), friction (friction for this entity 0.0-1.0). Returns nothing. Stores entity-specific slope config in data.
Sets per-entity slope override (custom slope behavior for specific surface entityHandle, overrides default). Takes characterHandle (character controller), entityHandle (specific entity/surface for custom behavior), maxClimbXZ (walkable angle for this entity in degrees), maxSlide (slide start angle for this entity in degrees), friction (friction for this entity 0.0-1.0). Returns nothing. Stores entity-specific slope config in data.entitySlopes map, overrides default slope behavior when character contacts this entity. Use for mixed terrain types (ice, mud, rock on same level).
This function creates surface-specific slope config. Entity-specific override: applies only when character contacts entityHandle surface (specific entity gets custom slope behavior), overrides default slope set by b3dSetCharacterMaxSlope (entity-specific takes priority), allows mixed terrain (ice patch has low friction, rock has high, within same environment). Parameters same as b3dSetCharacterMaxSlope: maxClimbXZ (climbable angle for this surface, degrees), maxSlide (slide start angle for this surface, degrees), friction (sliding friction for this surface, 0.0-1.0). Use cases: (1) Ice patches (low friction slippery surfaces in otherwise normal terrain), (2) Mud areas (higher friction sticky zones), (3) Metal ramps (specific climbing angles different from stone), (4) Conveyor belts (custom friction for belt surfaces), (5) Gameplay obstacles (challenge zones with difficult slope behavior). Common patterns: ice patch b3dSetCharacterSlopeResponse(char, icePlatform, 25, 40, 0.1), mud area b3dSetCharacterSlopeResponse(char, mudZone, 35, 50, 0.9), metal ramp b3dSetCharacterSlopeResponse(char, metalRamp, 40, 55, 0.4). Typical usage: configure during level load (set all special surface behaviors), apply to specific entities (ice, mud, metal entities get custom configs), character experiences different slope behavior per surface (walks onto ice, slips differently than rock). Entity slope storage: stores SlopeResponse in data.entitySlopes[entityHandle] (map from entity handle to slope config), persists until explicitly changed or removed, checked during UpdatePhysicsSystem contact resolution (if contact entity in map use override else use default). Priority system: when character contacts entity check if entityHandle in entitySlopes map (entity-specific config exists), if exists use entity slope config (maxClimbXZ, maxSlide, friction from map), if not exists use default slope config (from b3dSetCharacterMaxSlope), allows mixed behavior per surface type. Multiple entity overrides: can set different slopes for multiple entities (each entity custom config), character adapts to each surface (smooth transitions between terrain types), example ice entity friction 0.1, mud entity friction 0.9 (character switches friction when crossing boundary). Slope parameter meaning: maxClimbXZ (walkable angle, higher = can climb steeper slopes on this surface), maxSlide (slide start angle, higher = starts sliding later), friction (0.0 slippery, 1.0 sticky, affects slide speed on this surface). Ice example: b3dSetCharacterSlopeResponse(char, iceFloor, 20, 35, 0.05) (can't climb steep ice maxClimbXZ=20 low, slides early maxSlide=35, very slippery friction=0.05), character on ice slides easily (reduced climb ability, low friction). Mud example: b3dSetCharacterSlopeResponse(char, mudFloor, 40, 55, 0.85) (climbs steep mud maxClimbXZ=40 decent, slides late maxSlide=55, sticky friction=0.85), character in mud has traction (good climb ability, high friction prevents sliding). Contact detection: UpdatePhysicsSystem gets contact entity during collision (CharacterVirtual active contacts), looks up entity handle in g_entities (maps Jolt BodyID to entity handle), checks if entity in entitySlopes map (entity-specific slope exists), applies override config if found. Removing override: to remove entity-specific slope delete from map (C++ erase), revert to default slope for that entity (uses b3dSetCharacterMaxSlope config), currently no BambooBasic function to remove (would need b3dRemoveCharacterSlopeResponse if desired). Terrain transitions: character walks from normal ground to ice (default slope to ice slope config), smooth transition (slope config switches at contact boundary), responsive terrain feel (immediate friction change when stepping on new surface). Slope override vs launch response: slope response affects climbing and sliding (angle limits, friction), launch response affects bouncing and stopping (b3dSetLaunchResponse separate system), both can be combined (entity has custom slope AND custom launch behavior). Performance: O(1) operation (simple map insertion, stores SlopeResponse struct), lookup cost during physics update (map lookup per contact, fast hash map O(1)), negligible overhead (only checked for active contacts ~1-4 per character). Entity handle validity: entityHandle should be valid physics body entity (entity with collision geometry), invalid entityHandle still stored in map (no validation, config exists but never used), entity deleted config remains in map (stale config harmless but wastes memory). Default behavior: entities without override use default slope (set by b3dSetCharacterMaxSlope), allows setting most common terrain as default (rock, grass typical), override only special cases (ice, mud exceptions). Validation: silently returns if characterHandle not found (invalid or freed character), no validation on entityHandle (any handle allowed, even invalid), no validation on slope parameters (user responsible for reasonable values). Related: b3dSetCharacterMaxSlope sets default slope for all surfaces (global config), b3dSetLaunchResponse sets entity-specific collision response (complementary system), b3dCreateCharacterController creates character controller (default slope set at creation), b3dMoveCharacter uses slope config during movement (slope affects character motion).