Skip to content

@fibbojs / 2d / FCollider

Class: FCollider

A 3d collider.

Constructors

new FCollider()

new FCollider(component, options?): FCollider

Creates a collider for a given component.

Parameters

component: FComponent

The component which the collider will be attached to.

options?: FColliderOptions

The options for the collider.

Returns

FCollider

Example

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

Defined in

2d/src/core/FCollider.ts:56

Properties

collider

collider: Collider

RAPIER Collider

Defined in

2d/src/core/FCollider.ts:23


colliderPositionOffset

colliderPositionOffset: object

Position Offset for the collider. This is used to adjust the collider position relative to the mesh.

x

x: number

y

y: number

Defined in

2d/src/core/FCollider.ts:28


colliderRotationOffset

colliderRotationOffset: number

Rotation Offset for the collider. This is used to adjust the collider position relative to the mesh.

Defined in

2d/src/core/FCollider.ts:33