RealisticModel

@three-blocks/proPresetRealisticSimulationMovement
const RealisticModel = { name: 'realistic', config: { gravity: 32, maxSpeed: 8, groundAccel: 10, airAccel: 0.5, friction: 4.8, stopSpeed: 1,...
Value
{ name: 'realistic', config: { gravity: 32, maxSpeed: 8, groundAccel: 10, airAccel: 0.5, friction: 4.8, stopSpeed: 1, jumpVelocity: 8, groundAngleThreshold: 0.7854, bhopFrictionMultiplier: 0.8, }, isGround( surfaceAngle ) { return surfac...

Realistic Physics Model

Simulation-style physics with:

  • Almost no air control (committed movement)
  • Heavier gravity feel
  • Higher ground friction for immediate stops
  • Lower, more realistic jump height

Best for:

  • Simulation-style games
  • Tactical shooters
  • Games requiring committed movement decisions

Usage

Example
import { Physics, RealisticModel, PresetNames } from '@three-blocks/pro';

// Using the preset name
const physics = new Physics( { physicsModel: PresetNames.REALISTIC } );

// Or using the model directly
const physics = new Physics( {
  physicsModel: 'custom',
  customPhysicsModel: RealisticModel
} );

// Access configuration
console.log( RealisticModel.config.gravity ); // 32 (heavier)
console.log( RealisticModel.config.airAccel ); // 0.5 (minimal air control)

Members

config#

Configuration - Realistic simulation physics

Methods

isGround#

isGround(surfaceAngle : number) : boolean

Determine if surface is walkable ground

Parameters
surfaceAnglenumber
Angle from up vector in radians
Returns
boolean
  • True if walkable ground

groundMove#

groundMove(velocity : THREE.Vector3, wishDir : THREE.Vector3, wishSpeed : number, delta : number, isJumping : boolean)

Ground movement physics Higher friction for immediate stops

Parameters
velocityTHREE.Vector3
Current velocity (modified in place)
wishDirTHREE.Vector3
Input direction
wishSpeednumber
Input magnitude (0-1)
deltanumber
Time step
isJumpingboolean
Whether player is jumping this frame (for bhop friction bypass)

airMove#

airMove(velocity : THREE.Vector3, wishDir : THREE.Vector3, wishSpeed : number, delta : number)

Air movement physics Almost no air control - once you jump, you're committed

Parameters
velocityTHREE.Vector3
Current velocity (modified in place)
wishDirTHREE.Vector3
Input direction
wishSpeednumber
Input magnitude (0-1)
deltanumber
Time step

clipVelocity#

clipVelocity(velocity : THREE.Vector3, normal : THREE.Vector3)

Clip velocity against surface Standard clip without overbounce

Parameters
velocityTHREE.Vector3
Current velocity (modified in place)
normalTHREE.Vector3
Surface normal

jump#

jump(velocity : THREE.Vector3, onGround : boolean) : boolean

Handle jump Lower, more realistic jump

Parameters
velocityTHREE.Vector3
Current velocity (modified in place)
onGroundboolean
Whether player is on ground
Returns
boolean
  • True if jump was executed