Sets physics body surface friction (0.0=ice/frictionless, 0.5=wood, 1.0=rubber, higher=sticky).
Takes bodyHandle (physics body from b3dCreatePhysicsBody), friction (0.0=no friction like ice, 0.5=moderate like wood, 1.0=high like rubber, higher=very sticky).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
bodyHandleInt
frictionDouble
Returns
Void
Quick Summary
Sets physics body surface friction (0.0=ice/frictionless, 0.5=wood, 1.0=rubber, higher=sticky).
Takes bodyHandle (physics body from b3dCreatePhysicsBody), friction (0.0=no friction like ice, 0.5=moderate like wood, 1.0=high like rubber, higher=very sticky).
Returns nothing.
Technical Exegesis...
Sets physics body surface friction (0.0=ice/frictionless, 0.5=wood, 1.0=rubber, higher=sticky). Takes bodyHandle (physics body from b3dCreatePhysicsBody), friction (0.0=no friction like ice, 0.5=moderate like wood, 1.0=high like rubber, higher=very sticky). Returns nothing. Sets Jolt friction property, affects sliding resistance when body contacts surfaces. Controls tangential force during collisions.
This function configures surface friction. Friction values: 0.
Sets physics body surface friction (0.0=ice/frictionless, 0.5=wood, 1.0=rubber, higher=sticky). Takes bodyHandle (physics body from b3dCreatePhysicsBody), friction (0.0=no friction like ice, 0.5=moderate like wood, 1.0=high like rubber, higher=very sticky). Returns nothing. Sets Jolt friction property, affects sliding resistance when body contacts surfaces. Controls tangential force during collisions.
This function configures surface friction. Friction values: 0.0 (frictionless, no sliding resistance, objects slide forever like ice, air hockey table), 0.2 (low friction, smooth surfaces like polished metal, wet surfaces), 0.5 (moderate friction, typical materials like wood on wood, concrete on rubber), 1.0 (high friction, rubber on dry pavement, sandpaper), >1.0 (very sticky, prevents sliding almost entirely, like glue or velcro). Use cases: (1) Material realism (0.0-0.1 for ice, 0.3-0.5 for wood/metal, 0.8-1.0 for rubber), (2) Character control (low friction for slippery surfaces, high for normal walking), (3) Gameplay mechanics (friction zones affect player movement speed), (4) Vehicle physics (tire friction affects grip and turning). Common patterns: ice surface b3dSetPhysicsBodyFriction(ice, 0.05), wooden crate b3dSetPhysicsBodyFriction(crate, 0.4), rubber tire b3dSetPhysicsBodyFriction(tire, 0.9), sticky platform b3dSetPhysicsBodyFriction(platform, 1.5). Typical usage: set after b3dCreatePhysicsBody to define material properties, combine with b3dSetPhysicsBodyRestitution for complete surface definition, adjust dynamically for surface type changes (ice patches, oil slicks). Collision response: when two bodies slide against each other Jolt combines friction (typically multiply or average of both bodies), friction opposes tangential velocity (perpendicular to collision normal), affects both linear motion (sliding resistance) and angular motion (rolling resistance). Physics behavior: high friction prevents sliding (object stops quickly when pushed), low friction allows sliding (object drifts after push), friction independent of contact area (standard Coulomb friction model), applied as constraint during collision solve. Material combinations: tire(0.9) on ice(0.1) might use average or multiply for combined friction (affects grip calculation), allows realistic material interactions (slippery surfaces slow objects less). Static vs dynamic friction: Jolt uses single friction value (simplified model, not separate static/dynamic), approximates both sticking and sliding resistance, sufficient for most game physics. Performance: O(1) operation (simple property set), friction processed during collision solve (minimal overhead per contact pair). Default value: Jolt default friction typically 0.5 (moderate friction unless explicitly set). Friction force calculation: friction force = friction coefficient * normal force (Coulomb friction), prevents acceleration tangent to contact surface, clamped to not exceed applied tangential force (no artificial acceleration). Validation: silently returns if g_physicsSystem not initialized, silently returns if bodyHandle not found in g_bodyHandleToBodyID, no value clamping (negative friction allowed but non-physical). Related: b3dSetPhysicsBodyRestitution sets bounciness (friction affects sliding, restitution affects bouncing), b3dCreatePhysicsBody creates physics body (call this after creation), b3dSetPhysicsBodyVelocity sets velocity (friction opposes tangential velocity).