ArcadeModel
const ArcadeModel = { name: 'arcade', targetFPS: 100, targetTickRate: 600, config: ARCADE_CONFIG, isGround( surfaceAngle ) { return surfa...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) : booleanDetermine if surface is walkable ground (< 45.57 degrees)
Parameters
surfaceAnglenumberAngle 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.Vector3Current velocity (modified in place)
wishDirTHREE.Vector3Input direction
wishSpeednumberInput magnitude (0-1)
deltanumberTime 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.Vector3Current velocity (modified in place)
wishDirTHREE.Vector3Input direction
wishSpeednumberInput magnitude (0-1)
deltanumberTime step
clipVelocity#
clipVelocity(velocity : THREE.Vector3, normal : THREE.Vector3)Clip velocity against surface (project onto surface plane) Called on ANY surface collision
Parameters
velocityTHREE.Vector3Current velocity (modified in place)
normalTHREE.Vector3Surface normal
jump#
jump(velocity : THREE.Vector3, onGround : boolean) : booleanHandle jump
Parameters
velocityTHREE.Vector3Current velocity (modified in place)
onGroundbooleanWhether player is on ground
Returns
boolean — - True if jump was executed