Sets wind resistance 0.0-1.0 (0.0=full wind effect, 1.0=immune to wind, default 0.0).
Takes characterHandle (character controller from b3dCreateCharacterController), resistance (wind resistance factor 0.0-1.0, how much wind is resisted).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
characterHandleInt
resistanceDouble
Returns
Void
Quick Summary
Sets wind resistance 0.0-1.0 (0.0=full wind effect, 1.0=immune to wind, default 0.0).
Takes characterHandle (character controller from b3dCreateCharacterController), resistance (wind resistance factor 0.0-1.0, how much wind is resisted).
Returns nothing.
Technical Exegesis...
Sets wind resistance 0.0-1.0 (0.0=full wind effect, 1.0=immune to wind, default 0.0). Takes characterHandle (character controller from b3dCreateCharacterController), resistance (wind resistance factor 0.0-1.0, how much wind is resisted). Returns nothing. Sets data.windResistance clamped to 0.0-1.0, scales wind force during physics updates. Use to differentiate character types, powerups, or gameplay mechanics requiring wind immunity.
This function configures wind resistance.
Sets wind resistance 0.0-1.0 (0.0=full wind effect, 1.0=immune to wind, default 0.0). Takes characterHandle (character controller from b3dCreateCharacterController), resistance (wind resistance factor 0.0-1.0, how much wind is resisted). Returns nothing. Sets data.windResistance clamped to 0.0-1.0, scales wind force during physics updates. Use to differentiate character types, powerups, or gameplay mechanics requiring wind immunity.
This function configures wind resistance. Wind resistance system: global wind force set by b3dSetPhysicsWind (persistent environmental wind, units/sec^2 acceleration), resistance scales wind effect (effective wind = windForce * (1.0 - resistance), reduces wind impact), per-character customization (different characters different resistance, independent wind sensitivity). Resistance parameter: resistance = 0.0 full wind (default, character fully affected by wind, maximum push, no resistance), resistance = 0.5 half wind (character affected by 50% of wind, partial resistance), resistance = 1.0 immune to wind (character not affected by wind at all, complete immunity), clamped to 0.0-1.0 range (values outside clamped automatically, ensures valid resistance). Use cases: (1) Heavy characters (large or heavy characters higher resistance, less affected by wind), (2) Light characters (small or light characters lower resistance, more affected by wind), (3) Powerups (wind immunity powerup sets resistance 1.0, temporarily ignore wind), (4) Status effects (rooted state increases resistance, anchored to ground), (5) Character differentiation (varied resistance creates different movement feel per character type). Common patterns: heavy character b3dSetPhysicsWindResistance(tank, 0.8), light character b3dSetPhysicsWindResistance(fairy, 0.1), wind immunity b3dSetPhysicsWindResistance(char, 1.0), normal resistance b3dSetPhysicsWindResistance(char, 0.0). Typical usage: set once at character creation (configure character-specific wind sensitivity), adjust for powerups or status effects (temporary wind immunity or vulnerability), reset when effect ends (restore default resistance).
Default value: windResistance = 0.0 (no resistance, full wind effect, set in b3dCreateCharacterController), remains until explicitly changed (persistent across frames), character fully affected by wind (standard wind sensitivity). Wind resistance calculation: effective wind = windForce * (1.0 - resistance) (e.g. wind 10.0 units/sec^2 with resistance 0.7 gives effective wind 3.0), applied during UpdatePhysicsSystem (velocity += effectiveWind * deltaTime each frame), resistance reduces wind impact (higher resistance = less wind effect, lower resistance = more wind effect). Resistance = 0.0 full wind: character fully affected by wind (no resistance, maximum wind impact), wind force applied at full strength (effectiveWind = windForce * 1.0), typical for light or normal characters (default behavior, standard wind sensitivity). Resistance = 0.5 half wind: character affected by 50% of wind (moderate resistance, partial immunity), wind force applied at half strength (effectiveWind = windForce * 0.5), balanced for medium-weight characters (some wind effect but not overwhelming). Resistance = 1.0 immune to wind: character not affected by wind at all (complete immunity, zero wind impact), wind force ignored (effectiveWind = windForce * 0.0 = 0), useful for heavy characters or powerups (anchored to ground, wind cannot move them). Heavy character example: set at character creation (b3dSetPhysicsWindResistance(heavyCharacter, 0.75) resistant to wind), persistent heavy feel (character less affected by wind, harder to push), differentiated character types (heavy tanks resist wind, light scouts blown easily). Light character example: set at character creation (b3dSetPhysicsWindResistance(lightCharacter, 0.2) vulnerable to wind), high wind sensitivity (character blown easily by wind, very affected), creates challenge (light characters must fight wind, harder movement control). Wind immunity powerup: activate powerup (If pickupWindImmunity Then immune = True), set immunity (b3dSetPhysicsWindResistance(char, 1.0) ignore wind completely), restore on expiration (b3dSetPhysicsWindResistance(char, 0.0) after powerup duration), temporary wind immunity (timed effect, character unaffected by wind zones). Rooted status effect: apply root effect (If rooted Then anchored = True), increase resistance (b3dSetPhysicsWindResistance(char, 0.9) nearly immune to wind), character anchored (can't be pushed by wind, grounded firmly), remove on status end (b3dSetPhysicsWindResistance(char, 0.0) when root expires). Parameter clamping: resistance < 0.0 clamped to 0.0 (negative values become full wind, no negative resistance), resistance > 1.0 clamped to 1.0 (values above 1 become immunity, no super-resistance), valid range 0.0-1.0 only (ensures physically meaningful resistance, prevents undefined behavior). Wind resistance vs gravity scale: resistance reduces wind force (affects environmental wind only, not gravity), gravity scale multiplies gravity force (affects downward pull only, not wind), independent systems (set resistance for wind, set gravity scale for gravity, both affect velocity separately). Character differentiation: fairy resistance 0.1 (light floaty character, blown easily by wind), human resistance 0.3 (moderate weight, normal wind effect), knight resistance 0.6 (heavy armored character, resistant to wind), golem resistance 0.9 (massive character, nearly immune to wind), creates gameplay variety (different movement feel per character type). Resistance animation: low resistance add sway animation (character leans with wind, visual wind effect), high resistance stable animation (character stands firm, unaffected visually), match resistance to visuals (animation matches physics resistance for consistency). Wind gameplay balance: too low resistance removes player control (character blown uncontrollably, frustrating), too high resistance nullifies wind zones (wind mechanic pointless, no challenge), balance resistance for gameplay (wind affects character but player maintains control). Dynamic resistance: check character state each frame (state = GetCharacterState(char)), adjust resistance based on state (If crouching Then resistance *= 1.5, If jumping Then resistance *= 0.7), state-dependent resistance (crouching more stable, jumping more vulnerable). Resistance and velocity: resistance doesn't affect existing velocity (only affects new wind acceleration, doesn't slow current movement), character with velocity still moves (resistance prevents wind from adding velocity, doesn't remove existing momentum), affects wind contribution only (not gravity, not input, only wind force scaled). Wind resistance persistence: resistance remains until explicitly changed (persistent across frames, not auto-reset), set once per character type (configure resistance on character creation, remains for character lifetime), update for temporary effects (powerups or status change resistance temporarily). Multiple wind sources: resistance affects all wind equally (global wind from b3dSetPhysicsWind scaled by resistance), doesn't differentiate wind types (all environmental wind affected uniformly), single resistance value (not per-wind-source, global character property). Resistance recommendations: light characters 0.0-0.3 (easily affected, floaty gameplay), normal characters 0.3-0.5 (balanced wind effect, moderate gameplay), heavy characters 0.6-0.9 (resistant to wind, stable gameplay), immune characters 1.0 (special cases, powerups, anchored state). Resistance vs wind zones: set resistance per character (character property, independent of zones), wind zones set wind force (environmental property, affects all characters), combine both (character resistance determines how much zone wind affects them), flexible system (same wind zone affects characters differently based on resistance). Visual feedback: low resistance spawn wind effect particles (character visibly buffeted by wind), high resistance minimal wind effects (character unaffected visually), resistance matches visuals (particles and animation match physics resistance). 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 infrequently). Validation: silently returns if characterHandle not found (invalid or freed character), clamps resistance to 0.0-1.0 range (ensures valid resistance, no error for out-of-range), no error messages (silent failure for performance). Related: b3dSetPhysicsWind sets wind force (environmental wind affected by resistance), b3dSetCharacterGravityScale sets gravity scale (similar concept for gravity, multiplies gravity force), b3dCreateCharacterController initializes resistance to 0.0 (default full wind effect), b3dApplyCharacterForce applies custom force (not affected by wind resistance, independent force).