Skip to content

RapierPhysics

Extends

Constructors

new RapierPhysics()

new RapierPhysics(app): RapierPhysics

Parameters

app: Application<any>

Returns

RapierPhysics

Overrides

PhysicsBase.constructor

Source

src/physics/rapier/RapierPhysics.ts:15

Properties

_factory

_factory: IPhysicsFactory

Inherited from

PhysicsBase._factory

Source

src/physics/PhysicsBase.ts:7

Accessors

SIFactor

get SIFactor(): number

Returns

number

Source

src/physics/rapier/RapierPhysics.ts:20


add

get add(): IPhysicsAddFactory

Returns

IPhysicsAddFactory

Source

src/physics/PhysicsBase.ts:40


container

set container(value): void

Parameters

value: Container<Application<any>>

Source

src/physics/PhysicsBase.ts:44


debug

get debug(): boolean

set debug(value): void

Parameters

value: boolean

Returns

boolean

Source

src/physics/rapier/RapierPhysics.ts:35


factory

get factory(): IPhysicsFactory

Returns

IPhysicsFactory

Source

src/physics/PhysicsBase.ts:15


world

get world(): World

Returns

World

Source

src/physics/rapier/RapierPhysics.ts:24

Methods

addToWorld()

addToWorld(…objects): void

Parameters

• …objects: (RigidBody | IRapierPhysicsObject)[]

Returns

void

Overrides

PhysicsBase.addToWorld

Source

src/physics/rapier/RapierPhysics.ts:129


createWorldBounds()

createWorldBounds(useStage): void

Parameters

useStage: boolean= true

Returns

void

Source

src/physics/rapier/RapierPhysics.ts:97


destroy()

destroy(): void

Returns

void

Overrides

PhysicsBase.destroy

Source

src/physics/rapier/RapierPhysics.ts:76


drawDebug()

drawDebug(): void

Returns

void

Source

src/physics/rapier/RapierPhysics.ts:143


init()

init(pAutoStart, pDebug, autoCreateBounds, pEngineOptions?): Promise<void>

Initializes the physics engine

Parameters

pAutoStart: boolean= false

pDebug: boolean= false

autoCreateBounds: boolean= true

pEngineOptions?

pEngineOptions.gravity?: Vector2

pEngineOptions.systemOfUnitsFactor?: number

Returns

Promise<void>

Overrides

PhysicsBase.init

Source

src/physics/rapier/RapierPhysics.ts:39


makeWall()

makeWall(def): object

Parameters

def: IRapierWallDefinition

Returns

object

body

body: RigidBody

collider

collider: Collider

definition

definition: IRapierWallDefinition = def

Source

src/physics/rapier/RapierPhysics.ts:84


removeFromWorld()

removeFromWorld(…bodies): void

Parameters

• …bodies: RigidBody[]

Returns

void

Overrides

PhysicsBase.removeFromWorld

Source

src/physics/rapier/RapierPhysics.ts:137


start()

start(): void

Returns

void

Source

src/physics/rapier/RapierPhysics.ts:121


stop()

stop(): void

Returns

void

Source

src/physics/rapier/RapierPhysics.ts:125


update()

update(deltaTime): void

Parameters

deltaTime: number

Returns

void

Overrides

PhysicsBase.update

Source

src/physics/rapier/RapierPhysics.ts:159