Sets stair step height (stepUp for climbing, stepDown for floor sticking, default 0.4 units).
Takes characterHandle (character controller from b3dCreateCharacterController), stepHeight (maximum step height in units for both stepping up stairs and stepping down to stick to slopes).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
characterHandleInt
stepHeightDouble
Returns
Void
Quick Summary
Sets stair step height (stepUp for climbing, stepDown for floor sticking, default 0.4 units).
Takes characterHandle (character controller from b3dCreateCharacterController), stepHeight (maximum step height in units for both stepping up stairs and stepping down to stick to slopes).
Returns nothing.
Technical Exegesis...
Sets stair step height (stepUp for climbing, stepDown for floor sticking, default 0.4 units). Takes characterHandle (character controller from b3dCreateCharacterController), stepHeight (maximum step height in units for both stepping up stairs and stepping down to stick to slopes). Returns nothing. Sets both data.stepUp and data.stepDown to same value, affects stair climbing and floor adherence. Use to customize step behavior per character or environment.
This function configures step height.
Sets stair step height (stepUp for climbing, stepDown for floor sticking, default 0.4 units). Takes characterHandle (character controller from b3dCreateCharacterController), stepHeight (maximum step height in units for both stepping up stairs and stepping down to stick to slopes). Returns nothing. Sets both data.stepUp and data.stepDown to same value, affects stair climbing and floor adherence. Use to customize step behavior per character or environment.
This function configures step height. Step height parameters: stepUp = stepHeight (maximum height character can step up without jumping, for stairs and obstacles), stepDown = stepHeight (maximum depth character steps down to maintain floor contact, for slopes and descents). Both set to same value (single parameter controls up and down stepping). Step up (stairs): character automatically climbs steps up to stepHeight (no jumping required, smooth stair climbing), steps higher than stepHeight require jumping (treated as walls, block movement), typical values 0.3-0.5 for stairs (standard stair riser height ~0.4 units). Step down (floor stick): character steps down up to stepHeight to maintain floor contact (prevents floating on gentle slopes, stays grounded on descents), prevents floating when walking down stairs or slopes (character follows floor contour smoothly), typical values same as stepUp (0.3-0.5 for natural floor adherence). Use cases: (1) Stair climbing (set stepHeight to max stair riser for smooth climbing), (2) Obstacle navigation (adjust stepHeight to allow stepping over small obstacles), (3) Character size variation (larger characters higher stepHeight, smaller characters lower), (4) Accessibility (higher stepHeight makes navigation easier, lower more challenging), (5) Terrain adaptation (higher stepHeight for rough terrain, lower for flat surfaces). Common patterns: standard character b3dSetCharacterStepHeight(char, 0.4), tall character b3dSetCharacterStepHeight(giant, 0.6), small character b3dSetCharacterStepHeight(child, 0.2), flat terrain b3dSetCharacterStepHeight(char, 0.1), rough terrain b3dSetCharacterStepHeight(char, 0.5). Typical usage: set once at character creation (configure character-specific step capability), adjust for different environments (higher in dungeons with stairs, lower in smooth areas), modify based on character state (crouching reduces effective step height). Default value: stepUp and stepDown initialized to 0.4 in b3dCreateCharacterController (comfortable stair height for human-sized character, standard riser ~6-8 inches), remains until explicitly changed (persistent across frames). Step up behavior: when character encounters obstacle <= stepHeight moves up smoothly (Jolt CharacterVirtual handles step detection and climbing), when obstacle > stepHeight blocked (treated as wall, must jump over), no intermediate states (either steps or blocked, no partial climbing). Step down behavior: when descending slope or stairs character steps down up to stepHeight per frame (maintains floor contact, prevents floating), when drop > stepHeight character becomes airborne (leaves ground, enters falling state), creates smooth descent on gentle slopes (character hugs floor contour). Stair climbing example: standard stairs 0.2 unit rise, stepHeight 0.4 allows climbing (0.2 < 0.4 climbs smoothly), tall stairs 0.5 unit rise, stepHeight 0.4 blocks (0.5 > 0.4 must jump), comfortable stair navigation with proper stepHeight setting. Floor sticking example: walking down 30 degree slope, stepDown 0.4 maintains contact (character stays on slope surface), walking off 0.6 unit drop, stepDown 0.4 insufficient (character becomes airborne mid-drop), prevents floating on gentle descents with adequate stepDown. Step height vs character height: taller characters typically higher stepHeight (proportional to leg length, ~20-25% of total height), shorter characters lower stepHeight (smaller obstacles climbable, appropriate to size), adjust proportionally when changing character height (scale stepHeight with height changes). Jolt integration: stepUp passed to Jolt CharacterVirtual during Update (affects collision resolution and obstacle climbing), stepDown affects floor tracking (how far down to search for floor contact), both used by Jolt physics step (automatic stepping behavior). Performance: O(1) operation (simple float assignment, two values set), stepping cost in UpdatePhysicsSystem during collision resolution (Jolt handles stepping, minimal overhead), no validation overhead. Step height recommendations: minimum 0.1 for very flat terrain (barely any obstacles), maximum 1.0 for super-stepping (climb onto tables, larger obstacles), sweet spot 0.3-0.5 for human characters (realistic stair and terrain navigation), too high allows unrealistic climbing (character climbs onto tall objects without jump). Zero step height: stepHeight 0.0 disables stepping (character can't climb any obstacles, flat ground only), even tiny bumps block movement (1cm rise is wall), useful for vehicles or rolling characters (no stepping capability). Negative step height: negative values undefined behavior (may cause collision issues, avoid), always use positive stepHeight (0.0 minimum for no stepping, >0 for stepping). Validation: silently returns if characterHandle not found in g_characters (invalid or freed character), no validation on stepHeight value (any value allowed including zero or negative), user responsible for reasonable values. Related: b3dCreateCharacterController sets default stepHeight 0.4 (initial value), b3dSetCharacterMaxSlope affects climbable slope angle (complementary to step height), b3dMoveCharacter uses stepping during movement (automatic step climbing when moving).