Sets default slope behavior (maxClimbXZ=walkable angle, maxSlide=start slide angle, friction 0-1, degrees).
Takes characterHandle (character controller from b3dCreateCharacterController), maxClimbXZ (maximum climbable slope angle in degrees, angles below this walkable), maxSlide (angle where sliding starts in degrees, angles above this slide down), friction (slope friction 0.0-1.0, affects sliding speed).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
characterHandleInt
maxClimbXZDouble
maxSlideDouble
frictionDouble
Returns
Void
Quick Summary
Sets default slope behavior (maxClimbXZ=walkable angle, maxSlide=start slide angle, friction 0-1, degrees).
Takes characterHandle (character controller from b3dCreateCharacterController), maxClimbXZ (maximum climbable slope angle in degrees, angles below this walkable), maxSlide (angle where sliding starts in degrees, angles above this slide down), friction (slope friction 0.0-1.0, affects sliding speed).
Returns nothing.
Technical Exegesis...
Sets default slope behavior (maxClimbXZ=walkable angle, maxSlide=start slide angle, friction 0-1, degrees). Takes characterHandle (character controller from b3dCreateCharacterController), maxClimbXZ (maximum climbable slope angle in degrees, angles below this walkable), maxSlide (angle where sliding starts in degrees, angles above this slide down), friction (slope friction 0.0-1.0, affects sliding speed). Returns nothing.
Sets default slope behavior (maxClimbXZ=walkable angle, maxSlide=start slide angle, friction 0-1, degrees). Takes characterHandle (character controller from b3dCreateCharacterController), maxClimbXZ (maximum climbable slope angle in degrees, angles below this walkable), maxSlide (angle where sliding starts in degrees, angles above this slide down), friction (slope friction 0.0-1.0, affects sliding speed). Returns nothing. Configures default slope response for all surfaces, sets Jolt maxSlopeAngle hard wall limit. Use to define character slope climbing and sliding behavior globally.
This function sets global slope config. Slope angle zones: 0 to maxClimbXZ degrees (walkable zone, character climbs normally, full traction), maxClimbXZ to maxSlide degrees (sliding zone if maxSlide > maxClimbXZ, character slides down with friction applied, partial control), maxSlide degrees and above (wall or slide zone, Jolt treats as wall or slides fast depending on config). MaxClimbXZ parameter: maximum angle character can walk up (degrees from horizontal, 0=flat 90=vertical wall), typical values 35-45 degrees for realistic climbing (standard walkable slope), above maxClimbXZ character begins sliding (can't maintain footing, gravity wins). MaxSlide parameter: angle where full sliding begins (degrees from horizontal, typically >= maxClimbXZ), if maxSlide >= maxClimbXZ creates sliding zone (gradual transition from walk to slide), if maxSlide < maxClimbXZ no sliding zone (sharp transition walk to wall at maxClimbXZ). Friction parameter: surface friction during sliding (0.0=ice frictionless, 1.0=sticky maximum grip), affects sliding speed in sliding zone (lower friction = faster slide, higher friction = slower slide), applied when slope angle between maxClimbXZ and maxSlide or above maxSlide. Use cases: (1) Terrain type simulation (icy slopes low friction, rocky slopes high friction), (2) Character ability (skilled climbers higher maxClimbXZ, beginners lower), (3) Gameplay difficulty (hard mode steep slopes, easy mode gentle slopes only), (4) Dynamic environmental effects (rain reduces friction, dry increases). Common patterns: standard slopes b3dSetCharacterMaxSlope(char, 45, 60, 0.6), icy slopes b3dSetCharacterMaxSlope(char, 30, 45, 0.2), rocky slopes b3dSetCharacterMaxSlope(char, 50, 65, 0.8), steep world b3dSetCharacterMaxSlope(char, 35, 50, 0.5). Typical usage: set once at character creation (define default slope behavior), adjust for environmental conditions (different friction in rain vs dry), modify based on character state (fatigue reduces maxClimbXZ). Default values: maxClimbXZ=45 degrees (standard walkable slope, matches typical stair angle), maxSlide=45 degrees (same as climb, no sliding zone by default), friction=0.6 (moderate friction, realistic slope sliding), set in b3dCreateCharacterController initialization. Hard wall angle calculation: hardWallAngle = max(maxClimbXZ, maxSlide) (whichever is larger becomes absolute wall), passed to Jolt SetMaxSlopeAngle (Jolt's hard collision limit), slopes steeper than hardWallAngle are walls (character stops completely, can't walk or slide). Sliding zone behavior: if maxSlide > maxClimbXZ sliding zone exists (between climb and slide angles), character slides down in this zone (friction applied, reduces fall speed), allows gradual slope difficulty (not instant wall, forgiving transition), if maxSlide = maxClimbXZ no sliding zone (instant transition climb to wall). No sliding zone configuration: set maxSlide = maxClimbXZ (both 45 degrees typical), creates sharp transition (walkable to wall, no intermediate sliding), simpler behavior (either walk or wall, no sliding state), example b3dSetCharacterMaxSlope(char, 45, 45, 0.6). Sliding zone configuration: set maxSlide > maxClimbXZ (example 45 climb, 60 slide), creates sliding zone (45-60 degrees character slides), gradual difficulty curve (steep but not wall, sliding with control), example b3dSetCharacterMaxSlope(char, 45, 60, 0.4). Friction effect: in sliding zone character slides down (gravity pulls downward along slope), friction opposes sliding (higher friction = slower slide, lower = faster), friction 0.0 slides freely (ice, uncontrollable), friction 1.0 barely slides (maximum resistance, nearly stops). Angle recommendations: maxClimbXZ 30-50 degrees typical (30 cautious, 45 standard, 50 athletic), maxSlide 45-70 degrees typical (defines sliding difficulty, 60 common), friction 0.0-1.0 range (0.1 ice, 0.5 normal, 0.9 sticky). UpdatePhysicsSystem integration: reads defaultSlope during physics update (checks contact surface angle against these values), applies sliding forces when on slope (calculates downward slide vector based on friction), respects maxSlopeAngle (Jolt collision stops at hard wall angle). Entity-specific override: this sets default for all surfaces (global fallback), use b3dSetCharacterSlopeResponse to override per entity (specific surfaces custom behavior), entity-specific takes priority over default (allows mixed terrain types). Slope angle measurement: 0 degrees = flat horizontal ground (perfectly level), 45 degrees = diagonal (rise=run, standard climbable), 90 degrees = vertical wall (straight up, impassable), measured from horizontal plane (not from vertical). Validation: silently returns if characterHandle not found (invalid or freed character), no angle clamping (any values allowed including >90 or <0, user responsible), no friction clamping (can set >1.0 or <0, though non-physical). Performance: O(1) operation (simple float assignments and Jolt SetMaxSlopeAngle call), slope checking cost in UpdatePhysicsSystem during contact resolution (minimal overhead per contact), safe to call every frame if needed. Related: b3dSetCharacterSlopeResponse sets per-entity slope overrides (specific surfaces different behavior), b3dCreateCharacterController sets default slope config (initial values 45, 45, 0.6), b3dMoveCharacter affected by slope (sliding opposes movement on steep slopes), b3dSetCharacterStepHeight complements slope (steps for small obstacles, slopes for inclines).