Skip to content

@fibbojs / 3d / 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, z: 0 },
  scale: { x: 1, y: 1, z: 1 },
  rotation: { x: 0, y: 0, z: 0 },
  shape: FShapes.CUBE
})

Defined in

3d/src/core/FRigidBody.ts:72

Properties

collider

collider: FCollider

Fibbo Collider

Defined in

3d/src/core/FRigidBody.ts:41


rigidBody

rigidBody: RigidBody

RAPIER RigidBody

Defined in

3d/src/core/FRigidBody.ts:37