ArcadeModel

@three-blocks/proPresetArcadeMovement
const ArcadeModel = { name: 'arcade', targetFPS: 100, targetTickRate: 600, config: ARCADE_CONFIG, isGround( surfaceAngle ) { return surfa...
Value
{ name: 'arcade', targetFPS: 100, targetTickRate: 600, config: ARCADE_CONFIG, isGround( surfaceAngle ) { return surfaceAngle < this.config.groundAngleThreshold; }, groundMove( velocity, wishDir, wishSpeed, delta ) { pmFriction( velocity,...

Arcade Physics Model

Classic FPS arcade movement with two-state architecture (ground/air). All values in meters - no unit conversion needed.

Key features:

  • Ground threshold: ~45.57 degrees (surfaces steeper = air movement)
  • Air strafe cap: Enables strafe mechanics
  • Strong gravity: 20 m/s² for responsive arcade feel

Usage

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

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

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

// Access configuration (values in meters)
console.log( ArcadeModel.config.gravity ); // 20 m/s²
console.log( ArcadeModel.config.maxSpeed ); // 12 m/s
console.log( ArcadeModel.targetFPS ); // 100 FPS

Members

targetFPS#

Target physics FPS for this model (main loop interval). 100 FPS provides responsive arcade movement feel.

targetTickRate#

Target physics tick rate in Hz. 600 Hz = ~10 substeps per frame at 60 FPS render, prevents tunneling.

config#

Configuration - all values in meters

Methods

isGround#

isGround(surfaceAngle : number) : boolean

Determine if surface is walkable ground (< 45.57 degrees)

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)

Ground movement physics Called when player is on walkable ground (surface angle < 45.57 degrees)

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

airMove#

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

Air movement physics Called when player is NOT on ground (falling, jumping)

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 (project onto surface plane) Called on ANY surface collision

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

jump#

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

Handle jump

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