Physicsrapierwrapper

PhysicsRapierWrapper class

Wrapper for the physics engine, currently using Rapier3D

This is the type of the Physics variable in the scripting API

Signature:

export default class PhysicsRapierWrapper extends Object3D 

Extends: Object3D

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PhysicsRapierWrapper class.

Properties

Property

Modifiers

Type

Description

active

boolean

Returns true if the physics engine is active

eventQueue

EventQueue

frame

readonly

number

narrowPhase

NarrowPhase

raycast

(ray: { origin: { x: number; y: number; z: number; }; direction: { x: number; y: number; z: number; }; maxDistance?: number; ignoreRigidbody?: any; filterFlags?: QueryFilterFlags; shouldRaycast?: (collider: RCollider) => boolean; }) => { point: { x: any; y: any; z: any; }; distance: number; triangle: { meshName: any; }; raw: RAPIER.RayColliderToi; hit: unknown; }

Performs a raycast in the physics world and returns information about the hit, if any.

update

(dt: number, time: number) => void

world

World

Current Rapier world instance; cf Rapier docs (opens in a new tab) for more info