Skip to content

@fibbojs / 2d / FRigidBody

Class: FRigidBody

A 3d RigidBody.

Constructors

new FRigidBody()

new FRigidBody(component, options?): FRigidBody

Creates a rigid body for the given component.

Parameters

component: FComponent

The component which the collider will be attached to.

options?: FRigidBodyOptions

The options for the rigid body.

Returns

FRigidBody

Example

ts
const rigidBody = new FRigidBody({
  position: { x: 0, y: 0 },
  scale: { x: 1, y: 1 },
  rotation: 0,
  shape: FShapes.CUBE
})

Defined in

2d/src/core/FRigidBody.ts:65

Properties

collider

collider: FCollider

Fibbo Collider

Defined in

2d/src/core/FRigidBody.ts:34


rigidBody

rigidBody: RigidBody

RAPIER RigidBody

Defined in

2d/src/core/FRigidBody.ts:30