Sets air control 0.0-1.0 (horizontal movement control while airborne, default 0.3 = 30%).
Takes characterHandle (character controller from b3dCreateCharacterController), airControl (air control factor 0.0=no control to 1.0=full control, how much horizontal movement allowed while jumping/falling).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
characterHandleInt
airControlDouble
Returns
Void
Quick Summary
Sets air control 0.0-1.0 (horizontal movement control while airborne, default 0.3 = 30%).
Takes characterHandle (character controller from b3dCreateCharacterController), airControl (air control factor 0.0=no control to 1.0=full control, how much horizontal movement allowed while jumping/falling).
Returns nothing.
Technical Exegesis...
Sets air control 0.0-1.0 (horizontal movement control while airborne, default 0.3 = 30%). Takes characterHandle (character controller from b3dCreateCharacterController), airControl (air control factor 0.0=no control to 1.0=full control, how much horizontal movement allowed while jumping/falling). Returns nothing. Sets data.airControl, affects b3dMoveCharacter horizontal velocity when not grounded. Use to tune jump feel and aerial maneuverability per character or gameplay style.
Sets air control 0.0-1.0 (horizontal movement control while airborne, default 0.3 = 30%). Takes characterHandle (character controller from b3dCreateCharacterController), airControl (air control factor 0.0=no control to 1.0=full control, how much horizontal movement allowed while jumping/falling). Returns nothing. Sets data.airControl, affects b3dMoveCharacter horizontal velocity when not grounded. Use to tune jump feel and aerial maneuverability per character or gameplay style.
This function configures air control. Air control system: when character is airborne (not grounded, jumping or falling), horizontal input has reduced effect (can't change direction as easily in air vs on ground), airControl factor scales horizontal movement (0.0 = can't move horizontally at all, 1.0 = full ground-like control), realistic feel vs gameplay responsiveness tradeoff (lower control more realistic, higher control more responsive). Air control parameter: airControl = 0.0 to 1.0 (clamped to valid range if outside), 0.0 = no air control (horizontal input ignored completely while airborne, momentum-only movement), 0.3 = default (30% of ground control, moderate air steering), 1.0 = full air control (same control as on ground, unrealistic but responsive), typical values 0.2-0.5 for platformers (balance realism and feel). Use cases: (1) Platformer tuning (adjust air control for jump feel, higher control easier jumps), (2) Realism vs fun (lower control realistic physics, higher control forgiving gameplay), (3) Character differentiation (agile characters high air control, heavy characters low), (4) Skill-based mechanics (low air control rewards planning, high air control rewards reaction), (5) Aerial combat (higher air control allows mid-air dodging and maneuvering). Common patterns: realistic movement b3dSetCharacterAirControl(char, 0.2), responsive platformer b3dSetCharacterAirControl(char, 0.5), full control b3dSetCharacterAirControl(char, 1.0), momentum-only b3dSetCharacterAirControl(char, 0.0), agile character b3dSetCharacterAirControl(ninja, 0.7). Typical usage: set once at character creation (configure character-specific air control feel), tune during playtesting (adjust for jump feel and difficulty balance), modify for powerups or abilities (glider increases air control temporarily).
Default value: airControl = 0.3 (30% horizontal control while airborne, set in b3dCreateCharacterController), remains until explicitly changed (persistent across jumps and frames), balanced for moderate platforming (not too floaty, not too rigid). Air control effect: when character airborne (b3dIsCharacterGrounded returns false), b3dMoveCharacter applies airControl to horizontal input (desiredVelocity.X *= airControl, desiredVelocity.Z *= airControl), reduces horizontal acceleration/speed in air (can't steer as sharply mid-jump), vertical velocity unaffected (gravity and jumping not impacted by air control). Grounded vs airborne: when grounded (on floor, walking/running), full horizontal control applied (airControl ignored, 100% input response), when airborne (jumping, falling, in air), reduced horizontal control applied (airControl scales input, limited steering), automatic transition (UpdatePhysicsSystem detects ground state, switches control mode). Air control factor clamping: if airControl < 0.0 clamped to 0.0 (negative values become no control, prevents undefined behavior), if airControl > 1.0 clamped to 1.0 (values above 1 become full control, prevents over-steering), valid range 0.0-1.0 only (0% to 100% scaling factor). Zero air control (0.0): horizontal input completely ignored while airborne (can't steer at all mid-jump), character follows ballistic trajectory (launch angle determines landing, no mid-air correction), momentum-based platforming (requires precise jump timing and direction, unforgiving), realistic physics (real-world jumping has minimal air steering). Full air control (1.0): horizontal input has full effect while airborne (same as on ground, complete mid-air steering), character can change direction freely mid-jump (unrealistic but very responsive), arcade platforming (forgiving jumps, easy to correct mistakes mid-air), gameplay over realism (prioritizes fun and accessibility). Moderate air control (0.2-0.5): horizontal input has partial effect while airborne (can steer somewhat but limited), character can adjust trajectory slightly mid-jump (small corrections allowed, not full reversal), balanced platforming (combines planning and reaction, moderate forgiveness), typical for most games (30% default strikes good balance). Platformer tuning: low air control 0.15-0.25 (skill-based, requires precise jumps, challenging), medium air control 0.3-0.4 (balanced, allows some correction, moderate difficulty), high air control 0.5-0.8 (forgiving, easy mid-air adjustment, accessible), very high air control 0.9-1.0 (floaty, complete freedom, very easy). Character differentiation: heavy character low air control (b3dSetCharacterAirControl(tank, 0.15) sluggish jumps, momentum-based), normal character medium air control (b3dSetCharacterAirControl(player, 0.3) balanced jumps), agile character high air control (b3dSetCharacterAirControl(ninja, 0.6) precise mid-air maneuvering), provides varied character feel (different jump characteristics per character type). Powerup example: glider powerup increases air control (b3dSetCharacterAirControl(char, 0.8) while gliding, enhanced steering), revert when glider expires (b3dSetCharacterAirControl(char, 0.3) restore normal), temporary aerial mobility boost (limited duration enhanced air steering). Aerial combat: higher air control enables mid-air dodging (b3dSetCharacterAirControl(char, 0.6) allows evasive maneuvers), combat jumps feel responsive (can strafe and backpedal while airborne), useful for action games (melee attacks and dodges while jumping). Movement calculation: grounded desiredVel = input * currentSpeed (full control, no air control factor), airborne desiredVel = input * currentSpeed * airControl (reduced control, scaled by air control), then apply acceleration (smooth transition to desired velocity based on acceleration setting), final velocity used by b3dMoveCharacter (character moves with calculated velocity). Performance: O(1) operation (simple float assignment with clamping, instant), clamping cost negligible (two comparisons and assignments if needed), safe to call every frame (though typically set once at creation). Validation: silently returns if characterHandle not found in g_characters (invalid or freed character), clamps airControl to 0.0-1.0 range (ensures valid factor, no error for out-of-range), no error messages (silent failure for performance). Related: b3dMoveCharacter applies air control to horizontal velocity when airborne (uses airControl factor), b3dIsCharacterGrounded determines when air control is active (airborne vs grounded state), b3dCreateCharacterController sets default air control 0.3 (initial value), b3dCharacterJump initiates airborne state (air control becomes active after jump).