---
url: 'https://fibbo.dev/api/2d/index.md'
---
[@fibbojs](/api/index) / 2d
# 2d
## Index
### Classes
#### Camera
- [FAttachedCamera](classes/FAttachedCamera.md)
- [FCamera](classes/FCamera.md)
- [FFixedCamera](classes/FFixedCamera.md)
- [FFreeCamera](classes/FFreeCamera.md)
#### Controller
- [FCharacterController](classes/FCharacterController.md)
- [FCharacterControllerD](classes/FCharacterControllerD.md)
- [FCharacterControllerK](classes/FCharacterControllerK.md)
- [FCharacterControllerKP](classes/FCharacterControllerKP.md)
- [FCharacterControllerKV](classes/FCharacterControllerKV.md)
#### Core
- [FCollider](classes/FCollider.md)
- [FComponent](classes/FComponent.md)
- [FComponentEmpty](classes/FComponentEmpty.md)
- [FRigidBody](classes/FRigidBody.md)
- [FScene](classes/FScene.md)
- [FTransform](classes/FTransform.md)
#### Light
- [FLight](classes/FLight.md)
#### Other
- [FController](classes/FController.md)
#### Polygons
- [FCircle](classes/FCircle.md)
- [FPolygon](classes/FPolygon.md)
- [FRectangle](classes/FRectangle.md)
#### Sprite
- [FSprite](classes/FSprite.md)
### Enumerations
- [FRigidBodyType](enumerations/FRigidBodyType.md)
- [FShapes](enumerations/FShapes.md)
### Interfaces
- [FAttachedCameraOptions](interfaces/FAttachedCameraOptions.md)
- [FCameraOptions](interfaces/FCameraOptions.md)
- [FCharacterControllerOptions](interfaces/FCharacterControllerOptions.md)
- [FColliderOptions](interfaces/FColliderOptions.md)
- [FComponentOptions](interfaces/FComponentOptions.md)
- [FControllerOptions](interfaces/FControllerOptions.md)
- [FLightOptions](interfaces/FLightOptions.md)
- [FPolygonOptions](interfaces/FPolygonOptions.md)
- [FRigidBodyOptions](interfaces/FRigidBodyOptions.md)
- [FSceneOptions](interfaces/FSceneOptions.md)
- [FSpriteOptions](interfaces/FSpriteOptions.md)
- [FTransformOptions](interfaces/FTransformOptions.md)
- [GradientStep](interfaces/GradientStep.md)
---
---
url: 'https://fibbo.dev/api/3d/index.md'
---
[@fibbojs](/api/index) / 3d
# 3d
## Index
### Classes
#### Camera
- [FAttachedCamera](classes/FAttachedCamera.md)
- [FCamera](classes/FCamera.md)
- [FFixedCamera](classes/FFixedCamera.md)
- [FGameCamera](classes/FGameCamera.md)
- [FOrbitCamera](classes/FOrbitCamera.md)
- [FPointerLockCamera](classes/FPointerLockCamera.md)
#### Controller
- [FCharacterController](classes/FCharacterController.md)
- [FCharacterControllerD](classes/FCharacterControllerD.md)
- [FCharacterControllerK](classes/FCharacterControllerK.md)
- [FCharacterControllerKP](classes/FCharacterControllerKP.md)
- [FCharacterControllerKV](classes/FCharacterControllerKV.md)
#### Core
- [FCollider](classes/FCollider.md)
- [FComponent](classes/FComponent.md)
- [FComponentEmpty](classes/FComponentEmpty.md)
- [FRigidBody](classes/FRigidBody.md)
- [FScene](classes/FScene.md)
- [FSensor](classes/FSensor.md)
- [FTransform](classes/FTransform.md)
#### Light
- [FAmbientLight](classes/FAmbientLight.md)
- [FDirectionalLight](classes/FDirectionalLight.md)
- [FHemisphereLight](classes/FHemisphereLight.md)
- [FLight](classes/FLight.md)
- [FLightProbe](classes/FLightProbe.md)
- [FPointLight](classes/FPointLight.md)
- [FSpotLight](classes/FSpotLight.md)
#### Model
- [FFBX](classes/FFBX.md)
- [FGLB](classes/FGLB.md)
- [FGLTF](classes/FGLTF.md)
- [FModel](classes/FModel.md)
- [FOBJ](classes/FOBJ.md)
#### Other
- [FController](classes/FController.md)
#### Polyhedrons
- [FCapsule](classes/FCapsule.md)
- [FCuboid](classes/FCuboid.md)
- [FPolyhedron](classes/FPolyhedron.md)
- [FSphere](classes/FSphere.md)
### Enumerations
- [FRigidBodyType](enumerations/FRigidBodyType.md)
- [FShapes](enumerations/FShapes.md)
### Interfaces
- [FAttachedCameraOptions](interfaces/FAttachedCameraOptions.md)
- [FCameraOptions](interfaces/FCameraOptions.md)
- [FCharacterControllerOptions](interfaces/FCharacterControllerOptions.md)
- [FColliderOptions](interfaces/FColliderOptions.md)
- [FComponentOptions](interfaces/FComponentOptions.md)
- [FControllerOptions](interfaces/FControllerOptions.md)
- [FHemisphereLightOptions](interfaces/FHemisphereLightOptions.md)
- [FLightOptions](interfaces/FLightOptions.md)
- [FLightProbeOptions](interfaces/FLightProbeOptions.md)
- [FModelOptions](interfaces/FModelOptions.md)
- [FPolyhedronOptions](interfaces/FPolyhedronOptions.md)
- [FRigidBodyOptions](interfaces/FRigidBodyOptions.md)
- [FSceneOptions](interfaces/FSceneOptions.md)
- [FSpotLightOptions](interfaces/FSpotLightOptions.md)
- [FTransformOptions](interfaces/FTransformOptions.md)
---
---
url: 'https://fibbo.dev/guide/core/assets.md'
---
# Assets
Assets are files that are included in the final build of your application. They can be sprites or 3D models that you want to include in your application.
Fibbo considers assets are located in the `/assets` URL path of your project. If you're using the starter template (based on Vite), you should put your assets in the `public/assets` folder.
## Where can I find assets ?
Here are some websites where you can find free assets for your projects :
- https://kenney.nl/
- https://www.fab.com
- https://github.com/KhronosGroup/glTF-Sample-Assets
- https://polyhaven.com/
- https://itch.io/game-assets/free
- https://craftpix.net/freebies/
## How can I create my own assets ?
Here are some tools that you can use to create your own assets :
- [Blender](https://www.blender.org/)
- [Aseprite](https://www.aseprite.org/)
- [Spline](https://spline.design/)
- [MagicaVoxel](https://ephtracy.github.io/)
- [GIMP](https://www.gimp.org/)
- [Krita](https://krita.org/)
- [Piskel](https://www.piskelapp.com/)
- [Tiled](https://www.mapeditor.org/)
- [CodeAndWeb Suits](https://www.codeandweb.com/)
- [Goxel](https://goxel.xyz/)
---
---
url: 'https://fibbo.dev/guide/audio/introduction.md'
---
# Audio
Audio is still not supported natively in Fibbo, so for now, you should consider using third-party libraries to manage audio in your Fibbo application.
Here are some libraries that you can use to manage audio on the web :
- [Howler.js](https://github.com/goldfire/howler.js)
- [Tone.js](https://github.com/Tonejs/Tone.js)
- [Pizzicato.js](https://github.com/alemangui/pizzicato)
You can find more libraries on the [awesome-audio](https://github.com/notthetup/awesome-webaudio) list.
---
---
url: 'https://fibbo.dev/guide/core/cameras.md'
---
# Cameras
Cameras are used to render a scene from a specific point of view. They are attached to a scene and are used to render the scene to the screen.
However, they're technically very different in 2D and 3D scenes, so we'll cover them separately.
## 3D Cameras
In 3D scenes, cameras technically exist the same way you would think of a camera in real life. They have a position, a rotation, and a field of view.
Every camera in `@fibbojs/3d` extends the [PerspectiveCamera](https://threejs.org/docs/?q=Persp#api/en/cameras/PerspectiveCamera) class from Three.js.
To learn more about cameras in Three.js, you can check the [Three.js documentation](https://threejs.org/manual/#en/cameras).
## 2D Cameras
In 2D scenes, cameras are a bit different as 2D environments don't have a concept of perspective. Instead, they have a position and a zoom level.
But as the concept of camera is still useful to think about how the scene is rendered, we still have camera classes in `@fibbojs/2d`.
Under the hood, they're just cleverly managing the scene's viewport based on [pixi-viewport](https://github.com/davidfig/pixi-viewport?tab=readme-ov-file).
## Changing the camera of a scene
You can change the camera used to render the scene by setting the `camera` property of the scene.
```typescript
// Attach a camera to the character
scene.camera = new FGameCamera({
target: character,
})
```
## Available cameras
Here are the available cameras in Fibbo :
| Camera | Available in 2D | Available in 3D | Description |
| ------------------ | --------------- | --------------- | ------------------------------------------------------------------------------------------------------ |
| FGameCamera | ❌ | ✅ | A camera that follows a target and can be rotated. Enables a third-person view and locking the cursor. |
| FOrbitCamera | ❌ | ✅ | More raw version of the game camera. |
| FAttachedCamera | ✅ | ✅ | A camera attached to a given target. |
| FFixedCamera | ✅ | ✅ | A fixed camera that doesn't move. |
| FPointerLockCamera | ❌ | ✅ | Similar to the game camera but behaves like a first-person shooter. |
| FFreeCamera | ✅ | ❌ | A camera that can be moved freely in the scene. |
| FCamera | ✅ | ✅ | The base class for all cameras. |
---
---
url: 'https://fibbo.dev/more/recipes/character-controller.md'
---
# Character controller
Fibbo provides default character controller that can be used to control the character in the game. The character controller extends the [`FController`](/api/core/classes/FController) class and provides the following features :
- Gravity
- Movement
- Jumping
## Available character controllers
Here are the available character controllers in Fibbo :
| Controller | Description | Common usage |
| --------------------- | --------------------------------------------------------------------------------------------------------- | ------------ |
| FCharacterControllerD | The "D" stands for dynamic. It it based on a dynamic rigidBody so it is affected by the scene's gravity. | Not recommended as movements do not feel game-like. |
| FCharacterControllerK | The "K" stands for kinematic. It is an abstract controller used for `FCharacterControllerKP` and `FCharacterControllerKV`. | |
| FCharacterControllerKP | The "KP" stands for kinematic position-based. It is based on a kinematic position-based rigidBody, and has its own gravity. | Recommended for most use cases as position-based behavior generally feel more natural to think about. It is also the only controller including rotation movements by default in 3D. |
| FCharacterControllerKV | The "KV" stands for kinematic velocity-based. It is based on a kinematic velocity-based rigidBody, and has its own gravity. | Less recommended but very similar to `FCharacterControllerKP`. |
## Using a character controller
Character controllers should be used the same way as any other controller. Here is an example of how to use the `FCharacterControllerKP` :
::: code-group
```typescript [2d]
import { FCharacterControllerKP, FRectangle } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.addController(new FCharacterControllerKP({
component: rectangle,
}))
```
```typescript [3d]
import { FCapsule, FCharacterControllerKP } from '@fibbojs/3d'
const character = new FCapsule()
character.addController(new FCharacterControllerKP({
component: character,
}))
```
:::
---
---
url: 'https://fibbo.dev/api/2d/classes/FCamera.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCamera
# Class: `abstract` FCamera
The base class for 2D cameras in Fibbo.
## Extends
- `FCamera`
## Extended by
- [`FAttachedCamera`](FAttachedCamera.md)
- [`FFixedCamera`](FFixedCamera.md)
- [`FFreeCamera`](FFreeCamera.md)
## Constructors
### new FCamera()
> **new FCamera**(`options`?): [`FCamera`](FCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FCamera`](FCamera.md)
#### Overrides
`FCameraCore.constructor`
#### Defined in
[2d/src/cameras/FCamera.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L30)
## Methods
### \_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_()
> `abstract` **\_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_**(): `void`
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:49](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L49)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**
• **position.x**: `number`
• **position.y**: `number`
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L59)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L67)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L76)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
`FCameraCore.addController`
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
`FCameraCore.emitCollisionWith`
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FCameraCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
`FCameraCore.frame`
#### Defined in
core/dist/index.d.ts:429
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
`FCameraCore.onCollisionWith`
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FCameraCore.onFrame`
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FCameraCore.onLoaded`
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
`FCameraCore.removeController`
#### Defined in
core/dist/index.d.ts:423
***
### setZoom()
> **setZoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`void`
#### Defined in
[2d/src/cameras/FCamera.ts:51](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L51)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
`FCameraCore.__CALLBACKS_ON_COLLISION__`
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FCameraCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
`FCameraCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
`FCameraCore.__ID__`
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FCameraCore.__IS_2D__`
#### Defined in
[2d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L19)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
`FCameraCore.__IS_3D__`
#### Defined in
core/dist/index.d.ts:383
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
`FCameraCore.controllers`
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Overrides
`FCameraCore.scene`
#### Defined in
[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L21)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
It is used to store the position of the camera.
The scale and rotation of the transform are not used.
#### Defined in
[2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L28)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCamera
# Class: `abstract` FCamera
The base class for 3d cameras in Fibbo.
## Extends
- `FCamera`
## Extended by
- [`FAttachedCamera`](FAttachedCamera.md)
- [`FFixedCamera`](FFixedCamera.md)
- [`FOrbitCamera`](FOrbitCamera.md)
- [`FPointerLockCamera`](FPointerLockCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FCamera()
> **new FCamera**(`options`?): [`FCamera`](FCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FCamera`](FCamera.md)
#### Overrides
`FCameraCore.constructor`
#### Defined in
[3d/src/cameras/FCamera.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L35)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
`FCameraCore.addController`
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
`FCameraCore.emitCollisionWith`
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FCameraCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
`FCameraCore.frame`
#### Defined in
core/dist/index.d.ts:429
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
`FCameraCore.onCollisionWith`
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FCameraCore.onFrame`
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FCameraCore.onLoaded`
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
`FCameraCore.removeController`
#### Defined in
core/dist/index.d.ts:423
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
`FCameraCore.__CALLBACKS_ON_COLLISION__`
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FCameraCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
`FCameraCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
`FCameraCore.__ID__`
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Overrides
`FCameraCore.__IS_2D__`
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FCameraCore.__IS_3D__`
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
`FCameraCore.controllers`
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
`FCameraCore.scene`
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/core/classes/FCamera.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FCamera
# Class: `abstract` FCamera
The base class for cameras in Fibbo.
## Extends
- [`FComponent`](FComponent.md)
## Constructors
### new FCamera()
> **new FCamera**(`options`?): [`FCamera`](FCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FCamera`](FCamera.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[core/src/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FCamera.ts#L13)
## Methods
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: [`FController`](FController.md)
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
[core/src/FComponent.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L100)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: [`FComponent`](FComponent.md)
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
[core/src/FComponent.ts:252](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L252)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
[core/src/FComponent.ts:164](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L164)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[core/src/FComponent.ts:131](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L131)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[core/src/FComponent.ts:202](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L202)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
[core/src/FComponent.ts:149](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L149)
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
[core/src/FComponent.ts:157](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L157)
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: [`FController`](FController.md)
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
[core/src/FComponent.ts:112](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L112)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
[core/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L55)
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] = `[]`
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L44)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]`
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
[core/src/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L49)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L39)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L33)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `false`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
[core/src/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L32)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[core/src/FComponent.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L65)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L60)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCharacterController.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterController
# Class: `abstract` FCharacterController
An abstract pre-defined character controller.
## Extends
- [`FController`](FController.md)
## Extended by
- [`FCharacterControllerD`](FCharacterControllerD.md)
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterController()
> **new FCharacterController**(`options`): [`FCharacterController`](FCharacterController.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterController`](FCharacterController.md)
#### Overrides
[`FController`](FController.md).[`constructor`](FController.md#constructors)
#### Defined in
[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L38)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FController`](FController.md).[`frame`](FController.md#frame)
#### Defined in
core/dist/index.d.ts:32
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FController`](FController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Inherited from
[`FController`](FController.md).[`component`](FController.md#component)
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### down
> **down**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### up
> **up**: `boolean`
#### Defined in
[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L21)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Defined in
[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L36)
***
### speed
> **speed**: `number`
The speed of the character.
#### Defined in
[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L31)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCharacterController.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterController
# Class: `abstract` FCharacterController
An abstract pre-defined character controller.
## Extends
- [`FController`](FController.md)
## Extended by
- [`FCharacterControllerD`](FCharacterControllerD.md)
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterController()
> **new FCharacterController**(`options`): [`FCharacterController`](FCharacterController.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterController`](FCharacterController.md)
#### Overrides
[`FController`](FController.md).[`constructor`](FController.md#constructors)
#### Defined in
[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L41)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FController`](FController.md).[`frame`](FController.md#frame)
#### Defined in
core/dist/index.d.ts:32
***
### getCorrectedRotation()
> **getCorrectedRotation**(): `Quaternion`
Return the corrected rotation for the current frame.
Uses the camera so the character nevers faces the camera.
#### Returns
`Quaternion`
#### Defined in
[3d/src/controllers/FCharacterController.ts:125](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L125)
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FController`](FController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Inherited from
[`FController`](FController.md).[`component`](FController.md#component)
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### backward
> **backward**: `boolean`
#### forward
> **forward**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### Defined in
[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L24)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Defined in
[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L39)
***
### speed
> **speed**: `number`
The speed of the character.
#### Defined in
[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L34)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCharacterControllerK.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerK
# Class: `abstract` FCharacterControllerK
An abstract pre-defined character controller based on Kinematic rigidbodies.
## Extends
- [`FCharacterController`](FCharacterController.md)
## Extended by
- [`FCharacterControllerKP`](FCharacterControllerKP.md)
- [`FCharacterControllerKV`](FCharacterControllerKV.md)
## Constructors
### new FCharacterControllerK()
> **new FCharacterControllerK**(`options`): [`FCharacterControllerK`](FCharacterControllerK.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerK`](FCharacterControllerK.md)
#### Overrides
[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L30)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame)
#### Defined in
core/dist/index.d.ts:32
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `object`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:64](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L64)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L28)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L19)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`component`](FCharacterController.md#component)
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### down
> **down**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### up
> **up**: `boolean`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`inputs`](FCharacterController.md#inputs)
#### Defined in
[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L21)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L24)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene)
#### Defined in
[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L36)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed)
#### Defined in
[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L31)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to simulate gravity.
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L14)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCharacterControllerK.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerK
# Class: `abstract` FCharacterControllerK
An abstract pre-defined character controller based on Kinematic rigidbodies.
## Extends
- [`FCharacterController`](FCharacterController.md)
## Extended by
- [`FCharacterControllerKP`](FCharacterControllerKP.md)
- [`FCharacterControllerKV`](FCharacterControllerKV.md)
## Constructors
### new FCharacterControllerK()
> **new FCharacterControllerK**(`options`): [`FCharacterControllerK`](FCharacterControllerK.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerK`](FCharacterControllerK.md)
#### Overrides
[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L32)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame)
#### Defined in
core/dist/index.d.ts:32
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `FVector3`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`FVector3`
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:66](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L66)
***
### getCorrectedRotation()
> **getCorrectedRotation**(): `Quaternion`
Return the corrected rotation for the current frame.
Uses the camera so the character nevers faces the camera.
#### Returns
`Quaternion`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation)
#### Defined in
[3d/src/controllers/FCharacterController.ts:125](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L125)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L30)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L21)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`component`](FCharacterController.md#component)
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### backward
> **backward**: `boolean`
#### forward
> **forward**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`inputs`](FCharacterController.md#inputs)
#### Defined in
[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L24)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L26)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene)
#### Defined in
[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L39)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed)
#### Defined in
[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L34)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to apply gravity.
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/classes/FComponent.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FComponent
# Class: `abstract` FComponent
The base class for all 2D components in Fibbo.
## Extends
- `FComponent`
## Extended by
- [`FComponentEmpty`](FComponentEmpty.md)
- [`FPolygon`](FPolygon.md)
- [`FSprite`](FSprite.md)
## Constructors
### new FComponent()
> **new FComponent**(`options`?): [`FComponent`](FComponent.md)
#### Parameters
• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md)
The options for the component.
#### Returns
[`FComponent`](FComponent.md)
#### Overrides
`FComponentCore.constructor`
#### Defined in
[2d/src/core/FComponent.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L72)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L268)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
`FComponentCore.addController`
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
`FComponentCore.emitCollisionWith`
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FComponentCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
`FComponentCore.frame`
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L286)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L295)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L304)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Overrides
`FComponentCore.onCollisionWith`
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FComponentCore.onFrame`
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FComponentCore.onLoaded`
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
`FComponentCore.removeController`
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
`FComponentCore.__CALLBACKS_ON_COLLISION__`
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FComponentCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
`FComponentCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\>
PIXI container
#### Defined in
[2d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L43)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
`FComponentCore.__ID__`
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FComponentCore.__IS_2D__`
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
`FComponentCore.__IS_3D__`
#### Defined in
core/dist/index.d.ts:383
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Overrides
`FComponentCore.controllers`
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Overrides
`FComponentCore.scene`
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FComponent.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FComponent
# Class: `abstract` FComponent
The base class for all 3D components in Fibbo.
## Extends
- `FComponent`
## Extended by
- [`FComponentEmpty`](FComponentEmpty.md)
- [`FModel`](FModel.md)
- [`FPolyhedron`](FPolyhedron.md)
## Constructors
### new FComponent()
> **new FComponent**(`options`?): [`FComponent`](FComponent.md)
#### Parameters
• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md)
The options for the component.
#### Returns
[`FComponent`](FComponent.md)
#### Overrides
`FComponentCore.constructor`
#### Defined in
[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L83)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
`FComponentCore.addController`
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
`FComponentCore.emitCollisionWith`
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FComponentCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
`FComponentCore.frame`
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Overrides
`FComponentCore.onCollisionWith`
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FComponentCore.onFrame`
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FComponentCore.onLoaded`
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
`FComponentCore.removeController`
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
`FComponentCore.__CALLBACKS_ON_COLLISION__`
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FComponentCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
`FComponentCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
`FComponentCore.__ID__`
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
`FComponentCore.__IS_2D__`
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FComponentCore.__IS_3D__`
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Overrides
`FComponentCore.controllers`
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Overrides
`FComponentCore.scene`
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/core/classes/FComponent.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FComponent
# Class: `abstract` FComponent
The base class for all 2D and 3D components in Fibbo.
## Extended by
- [`FCamera`](FCamera.md)
## Constructors
### new FComponent()
> **new FComponent**(`options`?): [`FComponent`](FComponent.md)
#### Parameters
• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md)
#### Returns
[`FComponent`](FComponent.md)
#### Defined in
[core/src/FComponent.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L67)
## Methods
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: [`FController`](FController.md)
The controller to add.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L100)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: [`FComponent`](FComponent.md)
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Defined in
[core/src/FComponent.ts:252](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L252)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:164](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L164)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:131](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L131)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Defined in
[core/src/FComponent.ts:202](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L202)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:149](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L149)
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:157](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L157)
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: [`FController`](FController.md)
The controller to remove.
#### Returns
`void`
#### Defined in
[core/src/FComponent.ts:112](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L112)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Defined in
[core/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L55)
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] = `[]`
Callbacks for when a frame is rendered.
#### Defined in
[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L44)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]`
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Defined in
[core/src/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L49)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Defined in
[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L39)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Defined in
[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L33)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `false`
Internal flags
#### Defined in
[core/src/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L32)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Defined in
[core/src/FComponent.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L65)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Defined in
[core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L60)
---
---
url: 'https://fibbo.dev/api/2d/classes/FController.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FController
# Class: `abstract` FController
The base class for 2D controllers in Fibbo.
## Extends
- `FController`
## Extended by
- [`FCharacterController`](FCharacterController.md)
## Constructors
### new FController()
> **new FController**(`options`): [`FController`](FController.md)
#### Parameters
• **options**: [`FControllerOptions`](../interfaces/FControllerOptions.md)
The options for the controller.
#### Returns
[`FController`](FController.md)
#### Overrides
`FControllerCore.constructor`
#### Defined in
[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L23)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
`FControllerCore.frame`
#### Defined in
core/dist/index.d.ts:32
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
`FControllerCore.__RUN_IN_PHYSIC_PIPELINE__`
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Overrides
`FControllerCore.component`
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
---
---
url: 'https://fibbo.dev/api/3d/classes/FController.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FController
# Class: `abstract` FController
The base class for 3D controllers in Fibbo.
## Extends
- `FController`
## Extended by
- [`FCharacterController`](FCharacterController.md)
## Constructors
### new FController()
> **new FController**(`options`): [`FController`](FController.md)
#### Parameters
• **options**: [`FControllerOptions`](../interfaces/FControllerOptions.md)
The options for the controller.
#### Returns
[`FController`](FController.md)
#### Overrides
`FControllerCore.constructor`
#### Defined in
[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L23)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
`FControllerCore.frame`
#### Defined in
core/dist/index.d.ts:32
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
`FControllerCore.__RUN_IN_PHYSIC_PIPELINE__`
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Overrides
`FControllerCore.component`
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
---
---
url: 'https://fibbo.dev/api/core/classes/FController.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FController
# Class: `abstract` FController
The base class for all controllers in Fibbo.
## Constructors
### new FController()
> **new FController**(`options`): [`FController`](FController.md)
#### Parameters
• **options**: [`FControllerOptions`](../interfaces/FControllerOptions.md)
The options for the controller.
#### Returns
[`FController`](FController.md)
#### Defined in
[core/src/FController.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L27)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Defined in
[core/src/FController.ts:37](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L37)
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Defined in
[core/src/FController.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L20)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
#### Defined in
[core/src/FController.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/classes/FLight.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FLight
# Class: `abstract` FLight
The base class for 2d lights in Fibbo.
## Extends
- `FLight`
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `number`
#### Returns
`number`
#### Defined in
[2d/src/lights/FLight.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L106)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Defined in
[2d/src/lights/FLight.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L114)
***
### lookAt
> `get` **lookAt**(): `object`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**
• **lookAt.x**: `number`
• **lookAt.y**: `number`
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Defined in
[2d/src/lights/FLight.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L118)
## Constructors
### new FLight()
> **new FLight**(`options`?): [`FLight`](FLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FLight`](FLight.md)
#### Overrides
`FLightCore.constructor`
#### Defined in
[2d/src/lights/FLight.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L47)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[2d/src/lights/FLight.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L80)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L88)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L96)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FLightCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FLightCore.onLoaded`
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Defined in
[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L28)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
`FLightCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Defined in
[2d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L27)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
#### Defined in
[2d/src/lights/FLight.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L26)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `false`
Internal flags
#### Defined in
[2d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L25)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `any`
The original light object from PIXI.js.
#### Defined in
[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L33)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `object`
Look at target of the light.
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L45)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the light is attached to.
#### Overrides
`FLightCore.scene`
#### Defined in
[2d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L35)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Defined in
[2d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L40)
---
---
url: 'https://fibbo.dev/api/3d/classes/FLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FLight
# Class: `abstract` FLight
The base class for 3d lights in Fibbo.
## Extends
- `FLight`
## Extended by
- [`FAmbientLight`](FAmbientLight.md)
- [`FDirectionalLight`](FDirectionalLight.md)
- [`FHemisphereLight`](FHemisphereLight.md)
- [`FLightProbe`](FLightProbe.md)
- [`FPointLight`](FPointLight.md)
- [`FSpotLight`](FSpotLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FLight()
> **new FLight**(`options`?): [`FLight`](FLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FLight`](FLight.md)
#### Overrides
`FLightCore.constructor`
#### Defined in
[3d/src/lights/FLight.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L57)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
`FLightCore.emitOnLoaded`
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
`FLightCore.onLoaded`
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
`FLightCore.__CALLBACKS_ON_LOADED__`
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Overrides
`FLightCore.scene`
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/core/classes/FLight.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FLight
# Class: `abstract` FLight
The base class for lights in Fibbo.
## Constructors
### new FLight()
> **new FLight**(`options`?): [`FLight`](FLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FLight`](FLight.md)
#### Defined in
[core/src/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L23)
## Methods
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Defined in
[core/src/FLight.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L57)
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Defined in
[core/src/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L50)
## Properties
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]`
Callbacks for when the light is loaded.
#### Defined in
[core/src/FLight.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L16)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the light is attached to.
#### Defined in
[core/src/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L21)
---
---
url: 'https://fibbo.dev/api/3d/classes/FModel.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FModel
# Class: `abstract` FModel
An abstract 3D Model base class.
## Extends
- [`FComponent`](FComponent.md)
## Extended by
- [`FFBX`](FFBX.md)
- [`FGLTF`](FGLTF.md)
- [`FOBJ`](FOBJ.md)
## Constructors
### new FModel()
> **new FModel**(`options`): [`FModel`](FModel.md)
#### Parameters
• **options**: [`FModelOptions`](../interfaces/FModelOptions.md)
The options for the component (inherits from FComponent).
#### Returns
[`FModel`](FModel.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[3d/src/model/FModel.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L57)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### defineMeshTransforms()
> **defineMeshTransforms**(): `void`
Define mesh transforms (used after loading the model).
#### Returns
`void`
#### Defined in
[3d/src/model/FModel.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L108)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
It was overridden to add shadow support.
#### Returns
`void`
#### Overrides
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
[3d/src/model/FModel.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L91)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### loadTextureForMesh()
> **loadTextureForMesh**(`mesh`): `void`
Load the texture for a given mesh.
#### Parameters
• **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
The mesh to load the texture for.
#### Returns
`void`
#### Example
```ts
model.loadTextureFor(mesh)
```
#### Defined in
[3d/src/model/FModel.ts:134](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L134)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### fileExtension
> **fileExtension**: `string`
The file extension of the model.
Default is 'obj'.
#### Defined in
[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L47)
***
### name
> **name**: `string`
The name of the model.
Shouldn't contain file extensions.
#### Defined in
[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L22)
***
### path
> **path**: `string`
The path to the model file.
Will be interpreted as a URL if it starts with http.
Will be interpreted as an absolute path if it starts with /.
Otherwise, it will be treated as a relative path to the models folder.
#### Defined in
[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L30)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### textures
> **textures**: `Record`\<`string`, `string`\>
A record containing texture path for each material.
#### Example
```json
{
"default": "/models/my-model/my-model.png"
}
```
#### Defined in
[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L41)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FPolygon.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FPolygon
# Class: `abstract` FPolygon
A simple polygon in Fibbo.
## Extends
- [`FComponent`](FComponent.md)
## Extended by
- [`FCircle`](FCircle.md)
- [`FRectangle`](FRectangle.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
#### Parameters
• **value**: `number`
#### Returns
`number`
#### Defined in
[2d/src/polygons/FPolygon.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L61)
## Constructors
### new FPolygon()
> **new FPolygon**(`options`?): [`FPolygon`](FPolygon.md)
#### Parameters
• **options?**: [`FPolygonOptions`](../interfaces/FPolygonOptions.md)
#### Returns
[`FPolygon`](FPolygon.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[2d/src/polygons/FPolygon.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L32)
## Methods
### \_\_DRAW\_SHAPE\_\_()
> `abstract` **\_\_DRAW\_SHAPE\_\_**(`graphics`): `void`
Draw the shape of the polygon.
This method should be implemented by the child class.
#### Parameters
• **graphics**: `Graphics`
The PIXI.Graphics object to draw the shape on.
#### Returns
`void`
#### Defined in
[2d/src/polygons/FPolygon.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L57)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[2d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L268)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[2d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L286)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[2d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L295)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[2d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L304)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_?
> `optional` **\_\_COLOR\_\_**: `number`
The color of the polygon.
#### Defined in
[2d/src/polygons/FPolygon.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L23)
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Graphics`
PIXI container
#### Overrides
[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__)
#### Defined in
[2d/src/polygons/FPolygon.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L30)
***
### \_\_GRADIENT\_\_?
> `optional` **\_\_GRADIENT\_\_**: [`GradientStep`](../interfaces/GradientStep.md)[]
The gradient of the polygon.
#### Defined in
[2d/src/polygons/FPolygon.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L27)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FPolyhedron.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FPolyhedron
# Class: `abstract` FPolyhedron
A simple polyhedron model in Fibbo.
Defaults to a cube.
## Extends
- [`FComponent`](FComponent.md)
## Extended by
- [`FCapsule`](FCapsule.md)
- [`FCuboid`](FCuboid.md)
- [`FSphere`](FSphere.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
Change the color of the polyhedron.
#### Example
```ts
cube.color = 0xFF0000
```
#### Parameters
• **value**: `number`
The color of the polyhedron.
#### Returns
`number`
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L60)
## Constructors
### new FPolyhedron()
> **new FPolyhedron**(`options`?): [`FPolyhedron`](FPolyhedron.md)
#### Parameters
• **options?**: [`FPolyhedronOptions`](../interfaces/FPolyhedronOptions.md)
#### Returns
[`FPolyhedron`](FPolyhedron.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L26)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_
> **\_\_COLOR\_\_**: `number`
The color of the polyhedron.
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L18)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_
> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
Mesh is redefined from FComponent without the ? because it is
directly available after the constructor, as a polyhedron is created synchronously.
#### Overrides
[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L24)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/core/classes/FScene.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FScene
# Class: `abstract` FScene
A scene which contains the components, lights and camera.
Also contains the Rapier world if physics is enabled.
## Accessors
### camera
> `get` **camera**(): [`FCamera`](FCamera.md)
The camera of the scene.
> `set` **camera**(`camera`): `void`
The camera of the scene.
#### Parameters
• **camera**: [`FCamera`](FCamera.md)
#### Returns
[`FCamera`](FCamera.md)
#### Defined in
[core/src/FScene.ts:240](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L240)
## Constructors
### new FScene()
> **new FScene**(`options`?): [`FScene`](FScene.md)
#### Parameters
• **options?**: [`FSceneOptions`](../interfaces/FSceneOptions.md)
#### Returns
[`FScene`](FScene.md)
#### Defined in
[core/src/FScene.ts:96](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L96)
## Methods
### addComponent()
> **addComponent**(`component`): `void`
Add a component to the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L166)
***
### addLight()
> **addLight**(`light`): `void`
Add a light to the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:199](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L199)
***
### frame()
> **frame**(`delta`): `void`
Compute a frame with the given delta time.
By default, it is called every frame in the main pipeline, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene.
#### Parameters
• **delta**: `number`
The time in seconds since the last frame.
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L151)
***
### init()
> `abstract` **init**(): `void`
Initialize the scene.
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:139](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L139)
***
### initPhysics()
> `abstract` **initPhysics**(): `Promise`\<`void`\>
Initialize the physics world.
#### Returns
`Promise`\<`void`\>
#### Defined in
[core/src/FScene.ts:144](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L144)
***
### onComponentAdded()
> **onComponentAdded**(`callback`): `void`
Add a callback to be called when a component is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:185](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L185)
***
### onComponentRemoved()
> **onComponentRemoved**(`callback`): `void`
Add a callback to be called when a component is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:192](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L192)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called when a frame is rendered.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L159)
***
### onLightAdded()
> **onLightAdded**(`callback`): `void`
Add a callback to be called when a light is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:218](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L218)
***
### onLightRemoved()
> **onLightRemoved**(`callback`): `void`
Add a callback to be called when a light is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:225](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L225)
***
### onReady()
> **onReady**(`callback`): `void`
Add a callback to be called when the scene is ready.
The scene is ready when the `init` method has finished.
#### Parameters
• **callback**
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:233](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L233)
***
### removeComponent()
> **removeComponent**(`component`): `void`
Remove a component from the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:174](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L174)
***
### removeLight()
> **removeLight**(`light`): `void`
Remove a light from the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Defined in
[core/src/FScene.ts:207](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L207)
## Properties
### \_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[] = `[]`
Callbacks for when a component is added to the scene.
#### Defined in
[core/src/FScene.ts:78](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L78)
***
### \_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[] = `[]`
Callbacks for when a component is removed from the scene.
#### Defined in
[core/src/FScene.ts:82](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L82)
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[] = `[]`
Callbacks for when a frame is rendered.
#### Defined in
[core/src/FScene.ts:74](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L74)
***
### \_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[] = `[]`
Callbacks for when a light is added to the scene.
#### Defined in
[core/src/FScene.ts:90](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L90)
***
### \_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[] = `[]`
Callbacks for when a light is removed from the scene.
#### Defined in
[core/src/FScene.ts:94](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L94)
***
### \_\_CALLBACKS\_ON\_READY\_\_
> **\_\_CALLBACKS\_ON\_READY\_\_**: () => `void`[] = `[]`
Callbacks for when the scene is ready.
#### Defined in
[core/src/FScene.ts:86](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L86)
***
### \_\_CAMERA\_\_?
> `optional` **\_\_CAMERA\_\_**: [`FCamera`](FCamera.md)
The camera of the scene.
#### Defined in
[core/src/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L57)
***
### \_\_DOM\_NODE\_\_
> **\_\_DOM\_NODE\_\_**: `HTMLElement`
DOM element that the renderer will be appended to
#### Defined in
[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L42)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Defined in
[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L26)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `false`
#### Defined in
[core/src/FScene.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L25)
***
### \_\_PHYSIC\_CONTROLLERS\_\_
> **\_\_PHYSIC\_CONTROLLERS\_\_**: [`FController`](FController.md)[] = `[]`
Controllers that will run in the physic pipeline.
#### Defined in
[core/src/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L62)
***
### \_\_PHYSIC\_FRAME\_RATE\_\_
> **\_\_PHYSIC\_FRAME\_RATE\_\_**: `number`
Physic frame rate.
It is stored here as the initialisation of the physics pipeline is handled by child classes.
#### Defined in
[core/src/FScene.ts:37](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L37)
***
### \_\_PIPELINE\_MANAGER\_\_
> **\_\_PIPELINE\_MANAGER\_\_**: [`PipelineManager`](PipelineManager.md)
Pipeline manager that manages the pipelines of the scene.
By default, it contains the main pipeline.
#### Defined in
[core/src/FScene.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L32)
***
### \_\_RAPIER\_TO\_COMPONENT\_\_
> **\_\_RAPIER\_TO\_COMPONENT\_\_**: `Map`\<`number`, [`FComponent`](FComponent.md)\>
#### Defined in
[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L68)
***
### components
> **components**: [`FComponent`](FComponent.md)[]
The components in the scene.
#### Defined in
[core/src/FScene.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L47)
***
### eventQueue
> **eventQueue**: `EventQueue` \| `EventQueue`
#### Defined in
[core/src/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L67)
***
### gravity
> **gravity**: `object` \| `object`
#### Defined in
[core/src/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L65)
***
### lights
> **lights**: [`FLight`](FLight.md)[]
The lights in the scene.
#### Defined in
[core/src/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L52)
***
### world
> **world**: `World` \| `World`
#### Defined in
[core/src/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L66)
---
---
url: 'https://fibbo.dev/api/core/classes/IntervalPipeline.md'
---
[@fibbojs](/api/index) / [core](/api/core) / IntervalPipeline
# Class: `abstract` IntervalPipeline
Unlike the Standard and Throttled pipelines, the Interval pipeline runs at a fixed frame rate.
It relies on [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval) to call the frame method at a fixed interval.
## Extends
- [`Pipeline`](Pipeline.md)
## Constructors
### new IntervalPipeline()
> **new IntervalPipeline**(): [`IntervalPipeline`](IntervalPipeline.md)
#### Returns
[`IntervalPipeline`](IntervalPipeline.md)
#### Overrides
[`Pipeline`](Pipeline.md).[`constructor`](Pipeline.md#constructors)
#### Defined in
[core/src/pipeline/IntervalPipeline.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/IntervalPipeline.ts#L14)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
The frame method is the main method that is called by the pipeline.
It should implement the desired behavior of the pipeline.
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`Pipeline`](Pipeline.md).[`frame`](Pipeline.md#frame)
#### Defined in
[core/src/pipeline/Pipeline.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L40)
***
### start()
> **start**(): `void`
Start the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`start`](Pipeline.md#start)
#### Defined in
[core/src/pipeline/IntervalPipeline.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/IntervalPipeline.ts#L18)
***
### stop()
> **stop**(): `void`
Stop the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`stop`](Pipeline.md#stop)
#### Defined in
[core/src/pipeline/IntervalPipeline.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/IntervalPipeline.ts#L27)
## Properties
### frameRate
> **frameRate**: `number`
The frame rate of the pipeline.
This is the number of frames per second that the pipeline will run at.
e.g. 30 will run the pipeline at 30 frames per second.
The default value is 30.
#### Inherited from
[`Pipeline`](Pipeline.md).[`frameRate`](Pipeline.md#framerate)
#### Defined in
[core/src/pipeline/Pipeline.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L28)
***
### intervalId
> **intervalId**: `Timeout`
The interval ID returned by [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval).
#### Defined in
[core/src/pipeline/IntervalPipeline.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/IntervalPipeline.ts#L12)
***
### state
> **state**: [`PipelineState`](../enumerations/PipelineState.md)
The current state of the pipeline.
#### Inherited from
[`Pipeline`](Pipeline.md).[`state`](Pipeline.md#state)
#### Defined in
[core/src/pipeline/Pipeline.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L21)
---
---
url: 'https://fibbo.dev/api/core/classes/Pipeline.md'
---
[@fibbojs](/api/index) / [core](/api/core) / Pipeline
# Class: `abstract` Pipeline
Pipeline class that helps handling many processes at a time.
## Extended by
- [`IntervalPipeline`](IntervalPipeline.md)
- [`StandardPipeline`](StandardPipeline.md)
- [`ThrottledPipeline`](ThrottledPipeline.md)
## Constructors
### new Pipeline()
> **new Pipeline**(): [`Pipeline`](Pipeline.md)
#### Returns
[`Pipeline`](Pipeline.md)
#### Defined in
[core/src/pipeline/Pipeline.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L30)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
The frame method is the main method that is called by the pipeline.
It should implement the desired behavior of the pipeline.
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Defined in
[core/src/pipeline/Pipeline.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L40)
***
### start()
> `abstract` **start**(): `void`
Start the pipeline
#### Returns
`void`
#### Defined in
[core/src/pipeline/Pipeline.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L45)
***
### stop()
> `abstract` **stop**(): `void`
Stop the pipeline
#### Returns
`void`
#### Defined in
[core/src/pipeline/Pipeline.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L50)
## Properties
### frameRate
> **frameRate**: `number`
The frame rate of the pipeline.
This is the number of frames per second that the pipeline will run at.
e.g. 30 will run the pipeline at 30 frames per second.
The default value is 30.
#### Defined in
[core/src/pipeline/Pipeline.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L28)
***
### state
> **state**: [`PipelineState`](../enumerations/PipelineState.md)
The current state of the pipeline.
#### Defined in
[core/src/pipeline/Pipeline.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L21)
---
---
url: 'https://fibbo.dev/api/core/classes/StandardPipeline.md'
---
[@fibbojs](/api/index) / [core](/api/core) / StandardPipeline
# Class: `abstract` StandardPipeline
A standard pipeline is a pipeline that runs at max FPS, using [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame).
This means that the frame method will be called as fast as possible.
Do not compute heavy tasks using this pipeline, as it will run at max FPS depending on the user's screen refresh rate.
## Extends
- [`Pipeline`](Pipeline.md)
## Constructors
### new StandardPipeline()
> **new StandardPipeline**(): [`StandardPipeline`](StandardPipeline.md)
#### Returns
[`StandardPipeline`](StandardPipeline.md)
#### Overrides
[`Pipeline`](Pipeline.md).[`constructor`](Pipeline.md#constructors)
#### Defined in
[core/src/pipeline/StandardPipeline.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/StandardPipeline.ts#L10)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
The frame method is the main method that is called by the pipeline.
It should implement the desired behavior of the pipeline.
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`Pipeline`](Pipeline.md).[`frame`](Pipeline.md#frame)
#### Defined in
[core/src/pipeline/Pipeline.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L40)
***
### start()
> **start**(): `void`
Start the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`start`](Pipeline.md#start)
#### Defined in
[core/src/pipeline/StandardPipeline.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/StandardPipeline.ts#L14)
***
### stop()
> **stop**(): `void`
Stop the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`stop`](Pipeline.md#stop)
#### Defined in
[core/src/pipeline/StandardPipeline.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/StandardPipeline.ts#L19)
## Properties
### frameRate
> **frameRate**: `number`
The frame rate of the pipeline.
This is the number of frames per second that the pipeline will run at.
e.g. 30 will run the pipeline at 30 frames per second.
The default value is 30.
#### Inherited from
[`Pipeline`](Pipeline.md).[`frameRate`](Pipeline.md#framerate)
#### Defined in
[core/src/pipeline/Pipeline.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L28)
***
### state
> **state**: [`PipelineState`](../enumerations/PipelineState.md)
The current state of the pipeline.
#### Inherited from
[`Pipeline`](Pipeline.md).[`state`](Pipeline.md#state)
#### Defined in
[core/src/pipeline/Pipeline.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L21)
---
---
url: 'https://fibbo.dev/api/core/classes/ThrottledPipeline.md'
---
[@fibbojs](/api/index) / [core](/api/core) / ThrottledPipeline
# Class: `abstract` ThrottledPipeline
A throttled pipeline is similar to a StandardPipeline (also based on [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)), but it only calls the frame method if enough time has passed.
This means the given frameRate is not guaranteed, but it will try to match it as close as possible.
## Extends
- [`Pipeline`](Pipeline.md)
## Constructors
### new ThrottledPipeline()
> **new ThrottledPipeline**(): [`ThrottledPipeline`](ThrottledPipeline.md)
#### Returns
[`ThrottledPipeline`](ThrottledPipeline.md)
#### Overrides
[`Pipeline`](Pipeline.md).[`constructor`](Pipeline.md#constructors)
#### Defined in
[core/src/pipeline/ThrottledPipeline.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/ThrottledPipeline.ts#L15)
## Methods
### frame()
> `abstract` **frame**(`delta`): `void`
The frame method is the main method that is called by the pipeline.
It should implement the desired behavior of the pipeline.
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`Pipeline`](Pipeline.md).[`frame`](Pipeline.md#frame)
#### Defined in
[core/src/pipeline/Pipeline.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L40)
***
### start()
> **start**(): `void`
Start the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`start`](Pipeline.md#start)
#### Defined in
[core/src/pipeline/ThrottledPipeline.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/ThrottledPipeline.ts#L20)
***
### stop()
> **stop**(): `void`
Stop the pipeline
#### Returns
`void`
#### Overrides
[`Pipeline`](Pipeline.md).[`stop`](Pipeline.md#stop)
#### Defined in
[core/src/pipeline/ThrottledPipeline.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/ThrottledPipeline.ts#L25)
## Properties
### frameRate
> **frameRate**: `number`
The frame rate of the pipeline.
This is the number of frames per second that the pipeline will run at.
e.g. 30 will run the pipeline at 30 frames per second.
The default value is 30.
#### Inherited from
[`Pipeline`](Pipeline.md).[`frameRate`](Pipeline.md#framerate)
#### Defined in
[core/src/pipeline/Pipeline.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L28)
***
### lastTime
> **lastTime**: `number`
The last time the frame was called.
This is used to determine if enough time has passed to call the frame method again.
#### Defined in
[core/src/pipeline/ThrottledPipeline.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/ThrottledPipeline.ts#L13)
***
### state
> **state**: [`PipelineState`](../enumerations/PipelineState.md)
The current state of the pipeline.
#### Inherited from
[`Pipeline`](Pipeline.md).[`state`](Pipeline.md#state)
#### Defined in
[core/src/pipeline/Pipeline.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L21)
---
---
url: 'https://fibbo.dev/api/core/classes/FGroup.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FGroup
# Class: ~~`abstract` FGroup~~
The base class for all groups of components in Fibbo.
## Deprecated
Marked as deprecated while we are not sure if we will keep this class.
## Constructors
### new FGroup()
> **new FGroup**(`options`): [`FGroup`](FGroup.md)
Initialize the group with a list of components.
If no components are provided, the group will be empty.
#### Parameters
• **options** = `...`
The options for the group.
• **options.components**: [`FComponent`](FComponent.md)[]
The components to add to the group.
#### Returns
[`FGroup`](FGroup.md)
#### Defined in
[core/src/FGroup.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FGroup.ts#L20)
## Methods
### ~~addComponent()~~
> **addComponent**(`component`): `void`
Add a component to the group.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[core/src/FGroup.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FGroup.ts#L27)
***
### ~~frame()~~
> **frame**(`delta`): `void`
Update all components in the group.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Defined in
[core/src/FGroup.ts:42](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FGroup.ts#L42)
***
### ~~removeComponent()~~
> **removeComponent**(`component`): `void`
Remove a component from the group.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[core/src/FGroup.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FGroup.ts#L34)
## Properties
### ~~components~~
> **components**: [`FComponent`](FComponent.md)[] = `[]`
The components in the group.
#### Defined in
[core/src/FGroup.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FGroup.ts#L12)
---
---
url: 'https://fibbo.dev/api/3d/classes/FAmbientLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FAmbientLight
# Class: FAmbientLight
An ambient light in 3d space.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FAmbientLight()
> **new FAmbientLight**(`options`?): [`FAmbientLight`](FAmbientLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FAmbientLight`](FAmbientLight.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FAmbientLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FAmbientLight.ts#L10)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/util/classes/FAssetUtil.md'
---
[@fibbojs](/api/index) / [util](/api/util) / FAssetUtil
# Class: FAssetUtil
A class that provides asset management utilities.
## Constructors
### new FAssetUtil()
> **new FAssetUtil**(): [`FAssetUtil`](FAssetUtil.md)
#### Returns
[`FAssetUtil`](FAssetUtil.md)
## Methods
### interpretPath()
> `static` **interpretPath**(`path`): `string`
Smartly interpret a path to an asset.
- URL paths are returned as is.
- Absolute paths are interpreted as relative to the origin.
- Relative paths are interpreted as relative to the assets folder.
This method uses the current window location to determine the origin, so it should only be used in a browser environment.
#### Parameters
• **path**: `string`
The path to interpret.
#### Returns
`string`
The interpreted path.
#### Defined in
[util/src/FAssetUtil.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/util/src/FAssetUtil.ts#L22)
## Properties
### \_\_ASSETS\_PATH\_\_
> `static` **\_\_ASSETS\_PATH\_\_**: `string` = `'assets'`
The path to the assets directory.
#### Default
```ts
'assets'
```
#### Defined in
[util/src/FAssetUtil.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/util/src/FAssetUtil.ts#L11)
---
---
url: 'https://fibbo.dev/api/2d/classes/FAttachedCamera.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FAttachedCamera
# Class: FAttachedCamera
A camera attached to a given target.
## Extends
- [`FCamera`](FCamera.md)
## Constructors
### new FAttachedCamera()
> **new FAttachedCamera**(`options`): [`FAttachedCamera`](FAttachedCamera.md)
#### Parameters
• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md)
#### Returns
[`FAttachedCamera`](FAttachedCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[2d/src/cameras/FAttachedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FAttachedCamera.ts#L19)
## Methods
### \_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_()
> **\_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_**(): `void`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`__ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__`](FCamera.md#__on_camera_added_to_scene_please_do_not_call_this_by_hand__)
#### Defined in
[2d/src/cameras/FAttachedCamera.ts:32](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FAttachedCamera.ts#L32)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**
• **position.x**: `number`
• **position.y**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L59)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L67)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[2d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L76)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`_delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
[2d/src/cameras/FAttachedCamera.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FAttachedCamera.ts#L24)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### setZoom()
> **setZoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom)
#### Defined in
[2d/src/cameras/FCamera.ts:51](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L51)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[2d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L19)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L21)
***
### target
> **target**: [`FComponent`](FComponent.md)
The target to follow.
#### Defined in
[2d/src/cameras/FAttachedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FAttachedCamera.ts#L17)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
It is used to store the position of the camera.
The scale and rotation of the transform are not used.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L28)
---
---
url: 'https://fibbo.dev/api/3d/classes/FAttachedCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FAttachedCamera
# Class: FAttachedCamera
A camera that can be attached to a FComponent.
## Example
```ts
import { FAttachedCamera, FCuboid, FScene } from '@fibbojs/3d'
const scene = new FScene()
const cube = new FCuboid()
scene.camera = new FAttachedCamera({
target: cube
})
```
## Extends
- [`FCamera`](FCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Inherited from
[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom)
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FAttachedCamera()
> **new FAttachedCamera**(`options`): [`FAttachedCamera`](FAttachedCamera.md)
#### Parameters
• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md)
Options for the camera
#### Returns
[`FAttachedCamera`](FAttachedCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[3d/src/cameras/FAttachedCamera.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FAttachedCamera.ts#L36)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`_delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
[3d/src/cameras/FAttachedCamera.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FAttachedCamera.ts#L41)
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Inherited from
[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection)
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat)
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Inherited from
[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__)
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### attachedComponent
> **attachedComponent**: [`FComponent`](FComponent.md)
#### Defined in
[3d/src/cameras/FAttachedCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FAttachedCamera.ts#L28)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### offset
> **offset**: `FVector3`
#### Defined in
[3d/src/cameras/FAttachedCamera.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FAttachedCamera.ts#L30)
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCapsule.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCapsule
# Class: FCapsule
A simple capsule model in Fibbo.
## Example
```ts
import { FCapsule } from '@fibbojs/3d'
const capsule = new FCapsule()
```
## Extends
- [`FPolyhedron`](FPolyhedron.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
Change the color of the polyhedron.
#### Example
```ts
cube.color = 0xFF0000
```
#### Parameters
• **value**: `number`
The color of the polyhedron.
#### Returns
`number`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`color`](FPolyhedron.md#color)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L60)
## Constructors
### new FCapsule()
> **new FCapsule**(`options`?): [`FCapsule`](FCapsule.md)
#### Parameters
• **options?**: [`FPolyhedronOptions`](../interfaces/FPolyhedronOptions.md)
#### Returns
[`FCapsule`](FCapsule.md)
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors)
#### Defined in
[3d/src/polyhedrons/FCapsule.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FCapsule.ts#L19)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`addController`](FPolyhedron.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider)
#### Defined in
[3d/src/polyhedrons/FCapsule.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FCapsule.ts#L34)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody)
#### Defined in
[3d/src/polyhedrons/FCapsule.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FCapsule.ts#L41)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor)
#### Defined in
[3d/src/polyhedrons/FCapsule.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FCapsule.ts#L48)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onCollisionWith`](FPolyhedron.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`removeController`](FPolyhedron.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`render`](FPolyhedron.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_
> **\_\_COLOR\_\_**: `number`
The color of the polyhedron.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__COLOR__`](FPolyhedron.md#__color__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L18)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__ID__`](FPolyhedron.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_2D__`](FPolyhedron.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_3D__`](FPolyhedron.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_
> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
Mesh is redefined from FComponent without the ? because it is
directly available after the constructor, as a polyhedron is created synchronously.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L24)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`controllers`](FPolyhedron.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`rigidBody`](FPolyhedron.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`scene`](FPolyhedron.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`sensor`](FPolyhedron.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`transform`](FPolyhedron.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCharacterControllerD.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerD
# Class: FCharacterControllerD
A pre-defined character controller based on a Dynamic RigidBody.
## Example
```ts
import { FCharacterControllerD, FRectangle } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.addController(new FCharacterControllerD())
```
## Extends
- [`FCharacterController`](FCharacterController.md)
## Constructors
### new FCharacterControllerD()
> **new FCharacterControllerD**(`options`): [`FCharacterControllerD`](FCharacterControllerD.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerD`](FCharacterControllerD.md)
#### Overrides
[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors)
#### Defined in
[2d/src/controllers/FCharacterControllerD.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerD.ts#L18)
## Methods
### frame()
> **frame**(`_delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame)
#### Defined in
[2d/src/controllers/FCharacterControllerD.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerD.ts#L36)
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`component`](FCharacterController.md#component)
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### down
> **down**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### up
> **up**: `boolean`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`inputs`](FCharacterController.md#inputs)
#### Defined in
[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L21)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene)
#### Defined in
[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L36)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed)
#### Defined in
[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L31)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCharacterControllerD.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerD
# Class: FCharacterControllerD
A pre-defined character controller based on a Dynamic RigidBody.
## Example
```ts
import { FCapsule, FCharacterControllerD } from '@fibbojs/3d'
const capsule = new FCapsule()
capsule.addController(new FCharacterControllerD())
```
## Extends
- [`FCharacterController`](FCharacterController.md)
## Constructors
### new FCharacterControllerD()
> **new FCharacterControllerD**(`options`): [`FCharacterControllerD`](FCharacterControllerD.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerD`](FCharacterControllerD.md)
#### Overrides
[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors)
#### Defined in
[3d/src/controllers/FCharacterControllerD.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerD.ts#L19)
## Methods
### frame()
> **frame**(`_delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame)
#### Defined in
[3d/src/controllers/FCharacterControllerD.ts:37](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerD.ts#L37)
***
### getCorrectedRotation()
> **getCorrectedRotation**(): `Quaternion`
Return the corrected rotation for the current frame.
Uses the camera so the character nevers faces the camera.
#### Returns
`Quaternion`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation)
#### Defined in
[3d/src/controllers/FCharacterController.ts:125](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L125)
## Properties
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterController.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`component`](FCharacterController.md#component)
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### backward
> **backward**: `boolean`
#### forward
> **forward**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`inputs`](FCharacterController.md#inputs)
#### Defined in
[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L24)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene)
#### Defined in
[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L39)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed)
#### Defined in
[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L34)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCharacterControllerKP.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerKP
# Class: FCharacterControllerKP
A pre-defined character controller based on a Kinematic Position RigidBody.
## Example
```ts
import { FCharacterControllerKP, FRectangle } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.addController(new FCharacterControllerKP())
```
## Extends
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterControllerKP()
> **new FCharacterControllerKP**(`options`): [`FCharacterControllerKP`](FCharacterControllerKP.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerKP`](FCharacterControllerKP.md)
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors)
#### Defined in
[2d/src/controllers/FCharacterControllerKP.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerKP.ts#L17)
## Methods
### frame()
> **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame)
#### Defined in
[2d/src/controllers/FCharacterControllerKP.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerKP.ts#L28)
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `object`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:64](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L64)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__LAST_IS_GROUNDED__`](FCharacterControllerK.md#__last_is_grounded__)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L28)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterControllerK.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`characterController`](FCharacterControllerK.md#charactercontroller)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L19)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`component`](FCharacterControllerK.md#component)
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### down
> **down**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### up
> **up**: `boolean`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`inputs`](FCharacterControllerK.md#inputs)
#### Defined in
[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L21)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`isGrounded`](FCharacterControllerK.md#isgrounded)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L24)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene)
#### Defined in
[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L36)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed)
#### Defined in
[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L31)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to simulate gravity.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L14)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCharacterControllerKP.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerKP
# Class: FCharacterControllerKP
A pre-defined character controller based on a Kinematic Position RigidBody.
## Example
```ts
import { FCapsule, FCharacterControllerKP } from '@fibbojs/3d'
const capsule = new FCapsule()
capsule.addController(new FCharacterControllerKP())
```
## Extends
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterControllerKP()
> **new FCharacterControllerKP**(`options`): [`FCharacterControllerKP`](FCharacterControllerKP.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerKP`](FCharacterControllerKP.md)
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors)
#### Defined in
[3d/src/controllers/FCharacterControllerKP.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerKP.ts#L18)
## Methods
### frame()
> **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame)
#### Defined in
[3d/src/controllers/FCharacterControllerKP.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerKP.ts#L29)
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `FVector3`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`FVector3`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:66](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L66)
***
### getCorrectedRotation()
> **getCorrectedRotation**(): `Quaternion`
Return the corrected rotation for the current frame.
Uses the camera so the character nevers faces the camera.
#### Returns
`Quaternion`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation)
#### Defined in
[3d/src/controllers/FCharacterController.ts:125](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L125)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__LAST_IS_GROUNDED__`](FCharacterControllerK.md#__last_is_grounded__)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L30)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterControllerK.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`characterController`](FCharacterControllerK.md#charactercontroller)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L21)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`component`](FCharacterControllerK.md#component)
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### backward
> **backward**: `boolean`
#### forward
> **forward**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`inputs`](FCharacterControllerK.md#inputs)
#### Defined in
[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L24)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`isGrounded`](FCharacterControllerK.md#isgrounded)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L26)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene)
#### Defined in
[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L39)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed)
#### Defined in
[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L34)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to apply gravity.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCharacterControllerKV.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerKV
# Class: FCharacterControllerKV
A pre-defined character controller based on a Kinematic Velocity RigidBody.
## Example
```ts
import { FCharacterControllerKV, FRectangle } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.addController(new FCharacterControllerKV())
```
## Extends
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterControllerKV()
> **new FCharacterControllerKV**(`options`): [`FCharacterControllerKV`](FCharacterControllerKV.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerKV`](FCharacterControllerKV.md)
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors)
#### Defined in
[2d/src/controllers/FCharacterControllerKV.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerKV.ts#L17)
## Methods
### frame()
> **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame)
#### Defined in
[2d/src/controllers/FCharacterControllerKV.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerKV.ts#L28)
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `object`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:64](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L64)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__LAST_IS_GROUNDED__`](FCharacterControllerK.md#__last_is_grounded__)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L28)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterControllerK.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`characterController`](FCharacterControllerK.md#charactercontroller)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L19)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 2D properties).
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`component`](FCharacterControllerK.md#component)
#### Defined in
[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### down
> **down**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### up
> **up**: `boolean`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`inputs`](FCharacterControllerK.md#inputs)
#### Defined in
[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L21)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`isGrounded`](FCharacterControllerK.md#isgrounded)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L24)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene)
#### Defined in
[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L36)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed)
#### Defined in
[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L31)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to simulate gravity.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity)
#### Defined in
[2d/src/controllers/FCharacterControllerK.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterControllerK.ts#L14)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCharacterControllerKV.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerKV
# Class: FCharacterControllerKV
A pre-defined character controller based on a Kinematic Velocity RigidBody.
## Example
```ts
import { FCapsule, FCharacterControllerKV } from '@fibbojs/3d'
const capsule = new FCapsule()
capsule.addController(new FCharacterControllerKV())
```
## Extends
- [`FCharacterControllerK`](FCharacterControllerK.md)
## Constructors
### new FCharacterControllerKV()
> **new FCharacterControllerKV**(`options`): [`FCharacterControllerKV`](FCharacterControllerKV.md)
#### Parameters
• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md)
#### Returns
[`FCharacterControllerKV`](FCharacterControllerKV.md)
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors)
#### Defined in
[3d/src/controllers/FCharacterControllerKV.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerKV.ts#L18)
## Methods
### frame()
> **frame**(`delta`): `void`
Update the controller. Should be called every frame.
The purpose of this method is to update the component transform based on the controller logic.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Overrides
[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame)
#### Defined in
[3d/src/controllers/FCharacterControllerKV.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerKV.ts#L29)
***
### getCorrectedMovements()
> **getCorrectedMovements**(`delta`): `FVector3`
Return the corrected movements for the current frame.
#### Parameters
• **delta**: `number`
#### Returns
`FVector3`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:66](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L66)
***
### getCorrectedRotation()
> **getCorrectedRotation**(): `Quaternion`
Return the corrected rotation for the current frame.
Uses the camera so the character nevers faces the camera.
#### Returns
`Quaternion`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation)
#### Defined in
[3d/src/controllers/FCharacterController.ts:125](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L125)
## Properties
### \_\_LAST\_IS\_GROUNDED\_\_
> **\_\_LAST\_IS\_GROUNDED\_\_**: `boolean`
Tells if the character was grounded in the last frame.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__LAST_IS_GROUNDED__`](FCharacterControllerK.md#__last_is_grounded__)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L30)
***
### \_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_
> **\_\_RUN\_IN\_PHYSIC\_PIPELINE\_\_**: `boolean`
True if the controller should run in the physic pipeline.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`__RUN_IN_PHYSIC_PIPELINE__`](FCharacterControllerK.md#__run_in_physic_pipeline__)
#### Defined in
core/dist/index.d.ts:20
***
### characterController
> **characterController**: `KinematicCharacterController`
The character controller that will be used to move the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`characterController`](FCharacterControllerK.md#charactercontroller)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L21)
***
### component
> **component**: [`FComponent`](FComponent.md)
The component attached to the controller.
It is redefined here to get the correct type (with 3D properties).
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`component`](FCharacterControllerK.md#component)
#### Defined in
[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L17)
***
### inputs
> **inputs**: `object`
The inputs that will be used to move the character.
#### backward
> **backward**: `boolean`
#### forward
> **forward**: `boolean`
#### left
> **left**: `boolean`
#### right
> **right**: `boolean`
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`inputs`](FCharacterControllerK.md#inputs)
#### Defined in
[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L24)
***
### isGrounded
> **isGrounded**: `boolean`
Tells if the character is grounded.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`isGrounded`](FCharacterControllerK.md#isgrounded)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L26)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene where the character is.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene)
#### Defined in
[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L39)
***
### speed
> **speed**: `number`
The speed of the character.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed)
#### Defined in
[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L34)
***
### yVelocity
> **yVelocity**: `number`
The y velocity of the character. Used to apply gravity.
#### Inherited from
[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity)
#### Defined in
[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterControllerK.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCircle.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCircle
# Class: FCircle
A simple circle in Fibbo.
## Example
```ts
import { FCircle } from '@fibbojs/2d'
const circle = new FCircle()
```
## Extends
- [`FPolygon`](FPolygon.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
#### Parameters
• **value**: `number`
#### Returns
`number`
#### Inherited from
[`FPolygon`](FPolygon.md).[`color`](FPolygon.md#color)
#### Defined in
[2d/src/polygons/FPolygon.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L61)
## Constructors
### new FCircle()
> **new FCircle**(`options`?): [`FCircle`](FCircle.md)
#### Parameters
• **options?**: [`FPolygonOptions`](../interfaces/FPolygonOptions.md)
#### Returns
[`FCircle`](FCircle.md)
#### Overrides
[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors)
#### Defined in
[2d/src/polygons/FCircle.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FCircle.ts#L19)
## Methods
### \_\_DRAW\_SHAPE\_\_()
> **\_\_DRAW\_SHAPE\_\_**(`graphics`): `void`
Draw the shape of the polygon.
This method should be implemented by the child class.
#### Parameters
• **graphics**: `Graphics`
The PIXI.Graphics object to draw the shape on.
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`__DRAW_SHAPE__`](FPolygon.md#__draw_shape__)
#### Defined in
[2d/src/polygons/FCircle.ts:44](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FCircle.ts#L44)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__SET_POSITION__`](FPolygon.md#__set_position__)
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__SET_ROTATION__`](FPolygon.md#__set_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__SET_SCALE__`](FPolygon.md#__set_scale__)
#### Defined in
[2d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L268)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_POSITION__`](FPolygon.md#__update_position__)
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_ROTATION__`](FPolygon.md#__update_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_SCALE__`](FPolygon.md#__update_scale__)
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`addController`](FPolygon.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FPolygon`](FPolygon.md).[`emitCollisionWith`](FPolygon.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`emitOnLoaded`](FPolygon.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`frame`](FPolygon.md#frame)
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider)
#### Defined in
[2d/src/polygons/FCircle.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FCircle.ts#L48)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody)
#### Defined in
[2d/src/polygons/FCircle.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FCircle.ts#L55)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor)
#### Defined in
[2d/src/polygons/FCircle.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FCircle.ts#L62)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FPolygon`](FPolygon.md).[`onCollisionWith`](FPolygon.md#oncollisionwith)
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`onLoaded`](FPolygon.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`removeController`](FPolygon.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`render`](FPolygon.md#render)
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_FRAME__`](FPolygon.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_LOADED__`](FPolygon.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_?
> `optional` **\_\_COLOR\_\_**: `number`
The color of the polygon.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__COLOR__`](FPolygon.md#__color__)
#### Defined in
[2d/src/polygons/FPolygon.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L23)
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Graphics`
PIXI container
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CONTAINER__`](FPolygon.md#__container__)
#### Defined in
[2d/src/polygons/FPolygon.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L30)
***
### \_\_GRADIENT\_\_?
> `optional` **\_\_GRADIENT\_\_**: [`GradientStep`](../interfaces/GradientStep.md)[]
The gradient of the polygon.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__GRADIENT__`](FPolygon.md#__gradient__)
#### Defined in
[2d/src/polygons/FPolygon.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L27)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__ID__`](FPolygon.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FPolygon`](FPolygon.md).[`__IS_2D__`](FPolygon.md#__is_2d__)
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FPolygon`](FPolygon.md).[`__IS_3D__`](FPolygon.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Inherited from
[`FPolygon`](FPolygon.md).[`collider`](FPolygon.md#collider)
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FPolygon`](FPolygon.md).[`controllers`](FPolygon.md#controllers)
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Inherited from
[`FPolygon`](FPolygon.md).[`rigidBody`](FPolygon.md#rigidbody)
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FPolygon`](FPolygon.md).[`scene`](FPolygon.md#scene)
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FPolygon`](FPolygon.md).[`sensor`](FPolygon.md#sensor)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FPolygon`](FPolygon.md).[`transform`](FPolygon.md#transform)
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FCollider.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCollider
# Class: FCollider
A 2d collider that can be attached to a component.
## Example
```ts
import { FCollider } from '@fibbojs/2d'
const collider = new FCollider({
position: { x: 0, y: 0 },
scale: { x: 1, y: 1 },
shape: FShapes.CIRCLE
})
```
## Accessors
### component
> `get` **component**(): [`FComponent`](FComponent.md)
> `set` **component**(`component`): `void`
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
[`FComponent`](FComponent.md)
#### Defined in
[2d/src/core/FCollider.ts:284](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L284)
## Constructors
### new FCollider()
> **new FCollider**(`options`?): [`FCollider`](FCollider.md)
Creates a collider for a given component.
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
The options for the collider.
#### Returns
[`FCollider`](FCollider.md)
#### Defined in
[2d/src/core/FCollider.ts:74](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L74)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
Set the position of the collider.
#### Parameters
• **position**: `FVector2`
The new position of the collider.
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:247](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L247)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
Set the rotation of the collider.
#### Parameters
• **rotation**: `number`
The new rotation of the collider in degrees.
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:256](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L256)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
Set the scale of the collider.
#### Parameters
• **scale**: `FVector2`
The new scale of the collider.
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:265](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L265)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the position update.
This means the new position will be the position of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:166](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L166)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the rotation update.
This means the new rotation will be the rotation of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:195](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L195)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the scale update.
This means the new scale will be the scale of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:221](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L221)
***
### frame()
> **frame**(`_delta`): `void`
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Defined in
[2d/src/core/FCollider.ts:144](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L144)
## Properties
### \_\_COLLIDER\_\_
> **\_\_COLLIDER\_\_**: `Collider`
RAPIER Collider
#### Defined in
[2d/src/core/FCollider.ts:42](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L42)
***
### \_\_COMPONENT\_\_?
> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md)
The component the collider is attached to.
#### Defined in
[2d/src/core/FCollider.ts:46](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L46)
***
### offset
> **offset**: [`FTransform`](FTransform.md)
The transform offset of the collider.
#### Defined in
[2d/src/core/FCollider.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L54)
***
### shape
> **shape**: [`FShapes`](../enumerations/FShapes.md)
The shape of the collider.
#### Defined in
[2d/src/core/FCollider.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L58)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
The transform of the collider.
#### Defined in
[2d/src/core/FCollider.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L50)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCollider.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCollider
# Class: FCollider
A 3d collider that can be attached to a component.
## Example
```ts
import { FCollider } from '@fibbojs/3d'
const collider = new FCollider({
position: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
rotation: { x: 0, y: 0, z: 0 },
shape: FShapes.CUBOID
})
```
## Accessors
### component
> `get` **component**(): [`FComponent`](FComponent.md)
> `set` **component**(`component`): `void`
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
[`FComponent`](FComponent.md)
#### Defined in
[3d/src/core/FCollider.ts:331](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L331)
## Constructors
### new FCollider()
> **new FCollider**(`options`?): [`FCollider`](FCollider.md)
Creates a collider for a given component.
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
The options for the collider.
#### Returns
[`FCollider`](FCollider.md)
#### Defined in
[3d/src/core/FCollider.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L80)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
Set the position of the collider.
#### Parameters
• **position**: `FVector3`
The new position of the collider.
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:284](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L284)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
Set the rotation of the collider.
#### Parameters
• **rotation**: `FVector3`
The new rotation of the collider.
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:293](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L293)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
Set the scale of the collider.
#### Parameters
• **scale**: `FVector3`
The new scale of the collider.
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:302](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L302)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the position update.
This means the new position will be the position of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:197](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L197)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the rotation update.
This means the new rotation will be the rotation of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:227](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L227)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the collider according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the collider won't be considered as the initiator of the scale update.
This means the new scale will be the scale of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:257](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L257)
***
### frame()
> **frame**(`_delta`): `void`
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Defined in
[3d/src/core/FCollider.ts:175](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L175)
## Properties
### \_\_COLLIDER\_\_
> **\_\_COLLIDER\_\_**: `Collider`
RAPIER Collider
#### Defined in
[3d/src/core/FCollider.ts:46](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L46)
***
### \_\_COMPONENT\_\_?
> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md)
The component the collider is attached to.
#### Defined in
[3d/src/core/FCollider.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L50)
***
### offset
> **offset**: [`FTransform`](FTransform.md)
The transform offset of the collider.
#### Defined in
[3d/src/core/FCollider.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L58)
***
### shape
> **shape**: [`FShapes`](../enumerations/FShapes.md)
The shape of the collider.
#### Defined in
[3d/src/core/FCollider.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
The transform of the collider.
#### Defined in
[3d/src/core/FCollider.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L54)
---
---
url: 'https://fibbo.dev/api/2d/classes/FComponentEmpty.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FComponentEmpty
# Class: FComponentEmpty
An empty component. The PIXI container will be empty.
## Extends
- [`FComponent`](FComponent.md)
## Constructors
### new FComponentEmpty()
> **new FComponentEmpty**(`options`?): [`FComponentEmpty`](FComponentEmpty.md)
#### Parameters
• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md)
#### Returns
[`FComponentEmpty`](FComponentEmpty.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[2d/src/core/FComponentEmpty.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponentEmpty.ts#L9)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[2d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L268)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[2d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L286)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[2d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L295)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[2d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L304)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\>
PIXI container
#### Inherited from
[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__)
#### Defined in
[2d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L43)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FComponentEmpty.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FComponentEmpty
# Class: FComponentEmpty
An empty component. No mesh is created.
## Extends
- [`FComponent`](FComponent.md)
## Constructors
### new FComponentEmpty()
> **new FComponentEmpty**(`options`?): [`FComponentEmpty`](FComponentEmpty.md)
#### Parameters
• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md)
#### Returns
[`FComponentEmpty`](FComponentEmpty.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponentEmpty.ts#L10)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FCuboid.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCuboid
# Class: FCuboid
A simple cuboid model in Fibbo.
## Example
```ts
import { FCuboid } from '@fibbojs/3d'
const cube = new FCuboid()
```
## Extends
- [`FPolyhedron`](FPolyhedron.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
Change the color of the polyhedron.
#### Example
```ts
cube.color = 0xFF0000
```
#### Parameters
• **value**: `number`
The color of the polyhedron.
#### Returns
`number`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`color`](FPolyhedron.md#color)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L60)
## Constructors
### new FCuboid()
> **new FCuboid**(`options`?): [`FCuboid`](FCuboid.md)
#### Parameters
• **options?**: [`FPolyhedronOptions`](../interfaces/FPolyhedronOptions.md)
#### Returns
[`FCuboid`](FCuboid.md)
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors)
#### Defined in
[3d/src/polyhedrons/FCuboid.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FCuboid.ts#L15)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`addController`](FPolyhedron.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onCollisionWith`](FPolyhedron.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`removeController`](FPolyhedron.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`render`](FPolyhedron.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_
> **\_\_COLOR\_\_**: `number`
The color of the polyhedron.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__COLOR__`](FPolyhedron.md#__color__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L18)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__ID__`](FPolyhedron.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_2D__`](FPolyhedron.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_3D__`](FPolyhedron.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_
> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
Mesh is redefined from FComponent without the ? because it is
directly available after the constructor, as a polyhedron is created synchronously.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L24)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`controllers`](FPolyhedron.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`rigidBody`](FPolyhedron.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`scene`](FPolyhedron.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`sensor`](FPolyhedron.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`transform`](FPolyhedron.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FDirectionalLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FDirectionalLight
# Class: FDirectionalLight
A directional light in 3d space.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FDirectionalLight()
> **new FDirectionalLight**(`options`?): [`FDirectionalLight`](FDirectionalLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FDirectionalLight`](FDirectionalLight.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FDirectionalLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FDirectionalLight.ts#L10)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/3d/classes/FFBX.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FFBX
# Class: FFBX
A FBX model in Fibbo.
## Example
```ts
import { FFBX } from '@fibbojs/3d'
const fbx = new FFBX({
path: 'model.fbx',
})
```
## Extends
- [`FModel`](FModel.md)
## Constructors
### new FFBX()
> **new FFBX**(`options`): [`FFBX`](FFBX.md)
#### Parameters
• **options**: [`FModelOptions`](../interfaces/FModelOptions.md)
#### Returns
[`FFBX`](FFBX.md)
#### Overrides
[`FModel`](FModel.md).[`constructor`](FModel.md#constructors)
#### Defined in
[3d/src/model/FFBX.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FFBX.ts#L20)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Overrides
[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__)
#### Defined in
[3d/src/model/FFBX.ts:75](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FFBX.ts#L75)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`addController`](FModel.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### defineMeshTransforms()
> **defineMeshTransforms**(): `void`
Define mesh transforms (used after loading the model).
#### Returns
`void`
#### Overrides
[`FModel`](FModel.md).[`defineMeshTransforms`](FModel.md#definemeshtransforms)
#### Defined in
[3d/src/model/FFBX.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FFBX.ts#L62)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FModel`](FModel.md).[`emitCollisionWith`](FModel.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
It was overridden to add shadow support.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`emitOnLoaded`](FModel.md#emitonloaded)
#### Defined in
[3d/src/model/FModel.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L91)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`frame`](FModel.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initCollider`](FModel.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### loadTextureForMesh()
> **loadTextureForMesh**(`mesh`): `void`
Load the texture for a given mesh.
#### Parameters
• **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
The mesh to load the texture for.
#### Returns
`void`
#### Example
```ts
model.loadTextureFor(mesh)
```
#### Inherited from
[`FModel`](FModel.md).[`loadTextureForMesh`](FModel.md#loadtextureformesh)
#### Defined in
[3d/src/model/FModel.ts:134](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L134)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FModel`](FModel.md).[`onCollisionWith`](FModel.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onFrame`](FModel.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onLoaded`](FModel.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`removeController`](FModel.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`render`](FModel.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_LOADED__`](FModel.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FModel`](FModel.md).[`__ID__`](FModel.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FModel`](FModel.md).[`__IS_2D__`](FModel.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FModel`](FModel.md).[`__IS_3D__`](FModel.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FModel`](FModel.md).[`collider`](FModel.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FModel`](FModel.md).[`controllers`](FModel.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### fileExtension
> **fileExtension**: `string`
The file extension of the model.
Default is 'obj'.
#### Inherited from
[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension)
#### Defined in
[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L47)
***
### name
> **name**: `string`
The name of the model.
Shouldn't contain file extensions.
#### Inherited from
[`FModel`](FModel.md).[`name`](FModel.md#name)
#### Defined in
[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L22)
***
### path
> **path**: `string`
The path to the model file.
Will be interpreted as a URL if it starts with http.
Will be interpreted as an absolute path if it starts with /.
Otherwise, it will be treated as a relative path to the models folder.
#### Inherited from
[`FModel`](FModel.md).[`path`](FModel.md#path)
#### Defined in
[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L30)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FModel`](FModel.md).[`rigidBody`](FModel.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FModel`](FModel.md).[`scene`](FModel.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FModel`](FModel.md).[`sensor`](FModel.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### textures
> **textures**: `Record`\<`string`, `string`\>
A record containing texture path for each material.
#### Example
```json
{
"default": "/models/my-model/my-model.png"
}
```
#### Inherited from
[`FModel`](FModel.md).[`textures`](FModel.md#textures)
#### Defined in
[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L41)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FModel`](FModel.md).[`transform`](FModel.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FFixedCamera.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FFixedCamera
# Class: FFixedCamera
A fixed camera.
## Extends
- [`FCamera`](FCamera.md)
## Constructors
### new FFixedCamera()
> **new FFixedCamera**(`options`?): [`FFixedCamera`](FFixedCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FFixedCamera`](FFixedCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[2d/src/cameras/FFixedCamera.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FFixedCamera.ts#L9)
## Methods
### \_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_()
> **\_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_**(): `void`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`__ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__`](FCamera.md#__on_camera_added_to_scene_please_do_not_call_this_by_hand__)
#### Defined in
[2d/src/cameras/FFixedCamera.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FFixedCamera.ts#L13)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**
• **position.x**: `number`
• **position.y**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L59)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L67)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[2d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L76)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
core/dist/index.d.ts:429
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### setZoom()
> **setZoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom)
#### Defined in
[2d/src/cameras/FCamera.ts:51](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L51)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[2d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L19)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L21)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
It is used to store the position of the camera.
The scale and rotation of the transform are not used.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L28)
---
---
url: 'https://fibbo.dev/api/3d/classes/FFixedCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FFixedCamera
# Class: FFixedCamera
A fixed camera that does not move.
## Example
```ts
import { FFixedCamera, FScene } from '@fibbojs/3d'
const scene = new FScene()
scene.camera = new FFixedCamera()
scene.camera.setPosition(0, 5, 5)
scene.camera.lookAt(0, 0, 0)
```
## Extends
- [`FCamera`](FCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Inherited from
[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom)
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FFixedCamera()
> **new FFixedCamera**(`options`?): [`FFixedCamera`](FFixedCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FFixedCamera`](FFixedCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FFixedCamera.ts#L19)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
core/dist/index.d.ts:429
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Inherited from
[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection)
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat)
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Inherited from
[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__)
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/2d/classes/FFreeCamera.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FFreeCamera
# Class: FFreeCamera
A free camera that can be moved around.
## Extends
- [`FCamera`](FCamera.md)
## Constructors
### new FFreeCamera()
> **new FFreeCamera**(`options`?): [`FFreeCamera`](FFreeCamera.md)
#### Parameters
• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md)
#### Returns
[`FFreeCamera`](FFreeCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[2d/src/cameras/FFreeCamera.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FFreeCamera.ts#L9)
## Methods
### \_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_()
> **\_\_ON\_CAMERA\_ADDED\_TO\_SCENE\_PLEASE\_DO\_NOT\_CALL\_THIS\_BY\_HAND\_\_**(): `void`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`__ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__`](FCamera.md#__on_camera_added_to_scene_please_do_not_call_this_by_hand__)
#### Defined in
[2d/src/cameras/FFreeCamera.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FFreeCamera.ts#L13)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**
• **position.x**: `number`
• **position.y**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L59)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L67)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[2d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L76)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
core/dist/index.d.ts:429
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### setZoom()
> **setZoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom)
#### Defined in
[2d/src/cameras/FCamera.ts:51](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L51)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[2d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L19)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L21)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
It is used to store the position of the camera.
The scale and rotation of the transform are not used.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L28)
---
---
url: 'https://fibbo.dev/api/3d/classes/FGameCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FGameCamera
# Class: FGameCamera
A camera that can be attached to a FComponent and orbits around it in a more game-like way.
## Example
```ts
import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d'
const scene = new FScene()
const cube = new FCuboid()
scene.camera = new FGameCamera({
target: cube
})
```
## Extends
- [`FOrbitCamera`](FOrbitCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`zoom`](FOrbitCamera.md#zoom)
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FGameCamera()
> **new FGameCamera**(`options`): [`FGameCamera`](FGameCamera.md)
#### Parameters
• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md)
#### Returns
[`FGameCamera`](FGameCamera.md)
#### Overrides
[`FOrbitCamera`](FOrbitCamera.md).[`constructor`](FOrbitCamera.md#constructors)
#### Defined in
[3d/src/cameras/FGameCamera.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FGameCamera.ts#L29)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_POSITION__`](FOrbitCamera.md#__update_position__)
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_ROTATION__`](FOrbitCamera.md#__update_rotation__)
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_SCALE__`](FOrbitCamera.md#__update_scale__)
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`addController`](FOrbitCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`emitCollisionWith`](FOrbitCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`emitOnLoaded`](FOrbitCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Overrides
[`FOrbitCamera`](FOrbitCamera.md).[`frame`](FOrbitCamera.md#frame)
#### Defined in
[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FGameCamera.ts#L57)
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`getCameraDirection`](FOrbitCamera.md#getcameradirection)
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`lookAt`](FOrbitCamera.md#lookat)
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`onCollisionWith`](FOrbitCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`onFrame`](FOrbitCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`onLoaded`](FOrbitCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`removeController`](FOrbitCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### setPosition()
> **setPosition**(`position`): `void`
Set the position of the camera relative to the attached model.
#### Parameters
• **position**: `FVector3`
The position to set the camera to.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`setPosition`](FOrbitCamera.md#setposition)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:53](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L53)
***
### setZoom()
> **setZoom**(`zoom`): `void`
Set the zoom of the camera.
#### Parameters
• **zoom**: `number`
The zoom level to set the camera to.
#### Returns
`void`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`setZoom`](FOrbitCamera.md#setzoom)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:69](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L69)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_COLLISION__`](FOrbitCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_FRAME__`](FOrbitCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_LOADED__`](FOrbitCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__CAMERA__`](FOrbitCamera.md#__camera__)
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__ID__`](FOrbitCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__IS_2D__`](FOrbitCamera.md#__is_2d__)
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`__IS_3D__`](FOrbitCamera.md#__is_3d__)
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### attachedComponent
> **attachedComponent**: [`FComponent`](FComponent.md)
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`attachedComponent`](FOrbitCamera.md#attachedcomponent)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L26)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`controllers`](FOrbitCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### controls
> **controls**: `OrbitControls`
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`controls`](FOrbitCamera.md#controls)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L28)
***
### isPointerLocked
> **isPointerLocked**: `boolean` = `false`
#### Defined in
[3d/src/cameras/FGameCamera.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FGameCamera.ts#L25)
***
### lastMouseMoveEvent
> **lastMouseMoveEvent**: `MouseEvent`
#### Defined in
[3d/src/cameras/FGameCamera.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FGameCamera.ts#L27)
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`scene`](FOrbitCamera.md#scene)
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Inherited from
[`FOrbitCamera`](FOrbitCamera.md).[`transform`](FOrbitCamera.md#transform)
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/3d/classes/FGLB.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FGLB
# Class: FGLB
A GLB model in Fibbo.
For now, it is just a wrapper around FGLTF as GLB is a binary form of glTF.
## Example
```ts
import { FGLB } from '@fibbojs/3d'
const glb = new FGLB({
path: 'model.glb',
})
```
## Extends
- [`FGLTF`](FGLTF.md)
## Constructors
### new FGLB()
> **new FGLB**(`options`): [`FGLB`](FGLB.md)
#### Parameters
• **options**: [`FModelOptions`](../interfaces/FModelOptions.md)
#### Returns
[`FGLB`](FGLB.md)
#### Overrides
[`FGLTF`](FGLTF.md).[`constructor`](FGLTF.md#constructors)
#### Defined in
[3d/src/model/FGLB.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FGLB.ts#L18)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__SET_POSITION__`](FGLTF.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__SET_ROTATION__`](FGLTF.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__SET_SCALE__`](FGLTF.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__UPDATE_POSITION__`](FGLTF.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__UPDATE_ROTATION__`](FGLTF.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__UPDATE_SCALE__`](FGLTF.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`addController`](FGLTF.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### defineMeshTransforms()
> **defineMeshTransforms**(): `void`
Define mesh transforms (used after loading the model).
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`defineMeshTransforms`](FGLTF.md#definemeshtransforms)
#### Defined in
[3d/src/model/FModel.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L108)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FGLTF`](FGLTF.md).[`emitCollisionWith`](FGLTF.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
It was overridden to add shadow support.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`emitOnLoaded`](FGLTF.md#emitonloaded)
#### Defined in
[3d/src/model/FModel.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L91)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`frame`](FGLTF.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`initCollider`](FGLTF.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`initRigidBody`](FGLTF.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`initSensor`](FGLTF.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### loadTextureForMesh()
> **loadTextureForMesh**(`mesh`): `void`
Load the texture for a given mesh.
#### Parameters
• **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
The mesh to load the texture for.
#### Returns
`void`
#### Example
```ts
model.loadTextureFor(mesh)
```
#### Inherited from
[`FGLTF`](FGLTF.md).[`loadTextureForMesh`](FGLTF.md#loadtextureformesh)
#### Defined in
[3d/src/model/FModel.ts:134](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L134)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FGLTF`](FGLTF.md).[`onCollisionWith`](FGLTF.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`onFrame`](FGLTF.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`onLoaded`](FGLTF.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`removeController`](FGLTF.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FGLTF`](FGLTF.md).[`render`](FGLTF.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_COLLISION__`](FGLTF.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_FRAME__`](FGLTF.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_LOADED__`](FGLTF.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FGLTF`](FGLTF.md).[`__ID__`](FGLTF.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FGLTF`](FGLTF.md).[`__IS_2D__`](FGLTF.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FGLTF`](FGLTF.md).[`__IS_3D__`](FGLTF.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FGLTF`](FGLTF.md).[`__MESH__`](FGLTF.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FGLTF`](FGLTF.md).[`collider`](FGLTF.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FGLTF`](FGLTF.md).[`controllers`](FGLTF.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### fileExtension
> **fileExtension**: `string`
The file extension of the model.
Default is 'obj'.
#### Inherited from
[`FGLTF`](FGLTF.md).[`fileExtension`](FGLTF.md#fileextension)
#### Defined in
[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L47)
***
### name
> **name**: `string`
The name of the model.
Shouldn't contain file extensions.
#### Inherited from
[`FGLTF`](FGLTF.md).[`name`](FGLTF.md#name)
#### Defined in
[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L22)
***
### path
> **path**: `string`
The path to the model file.
Will be interpreted as a URL if it starts with http.
Will be interpreted as an absolute path if it starts with /.
Otherwise, it will be treated as a relative path to the models folder.
#### Inherited from
[`FGLTF`](FGLTF.md).[`path`](FGLTF.md#path)
#### Defined in
[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L30)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FGLTF`](FGLTF.md).[`rigidBody`](FGLTF.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FGLTF`](FGLTF.md).[`scene`](FGLTF.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FGLTF`](FGLTF.md).[`sensor`](FGLTF.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### textures
> **textures**: `Record`\<`string`, `string`\>
A record containing texture path for each material.
#### Example
```json
{
"default": "/models/my-model/my-model.png"
}
```
#### Inherited from
[`FGLTF`](FGLTF.md).[`textures`](FGLTF.md#textures)
#### Defined in
[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L41)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FGLTF`](FGLTF.md).[`transform`](FGLTF.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FGLTF.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FGLTF
# Class: FGLTF
A GLTF model in Fibbo.
## Example
```ts
import { FGLTF } from '@fibbojs/3d'
const gltf = new FGLTF({
path: 'model.glb',
})
```
## Extends
- [`FModel`](FModel.md)
## Extended by
- [`FGLB`](FGLB.md)
## Constructors
### new FGLTF()
> **new FGLTF**(`options`): [`FGLTF`](FGLTF.md)
#### Parameters
• **options**: [`FModelOptions`](../interfaces/FModelOptions.md)
#### Returns
[`FGLTF`](FGLTF.md)
#### Overrides
[`FModel`](FModel.md).[`constructor`](FModel.md#constructors)
#### Defined in
[3d/src/model/FGLTF.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FGLTF.ts#L33)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`addController`](FModel.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### defineMeshTransforms()
> **defineMeshTransforms**(): `void`
Define mesh transforms (used after loading the model).
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`defineMeshTransforms`](FModel.md#definemeshtransforms)
#### Defined in
[3d/src/model/FModel.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L108)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FModel`](FModel.md).[`emitCollisionWith`](FModel.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
It was overridden to add shadow support.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`emitOnLoaded`](FModel.md#emitonloaded)
#### Defined in
[3d/src/model/FModel.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L91)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`frame`](FModel.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initCollider`](FModel.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### loadTextureForMesh()
> **loadTextureForMesh**(`mesh`): `void`
Load the texture for a given mesh.
#### Parameters
• **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
The mesh to load the texture for.
#### Returns
`void`
#### Example
```ts
model.loadTextureFor(mesh)
```
#### Inherited from
[`FModel`](FModel.md).[`loadTextureForMesh`](FModel.md#loadtextureformesh)
#### Defined in
[3d/src/model/FModel.ts:134](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L134)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FModel`](FModel.md).[`onCollisionWith`](FModel.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onFrame`](FModel.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onLoaded`](FModel.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`removeController`](FModel.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`render`](FModel.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_LOADED__`](FModel.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FModel`](FModel.md).[`__ID__`](FModel.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FModel`](FModel.md).[`__IS_2D__`](FModel.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FModel`](FModel.md).[`__IS_3D__`](FModel.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FModel`](FModel.md).[`collider`](FModel.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FModel`](FModel.md).[`controllers`](FModel.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### fileExtension
> **fileExtension**: `string`
The file extension of the model.
Default is 'obj'.
#### Inherited from
[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension)
#### Defined in
[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L47)
***
### name
> **name**: `string`
The name of the model.
Shouldn't contain file extensions.
#### Inherited from
[`FModel`](FModel.md).[`name`](FModel.md#name)
#### Defined in
[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L22)
***
### path
> **path**: `string`
The path to the model file.
Will be interpreted as a URL if it starts with http.
Will be interpreted as an absolute path if it starts with /.
Otherwise, it will be treated as a relative path to the models folder.
#### Inherited from
[`FModel`](FModel.md).[`path`](FModel.md#path)
#### Defined in
[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L30)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FModel`](FModel.md).[`rigidBody`](FModel.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FModel`](FModel.md).[`scene`](FModel.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FModel`](FModel.md).[`sensor`](FModel.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### textures
> **textures**: `Record`\<`string`, `string`\>
A record containing texture path for each material.
#### Example
```json
{
"default": "/models/my-model/my-model.png"
}
```
#### Inherited from
[`FModel`](FModel.md).[`textures`](FModel.md#textures)
#### Defined in
[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L41)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FModel`](FModel.md).[`transform`](FModel.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FHemisphereLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FHemisphereLight
# Class: FHemisphereLight
An hemisphere light in 3d space.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FHemisphereLight()
> **new FHemisphereLight**(`options`?): [`FHemisphereLight`](FHemisphereLight.md)
#### Parameters
• **options?**: [`FHemisphereLightOptions`](../interfaces/FHemisphereLightOptions.md)
#### Returns
[`FHemisphereLight`](FHemisphereLight.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FHemisphereLight.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FHemisphereLight.ts#L15)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/event/classes/FKeyboard.md'
---
[@fibbojs](/api/index) / [event](/api/event) / FKeyboard
# Class: FKeyboard
A helper class to manage keyboard events.
Events will be triggered on each frame.
## Example
```ts
const keyboard = new FKeyboard()
keyboard.on('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
```
## Constructors
### new FKeyboard()
> **new FKeyboard**(`options`?): [`FKeyboard`](FKeyboard.md)
#### Parameters
• **options?**: `FKeyboardOptions`
#### Returns
[`FKeyboard`](FKeyboard.md)
#### Defined in
[event/src/FKeyboard.ts:37](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L37)
## Methods
### clear()
> **clear**(): `void`
Remove all the listeners
#### Returns
`void`
#### Example
```ts
const keyboard = new FKeyboard(scene)
keyboard.on('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
keyboard.clear()
```
#### Defined in
[event/src/FKeyboard.ts:203](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L203)
***
### on()
> **on**(`key`, `callback`): () => `void`
Add a listener to a given key event.
This is a small wrapper around the native `addEventListener` method, which helps listen to key events continuously.
Basically, this prevents keyboard "debounce" delay by firing the given callback on each frame if the key is pressed.
#### Parameters
• **key**: `string`
The key to listen to
• **callback**
The callback to call when the key is pressed
#### Returns
`Function`
The callback function that removes the listener
##### Returns
`void`
#### Examples
```ts
const keyboard = new FKeyboard()
keyboard.on('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
```
```ts
const keyboard = new FKeyboard()
const removeListener = keyboard.on('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
removeListener()
```
#### Defined in
[event/src/FKeyboard.ts:111](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L111)
***
### onKeyDown()
> **onKeyDown**(`key`, `callback`): () => `void`
Add a listener to a given key event when the key is pressed
#### Parameters
• **key**: `string`
The key to listen to
• **callback**
The callback to call when the key is pressed
#### Returns
`Function`
The callback function that removes the listener
##### Returns
`void`
#### Examples
```ts
const keyboard = new FKeyboard()
keyboard.onKeyDown('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
```
```ts
const keyboard = new FKeyboard()
const removeListener = keyboard.onKeyDown('ArrowUp', () => {
console.log('ArrowUp key pressed!')
})
removeListener()
```
#### Defined in
[event/src/FKeyboard.ts:145](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L145)
***
### onKeyUp()
> **onKeyUp**(`key`, `callback`): () => `void`
Add a listener to a given key event when the key is released
#### Parameters
• **key**: `string`
The key to listen to
• **callback**
The callback to call when the key is released
#### Returns
`Function`
The callback function that removes the listener
##### Returns
`void`
#### Examples
```ts
const keyboard = new FKeyboard()
keyboard.onKeyUp('ArrowUp', () => {
console.log('ArrowUp key released!')
})
```
```ts
const keyboard = new FKeyboard()
const removeListener = keyboard.onKeyUp('ArrowUp', () => {
console.log('ArrowUp key released!')
})
removeListener()
```
#### Defined in
[event/src/FKeyboard.ts:179](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L179)
## Properties
### callback
> **callback**: `Record`\<`string`, () => `void`[]\>
An map of all the callbacks for each key being pressed
#### Defined in
[event/src/FKeyboard.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L27)
***
### callbackKeyDown
> **callbackKeyDown**: `Record`\<`string`, () => `void`[]\>
An map of all the callbacks for each key being released
#### Defined in
[event/src/FKeyboard.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L31)
***
### callbackKeyUp
> **callbackKeyUp**: `Record`\<`string`, () => `void`[]\>
An map of all the callbacks for each key being released
#### Defined in
[event/src/FKeyboard.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L35)
***
### keys
> **keys**: `Record`\<`string`, `boolean`\>
A map of all the keys being pressed
#### Defined in
[event/src/FKeyboard.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/event/src/FKeyboard.ts#L23)
---
---
url: 'https://fibbo.dev/api/3d/classes/FLightProbe.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FLightProbe
# Class: FLightProbe
A light probe in 3d space.
Unlike other lights, light probes do not emit light.
Instead they store information about light passing through 3D space.
During rendering, the light that hits a 3D object is approximated by using the data from the light probe.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FLightProbe()
> **new FLightProbe**(`options`?): [`FLightProbe`](FLightProbe.md)
#### Parameters
• **options?**: [`FLightProbeOptions`](../interfaces/FLightProbeOptions.md)
#### Returns
[`FLightProbe`](FLightProbe.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FLightProbe.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLightProbe.ts#L17)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/util/classes/FMathUtil.md'
---
[@fibbojs](/api/index) / [util](/api/util) / FMathUtil
# Class: FMathUtil
A class that provides math utilities.
## Constructors
### new FMathUtil()
> **new FMathUtil**(): [`FMathUtil`](FMathUtil.md)
#### Returns
[`FMathUtil`](FMathUtil.md)
## Methods
### degreeToRad()
> `static` **degreeToRad**(`degree`): `number`
Convert an euler angle to a radian angle.
#### Parameters
• **degree**: `number`
The euler angle to convert.
#### Returns
`number`
The radian angle.
#### Defined in
[util/src/FMathUtil.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/util/src/FMathUtil.ts#L22)
***
### quaternionToRad()
> `static` **quaternionToRad**(`quaternion`): `FVector3`
Convert a value from quaternion to a radian angle.
#### Parameters
• **quaternion**: `FVector4`
The quaternion value to convert.
#### Returns
`FVector3`
The radian angle.
#### Defined in
[util/src/FMathUtil.ts:31](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/util/src/FMathUtil.ts#L31)
***
### radToDegree()
> `static` **radToDegree**(`radian`): `number`
Convert a radian angle to a euler angle.
#### Parameters
• **radian**: `number`
The radian angle to convert.
#### Returns
`number`
The euler angle.
#### Defined in
[util/src/FMathUtil.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/util/src/FMathUtil.ts#L13)
---
---
url: 'https://fibbo.dev/api/3d/classes/FOBJ.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FOBJ
# Class: FOBJ
An OBJ model in Fibbo.
## Example
```ts
import { FOBJ } from '@fibbojs/3d'
const obj = new FOBJ({
path: 'model.obj',
})
```
## Extends
- [`FModel`](FModel.md)
## Constructors
### new FOBJ()
> **new FOBJ**(`options`): [`FOBJ`](FOBJ.md)
#### Parameters
• **options**: [`FModelOptions`](../interfaces/FModelOptions.md)
#### Returns
[`FOBJ`](FOBJ.md)
#### Overrides
[`FModel`](FModel.md).[`constructor`](FModel.md#constructors)
#### Defined in
[3d/src/model/FOBJ.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FOBJ.ts#L19)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`addController`](FModel.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### defineMeshTransforms()
> **defineMeshTransforms**(): `void`
Define mesh transforms (used after loading the model).
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`defineMeshTransforms`](FModel.md#definemeshtransforms)
#### Defined in
[3d/src/model/FModel.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L108)
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FModel`](FModel.md).[`emitCollisionWith`](FModel.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
It was overridden to add shadow support.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`emitOnLoaded`](FModel.md#emitonloaded)
#### Defined in
[3d/src/model/FModel.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L91)
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`frame`](FModel.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initCollider`](FModel.md#initcollider)
#### Defined in
[3d/src/core/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L328)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody)
#### Defined in
[3d/src/core/FComponent.ts:338](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L338)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor)
#### Defined in
[3d/src/core/FComponent.ts:348](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L348)
***
### loadTextureForMesh()
> **loadTextureForMesh**(`mesh`): `void`
Load the texture for a given mesh.
#### Parameters
• **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
The mesh to load the texture for.
#### Returns
`void`
#### Example
```ts
model.loadTextureFor(mesh)
```
#### Inherited from
[`FModel`](FModel.md).[`loadTextureForMesh`](FModel.md#loadtextureformesh)
#### Defined in
[3d/src/model/FModel.ts:134](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L134)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FModel`](FModel.md).[`onCollisionWith`](FModel.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onFrame`](FModel.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`onLoaded`](FModel.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`removeController`](FModel.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FModel`](FModel.md).[`render`](FModel.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FModel`](FModel.md).[`__CALLBACKS_ON_LOADED__`](FModel.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FModel`](FModel.md).[`__ID__`](FModel.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FModel`](FModel.md).[`__IS_2D__`](FModel.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FModel`](FModel.md).[`__IS_3D__`](FModel.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_?
> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
Mesh
#### Inherited from
[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__)
#### Defined in
[3d/src/core/FComponent.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L43)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FModel`](FModel.md).[`collider`](FModel.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FModel`](FModel.md).[`controllers`](FModel.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### fileExtension
> **fileExtension**: `string`
The file extension of the model.
Default is 'obj'.
#### Inherited from
[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension)
#### Defined in
[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L47)
***
### name
> **name**: `string`
The name of the model.
Shouldn't contain file extensions.
#### Inherited from
[`FModel`](FModel.md).[`name`](FModel.md#name)
#### Defined in
[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L22)
***
### path
> **path**: `string`
The path to the model file.
Will be interpreted as a URL if it starts with http.
Will be interpreted as an absolute path if it starts with /.
Otherwise, it will be treated as a relative path to the models folder.
#### Inherited from
[`FModel`](FModel.md).[`path`](FModel.md#path)
#### Defined in
[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L30)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FModel`](FModel.md).[`rigidBody`](FModel.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FModel`](FModel.md).[`scene`](FModel.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FModel`](FModel.md).[`sensor`](FModel.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### textures
> **textures**: `Record`\<`string`, `string`\>
A record containing texture path for each material.
#### Example
```json
{
"default": "/models/my-model/my-model.png"
}
```
#### Inherited from
[`FModel`](FModel.md).[`textures`](FModel.md#textures)
#### Defined in
[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L41)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FModel`](FModel.md).[`transform`](FModel.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FOrbitCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FOrbitCamera
# Class: FOrbitCamera
A camera that can be attached to a FComponent and orbits around it.
## Example
```ts
import { FCuboid, FOrbitCamera, FScene } from '@fibbojs/3d'
const scene = new FScene()
const cube = new FCuboid()
scene.camera = new FOrbitCamera({
target: cube
})
```
## Extends
- [`FCamera`](FCamera.md)
## Extended by
- [`FGameCamera`](FGameCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Inherited from
[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom)
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FOrbitCamera()
> **new FOrbitCamera**(`options`): [`FOrbitCamera`](FOrbitCamera.md)
#### Parameters
• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md)
#### Returns
[`FOrbitCamera`](FOrbitCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L30)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`_delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L38)
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Inherited from
[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection)
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat)
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### setPosition()
> **setPosition**(`position`): `void`
Set the position of the camera relative to the attached model.
#### Parameters
• **position**: `FVector3`
The position to set the camera to.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:53](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L53)
***
### setZoom()
> **setZoom**(`zoom`): `void`
Set the zoom of the camera.
#### Parameters
• **zoom**: `number`
The zoom level to set the camera to.
#### Returns
`void`
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:69](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L69)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Inherited from
[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__)
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### attachedComponent
> **attachedComponent**: [`FComponent`](FComponent.md)
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L26)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### controls
> **controls**: `OrbitControls`
#### Defined in
[3d/src/cameras/FOrbitCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FOrbitCamera.ts#L28)
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/3d/classes/FPointerLockCamera.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FPointerLockCamera
# Class: FPointerLockCamera
A camera that can be attached to a FComponent and uses Pointer Lock controls.
This camera is useful for first-person or immersive experiences where the camera
is locked to the mouse movement and the user can look around freely.
## Example
```ts
import { FCuboid, FPointerLockCamera, FScene } from '@fibbojs/3d'
const scene = new FScene()
const cube = new FCuboid()
scene.camera = new FPointerLockCamera({
target: cube
})
```
## Extends
- [`FCamera`](FCamera.md)
## Accessors
### zoom
> `get` **zoom**(): `number`
> `set` **zoom**(`zoom`): `void`
#### Parameters
• **zoom**: `number`
#### Returns
`number`
#### Inherited from
[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom)
#### Defined in
[3d/src/cameras/FCamera.ts:118](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L118)
## Constructors
### new FPointerLockCamera()
> **new FPointerLockCamera**(`options`): [`FPointerLockCamera`](FPointerLockCamera.md)
#### Parameters
• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md)
#### Returns
[`FPointerLockCamera`](FPointerLockCamera.md)
#### Overrides
[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors)
#### Defined in
[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FPointerLockCamera.ts#L30)
## Methods
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__)
#### Defined in
[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L72)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the camera according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__)
#### Defined in
[3d/src/cameras/FCamera.ts:80](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L80)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the camera according to the transform.
This method should be called after updating the transform properties.
This method does not make sense for cameras, but it is implemented for consistency.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__)
#### Defined in
[3d/src/cameras/FCamera.ts:89](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L89)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`addController`](FCamera.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`_delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Overrides
[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame)
#### Defined in
[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FPointerLockCamera.ts#L45)
***
### getCameraDirection()
> **getCameraDirection**(): `Vector3`
Get the direction of the camera.
This method is useful to get the direction of the camera to apply forces in the direction of the camera.
#### Returns
`Vector3`
The direction of the camera. It is a normalized vector.
#### Inherited from
[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection)
#### Defined in
[3d/src/cameras/FCamera.ts:109](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L109)
***
### lookAt()
> **lookAt**(`target`): `void`
Make the camera look at a target.
#### Parameters
• **target**: `FVector3`
The target to look at.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat)
#### Defined in
[3d/src/cameras/FCamera.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L100)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith)
#### Defined in
core/dist/index.d.ts:476
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FCamera`](FCamera.md).[`removeController`](FCamera.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: `PerspectiveCamera`
Three.js camera object.
#### Inherited from
[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__)
#### Defined in
[3d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L28)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__)
#### Defined in
[3d/src/cameras/FCamera.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L23)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__)
#### Defined in
[3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L22)
***
### attachedComponent
> **attachedComponent**: [`FComponent`](FComponent.md)
#### Defined in
[3d/src/cameras/FPointerLockCamera.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FPointerLockCamera.ts#L26)
***
### controllers
> **controllers**: `FController`[]
The controllers attached to the component.
#### Inherited from
[`FCamera`](FCamera.md).[`controllers`](FCamera.md#controllers)
#### Defined in
core/dist/index.d.ts:412
***
### controls
> **controls**: `PointerLockControls`
#### Defined in
[3d/src/cameras/FPointerLockCamera.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FPointerLockCamera.ts#L28)
***
### scene
> **scene**: `FScene`
The scene the component is attached to.
#### Inherited from
[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene)
#### Defined in
core/dist/index.d.ts:408
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the camera.
#### Inherited from
[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform)
#### Defined in
[3d/src/cameras/FCamera.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L33)
---
---
url: 'https://fibbo.dev/api/3d/classes/FPointLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FPointLight
# Class: FPointLight
A point light in 3d space.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FPointLight()
> **new FPointLight**(`options`?): [`FPointLight`](FPointLight.md)
#### Parameters
• **options?**: [`FLightOptions`](../interfaces/FLightOptions.md)
#### Returns
[`FPointLight`](FPointLight.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FPointLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FPointLight.ts#L10)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/2d/classes/FRectangle.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FRectangle
# Class: FRectangle
A simple square in Fibbo.
## Example
```ts
import { FRectangle } from '@fibbojs/2d'
const square = new FRectangle()
```
## Extends
- [`FPolygon`](FPolygon.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
#### Parameters
• **value**: `number`
#### Returns
`number`
#### Inherited from
[`FPolygon`](FPolygon.md).[`color`](FPolygon.md#color)
#### Defined in
[2d/src/polygons/FPolygon.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L61)
## Constructors
### new FRectangle()
> **new FRectangle**(`options`?): [`FRectangle`](FRectangle.md)
#### Parameters
• **options?**: [`FPolygonOptions`](../interfaces/FPolygonOptions.md)
#### Returns
[`FRectangle`](FRectangle.md)
#### Overrides
[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors)
#### Defined in
[2d/src/polygons/FRectangle.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FRectangle.ts#L17)
## Methods
### \_\_DRAW\_SHAPE\_\_()
> **\_\_DRAW\_SHAPE\_\_**(`graphics`): `void`
Draw the shape of the polygon.
This method should be implemented by the child class.
#### Parameters
• **graphics**: `Graphics`
The PIXI.Graphics object to draw the shape on.
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`__DRAW_SHAPE__`](FPolygon.md#__draw_shape__)
#### Defined in
[2d/src/polygons/FRectangle.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FRectangle.ts#L47)
***
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__SET_POSITION__`](FPolygon.md#__set_position__)
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__SET_ROTATION__`](FPolygon.md#__set_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Overrides
[`FPolygon`](FPolygon.md).[`__SET_SCALE__`](FPolygon.md#__set_scale__)
#### Defined in
[2d/src/polygons/FRectangle.ts:42](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FRectangle.ts#L42)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_POSITION__`](FPolygon.md#__update_position__)
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_ROTATION__`](FPolygon.md#__update_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`__UPDATE_SCALE__`](FPolygon.md#__update_scale__)
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`addController`](FPolygon.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FPolygon`](FPolygon.md).[`emitCollisionWith`](FPolygon.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`emitOnLoaded`](FPolygon.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`frame`](FPolygon.md#frame)
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider)
#### Defined in
[2d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L286)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody)
#### Defined in
[2d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L295)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor)
#### Defined in
[2d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L304)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FPolygon`](FPolygon.md).[`onCollisionWith`](FPolygon.md#oncollisionwith)
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`onLoaded`](FPolygon.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`removeController`](FPolygon.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FPolygon`](FPolygon.md).[`render`](FPolygon.md#render)
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_FRAME__`](FPolygon.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_LOADED__`](FPolygon.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_?
> `optional` **\_\_COLOR\_\_**: `number`
The color of the polygon.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__COLOR__`](FPolygon.md#__color__)
#### Defined in
[2d/src/polygons/FPolygon.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L23)
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Graphics`
PIXI container
#### Inherited from
[`FPolygon`](FPolygon.md).[`__CONTAINER__`](FPolygon.md#__container__)
#### Defined in
[2d/src/polygons/FPolygon.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L30)
***
### \_\_GRADIENT\_\_?
> `optional` **\_\_GRADIENT\_\_**: [`GradientStep`](../interfaces/GradientStep.md)[]
The gradient of the polygon.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__GRADIENT__`](FPolygon.md#__gradient__)
#### Defined in
[2d/src/polygons/FPolygon.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L27)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FPolygon`](FPolygon.md).[`__ID__`](FPolygon.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FPolygon`](FPolygon.md).[`__IS_2D__`](FPolygon.md#__is_2d__)
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FPolygon`](FPolygon.md).[`__IS_3D__`](FPolygon.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Inherited from
[`FPolygon`](FPolygon.md).[`collider`](FPolygon.md#collider)
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FPolygon`](FPolygon.md).[`controllers`](FPolygon.md#controllers)
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Inherited from
[`FPolygon`](FPolygon.md).[`rigidBody`](FPolygon.md#rigidbody)
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FPolygon`](FPolygon.md).[`scene`](FPolygon.md#scene)
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FPolygon`](FPolygon.md).[`sensor`](FPolygon.md#sensor)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FPolygon`](FPolygon.md).[`transform`](FPolygon.md#transform)
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FRigidBody.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FRigidBody
# Class: FRigidBody
A 2d rigidBody that can be attached to a component.
## Example
```ts
import { FRigidBody } from '@fibbojs/2d'
const rigidBody = new FRigidBody({
position: { x: 0, y: 0 },
scale: { x: 1, y: 1 },
shape: 'CUBOID'
})
```
## Accessors
### component
> `get` **component**(): [`FComponent`](FComponent.md)
> `set` **component**(`component`): `void`
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
[`FComponent`](FComponent.md)
#### Defined in
[2d/src/core/FRigidBody.ts:321](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L321)
## Constructors
### new FRigidBody()
> **new FRigidBody**(`options`?): [`FRigidBody`](FRigidBody.md)
Creates a rigidBody for the given component.
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
The options for the rigidBody.
#### Returns
[`FRigidBody`](FRigidBody.md)
#### Defined in
[2d/src/core/FRigidBody.ts:85](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L85)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
Set the position of the rigidBody.
#### Parameters
• **position**: `FVector2`
The new position of the rigidBody.
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:294](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L294)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
Set the rotation of the rigidBody.
#### Parameters
• **rotation**: `number`
The new rotation of the rigidBody.
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L304)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
Set the scale of the rigidBody.
#### Parameters
• **scale**: `FVector2`
The new scale of the rigidBody.
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:314](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L314)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the position update.
This means the new position will be the position of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:213](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L213)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the rotation update.
This means the new rotation will be the rotation of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:242](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L242)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the scale update.
This means the new scale will be the scale of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L268)
***
### frame()
> **frame**(`_delta`): `void`
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:175](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L175)
***
### setAngvel()
> **setAngvel**(`velocity`): `void`
Set the angular velocity of the rigidBody.
#### Parameters
• **velocity**: `number`
The new angular velocity of the rigidBody.
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:202](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L202)
***
### setLinvel()
> **setLinvel**(`velocity`): `void`
Set the linear velocity of the rigidBody.
#### Parameters
• **velocity**: `FVector2`
The new linear velocity of the rigidBody.
#### Returns
`void`
#### Defined in
[2d/src/core/FRigidBody.ts:194](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L194)
## Properties
### \_\_COMPONENT\_\_?
> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md)
The component the rigidBody is attached to.
#### Defined in
[2d/src/core/FRigidBody.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L57)
***
### \_\_RIGIDBODY\_\_
> **\_\_RIGIDBODY\_\_**: `RigidBody`
RAPIER RigidBody
#### Defined in
[2d/src/core/FRigidBody.ts:49](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L49)
***
### collider
> **collider**: [`FCollider`](FCollider.md)
Fibbo Collider
#### Defined in
[2d/src/core/FRigidBody.ts:53](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L53)
***
### offset
> **offset**: [`FTransform`](FTransform.md)
The transform offset of the rigidBody.
#### Defined in
[2d/src/core/FRigidBody.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L65)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
The transform of the rigidBody.
#### Defined in
[2d/src/core/FRigidBody.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L61)
---
---
url: 'https://fibbo.dev/api/3d/classes/FRigidBody.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FRigidBody
# Class: FRigidBody
A 3d rigidBody that can be attached to a component.
## Example
```ts
import { FRigidBody } from '@fibbojs/3d'
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.CUBOID
})
```
## Extended by
- [`FSensor`](FSensor.md)
## Accessors
### component
> `get` **component**(): [`FComponent`](FComponent.md)
> `set` **component**(`component`): `void`
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
[`FComponent`](FComponent.md)
#### Defined in
[3d/src/core/FRigidBody.ts:372](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L372)
## Constructors
### new FRigidBody()
> **new FRigidBody**(`options`?): [`FRigidBody`](FRigidBody.md)
Creates a rigidBody for the given component.
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
The options for the rigidBody.
#### Returns
[`FRigidBody`](FRigidBody.md)
#### Defined in
[3d/src/core/FRigidBody.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L102)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
Set the position of the rigidBody.
#### Parameters
• **position**: `FVector3`
The new position of the rigidBody.
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:334](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L334)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
Set the rotation of the rigidBody.
#### Parameters
• **rotation**: `FVector3`
The new rotation of the rigidBody.
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:344](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L344)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
Set the scale of the rigidBody.
#### Parameters
• **scale**: `FVector3`
The new scale of the rigidBody.
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:354](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L354)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the position update.
This means the new position will be the position of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:247](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L247)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the rotation update.
This means the new rotation will be the rotation of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:277](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L277)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the scale update.
This means the new scale will be the scale of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:307](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L307)
***
### frame()
> **frame**(`_delta`): `void`
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:209](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L209)
***
### setAngvel()
> **setAngvel**(`velocity`): `void`
Set the angular velocity of the rigidBody.
#### Parameters
• **velocity**: `FVector3`
The new angular velocity of the rigidBody.
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:236](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L236)
***
### setLinvel()
> **setLinvel**(`velocity`): `void`
Set the linear velocity of the rigidBody.
#### Parameters
• **velocity**: `FVector3`
The new linear velocity of the rigidBody.
#### Returns
`void`
#### Defined in
[3d/src/core/FRigidBody.ts:228](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L228)
## Properties
### \_\_COMPONENT\_\_?
> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md)
The component the rigidBody is attached to.
#### Defined in
[3d/src/core/FRigidBody.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L67)
***
### \_\_RIGIDBODY\_\_
> **\_\_RIGIDBODY\_\_**: `RigidBody`
RAPIER RigidBody
#### Defined in
[3d/src/core/FRigidBody.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L59)
***
### collider
> **collider**: [`FCollider`](FCollider.md)
Fibbo Collider
#### Defined in
[3d/src/core/FRigidBody.ts:63](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L63)
***
### offset
> **offset**: [`FTransform`](FTransform.md)
The transform offset of the rigidBody.
#### Defined in
[3d/src/core/FRigidBody.ts:75](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L75)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
The transform of the rigidBody.
#### Defined in
[3d/src/core/FRigidBody.ts:71](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L71)
---
---
url: 'https://fibbo.dev/api/2d/classes/FScene.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FScene
# Class: FScene
A scene which contains the components, the Pixi.js scene and the Rapier world.
## Example
```ts
import { FAttachedCamera, FRectangle, FScene } from '@fibbojs/2d'
(async () => {
// Initialize the scene
const scene = new FScene()
await scene.init()
await scene.initPhysics()
// Create a ground
const ground = new FRectangle({
position: { x: 0, y: -0.1 },
scale: { x: 15, y: 0.1 },
color: 0x1F1F1F,
})
ground.initCollider()
// Create a square
const square = new FRectangle()
square.initRigidBody()
// Attach a camera to the square
scene.camera = new FAttachedCamera({ target: square })
})()
```
## Extends
- `FScene`
## Accessors
### camera
> `get` **camera**(): [`FCamera`](FCamera.md)
Getter for the camera.
> `set` **camera**(`camera`): `void`
Setter for the camera.
This is required so when the camera is set, its method to defined the viewport behavior is called.
#### Parameters
• **camera**: [`FCamera`](FCamera.md)
#### Returns
[`FCamera`](FCamera.md)
#### Overrides
`FSceneCore.camera`
#### Defined in
[2d/src/core/FScene.ts:277](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L277)
## Constructors
### new FScene()
> **new FScene**(`options`?): [`FScene`](FScene.md)
#### Parameters
• **options?**: [`FSceneOptions`](../interfaces/FSceneOptions.md)
#### Returns
[`FScene`](FScene.md)
#### Overrides
`FSceneCore.constructor`
#### Defined in
[2d/src/core/FScene.ts:78](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L78)
## Methods
### addCollider()
> **addCollider**(`collider`): `void`
#### Parameters
• **collider**: [`FCollider`](FCollider.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:249](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L249)
***
### addComponent()
> **addComponent**(`component`): `void`
Add a component to the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Overrides
`FSceneCore.addComponent`
#### Defined in
[2d/src/core/FScene.ts:206](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L206)
***
### addHandle()
> **addHandle**(`handle`, `component`): `void`
#### Parameters
• **handle**: `number`
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:198](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L198)
***
### addLight()
> **addLight**(`light`): `void`
Add a light to the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Overrides
`FSceneCore.addLight`
#### Defined in
[2d/src/core/FScene.ts:241](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L241)
***
### addRigidBody()
> **addRigidBody**(`rigidBody`): `void`
#### Parameters
• **rigidBody**: [`FRigidBody`](FRigidBody.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:260](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L260)
***
### frame()
> **frame**(`delta`): `void`
Compute a frame with the given delta time.
By default, it is called every frame in the main pipeline, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene.
#### Parameters
• **delta**: `number`
The time in seconds since the last frame.
#### Returns
`void`
#### Inherited from
`FSceneCore.frame`
#### Defined in
core/dist/index.d.ts:310
***
### handleCollision()
> **handleCollision**(`handle1`, `handle2`, `start`): `void`
Handle a collision event between two colliders.
#### Parameters
• **handle1**: `number`
The handle of the first collider
• **handle2**: `number`
The handle of the second collider
• **start**: `boolean`
If the collision has started or ended
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:174](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L174)
***
### init()
> **init**(): `Promise`\<`void`\>
Initialize the scene.
The application will create a renderer using WebGL, if possible,
with a fallback to a canvas render. It will also setup the ticker
and the root stage PIXI.Container.
#### Returns
`Promise`\<`void`\>
#### Overrides
`FSceneCore.init`
#### Defined in
[2d/src/core/FScene.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L100)
***
### initPhysics()
> **initPhysics**(): `Promise`\<`void`\>
Initialize the physics world.
#### Returns
`Promise`\<`void`\>
#### Overrides
`FSceneCore.initPhysics`
#### Defined in
[2d/src/core/FScene.ts:154](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L154)
***
### onComponentAdded()
> **onComponentAdded**(`callback`): `void`
Add a callback to be called when a component is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onComponentAdded`
#### Defined in
core/dist/index.d.ts:326
***
### onComponentRemoved()
> **onComponentRemoved**(`callback`): `void`
Add a callback to be called when a component is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onComponentRemoved`
#### Defined in
core/dist/index.d.ts:330
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called when a frame is rendered.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onFrame`
#### Defined in
core/dist/index.d.ts:314
***
### onLightAdded()
> **onLightAdded**(`callback`): `void`
Add a callback to be called when a light is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onLightAdded`
#### Defined in
core/dist/index.d.ts:342
***
### onLightRemoved()
> **onLightRemoved**(`callback`): `void`
Add a callback to be called when a light is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onLightRemoved`
#### Defined in
core/dist/index.d.ts:346
***
### onReady()
> **onReady**(`callback`): `void`
Add a callback to be called when the scene is ready.
The scene is ready when the `init` method has finished.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onReady`
#### Defined in
core/dist/index.d.ts:351
***
### removeCollider()
> **removeCollider**(`collider`): `void`
#### Parameters
• **collider**: [`FCollider`](FCollider.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:253](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L253)
***
### removeComponent()
> **removeComponent**(`component`): `void`
Remove a component from the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Overrides
`FSceneCore.removeComponent`
#### Defined in
[2d/src/core/FScene.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L220)
***
### removeHandle()
> **removeHandle**(`handle`): `void`
#### Parameters
• **handle**: `number`
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L202)
***
### removeLight()
> **removeLight**(`light`): `void`
Remove a light from the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Overrides
`FSceneCore.removeLight`
#### Defined in
[2d/src/core/FScene.ts:245](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L245)
***
### removeRigidBody()
> **removeRigidBody**(`rigidBody`): `void`
#### Parameters
• **rigidBody**: [`FRigidBody`](FRigidBody.md)
#### Returns
`void`
#### Defined in
[2d/src/core/FScene.ts:264](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L264)
## Properties
### PIXI
> **PIXI**: `__module`
#### Defined in
[2d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L68)
***
### \_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[]
Callbacks for when a component is added to the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_COMPONENT_ADDED__`
#### Defined in
core/dist/index.d.ts:279
***
### \_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[]
Callbacks for when a component is removed from the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_COMPONENT_REMOVED__`
#### Defined in
core/dist/index.d.ts:283
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:275
***
### \_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[]
Callbacks for when a light is added to the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_LIGHT_ADDED__`
#### Defined in
core/dist/index.d.ts:291
***
### \_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[]
Callbacks for when a light is removed from the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_LIGHT_REMOVED__`
#### Defined in
core/dist/index.d.ts:295
***
### \_\_CALLBACKS\_ON\_READY\_\_
> **\_\_CALLBACKS\_ON\_READY\_\_**: () => `void`[]
Callbacks for when the scene is ready.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_READY__`
#### Defined in
core/dist/index.d.ts:287
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: [`FCamera`](FCamera.md)
The camera of the scene.
#### Overrides
`FSceneCore.__CAMERA__`
#### Defined in
[2d/src/core/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L65)
***
### \_\_DOM\_NODE\_\_
> **\_\_DOM\_NODE\_\_**: `HTMLElement`
DOM element that the renderer will be appended to
#### Inherited from
`FSceneCore.__DOM_NODE__`
#### Defined in
core/dist/index.d.ts:244
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FSceneCore.__IS_2D__`
#### Defined in
[2d/src/core/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L53)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
#### Inherited from
`FSceneCore.__IS_3D__`
#### Defined in
core/dist/index.d.ts:229
***
### \_\_PHYSIC\_CONTROLLERS\_\_
> **\_\_PHYSIC\_CONTROLLERS\_\_**: `FController`[]
Controllers that will run in the physic pipeline.
#### Inherited from
`FSceneCore.__PHYSIC_CONTROLLERS__`
#### Defined in
core/dist/index.d.ts:260
***
### \_\_PHYSIC\_FRAME\_RATE\_\_
> **\_\_PHYSIC\_FRAME\_RATE\_\_**: `number`
Physic frame rate.
It is stored here as the initialisation of the physics pipeline is handled by child classes.
#### Inherited from
`FSceneCore.__PHYSIC_FRAME_RATE__`
#### Defined in
core/dist/index.d.ts:240
***
### \_\_PIPELINE\_MANAGER\_\_
> **\_\_PIPELINE\_MANAGER\_\_**: `PipelineManager`
Pipeline manager that manages the pipelines of the scene.
By default, it contains the main pipeline.
#### Inherited from
`FSceneCore.__PIPELINE_MANAGER__`
#### Defined in
core/dist/index.d.ts:235
***
### \_\_RAPIER\_TO\_COMPONENT\_\_
> **\_\_RAPIER\_TO\_COMPONENT\_\_**: `Map`\<`number`, [`FComponent`](FComponent.md)\>
#### Overrides
`FSceneCore.__RAPIER_TO_COMPONENT__`
#### Defined in
[2d/src/core/FScene.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L76)
***
### app
> **app**: `Application`\<`Renderer`\>
#### Defined in
[2d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L69)
***
### colliders
> **colliders**: [`FCollider`](FCollider.md)[]
#### Defined in
[2d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L60)
***
### components
> **components**: [`FComponent`](FComponent.md)[]
The components in the scene.
#### Overrides
`FSceneCore.components`
#### Defined in
[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L56)
***
### eventQueue
> **eventQueue**: `EventQueue`
#### Overrides
`FSceneCore.eventQueue`
#### Defined in
[2d/src/core/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L75)
***
### gravity
> **gravity**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Overrides
`FSceneCore.gravity`
#### Defined in
[2d/src/core/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L73)
***
### lights
> **lights**: [`FLight`](FLight.md)[]
The lights in the scene.
#### Overrides
`FSceneCore.lights`
#### Defined in
[2d/src/core/FScene.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L58)
***
### rigidBodies
> **rigidBodies**: [`FRigidBody`](FRigidBody.md)[]
#### Defined in
[2d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L62)
***
### viewport
> **viewport**: `Viewport`
#### Defined in
[2d/src/core/FScene.ts:70](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L70)
***
### world
> **world**: `World`
#### Overrides
`FSceneCore.world`
#### Defined in
[2d/src/core/FScene.ts:74](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L74)
---
---
url: 'https://fibbo.dev/api/3d/classes/FScene.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FScene
# Class: FScene
A scene which contains the components, the Three.js scene and the Rapier world.
## Example
```ts
import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d'
(async () => {
// Initialize the scene
const scene = new FScene()
scene.init()
await scene.initPhysics()
// Create a ground
const ground = new FCuboid({
position: { x: 0, y: -0.1, z: 0 },
scale: { x: 15, y: 0.1, z: 15 },
color: 0x1F1F1F,
})
ground.initCollider()
// Create a cube
const cube = new FCuboid()
cube.initRigidBody()
// Attach a camera to the cube
scene.camera = new FGameCamera({ target: cube })
})()
```
## Extends
- `FScene`
## Accessors
### camera
> `get` **camera**(): [`FCamera`](FCamera.md)
The camera of the scene.
> `set` **camera**(`camera`): `void`
The camera of the scene.
#### Parameters
• **camera**: [`FCamera`](FCamera.md)
#### Returns
[`FCamera`](FCamera.md)
#### Overrides
`FSceneCore.camera`
#### Defined in
[3d/src/core/FScene.ts:256](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L256)
## Constructors
### new FScene()
> **new FScene**(`options`?): [`FScene`](FScene.md)
#### Parameters
• **options?**: [`FSceneOptions`](../interfaces/FSceneOptions.md)
#### Returns
[`FScene`](FScene.md)
#### Overrides
`FSceneCore.constructor`
#### Defined in
[3d/src/core/FScene.ts:76](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L76)
## Methods
### addCollider()
> **addCollider**(`collider`): `void`
#### Parameters
• **collider**: [`FCollider`](FCollider.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:233](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L233)
***
### addComponent()
> **addComponent**(`component`): `void`
Add a component to the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Overrides
`FSceneCore.addComponent`
#### Defined in
[3d/src/core/FScene.ts:184](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L184)
***
### addHandle()
> **addHandle**(`handle`, `component`): `void`
#### Parameters
• **handle**: `number`
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:176](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L176)
***
### addLight()
> **addLight**(`light`): `void`
Add a light to the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Overrides
`FSceneCore.addLight`
#### Defined in
[3d/src/core/FScene.ts:221](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L221)
***
### addRigidBody()
> **addRigidBody**(`rigidBody`): `void`
#### Parameters
• **rigidBody**: [`FRigidBody`](FRigidBody.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:244](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L244)
***
### frame()
> **frame**(`delta`): `void`
Compute a frame with the given delta time.
By default, it is called every frame in the main pipeline, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene.
#### Parameters
• **delta**: `number`
The time in seconds since the last frame.
#### Returns
`void`
#### Inherited from
`FSceneCore.frame`
#### Defined in
core/dist/index.d.ts:310
***
### handleCollision()
> **handleCollision**(`handle1`, `handle2`, `start`): `void`
Handle a collision event between two colliders.
#### Parameters
• **handle1**: `number`
The handle of the first collider
• **handle2**: `number`
The handle of the second collider
• **start**: `boolean`
If the collision has started or ended
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:152](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L152)
***
### init()
> **init**(): `void`
Initialize the scene.
#### Returns
`void`
#### Overrides
`FSceneCore.init`
#### Defined in
[3d/src/core/FScene.ts:104](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L104)
***
### initPhysics()
> **initPhysics**(): `Promise`\<`void`\>
Initialize the physics world.
#### Returns
`Promise`\<`void`\>
#### Overrides
`FSceneCore.initPhysics`
#### Defined in
[3d/src/core/FScene.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L132)
***
### onComponentAdded()
> **onComponentAdded**(`callback`): `void`
Add a callback to be called when a component is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onComponentAdded`
#### Defined in
core/dist/index.d.ts:326
***
### onComponentRemoved()
> **onComponentRemoved**(`callback`): `void`
Add a callback to be called when a component is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onComponentRemoved`
#### Defined in
core/dist/index.d.ts:330
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called when a frame is rendered.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onFrame`
#### Defined in
core/dist/index.d.ts:314
***
### onLightAdded()
> **onLightAdded**(`callback`): `void`
Add a callback to be called when a light is added to the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onLightAdded`
#### Defined in
core/dist/index.d.ts:342
***
### onLightRemoved()
> **onLightRemoved**(`callback`): `void`
Add a callback to be called when a light is removed from the scene.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onLightRemoved`
#### Defined in
core/dist/index.d.ts:346
***
### onReady()
> **onReady**(`callback`): `void`
Add a callback to be called when the scene is ready.
The scene is ready when the `init` method has finished.
#### Parameters
• **callback**
#### Returns
`void`
#### Inherited from
`FSceneCore.onReady`
#### Defined in
core/dist/index.d.ts:351
***
### removeCollider()
> **removeCollider**(`collider`): `void`
#### Parameters
• **collider**: [`FCollider`](FCollider.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:237](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L237)
***
### removeComponent()
> **removeComponent**(`component`): `void`
Remove a component from the scene.
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
`void`
#### Overrides
`FSceneCore.removeComponent`
#### Defined in
[3d/src/core/FScene.ts:199](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L199)
***
### removeHandle()
> **removeHandle**(`handle`): `void`
#### Parameters
• **handle**: `number`
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L180)
***
### removeLight()
> **removeLight**(`light`): `void`
Remove a light from the scene.
#### Parameters
• **light**: [`FLight`](FLight.md)
#### Returns
`void`
#### Overrides
`FSceneCore.removeLight`
#### Defined in
[3d/src/core/FScene.ts:227](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L227)
***
### removeRigidBody()
> **removeRigidBody**(`rigidBody`): `void`
#### Parameters
• **rigidBody**: [`FRigidBody`](FRigidBody.md)
#### Returns
`void`
#### Defined in
[3d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L248)
## Properties
### THREE
> **THREE**: `__module`
#### Defined in
[3d/src/core/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L65)
***
### \_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[]
Callbacks for when a component is added to the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_COMPONENT_ADDED__`
#### Defined in
core/dist/index.d.ts:279
***
### \_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[]
Callbacks for when a component is removed from the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_COMPONENT_REMOVED__`
#### Defined in
core/dist/index.d.ts:283
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_FRAME__`
#### Defined in
core/dist/index.d.ts:275
***
### \_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[]
Callbacks for when a light is added to the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_LIGHT_ADDED__`
#### Defined in
core/dist/index.d.ts:291
***
### \_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_
> **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[]
Callbacks for when a light is removed from the scene.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_LIGHT_REMOVED__`
#### Defined in
core/dist/index.d.ts:295
***
### \_\_CALLBACKS\_ON\_READY\_\_
> **\_\_CALLBACKS\_ON\_READY\_\_**: () => `void`[]
Callbacks for when the scene is ready.
#### Inherited from
`FSceneCore.__CALLBACKS_ON_READY__`
#### Defined in
core/dist/index.d.ts:287
***
### \_\_CAMERA\_\_
> **\_\_CAMERA\_\_**: [`FCamera`](FCamera.md)
The camera of the scene.
#### Overrides
`FSceneCore.__CAMERA__`
#### Defined in
[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L68)
***
### \_\_DOM\_NODE\_\_
> **\_\_DOM\_NODE\_\_**: `HTMLElement`
DOM element that the renderer will be appended to
#### Inherited from
`FSceneCore.__DOM_NODE__`
#### Defined in
core/dist/index.d.ts:244
***
### \_\_ENABLE\_SHADOWS\_\_
> **\_\_ENABLE\_SHADOWS\_\_**: `boolean`
#### Defined in
[3d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L54)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
`FSceneCore.__IS_2D__`
#### Defined in
core/dist/index.d.ts:230
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Overrides
`FSceneCore.__IS_3D__`
#### Defined in
[3d/src/core/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L53)
***
### \_\_PHYSIC\_CONTROLLERS\_\_
> **\_\_PHYSIC\_CONTROLLERS\_\_**: `FController`[]
Controllers that will run in the physic pipeline.
#### Inherited from
`FSceneCore.__PHYSIC_CONTROLLERS__`
#### Defined in
core/dist/index.d.ts:260
***
### \_\_PHYSIC\_FRAME\_RATE\_\_
> **\_\_PHYSIC\_FRAME\_RATE\_\_**: `number`
Physic frame rate.
It is stored here as the initialisation of the physics pipeline is handled by child classes.
#### Inherited from
`FSceneCore.__PHYSIC_FRAME_RATE__`
#### Defined in
core/dist/index.d.ts:240
***
### \_\_PIPELINE\_MANAGER\_\_
> **\_\_PIPELINE\_MANAGER\_\_**: `PipelineManager`
Pipeline manager that manages the pipelines of the scene.
By default, it contains the main pipeline.
#### Inherited from
`FSceneCore.__PIPELINE_MANAGER__`
#### Defined in
core/dist/index.d.ts:235
***
### \_\_RAPIER\_TO\_COMPONENT\_\_
> **\_\_RAPIER\_TO\_COMPONENT\_\_**: `Map`\<`number`, [`FComponent`](FComponent.md)\>
#### Overrides
`FSceneCore.__RAPIER_TO_COMPONENT__`
#### Defined in
[3d/src/core/FScene.ts:74](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L74)
***
### colliders
> **colliders**: [`FCollider`](FCollider.md)[]
#### Defined in
[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L61)
***
### components
> **components**: [`FComponent`](FComponent.md)[]
The components in the scene.
#### Overrides
`FSceneCore.components`
#### Defined in
[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L57)
***
### eventQueue
> **eventQueue**: `EventQueue`
#### Overrides
`FSceneCore.eventQueue`
#### Defined in
[3d/src/core/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L73)
***
### gravity
> **gravity**: `FVector3`
#### Overrides
`FSceneCore.gravity`
#### Defined in
[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L71)
***
### lights
> **lights**: [`FLight`](FLight.md)[]
The lights in the scene.
#### Overrides
`FSceneCore.lights`
#### Defined in
[3d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L59)
***
### renderer
> **renderer**: `WebGLRenderer`
#### Defined in
[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L67)
***
### rigidBodies
> **rigidBodies**: [`FRigidBody`](FRigidBody.md)[]
#### Defined in
[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L63)
***
### scene
> **scene**: `Scene`
#### Defined in
[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L66)
***
### world
> **world**: `World`
#### Overrides
`FSceneCore.world`
#### Defined in
[3d/src/core/FScene.ts:72](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L72)
---
---
url: 'https://fibbo.dev/api/3d/classes/FSensor.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FSensor
# Class: FSensor
A 3d sensor that can be attached to a component.
## Example
```ts
import { FSensor } from '@fibbojs/3d'
const sensor = new FSensor({
position: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
rotation: { x: 0, y: 0, z: 0 },
shape: FShapes.CUBOID
})
```
## Extends
- [`FRigidBody`](FRigidBody.md)
## Accessors
### component
> `get` **component**(): [`FComponent`](FComponent.md)
> `set` **component**(`component`): `void`
#### Parameters
• **component**: [`FComponent`](FComponent.md)
#### Returns
[`FComponent`](FComponent.md)
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`component`](FRigidBody.md#component)
#### Defined in
[3d/src/core/FRigidBody.ts:372](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L372)
## Constructors
### new FSensor()
> **new FSensor**(`options`?): [`FSensor`](FSensor.md)
Creates a rigidBody for the given component.
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
The options for the rigidBody.
#### Returns
[`FSensor`](FSensor.md)
#### Overrides
[`FRigidBody`](FRigidBody.md).[`constructor`](FRigidBody.md#constructors)
#### Defined in
[3d/src/core/FSensor.ts:42](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FSensor.ts#L42)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
Set the position of the rigidBody.
#### Parameters
• **position**: `FVector3`
The new position of the rigidBody.
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__SET_POSITION__`](FRigidBody.md#__set_position__)
#### Defined in
[3d/src/core/FRigidBody.ts:334](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L334)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
Set the rotation of the rigidBody.
#### Parameters
• **rotation**: `FVector3`
The new rotation of the rigidBody.
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__SET_ROTATION__`](FRigidBody.md#__set_rotation__)
#### Defined in
[3d/src/core/FRigidBody.ts:344](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L344)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
Set the scale of the rigidBody.
#### Parameters
• **scale**: `FVector3`
The new scale of the rigidBody.
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__SET_SCALE__`](FRigidBody.md#__set_scale__)
#### Defined in
[3d/src/core/FRigidBody.ts:354](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L354)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the position update.
This means the new position will be the position of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__UPDATE_POSITION__`](FRigidBody.md#__update_position__)
#### Defined in
[3d/src/core/FRigidBody.ts:247](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L247)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the rotation update.
This means the new rotation will be the rotation of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__UPDATE_ROTATION__`](FRigidBody.md#__update_rotation__)
#### Defined in
[3d/src/core/FRigidBody.ts:277](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L277)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the rigidBody according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the rigidBody won't be considered as the initiator of the scale update.
This means the new scale will be the scale of the attached component, plus the offset.
Setting this to true will propagate the event to other objects (component, sensor,...).
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__UPDATE_SCALE__`](FRigidBody.md#__update_scale__)
#### Defined in
[3d/src/core/FRigidBody.ts:307](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L307)
***
### frame()
> **frame**(`_delta`): `void`
#### Parameters
• **\_delta**: `number`
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`frame`](FRigidBody.md#frame)
#### Defined in
[3d/src/core/FRigidBody.ts:209](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L209)
***
### setAngvel()
> **setAngvel**(`velocity`): `void`
Set the angular velocity of the rigidBody.
#### Parameters
• **velocity**: `FVector3`
The new angular velocity of the rigidBody.
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`setAngvel`](FRigidBody.md#setangvel)
#### Defined in
[3d/src/core/FRigidBody.ts:236](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L236)
***
### setLinvel()
> **setLinvel**(`velocity`): `void`
Set the linear velocity of the rigidBody.
#### Parameters
• **velocity**: `FVector3`
The new linear velocity of the rigidBody.
#### Returns
`void`
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`setLinvel`](FRigidBody.md#setlinvel)
#### Defined in
[3d/src/core/FRigidBody.ts:228](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L228)
## Properties
### \_\_COMPONENT\_\_?
> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md)
The component the rigidBody is attached to.
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__COMPONENT__`](FRigidBody.md#__component__)
#### Defined in
[3d/src/core/FRigidBody.ts:67](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L67)
***
### \_\_RIGIDBODY\_\_
> **\_\_RIGIDBODY\_\_**: `RigidBody`
RAPIER RigidBody
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`__RIGIDBODY__`](FRigidBody.md#__rigidbody__)
#### Defined in
[3d/src/core/FRigidBody.ts:59](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L59)
***
### collider
> **collider**: [`FCollider`](FCollider.md)
Fibbo Collider
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`collider`](FRigidBody.md#collider)
#### Defined in
[3d/src/core/FRigidBody.ts:63](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L63)
***
### offset
> **offset**: [`FTransform`](FTransform.md)
The transform offset of the rigidBody.
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`offset`](FRigidBody.md#offset)
#### Defined in
[3d/src/core/FRigidBody.ts:75](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L75)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
The transform of the rigidBody.
#### Inherited from
[`FRigidBody`](FRigidBody.md).[`transform`](FRigidBody.md#transform)
#### Defined in
[3d/src/core/FRigidBody.ts:71](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L71)
---
---
url: 'https://fibbo.dev/api/3d/classes/FSphere.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FSphere
# Class: FSphere
A simple sphere model in Fibbo.
## Example
```ts
import { FSphere } from '@fibbojs/3d'
const sphere = new FSphere()
```
## Extends
- [`FPolyhedron`](FPolyhedron.md)
## Accessors
### color
> `get` **color**(): `number`
> `set` **color**(`value`): `void`
Change the color of the polyhedron.
#### Example
```ts
cube.color = 0xFF0000
```
#### Parameters
• **value**: `number`
The color of the polyhedron.
#### Returns
`number`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`color`](FPolyhedron.md#color)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:60](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L60)
## Constructors
### new FSphere()
> **new FSphere**(`options`?): [`FSphere`](FSphere.md)
#### Parameters
• **options?**: [`FPolyhedronOptions`](../interfaces/FPolyhedronOptions.md)
#### Returns
[`FSphere`](FSphere.md)
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors)
#### Defined in
[3d/src/polyhedrons/FSphere.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FSphere.ts#L19)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__)
#### Defined in
[3d/src/core/FComponent.ts:282](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L282)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:291](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L291)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector3`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__)
#### Defined in
[3d/src/core/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L301)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__)
#### Defined in
[3d/src/core/FComponent.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L162)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__)
#### Defined in
[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L204)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__)
#### Defined in
[3d/src/core/FComponent.ts:246](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L246)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`addController`](FPolyhedron.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame)
#### Defined in
[3d/src/core/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L110)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider)
#### Defined in
[3d/src/polyhedrons/FSphere.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FSphere.ts#L34)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody)
#### Defined in
[3d/src/polyhedrons/FSphere.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FSphere.ts#L41)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Overrides
[`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor)
#### Defined in
[3d/src/polyhedrons/FSphere.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FSphere.ts#L48)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onCollisionWith`](FPolyhedron.md#oncollisionwith)
#### Defined in
[3d/src/core/FComponent.ts:318](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L318)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`removeController`](FPolyhedron.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`render`](FPolyhedron.md#render)
#### Defined in
[3d/src/core/FComponent.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L114)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_COLOR\_\_
> **\_\_COLOR\_\_**: `number`
The color of the polyhedron.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__COLOR__`](FPolyhedron.md#__color__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L18)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__ID__`](FPolyhedron.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean`
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_2D__`](FPolyhedron.md#__is_2d__)
#### Defined in
core/dist/index.d.ts:384
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__IS_3D__`](FPolyhedron.md#__is_3d__)
#### Defined in
[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L30)
***
### \_\_MESH\_\_
> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\>
Mesh is redefined from FComponent without the ? because it is
directly available after the constructor, as a polyhedron is created synchronously.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__)
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L24)
***
### collider?
> `optional` **collider**: [`FCollider`](FCollider.md)
Collider
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider)
#### Defined in
[3d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`controllers`](FPolyhedron.md#controllers)
#### Defined in
[3d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L38)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md)
RigidBody
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`rigidBody`](FPolyhedron.md#rigidbody)
#### Defined in
[3d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`scene`](FPolyhedron.md#scene)
#### Defined in
[3d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L34)
***
### sensor?
> `optional` **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`sensor`](FPolyhedron.md#sensor)
#### Defined in
[3d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FPolyhedron`](FPolyhedron.md).[`transform`](FPolyhedron.md#transform)
#### Defined in
[3d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/3d/classes/FSpotLight.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FSpotLight
# Class: FSpotLight
A spot light in 3d space.
## Extends
- [`FLight`](FLight.md)
## Accessors
### color
> `get` **color**(): `Color`
> `set` **color**(`color`): `void`
#### Parameters
• **color**: `ColorRepresentation`
#### Returns
`Color`
#### Inherited from
[`FLight`](FLight.md).[`color`](FLight.md#color)
#### Defined in
[3d/src/lights/FLight.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L124)
***
### intensity
> `get` **intensity**(): `number`
> `set` **intensity**(`intensity`): `void`
#### Parameters
• **intensity**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`intensity`](FLight.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:132](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L132)
***
### lookAt
> `get` **lookAt**(): `FVector3`
> `set` **lookAt**(`lookAt`): `void`
#### Parameters
• **lookAt**: `FVector3`
#### Returns
`FVector3`
#### Inherited from
[`FLight`](FLight.md).[`lookAt`](FLight.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L140)
***
### shadowQuality
> `get` **shadowQuality**(): `number`
> `set` **shadowQuality**(`quality`): `void`
#### Parameters
• **quality**: `number`
#### Returns
`number`
#### Inherited from
[`FLight`](FLight.md).[`shadowQuality`](FLight.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L151)
## Constructors
### new FSpotLight()
> **new FSpotLight**(`options`?): [`FSpotLight`](FSpotLight.md)
#### Parameters
• **options?**: [`FSpotLightOptions`](../interfaces/FSpotLightOptions.md)
— The options of the light.
#### Returns
[`FSpotLight`](FSpotLight.md)
#### Overrides
[`FLight`](FLight.md).[`constructor`](FLight.md#constructors)
#### Defined in
[3d/src/lights/FSpotLight.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FSpotLight.ts#L25)
## Methods
### \_\_UPDATE\_LOOK\_AT\_\_()
> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void`
Update the look at target of the light.
This method should be called after updating the position, so the light can look at the target.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__)
#### Defined in
[3d/src/lights/FLight.ts:116](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L116)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(): `void`
Update the position of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__)
#### Defined in
[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L91)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(): `void`
Update the rotation of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__)
#### Defined in
[3d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L100)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(): `void`
Update the scale of the light according to the transform.
This method should be called after updating the transform properties.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__)
#### Defined in
[3d/src/lights/FLight.ts:108](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L108)
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:61
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the light is loaded.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded)
#### Defined in
core/dist/index.d.ts:57
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}`
#### Index Signature
\[`key`: `string`\]: () => `void`[]
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_COLLISION__`](FLight.md#__callbacks_on_collision__)
#### Defined in
[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L30)
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the light is loaded.
#### Inherited from
[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:47
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
#### Inherited from
[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__)
#### Defined in
[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L29)
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `false`
#### Inherited from
[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__)
#### Defined in
[3d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L28)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__)
#### Defined in
[3d/src/lights/FLight.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L27)
***
### \_\_LIGHT\_\_
> **\_\_LIGHT\_\_**: `Light`\<`LightShadow`\<`Camera`\>\>
The original light object from Three.js.
#### Inherited from
[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__)
#### Defined in
[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L35)
***
### \_\_LOOK\_AT\_\_
> **\_\_LOOK\_AT\_\_**: `FVector3`
Look at target of the light.
#### Inherited from
[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__)
#### Defined in
[3d/src/lights/FLight.ts:50](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L50)
***
### \_\_SHADOW\_QUALITY\_\_
> **\_\_SHADOW\_QUALITY\_\_**: `number`
Quality of the shadow. Default is 5.
#### Inherited from
[`FLight`](FLight.md).[`__SHADOW_QUALITY__`](FLight.md#__shadow_quality__)
#### Defined in
[3d/src/lights/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L55)
***
### scene
> **scene**: [`FScene`](FScene.md)
Scene the light is in.
#### Inherited from
[`FLight`](FLight.md).[`scene`](FLight.md#scene)
#### Defined in
[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L40)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transform of the light.
#### Inherited from
[`FLight`](FLight.md).[`transform`](FLight.md#transform)
#### Defined in
[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L45)
---
---
url: 'https://fibbo.dev/api/2d/classes/FSprite.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FSprite
# Class: FSprite
A simple sprite in Fibbo.
## Example
```ts
import { FSprite } from '@fibbojs/2d'
const sprite = new FSprite('/my-texture.png')
```
## Extends
- [`FComponent`](FComponent.md)
## Constructors
### new FSprite()
> **new FSprite**(`options`): [`FSprite`](FSprite.md)
#### Parameters
• **options**: [`FSpriteOptions`](../interfaces/FSpriteOptions.md)
#### Returns
[`FSprite`](FSprite.md)
#### Overrides
[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors)
#### Defined in
[2d/src/sprite/FSprite.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L30)
## Methods
### \_\_SET\_POSITION\_\_()
> **\_\_SET\_POSITION\_\_**(`position`): `void`
#### Parameters
• **position**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__)
#### Defined in
[2d/src/core/FComponent.ts:254](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L254)
***
### \_\_SET\_ROTATION\_\_()
> **\_\_SET\_ROTATION\_\_**(`rotation`): `void`
#### Parameters
• **rotation**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:261](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L261)
***
### \_\_SET\_SCALE\_\_()
> **\_\_SET\_SCALE\_\_**(`scale`): `void`
#### Parameters
• **scale**: `FVector2`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__)
#### Defined in
[2d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L268)
***
### \_\_UPDATE\_POSITION\_\_()
> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void`
Update the position of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the position update.
Set this to true to propagate the position update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__)
#### Defined in
[2d/src/core/FComponent.ts:146](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L146)
***
### \_\_UPDATE\_ROTATION\_\_()
> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void`
Update the rotation of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the rotation update.
Set this to true to propagate the rotation update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__)
#### Defined in
[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L186)
***
### \_\_UPDATE\_SCALE\_\_()
> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void`
Update the scale of the component according to the transform.
This method should be called after updating the transform properties.
#### Parameters
• **initiator**: `boolean` = `false`
By default (false), the component won't be considered as the initiator of the scale update.
Set this to true to propagate the scale update to the rigidBody, collider and sensor.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__)
#### Defined in
[2d/src/core/FComponent.ts:220](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L220)
***
### addController()
> **addController**(`controller`): `void`
Add a controller to the component.
#### Parameters
• **controller**: `FController`
The controller to add.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`addController`](FComponent.md#addcontroller)
#### Defined in
core/dist/index.d.ts:418
***
### emitCollisionWith()
> **emitCollisionWith**(`options`): `void`
Emit a collision event with a given class or object.
#### Parameters
• **options**
The options for the collision event.
• **options.class?**: `any`
The class to emit the collision event with.
• **options.component?**: `FComponent`
The component to emit the collision event with.
#### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
class: Enemy
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.emitCollisionWith({
object: enemy
})
```
#### Inherited from
[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith)
#### Defined in
core/dist/index.d.ts:499
***
### emitOnLoaded()
> **emitOnLoaded**(): `void`
Emit the onLoaded callbacks.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded)
#### Defined in
core/dist/index.d.ts:443
***
### frame()
> **frame**(`delta`): `void`
Update the component. Should be called every frame.
The purpose of this method is to render the component, its mesh/sprite, and its properties.
#### Parameters
• **delta**: `number`
The time since the last frame.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame)
#### Defined in
[2d/src/core/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L102)
***
### initCollider()
> **initCollider**(`options`?): `void`
#### Parameters
• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider)
#### Defined in
[2d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L286)
***
### initRigidBody()
> **initRigidBody**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody)
#### Defined in
[2d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L295)
***
### initSensor()
> **initSensor**(`options`?): `void`
#### Parameters
• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md)
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor)
#### Defined in
[2d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L304)
***
### loadTexture()
> **loadTexture**(`texture`): `Promise`\<`void`\>
Load a texture from a path.
#### Parameters
• **texture**: `string`
The path to the texture.
#### Returns
`Promise`\<`void`\>
#### Defined in
[2d/src/sprite/FSprite.ts:49](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L49)
***
### onCollisionWith()
> **onCollisionWith**(`classOrObject`, `callback`): () => `void`
Add a callback to be called when a collision occurs.
#### Parameters
• **classOrObject**: `any`
The class or object to observe for collisions. Should inherit from FComponent.
• **callback**
The callback to add to the collision event.
#### Returns
`Function`
A function to remove the callback.
##### Returns
`void`
#### Examples
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(Enemy, ({ component }) => {
console.log('Player collided with an Enemy!')
console.log('The enemy is:', component)
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
```
```typescript
const player = new Player()
const enemy = new Enemy()
const removeThisCallback = player.onCollisionWith(enemy, () => {
console.log('Player collided with the enemy!')
})
// To remove the callback, call the function returned by onCollisionWith
removeThisCallback()
#### Inherited from
[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith)
#### Defined in
[2d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L276)
***
### onFrame()
> **onFrame**(`callback`): `void`
Add a callback to be called every frame.
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe)
#### Defined in
core/dist/index.d.ts:434
***
### onLoaded()
> **onLoaded**(`callback`): `void`
Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc).
#### Parameters
• **callback**
The callback function.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded)
#### Defined in
core/dist/index.d.ts:439
***
### removeController()
> **removeController**(`controller`): `void`
Remove a controller from the component.
#### Parameters
• **controller**: `FController`
The controller to remove.
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`removeController`](FComponent.md#removecontroller)
#### Defined in
core/dist/index.d.ts:423
***
### render()
> **render**(`delta`): `void`
#### Parameters
• **delta**: `number`
#### Returns
`void`
#### Inherited from
[`FComponent`](FComponent.md).[`render`](FComponent.md#render)
#### Defined in
[2d/src/core/FComponent.ts:106](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L106)
***
### setScaleHeight()
> **setScaleHeight**(`height`): `void`
Set the scale of the sprite to a specific height.
The width will be calculated according to the aspect ratio of the texture.
#### Parameters
• **height**: `number`
The height of the sprite.
#### Returns
`void`
#### Defined in
[2d/src/sprite/FSprite.ts:83](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L83)
***
### setScaleWidth()
> **setScaleWidth**(`width`): `void`
Set the scale of the sprite to a specific width.
The height will be calculated according to the aspect ratio of the texture.
#### Parameters
• **width**: `number`
The width of the sprite.
#### Returns
`void`
#### Defined in
[2d/src/sprite/FSprite.ts:74](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L74)
## Properties
### \_\_CALLBACKS\_ON\_COLLISION\_\_
> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object`
Callbacks for when a collision occurs with a given class or object.
It is a dictionary where the key is the class name or object id and the value is an array of callbacks.
#### Index Signature
\[`key`: `string`\]: (`data`) => `void`[]
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__)
#### Defined in
core/dist/index.d.ts:402
***
### \_\_CALLBACKS\_ON\_FRAME\_\_
> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[]
Callbacks for when a frame is rendered.
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__)
#### Defined in
core/dist/index.d.ts:393
***
### \_\_CALLBACKS\_ON\_LOADED\_\_
> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[]
Callbacks for when the component is loaded (could be a texture, a 3D model, etc).
#### Inherited from
[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__)
#### Defined in
core/dist/index.d.ts:397
***
### \_\_CONTAINER\_\_
> **\_\_CONTAINER\_\_**: `Sprite`
PIXI container
#### Overrides
[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__)
#### Defined in
[2d/src/sprite/FSprite.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L24)
***
### \_\_ID\_\_
> **\_\_ID\_\_**: `number`
Unique identifier for the component.
It is generated automatically.
#### Inherited from
[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__)
#### Defined in
core/dist/index.d.ts:389
***
### \_\_IS\_2D\_\_
> **\_\_IS\_2D\_\_**: `boolean` = `true`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__)
#### Defined in
[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L30)
***
### \_\_IS\_3D\_\_
> **\_\_IS\_3D\_\_**: `boolean`
Internal flags
#### Inherited from
[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__)
#### Defined in
core/dist/index.d.ts:383
***
### \_\_TEXTURE\_\_
> **\_\_TEXTURE\_\_**: `Texture`
The texture of the sprite.
#### Defined in
[2d/src/sprite/FSprite.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L28)
***
### collider
> **collider**: [`FCollider`](FCollider.md)
RAPIER Collider
#### Inherited from
[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider)
#### Defined in
[2d/src/core/FComponent.ts:58](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L58)
***
### controllers
> **controllers**: [`FController`](FController.md)[]
The controllers attached to the component.
#### Inherited from
[`FComponent`](FComponent.md).[`controllers`](FComponent.md#controllers)
#### Defined in
[2d/src/core/FComponent.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L38)
***
### rigidBody
> **rigidBody**: [`FRigidBody`](FRigidBody.md)
RAPIER RigidBody
#### Inherited from
[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody)
#### Defined in
[2d/src/core/FComponent.ts:54](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L54)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene the component is attached to.
#### Inherited from
[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene)
#### Defined in
[2d/src/core/FComponent.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L34)
***
### sensor
> **sensor**: [`FRigidBody`](FRigidBody.md)
Sensor (a collider that doesn't collide with other colliders, but still triggers events)
#### Inherited from
[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor)
#### Defined in
[2d/src/core/FComponent.ts:62](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L62)
***
### transform
> **transform**: [`FTransform`](FTransform.md)
Transforms
#### Inherited from
[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform)
#### Defined in
[2d/src/core/FComponent.ts:48](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L48)
---
---
url: 'https://fibbo.dev/api/2d/classes/FTransform.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FTransform
# Class: FTransform
2D Transform
## Accessors
### position
> `get` **position**(): `object`
Get the position.
> `set` **position**(`position`): `void`
Set the position.
#### Parameters
• **position**
The new position.
• **position.x**: `number`
The new position on the x axis.
• **position.y**: `number`
The new position on the y axis.
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Defined in
[2d/src/core/FTransform.ts:140](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L140)
***
### rotation
> `get` **rotation**(): `number`
Get the rotation in radians.
> `set` **rotation**(`rotation`): `void`
Set the rotation in radians.
#### Parameters
• **rotation**: `number`
The new rotation in radians.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:187](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L187)
***
### rotationDegree
> `get` **rotationDegree**(): `number`
Get the rotation in degrees.
> `set` **rotationDegree**(`rotationDegree`): `void`
Set the rotation in degrees.
#### Parameters
• **rotationDegree**: `number`
The new rotation in degrees.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:202](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L202)
***
### scale
> `get` **scale**(): `object`
Get the scale.
> `set` **scale**(`scale`): `void`
Set the scale.
#### Parameters
• **scale**
The new scale.
• **scale.x**: `number`
The new scale on the x axis.
• **scale.y**: `number`
The new scale on the y axis.
#### Returns
`object`
##### x
> **x**: `number`
##### y
> **y**: `number`
#### Defined in
[2d/src/core/FTransform.ts:217](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L217)
***
### scaleX
> `get` **scaleX**(): `number`
Get the scale on the x axis.
> `set` **scaleX**(`x`): `void`
Set the x scale.
#### Parameters
• **x**: `number`
The new scale on the x axis.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:234](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L234)
***
### scaleY
> `get` **scaleY**(): `number`
Get the scale on the y axis.
> `set` **scaleY**(`y`): `void`
Set the y scale.
#### Parameters
• **y**: `number`
The new scale on the y axis.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:249](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L249)
***
### x
> `get` **x**(): `number`
Get the position on the x axis.
> `set` **x**(`x`): `void`
Set the x position.
#### Parameters
• **x**: `number`
The new position on the x axis.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:157](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L157)
***
### y
> `get` **y**(): `number`
Get the position on the y axis.
> `set` **y**(`y`): `void`
Set the y position.
#### Parameters
• **y**: `number`
The new position on the y axis.
#### Returns
`number`
#### Defined in
[2d/src/core/FTransform.ts:172](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L172)
## Constructors
### new FTransform()
> **new FTransform**(`options`?): [`FTransform`](FTransform.md)
Create a new FTransform.
#### Parameters
• **options?**: [`FTransformOptions`](../interfaces/FTransformOptions.md)
The options for the transform.
#### Returns
[`FTransform`](FTransform.md)
#### Example
```ts
import { FTransform } from '@fibbojs/2d'
const transform = new FTransform({
position: { x: 0, y: 0 },
rotation: 0,
scale: { x: 1, y: 1 },
})
```
#### Defined in
[2d/src/core/FTransform.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L61)
## Methods
### onPositionUpdated()
> **onPositionUpdated**(`callback`): `void`
Add a callback for when the position is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:84](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L84)
***
### onRotationUpdated()
> **onRotationUpdated**(`callback`): `void`
Add a callback for when the rotation is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:92](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L92)
***
### onScaleUpdated()
> **onScaleUpdated**(`callback`): `void`
Add a callback for when the scale is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:100](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L100)
***
### setPosition()
> **setPosition**(`position`): `void`
Set a new position.
#### Parameters
• **position**
The new position.
• **position.x**: `number`
The new position on the x axis.
• **position.y**: `number`
The new position on the y axis.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:110](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L110)
***
### setRotation()
> **setRotation**(`rotation`): `void`
Set a new rotation in radians.
#### Parameters
• **rotation**: `number`
The new rotation in radians.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:119](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L119)
***
### setScale()
> **setScale**(`scale`): `void`
Set a new scale.
#### Parameters
• **scale**
The new scale.
• **scale.x**: `number`
The new scale on the x axis.
• **scale.y**: `number`
The new scale on the y axis.
#### Returns
`void`
#### Defined in
[2d/src/core/FTransform.ts:130](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L130)
## Properties
### \_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the position is updated.
#### Defined in
[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L20)
***
### \_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the rotation is updated.
#### Defined in
[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L24)
***
### \_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the scale is updated.
#### Defined in
[2d/src/core/FTransform.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L28)
***
### \_\_POSITION\_\_
> **\_\_POSITION\_\_**: `FVector2`
The position of the transform.
#### Defined in
[2d/src/core/FTransform.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L33)
***
### \_\_ROTATION\_\_
> **\_\_ROTATION\_\_**: `number`
The rotation of the transform in radians.
#### Defined in
[2d/src/core/FTransform.ts:41](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L41)
***
### \_\_SCALE\_\_
> **\_\_SCALE\_\_**: `FVector2`
The scale of the transform.
#### Defined in
[2d/src/core/FTransform.ts:37](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L37)
---
---
url: 'https://fibbo.dev/api/3d/classes/FTransform.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FTransform
# Class: FTransform
3D Transform
## Example
```ts
import { FTransform } from '@fibbojs/3d'
const transform = new FTransform({
position: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
rotation: { x: 0, y: 0, z: 0 },
})
```
## Accessors
### position
> `get` **position**(): `FVector3`
Get the position.
> `set` **position**(`position`): `void`
Set the position.
#### Parameters
• **position**: `FVector3`
The new position.
#### Returns
`FVector3`
#### Defined in
[3d/src/core/FTransform.ts:163](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L163)
***
### rotation
> `get` **rotation**(): `FVector3`
Get the rotation.
> `set` **rotation**(`rotation`): `void`
Set the rotation.
#### Parameters
• **rotation**: `FVector3`
The new rotation.
#### Returns
`FVector3`
#### Defined in
[3d/src/core/FTransform.ts:226](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L226)
***
### rotationDegree
> `get` **rotationDegree**(): `FVector3`
Get the rotation in degrees.
> `set` **rotationDegree**(`rotationDegree`): `void`
Set the rotation in degrees.
#### Parameters
• **rotationDegree**: `FVector3`
The new rotation in degrees.
#### Returns
`FVector3`
#### Defined in
[3d/src/core/FTransform.ts:289](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L289)
***
### rotationDegreeX
> `get` **rotationDegreeX**(): `number`
Get the rotation in degrees on the x axis.
> `set` **rotationDegreeX**(`x`): `void`
Set the x rotation in degrees.
#### Parameters
• **x**: `number`
The new rotation on the x axis in degrees.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:311](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L311)
***
### rotationDegreeY
> `get` **rotationDegreeY**(): `number`
Get the rotation in degrees on the y axis.
> `set` **rotationDegreeY**(`y`): `void`
Set the y rotation in degrees.
#### Parameters
• **y**: `number`
The new rotation on the y axis in degrees.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:326](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L326)
***
### rotationDegreeZ
> `get` **rotationDegreeZ**(): `number`
Get the rotation in degrees on the z axis.
> `set` **rotationDegreeZ**(`z`): `void`
Set the z rotation in degrees.
#### Parameters
• **z**: `number`
The new rotation on the z axis in degrees.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:341](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L341)
***
### rotationX
> `get` **rotationX**(): `number`
Get the rotation on the x axis.
> `set` **rotationX**(`x`): `void`
Set the x rotation.
#### Parameters
• **x**: `number`
The new rotation on the x axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:244](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L244)
***
### rotationY
> `get` **rotationY**(): `number`
Get the rotation on the y axis.
> `set` **rotationY**(`y`): `void`
Set the y rotation.
#### Parameters
• **y**: `number`
The new rotation on the y axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:259](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L259)
***
### rotationZ
> `get` **rotationZ**(): `number`
Get the rotation on the z axis.
> `set` **rotationZ**(`z`): `void`
Set the z rotation.
#### Parameters
• **z**: `number`
The new rotation on the z axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:274](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L274)
***
### scale
> `get` **scale**(): `FVector3`
Get the scale.
> `set` **scale**(`scale`): `void`
Set the scale.
#### Parameters
• **scale**: `FVector3`
The new scale.
#### Returns
`FVector3`
#### Defined in
[3d/src/core/FTransform.ts:356](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L356)
***
### scaleX
> `get` **scaleX**(): `number`
Get the scale on the x axis.
> `set` **scaleX**(`x`): `void`
Set the x scale.
#### Parameters
• **x**: `number`
The new scale on the x axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:374](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L374)
***
### scaleY
> `get` **scaleY**(): `number`
Get the scale on the y axis.
> `set` **scaleY**(`y`): `void`
Set the y scale.
#### Parameters
• **y**: `number`
The new scale on the y axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:389](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L389)
***
### scaleZ
> `get` **scaleZ**(): `number`
Get the scale on the z axis.
> `set` **scaleZ**(`z`): `void`
Set the z scale.
#### Parameters
• **z**: `number`
The new scale on the z axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:404](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L404)
***
### x
> `get` **x**(): `number`
Get the position on the x axis.
> `set` **x**(`x`): `void`
Set the x position.
#### Parameters
• **x**: `number`
The new position on the x axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:181](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L181)
***
### y
> `get` **y**(): `number`
Get the position on the y axis.
> `set` **y**(`y`): `void`
Set the y position.
#### Parameters
• **y**: `number`
The new position on the y axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:196](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L196)
***
### z
> `get` **z**(): `number`
Get the position on the z axis.
> `set` **z**(`z`): `void`
Set the z position.
#### Parameters
• **z**: `number`
The new position on the z axis.
#### Returns
`number`
#### Defined in
[3d/src/core/FTransform.ts:211](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L211)
## Constructors
### new FTransform()
> **new FTransform**(`options`?): [`FTransform`](FTransform.md)
Create a new FTransform.
#### Parameters
• **options?**: [`FTransformOptions`](../interfaces/FTransformOptions.md)
The options for the transform.
#### Returns
[`FTransform`](FTransform.md)
#### Defined in
[3d/src/core/FTransform.ts:61](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L61)
## Methods
### onPositionUpdated()
> **onPositionUpdated**(`callback`): `void`
Add a callback for when the position is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:87](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L87)
***
### onRotationUpdated()
> **onRotationUpdated**(`callback`): `void`
Add a callback for when the rotation is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:95](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L95)
***
### onScaleUpdated()
> **onScaleUpdated**(`callback`): `void`
Add a callback for when the scale is updated.
#### Parameters
• **callback**
The callback to add.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:103](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L103)
***
### setPosition()
> **setPosition**(`position`): `void`
Set a new position.
#### Parameters
• **position**: `FVector3`
The new position.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:114](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L114)
***
### setRotation()
> **setRotation**(`rotation`): `void`
Set a new rotation.
#### Parameters
• **rotation**: `FVector3`
The new rotation.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:126](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L126)
***
### setRotationDegree()
> **setRotationDegree**(`rotationDegree`): `void`
Set a new rotation in degrees.
#### Parameters
• **rotationDegree**: `FVector3`
The new rotation in degrees.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:138](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L138)
***
### setScale()
> **setScale**(`scale`): `void`
Set a new scale.
#### Parameters
• **scale**: `FVector3`
The new scale.
#### Returns
`void`
#### Defined in
[3d/src/core/FTransform.ts:153](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L153)
## Properties
### \_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the position is updated.
#### Defined in
[3d/src/core/FTransform.ts:30](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L30)
***
### \_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the rotation is updated.
#### Defined in
[3d/src/core/FTransform.ts:34](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L34)
***
### \_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_
> **\_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_**: () => `void`[] = `[]`
Callback for when the scale is updated.
#### Defined in
[3d/src/core/FTransform.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L38)
***
### \_\_POSITION\_\_
> **\_\_POSITION\_\_**: `FVector3`
The position of the transform.
#### Defined in
[3d/src/core/FTransform.ts:43](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L43)
***
### \_\_ROTATION\_\_
> **\_\_ROTATION\_\_**: `FVector3`
The rotation of the transform.
#### Defined in
[3d/src/core/FTransform.ts:51](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L51)
***
### \_\_SCALE\_\_
> **\_\_SCALE\_\_**: `FVector3`
The scale of the transform.
#### Defined in
[3d/src/core/FTransform.ts:47](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L47)
---
---
url: 'https://fibbo.dev/api/core/classes/PipelineManager.md'
---
[@fibbojs](/api/index) / [core](/api/core) / PipelineManager
# Class: PipelineManager
The pipeline manager is responsible for managing different pipelines in a scene.
It handles the execution of standard, throttled, and interval pipelines.
It also manages the auto loop feature, which allows pipelines to be executed automatically at a specified frame rate.
A pipeline manager is created automatically when a scene is created.
## Constructors
### new PipelineManager()
> **new PipelineManager**(`options`): [`PipelineManager`](PipelineManager.md)
#### Parameters
• **options**: [`PipelineManagerOptions`](../interfaces/PipelineManagerOptions.md)
#### Returns
[`PipelineManager`](PipelineManager.md)
#### Defined in
[core/src/pipeline/PipelineManager.ts:40](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L40)
## Methods
### addIntervalPipeline()
> **addIntervalPipeline**(`pipeline`): `void`
Add an interval pipeline.
#### Parameters
• **pipeline**: [`IntervalPipeline`](IntervalPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:182](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L182)
***
### addStandardPipeline()
> **addStandardPipeline**(`pipeline`): `void`
Add a standard pipeline.
#### Parameters
• **pipeline**: [`StandardPipeline`](StandardPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:142](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L142)
***
### addThrottledPipeline()
> **addThrottledPipeline**(`pipeline`): `void`
Add a throttled pipeline.
#### Parameters
• **pipeline**: [`ThrottledPipeline`](ThrottledPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:162](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L162)
***
### removeIntervalPipeline()
> **removeIntervalPipeline**(`pipeline`): `void`
Remove an interval pipeline.
#### Parameters
• **pipeline**: [`IntervalPipeline`](IntervalPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:191](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L191)
***
### removeStandardPipeline()
> **removeStandardPipeline**(`pipeline`): `void`
Remove a standard pipeline.
#### Parameters
• **pipeline**: [`StandardPipeline`](StandardPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:151](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L151)
***
### removeThrottledPipeline()
> **removeThrottledPipeline**(`pipeline`): `void`
Remove a throttled pipeline.
#### Parameters
• **pipeline**: [`ThrottledPipeline`](ThrottledPipeline.md)
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:171](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L171)
***
### start()
> **start**(): `void`
Start all pipelines.
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:124](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L124)
***
### stop()
> **stop**(): `void`
Stop all pipelines.
#### Returns
`void`
#### Defined in
[core/src/pipeline/PipelineManager.ts:133](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L133)
## Properties
### \_\_ANIMATION\_FRAME\_REQUEST\_ID\_\_
> **\_\_ANIMATION\_FRAME\_REQUEST\_ID\_\_**: `number`
Animation frame request ID
#### Defined in
[core/src/pipeline/PipelineManager.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L33)
***
### autoLoop
> **autoLoop**: `boolean`
Auto loop flag.
#### Defined in
[core/src/pipeline/PipelineManager.ts:38](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L38)
***
### intervalPipelines
> **intervalPipelines**: [`IntervalPipeline`](IntervalPipeline.md)[]
#### Defined in
[core/src/pipeline/PipelineManager.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L28)
***
### scene
> **scene**: [`FScene`](FScene.md)
The scene associated with the pipeline manager.
#### Defined in
[core/src/pipeline/PipelineManager.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L23)
***
### standardPipelines
> **standardPipelines**: [`StandardPipeline`](StandardPipeline.md)[]
#### Defined in
[core/src/pipeline/PipelineManager.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L26)
***
### throttledPipelines
> **throttledPipelines**: [`ThrottledPipeline`](ThrottledPipeline.md)[]
#### Defined in
[core/src/pipeline/PipelineManager.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L27)
---
---
url: 'https://fibbo.dev/guide/physics/colliders.md'
---
# Colliders
Colliders represent the geometric shapes that generate contacts and collision events when they touch. Attaching one or multiple colliders to a rigidBody allow the rigidBody to be affected by contact forces.
The only use case for a collider without a rigidBody might be to create ground or walls that are not supposed to move and which you do not want to detect contacts against.
Any other use case might require attaching the collider to a rigidBody.
## Adding a collider to a component
Every [`FComponent`](/api/core/classes/FComponent) has an `initCollider` method that allows you to create a collider and attach it to the component directly.
::: code-group
```typescript [2d]
import { FRectangle, FShapes } from '@fibbojs/3d'
const rectangle = new FRectangle()
rectangle.initCollider({
position: { x: 0, y: 0 },
rotation: 0,
rotationDegree: 0,
scale: { x: 1, y: 1 },
positionOffset: { x: 0, y: 0 },
rotationOffset: 0,
rotationDegreeOffset: 0,
scaleOffset: { x: 1, y: 1 },
shape: FShapes.RECTANGLE
})
```
```typescript [3d]
import { FCuboid, FShapes } from '@fibbojs/3d'
const cube = new FCuboid()
cube.initCollider({
position: { x: 0, y: 0, z: 0 },
rotation: { x: 0, y: 0, z: 0 },
rotationDegree: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
positionOffset: { x: 0, y: 0, z: 0 },
rotationOffset: { x: 0, y: 0, z: 0 },
rotationDegreeOffset: { x: 0, y: 0, z: 0 },
scaleOffset: { x: 1, y: 1, z: 1 },
shape: FShapes.CUBOID
})
```
:::
As soon as a collider is attached to a component, the component's transform will be updated relatively to the collider's transform.
An offset can be applied to the collider's transform so it can be placed relatively to the component's transform.
To learn more about colliders, you can refer to the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/colliders).
---
---
url: 'https://fibbo.dev/guide/events/collisions.md'
---
# Collisions
Collisions events are triggered when two objects collide with each other. This can be used to detect when a player touches a coin, or when a bullet hits an enemy.
## Initialization
To enable collisions events to be emitted on a component, you need to initialize a sensor on it. A sensor is a essentially a [rigidBody](/guide/physics/rigidbody) with the sensor flag (which mean it does not affect the physics simulation). It only emits events when it collides with another collider.
The available parameters are the same as for a [rigidBody](/guide/physics/rigidbody).
::: code-group
```typescript [2d]
import { FRectangle, FShapes } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.initSensor({
position: { x: 0, y: 0 },
rotation: 0,
rotationDegree: 0,
scale: { x: 1, y: 1 },
shape: FShapes.RECTANGLE
})
```
```typescript [3d]
import { FCuboid, FShapes } from '@fibbojs/3d'
const cube = new FCuboid()
cube.initSensor({
position: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
rotationDegree: { x: 0, y: 0, z: 0 },
shape: FShapes.CUBOID
})
```
:::
## Listening to collisions
Every [`FComponent`](/api/core/classes/FComponent) has a [`onCollisionWith`](/api/core/classes/FComponent#oncollisionwith) method that allows you to listen to collisions events.
::: code-group
```typescript [2d]
import { FCircle, FRectangle } from '@fibbojs/2d'
const rectangle = new FRectangle()
const circle = new FCircle()
// Detect collisions with all rectangles
rectangle.onCollisionWith(FRectangle, ({ component }) => {
console.log('Collision with a rectangle :', component)
})
// Detect collisions with the circle
rectangle.onCollisionWith(circle, () => {
console.log('Collision with the circle')
})
```
```typescript [3d]
import { FCuboid, FSphere } from '@fibbojs/3d'
const cube = new FCuboid()
const sphere = new FSphere()
// Detect collisions with all cuboids
cube.onCollisionWith(FCuboid, ({ component }) => {
console.log('Collision with a cuboid :', component)
})
// Detect collisions with the sphere
cube.onCollisionWith(sphere, () => {
console.log('Collision with the sphere')
})
```
:::
## Getting data about the collision
When a collision event is triggered, you can get [data about the collision](/api/core/interfaces/OnCollisionWithData).
For now, the only data available is the component that the collision event is triggered on.
---
---
url: 'https://fibbo.dev/guide/core/components.md'
---
# Components
Components are the main building blocks of Fibbo. They are the objects that you can add to a scene, move around, rotate, and interact with.
## What is a component ?
A component extends the [`FComponent`](/api/core/classes/FComponent) class. It represents an object in a scene, will be rendered, updated, and interacted with.
It is mainly composed of the following attributes :
- [`transform`](/guide/core/transforms) : The position, rotation, and scale of the component. It can be accessed and modified using getters and setters.
- [`collider`](/guide/physics/colliders) : (optional) The collider of the component, used for physics interactions.
- [`rigidBody`](/guide/physics/rigidbody) : (optional) The rigidBody of the component, used for physics interactions.
- [`sensor`](/guide/events/collisions) : (optional) The sensor of the component, used for detecting and emitting collisions events.
And the following methods :
- `frame` : Called every frame by the [Scene](/guide/core/scene) to update the component.
- `onFrame` : A method that takes a callback to be called every frame.
- `initCollider` : Initialize the collider of the component.
- `initRigidBody` : Initialize the rigidBody of the component.
- `initSensor` : Initialize the sensor of the component.
## Creating a component
To create a component, you can just import it and create a new instance :
::: code-group
```typescript [2d]
import { FRectangle } from '@fibbojs/2d'
new FRectangle()
```
```typescript [3d]
import { FCuboid } from '@fibbojs/3d'
new FCuboid()
```
:::
This will create a new component, that will automatically be added to the current scene.
Various options can be passed to the constructor :
::: code-group
```typescript [2d]
import { FRectangle } from '@fibbojs/2d'
new FRectangle({
position: { x: 1, y: 2 },
rotation: 0,
rotationDegree: 0,
scale: { x: 2, y: 2 },
})
```
```typescript [3d]
import { FCuboid } from '@fibbojs/3d'
new FCuboid({
position: { x: 1, y: 2, z: 3 },
rotation: { x: 0, y: 0, z: 0 },
rotationDegree: { x: 0, y: 0, z: 0 },
scale: { x: 2, y: 2, z: 2 },
})
```
:::
### Handling multiple scenes
When creating a component, the scene is automatically inferred from the current context. But if you want to add the component to a specific scene, you can pass it as an argument to the constructor :
::: code-group
```typescript [2d]
import { FRectangle, FScene } from '@fibbojs/2d'
const scene = new FScene()
new FRectangle({
scene,
})
```
```typescript [3d]
import { FCuboid, FScene } from '@fibbojs/3d'
const scene = new FScene()
new FCuboid({
scene,
})
```
:::
---
---
url: 'https://fibbo.dev/guide/2d/container.md'
---
# Container
Every [`FComponent`](/api/2d/classes/FComponent) in `@fibbojs/2d` has a [`__CONTAINER__`](/api/2d/classes/FComponent#container) attribute that corresponds to the [PixiJS Container](https://pixijs.com/8.x/guides/components/containers) that will be used to render the component.
This is either a [Graphics](https://pixijs.com/8.x/guides/components/graphics) (for rectangles, circles,...) or a [Sprite](https://pixijs.com/8.x/guides/components/sprites) (basically an image) depending on the component.
Unless you have a good reason to do so, you should not modify the [`__CONTAINER__`](/api/2d/classes/FComponent#container) attribute directly, but use the provided methods instead.
---
---
url: 'https://fibbo.dev/more/contributing.md'
---
# Contributing
Want to contribute to Fibbo ? We would love to have you on board !
Here are some ways you can help.
## Reporting bugs
If you encounter any issues while using Fibbo, please let us know by [opening an issue on GitHub](https://github.com/fibbojs/fibbo/issues/new).
Before opening an issue, please make sure to :
- Check if the issue has already been reported by searching the [existing issues](https://github.com/fibbojs/fibbo/issues) on GitHub.
- Provide as much information as possible, such as the steps to reproduce the issue, the expected behavior, and the actual behavior.
- If possible, provide a minimal example that reproduces the issue. It could be a link to a repository, a code snippet or an online playground (StackBlitz, CodeSandbox, etc.).
## Share ideas
If you have any ideas for new features, improvements, or anything else, please let us know by [opening a discussion on GitHub](https://github.com/orgs/fibbojs/discussions).
As Fibbo is still in its early stages, we are open to any suggestions that could help us improve the engine and make it more user-friendly.
Game engines are complex tools, and game developers have tons of different needs, so your feedback is crucial to us.
## Contributing code
If you want to contribute code to Fibbo, you can do so by [forking the repository](https://github.com/fibbojs/fibbo/fork) and [opening a pull request](https://github.com/fibbojs/fibbo/compare) once you're done.
Preferrably, you should follow these steps :
- Choose an issue to work on from the [project board](https://github.com/orgs/fibbojs/projects/1) (or the [issues list](https://github.com/fibbojs/fibbo/issues) directly, but make sure it's planned and not already in progress).
- Fork the repository and clone it on your machine.
- Commit your changes using [conventional commits](https://www.conventionalcommits.org/).
- Open a pull request that targets the `main` branch of the main repository.
::: tip
If you're a beginner, do not hesitate to ask for help in the issue you're working on. We will be happy to guide you through the process.
It's okay to make mistakes, as long as you're willing to learn from them. We all started somewhere, and we're here to help you grow.
:::
## Architecture
Some information about the architecture of Fibbo might help you understand how the engine is structured and how you can contribute to it.
Fibbo is a monorepo managed with [Nx](https://nx.dev/). It is composed of multiple packages, each with its own responsibility.
Here are the main packages :
- [`@fibbojs/core`](https://www.npmjs.com/package/@fibbojs/core) : The core package, which defines fundamental classes and interfaces.
- [`@fibbojs/2d`](https://www.npmjs.com/package/@fibbojs/2d) : The 2D engine, mainly based on [PixiJS](https://pixijs.com/) and [Rapier](https://rapier.rs/).
- [`@fibbojs/3d`](https://www.npmjs.com/package/@fibbojs/3d) : The 3D engine, mainly based on [Three.js](https://threejs.org/) and [Rapier](https://rapier.rs/).
- [`@fibbojs/event`](https://www.npmjs.com/package/@fibbojs/event) : The event system, which allows you to create and listen to events in the browser.
- [`@fibbojs/devtools`](https://www.npmjs.com/package/@fibbojs/devtools) : The devtools, which lets you inspect and debug your scenes.
- [`@fibbojs/util`](https://www.npmjs.com/package/@fibbojs/util) : Common utilities used by the other packages.
- [`@fibbojs/config`](https://www.npmjs.com/package/@fibbojs/config) : The configuration package, responsible for building and serving your application.
- [`fibbo`](https://www.npmjs.com/package/fibbo) : The CLI mainly used to call the `@fibbojs/config` package.
For now, here is what the tech stack looks like :
- Game stuff
- [Three.js](https://threejs.org/) for 3D rendering
- [Rapier](https://rapier.rs/) for physics
- [PixiJS](https://pixijs.com/) for 2D rendering
- [Vue](https://vuejs.org/) for the devtools
- Tooling
- [Nx](https://nx.dev/) for monorepo management
- [tsdown](https://tsdown.dev/) for building the packages
- [Vite](https://vitejs.dev/) for the playgrounds + building the devtools
- [VitePress](https://vitepress.dev/) for the documentation
- [Vitest](https://vitest.dev/) for testing
- [TypeDoc](https://typedoc.org/) for the API Reference part of the documentation
- [Biome](https://biomejs.dev/) for formatting and linting
---
---
url: 'https://fibbo.dev/guide/core/controllers.md'
---
# Controllers
Every [`FComponent`](/api/core/classes/FComponent) in Fibbo can have a [`FController`](/api/core/classes/FController) attached to it. A controller is instanciated given its component and is responsible for updating the component's properties every frame.
## Why use controllers ?
Technically, controllers are not required to make a component move or animate (you could just override the `frame` method in your component most of the time), but they are a good way to separate the logic of a component from its rendering.
Also, this allows you to reuse the same controller for multiple components, which can be useful if you want to create multiple groups of objects that share the same behavior.
## How to use controllers ?
A controller's [`frame`](/api/core/classes/FController#onframe) method is where you should put your typical movement logic. By default, this method is called every frame by the attached component itself.
To help you get started, here is a simple example of a controller that makes a component rotate around its one axis :
::: code-group
```typescript [2d]
import { FController, FRectangle } from '@fibbojs/2d'
import type { FControllerOptions } from '@fibbojs/2d'
export class MyRotateController extends FController {
constructor(options?: FControllerOptions) {
super(options)
}
frame() {
this.component.rotation += 0.01
}
}
// Usage
const rectangle = new FRectangle()
rectangle.addController(new MyRotateController({
component: cube
}))
```
```typescript [3d]
import { FController, FCuboid } from '@fibbojs/3d'
import type { FControllerOptions } from '@fibbojs/3d'
export class MyRotateController extends FController {
constructor(options?: FControllerOptions) {
super(options)
}
frame() {
this.component.rotation.y += 0.01
}
}
// Usage
const cube = new FCuboid()
cube.addController(new MyRotateController({
component: cube
}))
```
:::
In this example, the `frame` method adds `0.01` to the component's rotation each frame.
If you want to learn more about controllers, Fibbo provides a default [character controller](/more/recipes/character-controller) and you can also create your own [custom controller](/more/recipes/custom-controller).
---
---
url: 'https://fibbo.dev/api/core/index.md'
---
[@fibbojs](/api/index) / core
# core
## Index
### Classes
#### Core
- [FCamera](classes/FCamera.md)
- [FComponent](classes/FComponent.md)
- [FController](classes/FController.md)
- [FGroup](classes/FGroup.md)
- [FLight](classes/FLight.md)
- [FScene](classes/FScene.md)
- [PipelineManager](classes/PipelineManager.md)
#### Pipeline
- [IntervalPipeline](classes/IntervalPipeline.md)
- [Pipeline](classes/Pipeline.md)
- [StandardPipeline](classes/StandardPipeline.md)
- [ThrottledPipeline](classes/ThrottledPipeline.md)
### Enumerations
- [PipelineCommands](enumerations/PipelineCommands.md)
- [PipelineState](enumerations/PipelineState.md)
### Interfaces
- [FCameraOptions](interfaces/FCameraOptions.md)
- [FComponentOptions](interfaces/FComponentOptions.md)
- [FControllerOptions](interfaces/FControllerOptions.md)
- [FLightOptions](interfaces/FLightOptions.md)
- [FSceneOptions](interfaces/FSceneOptions.md)
- [FVector2](interfaces/FVector2.md)
- [FVector3](interfaces/FVector3.md)
- [FVector4](interfaces/FVector4.md)
- [OnCollisionWithData](interfaces/OnCollisionWithData.md)
- [PipelineManagerOptions](interfaces/PipelineManagerOptions.md)
---
---
url: 'https://fibbo.dev/more/deployment.md'
---
# Deployment
To bundle your game for deployment, just run `npm run build` and you'll get a production-ready build in the `dist` folder.
The starter also provides a GitHub Actions workflow that automatically builds and deploys your game to GitHub Pages whenever you push to the `main` branch. You can find the workflow file [here](https://github.com/fibbojs/create-fibbo/blob/main/templates/3d/.github/workflows/release.yml) if you want to customize it.
::: warning
If you're deploying to GitHub Pages, you are likely to run into issues with the default `base` setting in the `vite` config. You can fix this by setting `vite.base: '/your-repo-name/'` in `fibbo.config.ts`.
:::
As Fibbo is based on Vite, you can refer to the [Vite documentation](https://vitejs.dev/guide/build) to learn more about the build process and how to customize it.
---
---
url: 'https://fibbo.dev/more/devtools.md'
---
# Devtools
The `@fibbojs/devtools` package provides a debugging tool for your Fibbo scenes.
For now, it only enable displaying and editing the scene's components on a custom GUI. However any changes made to the components will not be saved in your source code.
If you're using the starter, the devtools are already included in the project. They should be visible in development mode, but disabled in production.
---
---
url: 'https://fibbo.dev/api/2d/enumerations/FRigidBodyType.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FRigidBodyType
# Enumeration: FRigidBodyType
## Enumeration Members
### DYNAMIC
> **DYNAMIC**: `"Dynamic"`
#### Defined in
[2d/src/types/FRigidBodyType.ts:3](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FRigidBodyType.ts#L3)
***
### FIXED
> **FIXED**: `"Fixed"`
#### Defined in
[2d/src/types/FRigidBodyType.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FRigidBodyType.ts#L6)
***
### KINEMATIC\_POSITION\_BASED
> **KINEMATIC\_POSITION\_BASED**: `"KinematicPositionBased"`
#### Defined in
[2d/src/types/FRigidBodyType.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FRigidBodyType.ts#L4)
***
### KINEMATIC\_VELOCITY\_BASED
> **KINEMATIC\_VELOCITY\_BASED**: `"KinematicVelocityBased"`
#### Defined in
[2d/src/types/FRigidBodyType.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FRigidBodyType.ts#L5)
---
---
url: 'https://fibbo.dev/api/3d/enumerations/FRigidBodyType.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FRigidBodyType
# Enumeration: FRigidBodyType
## Enumeration Members
### DYNAMIC
> **DYNAMIC**: `"Dynamic"`
#### Defined in
[3d/src/types/FRigidBodyType.ts:3](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FRigidBodyType.ts#L3)
***
### FIXED
> **FIXED**: `"Fixed"`
#### Defined in
[3d/src/types/FRigidBodyType.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FRigidBodyType.ts#L6)
***
### KINEMATIC\_POSITION\_BASED
> **KINEMATIC\_POSITION\_BASED**: `"KinematicPositionBased"`
#### Defined in
[3d/src/types/FRigidBodyType.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FRigidBodyType.ts#L4)
***
### KINEMATIC\_VELOCITY\_BASED
> **KINEMATIC\_VELOCITY\_BASED**: `"KinematicVelocityBased"`
#### Defined in
[3d/src/types/FRigidBodyType.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FRigidBodyType.ts#L5)
---
---
url: 'https://fibbo.dev/api/2d/enumerations/FShapes.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FShapes
# Enumeration: FShapes
## Enumeration Members
### CIRCLE
> **CIRCLE**: `"Circle"`
#### Defined in
[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FShapes.ts#L4)
***
### RECTANGLE
> **RECTANGLE**: `"Rectangle"`
#### Defined in
[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/types/FShapes.ts#L3)
---
---
url: 'https://fibbo.dev/api/3d/enumerations/FShapes.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FShapes
# Enumeration: FShapes
## Enumeration Members
### CAPSULE
> **CAPSULE**: `"Capsule"`
#### Defined in
[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FShapes.ts#L5)
***
### CUBOID
> **CUBOID**: `"Cuboid"`
#### Defined in
[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FShapes.ts#L3)
***
### MESH
> **MESH**: `"Mesh"`
#### Defined in
[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FShapes.ts#L6)
***
### SPHERE
> **SPHERE**: `"Sphere"`
#### Defined in
[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/types/FShapes.ts#L4)
---
---
url: 'https://fibbo.dev/api/core/enumerations/PipelineCommands.md'
---
[@fibbojs](/api/index) / [core](/api/core) / PipelineCommands
# Enumeration: PipelineCommands
## Enumeration Members
### START
> **START**: `"start"`
#### Defined in
[core/src/pipeline/Pipeline.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L4)
***
### STOP
> **STOP**: `"stop"`
#### Defined in
[core/src/pipeline/Pipeline.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L5)
---
---
url: 'https://fibbo.dev/api/core/enumerations/PipelineState.md'
---
[@fibbojs](/api/index) / [core](/api/core) / PipelineState
# Enumeration: PipelineState
## Enumeration Members
### RUNNING
> **RUNNING**: `"running"`
#### Defined in
[core/src/pipeline/Pipeline.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L9)
***
### STOPPED
> **STOPPED**: `"stopped"`
#### Defined in
[core/src/pipeline/Pipeline.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/Pipeline.ts#L10)
---
---
url: 'https://fibbo.dev/api/event/index.md'
---
[@fibbojs](/api/index) / event
# event
## Index
### Classes
#### Event
- [FKeyboard](classes/FKeyboard.md)
---
---
url: 'https://fibbo.dev/more/extending-fibbo.md'
---
# Extending Fibbo
We provide a [module starter](https://github.com/fibbojs/create-fibbo/tree/main/templates/module) to help you get started with creating your own modules for Fibbo.
This concept was highly inspired by the [Nuxt module system](https://nuxt.com/modules), so shoutout to them for the idea !
## Usage
- Clone the template
```bash
npm create fibbo@latest -t module
```
- Do not forget to modify the following fields :
- package.json : `name`, `description`, `author`, `homepage`, `repository`, `bugs`
- Install the dependencies
```bash
npm install
```
- Run the playground to test your module
```bash
npm run dev
```
- Build the module for production
```bash
npm run build
```
## Publishing a module
Once you are ready to publish your module, you can do so by running the following command :
```bash
npm publish
```
If you're not familiar with publishing packages to npm, you can refer to the [official documentation](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
---
---
url: 'https://fibbo.dev/api/index.md'
---
# fibbojs
## Modules
- [2d](/api/2d)
- [3d](/api/3d)
- [core](/api/core)
- [event](/api/event)
- [util](/api/util)
---
---
url: 'https://fibbo.dev/guide/fundamentals.md'
---
# Fundamentals
Before we dive into any code, let's take a moment to understand the fundamentals concepts of Fibbo. This will help you understand how the engine works, so you can be more efficient when using it, and prevent common pitfalls.
## General structure
Almost everything in Fibbo is exposed as a class. This includes scenes, components, cameras, and more. This means that you can create and manipulate objects in a scene using a simple object-oriented API.
If you're not familiar with [object-oriented programming](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming), Fibbo is a great way to learn it, as the API is fairly minimal and easy to understand.
Also, every class name in Fibbo is prefixed with `F`, to avoid conflicts with other libraries, but also to make it easier to identify Fibbo classes. If you ever want to use something from Fibbo, pressing `F` in your editor might be a good start.
Just press `F` !
## Unit system
Fibbo has its own unit system, to help you work with different environments in a consistent way. This system is used to define the [position](/guide/core/transforms#position) and [scale](/guide/core/transforms#scale) of components in the scene.
As Fibbo relies on other underlying libraries (such as Three.js or PixiJS) that have their own unit system, it is important to have a common unit system to work with.
So here is a quick overview of the unit system in Fibbo :
| Fibbo | Three.js | Rapier | PixiJS |
| ----- | -------- | ------ | ------- |
| `1` | `1` | `0.5` | `100px` |
That means that if you create a component with a size of `1` in Fibbo, it will be `1` in Three.js, `0.5` in Rapier, and `100px` in PixiJS. You can consider `1` is equivalent to 1 meter in the real world.
When using Fibbo's classes and methods, you should always use the Fibbo unit system and all the conversions will be done automatically for you.
But if for some reason you need to use the underlying libraries directly, you should be aware of the unit system they use.
## About internals
Fibbo is built on top of other libraries and does a lot of work behind the scenes to make your life easier.
This means that Fibbo's classes have a lot of internal properties that you should not use directly, but are exposed for convenience (in edge cases or when [extending Fibbo](/more/extending-fibbo) for example). These properties are formatted with uppercase letters and double underscores at the beginning and end of their name (e.g. `__INTERNAL__`).
If you ever feel the need to use these properties, you are very likely to have found a bug or a feature missing in Fibbo. If you're not sure about it, feel free to [ask on the forum](https://github.com/orgs/fibbojs/discussions) !
---
---
url: 'https://fibbo.dev/getting-started/installation.md'
---
# Installation
Want to create a new game ? Fibbo provides an easy way to clone a starter project to get you started quickly.
## Prerequisites
- [Node.js](https://nodejs.org/) : for now, Fibbo was only tested with [Node.js 22.2.0](https://nodejs.org/download/release/v22.2.0/), but it should work with any other versions as it is mainly a frontend technology.
- [npm](https://www.npmjs.com/) : should be included with Node.js
## Quick start
```bash
npm create fibbo@latest
```
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FAttachedCameraOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FAttachedCameraOptions
# Interface: FAttachedCameraOptions
## Extends
- [`FCameraOptions`](FCameraOptions.md)
## Properties
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`position`](FCameraOptions.md#position)
#### Defined in
[2d/src/cameras/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L8)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`scene`](FCameraOptions.md#scene)
#### Defined in
core/dist/index.d.ts:506
***
### target
> **target**: [`FComponent`](../classes/FComponent.md)
#### Defined in
[2d/src/cameras/FAttachedCamera.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FAttachedCamera.ts#L6)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FAttachedCameraOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FAttachedCameraOptions
# Interface: FAttachedCameraOptions
## Extends
- [`FCameraOptions`](FCameraOptions.md)
## Properties
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`position`](FCameraOptions.md#position)
#### Defined in
[3d/src/cameras/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L8)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`rotation`](FCameraOptions.md#rotation)
#### Defined in
[3d/src/cameras/FCamera.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L9)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`rotationDegree`](FCameraOptions.md#rotationdegree)
#### Defined in
[3d/src/cameras/FCamera.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L10)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`scale`](FCameraOptions.md#scale)
#### Defined in
[3d/src/cameras/FCamera.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L11)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FCameraOptions`](FCameraOptions.md).[`scene`](FCameraOptions.md#scene)
#### Defined in
core/dist/index.d.ts:506
***
### target
> **target**: [`FComponent`](../classes/FComponent.md)
#### Defined in
[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FAttachedCamera.ts#L7)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FCameraOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCameraOptions
# Interface: FCameraOptions
## Extends
- `FCameraOptions`
## Extended by
- [`FAttachedCameraOptions`](FAttachedCameraOptions.md)
## Properties
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/cameras/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/cameras/FCamera.ts#L8)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FCameraOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:506
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FCameraOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCameraOptions
# Interface: FCameraOptions
## Extends
- `FCameraOptions`
## Extended by
- [`FAttachedCameraOptions`](FAttachedCameraOptions.md)
## Properties
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/cameras/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L8)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/cameras/FCamera.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L9)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/cameras/FCamera.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L10)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/cameras/FCamera.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/cameras/FCamera.ts#L11)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FCameraOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:506
---
---
url: 'https://fibbo.dev/api/core/interfaces/FCameraOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FCameraOptions
# Interface: FCameraOptions
## Properties
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[core/src/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FCamera.ts#L5)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FCharacterControllerOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerOptions
# Interface: FCharacterControllerOptions
## Extends
- [`FControllerOptions`](FControllerOptions.md)
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
#### Inherited from
[`FControllerOptions`](FControllerOptions.md).[`component`](FControllerOptions.md#component)
#### Defined in
[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L6)
***
### runInPhysicPipeline?
> `optional` **runInPhysicPipeline**: `boolean`
#### Inherited from
[`FControllerOptions`](FControllerOptions.md).[`runInPhysicPipeline`](FControllerOptions.md#runinphysicpipeline)
#### Defined in
core/dist/index.d.ts:6
***
### speed?
> `optional` **speed**: `number`
The speed of the character.
#### Defined in
[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FCharacterController.ts#L10)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FCharacterControllerOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerOptions
# Interface: FCharacterControllerOptions
## Extends
- [`FControllerOptions`](FControllerOptions.md)
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
#### Inherited from
[`FControllerOptions`](FControllerOptions.md).[`component`](FControllerOptions.md#component)
#### Defined in
[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L6)
***
### runInPhysicPipeline?
> `optional` **runInPhysicPipeline**: `boolean`
#### Inherited from
[`FControllerOptions`](FControllerOptions.md).[`runInPhysicPipeline`](FControllerOptions.md#runinphysicpipeline)
#### Defined in
core/dist/index.d.ts:6
***
### speed?
> `optional` **speed**: `number`
The speed of the character.
#### Defined in
[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FCharacterController.ts#L13)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FColliderOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FColliderOptions
# Interface: FColliderOptions
## Properties
### position?
> `optional` **position**: `FVector2`
#### Defined in
[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L11)
***
### positionOffset?
> `optional` **positionOffset**: `FVector2`
#### Defined in
[2d/src/core/FCollider.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L15)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](../classes/FRigidBody.md)
#### Defined in
[2d/src/core/FCollider.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L20)
***
### rotation?
> `optional` **rotation**: `number`
#### Defined in
[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L12)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Defined in
[2d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L13)
***
### rotationDegreeOffset?
> `optional` **rotationDegreeOffset**: `number`
#### Defined in
[2d/src/core/FCollider.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L17)
***
### rotationOffset?
> `optional` **rotationOffset**: `number`
#### Defined in
[2d/src/core/FCollider.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L16)
***
### scale?
> `optional` **scale**: `FVector2`
#### Defined in
[2d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L14)
***
### scaleOffset?
> `optional` **scaleOffset**: `FVector2`
#### Defined in
[2d/src/core/FCollider.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L18)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L10)
***
### sensor?
> `optional` **sensor**: `boolean`
#### Defined in
[2d/src/core/FCollider.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L21)
***
### shape?
> `optional` **shape**: [`FShapes`](../enumerations/FShapes.md)
#### Defined in
[2d/src/core/FCollider.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FCollider.ts#L19)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FColliderOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FColliderOptions
# Interface: FColliderOptions
## Properties
### mesh?
> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
#### Defined in
[3d/src/core/FCollider.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L22)
***
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L13)
***
### positionOffset?
> `optional` **positionOffset**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L17)
***
### rigidBody?
> `optional` **rigidBody**: [`FRigidBody`](../classes/FRigidBody.md)
#### Defined in
[3d/src/core/FCollider.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L23)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L14)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L15)
***
### rotationDegreeOffset?
> `optional` **rotationDegreeOffset**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L19)
***
### rotationOffset?
> `optional` **rotationOffset**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L18)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L16)
***
### scaleOffset?
> `optional` **scaleOffset**: `FVector3`
#### Defined in
[3d/src/core/FCollider.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L20)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L12)
***
### sensor?
> `optional` **sensor**: `boolean`
#### Defined in
[3d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L24)
***
### shape?
> `optional` **shape**: [`FShapes`](../enumerations/FShapes.md)
#### Defined in
[3d/src/core/FCollider.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FCollider.ts#L21)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FComponentOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FComponentOptions
# Interface: FComponentOptions
## Extends
- `FComponentOptions`
## Extended by
- [`FPolygonOptions`](FPolygonOptions.md)
- [`FSpriteOptions`](FSpriteOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
`FComponentOptionsCore.addToScene`
#### Defined in
core/dist/index.d.ts:364
***
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `number`
#### Defined in
[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Defined in
[2d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FComponentOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:363
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FComponentOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FComponentOptions
# Interface: FComponentOptions
## Extends
- `FComponentOptions`
## Extended by
- [`FModelOptions`](FModelOptions.md)
- [`FPolyhedronOptions`](FPolyhedronOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
`FComponentOptionsCore.addToScene`
#### Defined in
core/dist/index.d.ts:364
***
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FComponentOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:363
---
---
url: 'https://fibbo.dev/api/core/interfaces/FComponentOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FComponentOptions
# Interface: FComponentOptions
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Defined in
[core/src/FComponent.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L11)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[core/src/FComponent.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L10)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FControllerOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FControllerOptions
# Interface: FControllerOptions
## Extends
- `FControllerOptions`
## Extended by
- [`FCharacterControllerOptions`](FCharacterControllerOptions.md)
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
#### Overrides
`FControllerOptionsCore.component`
#### Defined in
[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/controllers/FController.ts#L6)
***
### runInPhysicPipeline?
> `optional` **runInPhysicPipeline**: `boolean`
#### Inherited from
`FControllerOptionsCore.runInPhysicPipeline`
#### Defined in
core/dist/index.d.ts:6
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FControllerOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FControllerOptions
# Interface: FControllerOptions
## Extends
- `FControllerOptions`
## Extended by
- [`FCharacterControllerOptions`](FCharacterControllerOptions.md)
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
#### Overrides
`FControllerOptionsCore.component`
#### Defined in
[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/controllers/FController.ts#L6)
***
### runInPhysicPipeline?
> `optional` **runInPhysicPipeline**: `boolean`
#### Inherited from
`FControllerOptionsCore.runInPhysicPipeline`
#### Defined in
core/dist/index.d.ts:6
---
---
url: 'https://fibbo.dev/api/core/interfaces/FControllerOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FControllerOptions
# Interface: FControllerOptions
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
#### Defined in
[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L4)
***
### runInPhysicPipeline?
> `optional` **runInPhysicPipeline**: `boolean`
#### Defined in
[core/src/FController.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FController.ts#L5)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FHemisphereLightOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FHemisphereLightOptions
# Interface: FHemisphereLightOptions
## Extends
- [`FLightOptions`](FLightOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`addToScene`](FLightOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:37
***
### color?
> `optional` **color**: `ColorRepresentation`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`color`](FLightOptions.md#color)
#### Defined in
[3d/src/lights/FLight.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L13)
***
### groundColor?
> `optional` **groundColor**: `ColorRepresentation`
#### Defined in
[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FHemisphereLight.ts#L7)
***
### intensity?
> `optional` **intensity**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`intensity`](FLightOptions.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L14)
***
### lookAt?
> `optional` **lookAt**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`lookAt`](FLightOptions.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L15)
***
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`position`](FLightOptions.md#position)
#### Defined in
[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L9)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotation`](FLightOptions.md#rotation)
#### Defined in
[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L10)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotationDegree`](FLightOptions.md#rotationdegree)
#### Defined in
[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L11)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scale`](FLightOptions.md#scale)
#### Defined in
[3d/src/lights/FLight.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L12)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scene`](FLightOptions.md#scene)
#### Defined in
core/dist/index.d.ts:36
***
### shadowQuality?
> `optional` **shadowQuality**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`shadowQuality`](FLightOptions.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L16)
***
### skyColor?
> `optional` **skyColor**: `ColorRepresentation`
#### Defined in
[3d/src/lights/FHemisphereLight.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FHemisphereLight.ts#L6)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FLightOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FLightOptions
# Interface: FLightOptions
## Extends
- `FLightOptions`
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
`FLightOptionsCore.addToScene`
#### Defined in
core/dist/index.d.ts:37
***
### color?
> `optional` **color**: `number`
#### Defined in
[2d/src/lights/FLight.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L12)
***
### intensity?
> `optional` **intensity**: `number`
#### Defined in
[2d/src/lights/FLight.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L13)
***
### lookAt?
> `optional` **lookAt**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/lights/FLight.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L14)
***
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L8)
***
### rotation?
> `optional` **rotation**: `number`
#### Defined in
[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L9)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Defined in
[2d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L10)
***
### scale?
> `optional` **scale**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/lights/FLight.ts#L11)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FLightOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:36
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FLightOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FLightOptions
# Interface: FLightOptions
## Extends
- `FLightOptions`
## Extended by
- [`FHemisphereLightOptions`](FHemisphereLightOptions.md)
- [`FLightProbeOptions`](FLightProbeOptions.md)
- [`FSpotLightOptions`](FSpotLightOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
`FLightOptionsCore.addToScene`
#### Defined in
core/dist/index.d.ts:37
***
### color?
> `optional` **color**: `ColorRepresentation`
#### Defined in
[3d/src/lights/FLight.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L13)
***
### intensity?
> `optional` **intensity**: `number`
#### Defined in
[3d/src/lights/FLight.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L14)
***
### lookAt?
> `optional` **lookAt**: `FVector3`
#### Defined in
[3d/src/lights/FLight.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L15)
***
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L9)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L10)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L11)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/lights/FLight.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L12)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
`FLightOptionsCore.scene`
#### Defined in
core/dist/index.d.ts:36
***
### shadowQuality?
> `optional` **shadowQuality**: `number`
#### Defined in
[3d/src/lights/FLight.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L16)
---
---
url: 'https://fibbo.dev/api/core/interfaces/FLightOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FLightOptions
# Interface: FLightOptions
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Defined in
[core/src/FLight.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L5)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[core/src/FLight.ts:4](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FLight.ts#L4)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FLightProbeOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FLightProbeOptions
# Interface: FLightProbeOptions
## Extends
- [`FLightOptions`](FLightOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`addToScene`](FLightOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:37
***
### color?
> `optional` **color**: `ColorRepresentation`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`color`](FLightOptions.md#color)
#### Defined in
[3d/src/lights/FLight.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L13)
***
### intensity?
> `optional` **intensity**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`intensity`](FLightOptions.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L14)
***
### lookAt?
> `optional` **lookAt**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`lookAt`](FLightOptions.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L15)
***
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`position`](FLightOptions.md#position)
#### Defined in
[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L9)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotation`](FLightOptions.md#rotation)
#### Defined in
[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L10)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotationDegree`](FLightOptions.md#rotationdegree)
#### Defined in
[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L11)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scale`](FLightOptions.md#scale)
#### Defined in
[3d/src/lights/FLight.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L12)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scene`](FLightOptions.md#scene)
#### Defined in
core/dist/index.d.ts:36
***
### sh
> **sh**: `SphericalHarmonics3`
#### Defined in
[3d/src/lights/FLightProbe.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLightProbe.ts#L6)
***
### shadowQuality?
> `optional` **shadowQuality**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`shadowQuality`](FLightOptions.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L16)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FModelOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FModelOptions
# Interface: FModelOptions
## Extends
- [`FComponentOptions`](FComponentOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`addToScene`](FComponentOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:364
***
### fileExtension?
> `optional` **fileExtension**: `string`
#### Defined in
[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L10)
***
### name
> **name**: `string`
#### Defined in
[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L7)
***
### path?
> `optional` **path**: `string`
#### Defined in
[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L8)
***
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`position`](FComponentOptions.md#position)
#### Defined in
[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotation`](FComponentOptions.md#rotation)
#### Defined in
[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotationDegree`](FComponentOptions.md#rotationdegree)
#### Defined in
[3d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scale`](FComponentOptions.md#scale)
#### Defined in
[3d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scene`](FComponentOptions.md#scene)
#### Defined in
core/dist/index.d.ts:363
***
### textures?
> `optional` **textures**: `Record`\<`string`, `string`\>
#### Defined in
[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/model/FModel.ts#L9)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FPolygonOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FPolygonOptions
# Interface: FPolygonOptions
## Extends
- [`FComponentOptions`](FComponentOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`addToScene`](FComponentOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:364
***
### color?
> `optional` **color**: `number`
#### Defined in
[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L11)
***
### gradient?
> `optional` **gradient**: [`GradientStep`](GradientStep.md)[]
#### Defined in
[2d/src/polygons/FPolygon.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L12)
***
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`position`](FComponentOptions.md#position)
#### Defined in
[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotation`](FComponentOptions.md#rotation)
#### Defined in
[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotationDegree`](FComponentOptions.md#rotationdegree)
#### Defined in
[2d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scale`](FComponentOptions.md#scale)
#### Defined in
[2d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scene`](FComponentOptions.md#scene)
#### Defined in
core/dist/index.d.ts:363
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FPolyhedronOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FPolyhedronOptions
# Interface: FPolyhedronOptions
## Extends
- [`FComponentOptions`](FComponentOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`addToScene`](FComponentOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:364
***
### color?
> `optional` **color**: `number`
#### Defined in
[3d/src/polyhedrons/FPolyhedron.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/polyhedrons/FPolyhedron.ts#L6)
***
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`position`](FComponentOptions.md#position)
#### Defined in
[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotation`](FComponentOptions.md#rotation)
#### Defined in
[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotationDegree`](FComponentOptions.md#rotationdegree)
#### Defined in
[3d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scale`](FComponentOptions.md#scale)
#### Defined in
[3d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scene`](FComponentOptions.md#scene)
#### Defined in
core/dist/index.d.ts:363
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FRigidBodyOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FRigidBodyOptions
# Interface: FRigidBodyOptions
## Properties
### enabledTranslations?
> `optional` **enabledTranslations**: `object`
#### enableX
> **enableX**: `boolean`
#### enableY
> **enableY**: `boolean`
#### Defined in
[2d/src/core/FRigidBody.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L25)
***
### lockRotations?
> `optional` **lockRotations**: `boolean`
#### Defined in
[2d/src/core/FRigidBody.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L24)
***
### lockTranslations?
> `optional` **lockTranslations**: `boolean`
#### Defined in
[2d/src/core/FRigidBody.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L23)
***
### position?
> `optional` **position**: `FVector2`
#### Defined in
[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L12)
***
### positionOffset?
> `optional` **positionOffset**: `FVector2`
#### Defined in
[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L16)
***
### rigidBodyType?
> `optional` **rigidBodyType**: [`FRigidBodyType`](../enumerations/FRigidBodyType.md)
#### Defined in
[2d/src/core/FRigidBody.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L21)
***
### rotation?
> `optional` **rotation**: `number`
#### Defined in
[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L13)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Defined in
[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L14)
***
### rotationDegreeOffset?
> `optional` **rotationDegreeOffset**: `number`
#### Defined in
[2d/src/core/FRigidBody.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L18)
***
### rotationOffset?
> `optional` **rotationOffset**: `number`
#### Defined in
[2d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L17)
***
### scale?
> `optional` **scale**: `FVector2`
#### Defined in
[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L15)
***
### scaleOffset?
> `optional` **scaleOffset**: `FVector2`
#### Defined in
[2d/src/core/FRigidBody.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L19)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L11)
***
### sensor?
> `optional` **sensor**: `boolean`
#### Defined in
[2d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L22)
***
### shape?
> `optional` **shape**: [`FShapes`](../enumerations/FShapes.md)
#### Defined in
[2d/src/core/FRigidBody.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FRigidBody.ts#L20)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FRigidBodyOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FRigidBodyOptions
# Interface: FRigidBodyOptions
## Properties
### enabledRotations?
> `optional` **enabledRotations**: `object`
#### enableX
> **enableX**: `boolean`
#### enableY
> **enableY**: `boolean`
#### enableZ
> **enableZ**: `boolean`
#### Defined in
[3d/src/core/FRigidBody.ts:33](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L33)
***
### enabledTranslations?
> `optional` **enabledTranslations**: `object`
#### enableX
> **enableX**: `boolean`
#### enableY
> **enableY**: `boolean`
#### enableZ
> **enableZ**: `boolean`
#### Defined in
[3d/src/core/FRigidBody.ts:28](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L28)
***
### lockRotations?
> `optional` **lockRotations**: `boolean`
#### Defined in
[3d/src/core/FRigidBody.ts:27](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L27)
***
### lockTranslations?
> `optional` **lockTranslations**: `boolean`
#### Defined in
[3d/src/core/FRigidBody.ts:26](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L26)
***
### mesh?
> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\>
#### Defined in
[3d/src/core/FRigidBody.ts:23](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L23)
***
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L14)
***
### positionOffset?
> `optional` **positionOffset**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L18)
***
### rigidBodyType?
> `optional` **rigidBodyType**: [`FRigidBodyType`](../enumerations/FRigidBodyType.md)
#### Defined in
[3d/src/core/FRigidBody.ts:24](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L24)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L15)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L16)
***
### rotationDegreeOffset?
> `optional` **rotationDegreeOffset**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L20)
***
### rotationOffset?
> `optional` **rotationOffset**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L19)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L17)
***
### scaleOffset?
> `optional` **scaleOffset**: `FVector3`
#### Defined in
[3d/src/core/FRigidBody.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L21)
***
### scene?
> `optional` **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L13)
***
### sensor?
> `optional` **sensor**: `boolean`
#### Defined in
[3d/src/core/FRigidBody.ts:25](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L25)
***
### shape?
> `optional` **shape**: [`FShapes`](../enumerations/FShapes.md)
#### Defined in
[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FRigidBody.ts#L22)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FSceneOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FSceneOptions
# Interface: FSceneOptions
## Extends
- `FSceneOptions`
## Properties
### autoLoop?
> `optional` **autoLoop**: `boolean`
#### Inherited from
`FSceneOptionsCore.autoLoop`
#### Defined in
core/dist/index.d.ts:219
***
### domNode?
> `optional` **domNode**: `HTMLElement`
#### Inherited from
`FSceneOptionsCore.domNode`
#### Defined in
core/dist/index.d.ts:218
***
### gravity?
> `optional` **gravity**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Overrides
`FSceneOptionsCore.gravity`
#### Defined in
[2d/src/core/FScene.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FScene.ts#L16)
***
### mainFrameRate?
> `optional` **mainFrameRate**: `number`
#### Inherited from
`FSceneOptionsCore.mainFrameRate`
#### Defined in
core/dist/index.d.ts:220
***
### physicFrameRate?
> `optional` **physicFrameRate**: `number`
#### Inherited from
`FSceneOptionsCore.physicFrameRate`
#### Defined in
core/dist/index.d.ts:221
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FSceneOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FSceneOptions
# Interface: FSceneOptions
## Extends
- `FSceneOptions`
## Properties
### autoLoop?
> `optional` **autoLoop**: `boolean`
#### Inherited from
`FSceneOptionsCore.autoLoop`
#### Defined in
core/dist/index.d.ts:219
***
### domNode?
> `optional` **domNode**: `HTMLElement`
#### Inherited from
`FSceneOptionsCore.domNode`
#### Defined in
core/dist/index.d.ts:218
***
### gravity?
> `optional` **gravity**: `FVector3`
#### Overrides
`FSceneOptionsCore.gravity`
#### Defined in
[3d/src/core/FScene.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L15)
***
### mainFrameRate?
> `optional` **mainFrameRate**: `number`
#### Inherited from
`FSceneOptionsCore.mainFrameRate`
#### Defined in
core/dist/index.d.ts:220
***
### physicFrameRate?
> `optional` **physicFrameRate**: `number`
#### Inherited from
`FSceneOptionsCore.physicFrameRate`
#### Defined in
core/dist/index.d.ts:221
***
### shadows?
> `optional` **shadows**: `boolean`
#### Defined in
[3d/src/core/FScene.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FScene.ts#L16)
---
---
url: 'https://fibbo.dev/api/core/interfaces/FSceneOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FSceneOptions
# Interface: FSceneOptions
## Properties
### autoLoop?
> `optional` **autoLoop**: `boolean`
#### Defined in
[core/src/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L13)
***
### domNode?
> `optional` **domNode**: `HTMLElement`
#### Defined in
[core/src/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L12)
***
### gravity?
> `optional` **gravity**: `object` \| `object`
#### Defined in
[core/src/FScene.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L11)
***
### mainFrameRate?
> `optional` **mainFrameRate**: `number`
#### Defined in
[core/src/FScene.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L14)
***
### physicFrameRate?
> `optional` **physicFrameRate**: `number`
#### Defined in
[core/src/FScene.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FScene.ts#L15)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FSpotLightOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FSpotLightOptions
# Interface: FSpotLightOptions
## Extends
- [`FLightOptions`](FLightOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`addToScene`](FLightOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:37
***
### angle?
> `optional` **angle**: `number`
#### Defined in
[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FSpotLight.ts#L7)
***
### color?
> `optional` **color**: `ColorRepresentation`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`color`](FLightOptions.md#color)
#### Defined in
[3d/src/lights/FLight.ts:13](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L13)
***
### decay?
> `optional` **decay**: `number`
#### Defined in
[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FSpotLight.ts#L9)
***
### distance?
> `optional` **distance**: `number`
#### Defined in
[3d/src/lights/FSpotLight.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FSpotLight.ts#L6)
***
### intensity?
> `optional` **intensity**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`intensity`](FLightOptions.md#intensity)
#### Defined in
[3d/src/lights/FLight.ts:14](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L14)
***
### lookAt?
> `optional` **lookAt**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`lookAt`](FLightOptions.md#lookat)
#### Defined in
[3d/src/lights/FLight.ts:15](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L15)
***
### penumbra?
> `optional` **penumbra**: `number`
#### Defined in
[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FSpotLight.ts#L8)
***
### position?
> `optional` **position**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`position`](FLightOptions.md#position)
#### Defined in
[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L9)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotation`](FLightOptions.md#rotation)
#### Defined in
[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L10)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`rotationDegree`](FLightOptions.md#rotationdegree)
#### Defined in
[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L11)
***
### scale?
> `optional` **scale**: `FVector3`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scale`](FLightOptions.md#scale)
#### Defined in
[3d/src/lights/FLight.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L12)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`scene`](FLightOptions.md#scene)
#### Defined in
core/dist/index.d.ts:36
***
### shadowQuality?
> `optional` **shadowQuality**: `number`
#### Inherited from
[`FLightOptions`](FLightOptions.md).[`shadowQuality`](FLightOptions.md#shadowquality)
#### Defined in
[3d/src/lights/FLight.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/lights/FLight.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FSpriteOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FSpriteOptions
# Interface: FSpriteOptions
## Extends
- [`FComponentOptions`](FComponentOptions.md)
## Properties
### addToScene?
> `optional` **addToScene**: `boolean`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`addToScene`](FComponentOptions.md#addtoscene)
#### Defined in
core/dist/index.d.ts:364
***
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`position`](FComponentOptions.md#position)
#### Defined in
[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L16)
***
### rotation?
> `optional` **rotation**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotation`](FComponentOptions.md#rotation)
#### Defined in
[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L17)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`rotationDegree`](FComponentOptions.md#rotationdegree)
#### Defined in
[2d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L18)
***
### scale?
> `optional` **scale**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scale`](FComponentOptions.md#scale)
#### Defined in
[2d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FComponent.ts#L19)
***
### scene?
> `optional` **scene**: `FScene`
#### Inherited from
[`FComponentOptions`](FComponentOptions.md).[`scene`](FComponentOptions.md#scene)
#### Defined in
core/dist/index.d.ts:363
***
### texture
> **texture**: `string`
#### Defined in
[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/sprite/FSprite.ts#L7)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/FTransformOptions.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / FTransformOptions
# Interface: FTransformOptions
## Properties
### position?
> `optional` **position**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L5)
***
### rotation?
> `optional` **rotation**: `number`
#### Defined in
[2d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L6)
***
### rotationDegree?
> `optional` **rotationDegree**: `number`
#### Defined in
[2d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L7)
***
### scale?
> `optional` **scale**: `object`
#### x
> **x**: `number`
#### y
> **y**: `number`
#### Defined in
[2d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/core/FTransform.ts#L8)
---
---
url: 'https://fibbo.dev/api/3d/interfaces/FTransformOptions.md'
---
[@fibbojs](/api/index) / [3d](/api/3d) / FTransformOptions
# Interface: FTransformOptions
## Properties
### position?
> `optional` **position**: `FVector3`
#### Defined in
[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L5)
***
### rotation?
> `optional` **rotation**: `FVector3`
#### Defined in
[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L6)
***
### rotationDegree?
> `optional` **rotationDegree**: `FVector3`
#### Defined in
[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L7)
***
### scale?
> `optional` **scale**: `FVector3`
#### Defined in
[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/3d/src/core/FTransform.ts#L8)
---
---
url: 'https://fibbo.dev/api/core/interfaces/FVector2.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FVector2
# Interface: FVector2
A 2d vector with x and y coordinates.
## Properties
### x
> **x**: `number`
The x coordinate of the vector.
#### Defined in
[core/src/types/FVector2.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector2.ts#L8)
***
### y
> **y**: `number`
The y coordinate of the vector.
#### Defined in
[core/src/types/FVector2.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector2.ts#L12)
---
---
url: 'https://fibbo.dev/api/core/interfaces/FVector3.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FVector3
# Interface: FVector3
A 3d vector with x, y and z coordinates.
## Properties
### x
> **x**: `number`
The x coordinate of the vector.
#### Defined in
[core/src/types/FVector3.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector3.ts#L8)
***
### y
> **y**: `number`
The y coordinate of the vector.
#### Defined in
[core/src/types/FVector3.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector3.ts#L12)
***
### z
> **z**: `number`
The z coordinate of the vector.
#### Defined in
[core/src/types/FVector3.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector3.ts#L16)
---
---
url: 'https://fibbo.dev/api/core/interfaces/FVector4.md'
---
[@fibbojs](/api/index) / [core](/api/core) / FVector4
# Interface: FVector4
A 4d vector with x, y, z and w coordinates.
## Properties
### w
> **w**: `number`
The w coordinate of the vector.
#### Defined in
[core/src/types/FVector4.ts:20](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector4.ts#L20)
***
### x
> **x**: `number`
The x coordinate of the vector.
#### Defined in
[core/src/types/FVector4.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector4.ts#L8)
***
### y
> **y**: `number`
The y coordinate of the vector.
#### Defined in
[core/src/types/FVector4.ts:12](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector4.ts#L12)
***
### z
> **z**: `number`
The z coordinate of the vector.
#### Defined in
[core/src/types/FVector4.ts:16](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/types/FVector4.ts#L16)
---
---
url: 'https://fibbo.dev/api/2d/interfaces/GradientStep.md'
---
[@fibbojs](/api/index) / [2d](/api/2d) / GradientStep
# Interface: GradientStep
## Properties
### color
> **color**: `number`
#### Defined in
[2d/src/polygons/FPolygon.ts:7](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L7)
***
### position
> **position**: `number`
#### Defined in
[2d/src/polygons/FPolygon.ts:6](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/2d/src/polygons/FPolygon.ts#L6)
---
---
url: 'https://fibbo.dev/api/core/interfaces/OnCollisionWithData.md'
---
[@fibbojs](/api/index) / [core](/api/core) / OnCollisionWithData
# Interface: OnCollisionWithData
Data being sent to collision callbacks.
## Properties
### component
> **component**: [`FComponent`](../classes/FComponent.md)
The component that collided with the component.
#### Defined in
[core/src/FComponent.ts:21](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/FComponent.ts#L21)
---
---
url: 'https://fibbo.dev/api/core/interfaces/PipelineManagerOptions.md'
---
[@fibbojs](/api/index) / [core](/api/core) / PipelineManagerOptions
# Interface: PipelineManagerOptions
## Properties
### autoLoop?
> `optional` **autoLoop**: `boolean`
#### Defined in
[core/src/pipeline/PipelineManager.ts:9](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L9)
***
### scene
> **scene**: [`FScene`](../classes/FScene.md)
#### Defined in
[core/src/pipeline/PipelineManager.ts:8](https://github.com/fibbojs/fibbo/blob/65626b456ab47d7e61b23a8dd1be9f399238b0f1/packages/core/src/pipeline/PipelineManager.ts#L8)
---
---
url: 'https://fibbo.dev/getting-started/introduction.md'
---
# Introduction
Fibbo (pronounced [fˈa͡ɪbo͡ʊ](http://ipa-reader.xyz/?text=f%CB%88a%CD%A1%C9%AAbo%CD%A1%CA%8A)) is a free and [open-source](https://github.com/fibbojs/fibbo) web-based game engine that allows you to create interactive experiences using JavaScript, right in your browser.
It is designed to be simple to use, extensible, and flexible. You can use it to create games, simulations, visualizations, and more.
Fibbo exposes a simple object-oriented API that allows you to create and manipulate objects in a scene, both in 2D or 3D. You can add objects to the scene, move them around, rotate them, and much more.
## Why Fibbo ?
There are already many game engines available, such as [Unity](https://unity.com/), [Unreal Engine](https://www.unrealengine.com/), and [Godot](https://godotengine.org/). So why did we create Fibbo ?
There are a few reasons:
- **Accessibility** : Web games are easy to share, run on any device, and don't require any installation. We think this is an appropriate plateform for many types of experiences, such as arcade games, educational games, and more.
- **Easy to learn** : We think that Fibbo is easier to learn than other game engines. The API is fairly minimal, and the documentation was designed to be accessible to beginners.
- **Extensible** : Fibbo is designed to be extensible. You can create your own components, behaviors, and systems to extend the engine's functionality, but also share them easily through libraries (see [Extending Fibbo](/more/extending-fibbo)).
- **Free and open-source** : Fibbo is free to use and open-source. You can use it for any purpose, commercial or non-commercial, without any restrictions.
## Why not Fibbo ?
Although we think Fibbo is a great tool for many types of experiences, it may not be the best choice for all projects.
Here are a few reasons why you might not want to use Fibbo :
- **Performance** : It is fair to say that the web platform can't get as much performance as native platforms. And this is even more true for Fibbo, which is still in its early stages of development.
- **Standardization** : Fibbo is new and still not widely used. If you're on your way to become a professional game developer, you should probably consider more standard tools (we highly recommend [Godot](https://godotengine.org/) as a free and open-source game engine !).
- **Stability** : Fibbo is still in alpha. This means that there may be bugs, missing features, and breaking changes. We are working hard to improve the engine, but it may not be the best choice for a project that requires stability.
## So should I use it ?
Well it's really up to you ! We believe Fibbo can create fun experiences for everyone.
Moreover, we would really appreciate your feedback, so if you have any suggestions, questions, or if you encounter any issues, please let us know by either [asking on the forum](https://github.com/orgs/fibbojs/discussions) or [opening an issue on GitHub](https://github.com/fibbojs/fibbo/issues).
We are doing our best to make a great tool so developers can create amazing experiences, and your feedback is really important to us.
Ready to take off ? You can go to the next section to learn how to get started with Fibbo.
Have fun !
---
---
url: 'https://fibbo.dev/guide/physics/introduction.md'
---
# Introduction
Most of the game needs physics to simulate collisions, forces, gravity, and more. These concepts can't be applied directly to your objects for performance reasons, so you need a physics engine to handle them.
This is often a complex and time-consuming task, as you'll need to understand the underlying physics engine to synchronize your rendering with the physics simulation.
Fibbo provides a simple and easy-to-use API that abstracts the complexity of the underlying physics engine ([Rapier](https://rapier.rs/)), so you can focus on your game logic.
## How to setup the physics engine
The [`FScene`](/api/core/classes/FScene) component (either in [2d](/api/2d/classes/FScene) or [3d](/api/3d/classes/FScene)) class exposes an `initPhysics` method that initializes the physics engine for you. This method is asynchronous, so you need to use an async function to call it.
Once the physics engine is initialized, you can start adding physics to the components in your scene.
::: tip
A fair amount of the documentation was inspired by the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/getting_started_js).
:::
---
---
url: 'https://fibbo.dev/guide/physics/joints.md'
---
# Joints
As joints are still not supported natively in Fibbo, you should use the underlying libraries to create and manage joints in your scene.
You can check the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/joints) to learn more about how to manage joints in Rapier.
---
---
url: 'https://fibbo.dev/guide/events/keyboard.md'
---
# Keyboard
The `@fibbojs/event` package provides a convenient way to listen to keyboard events in a game-like way.
## Initialization
You can create a new `FKeyboard` instance and start listening to keyboard events.
```typescript
import { FKeyboard } from '@fibbojs/event'
const keyboard = new FKeyboard()
keyboard.on('a', () => {
console.log('The "a" key was pressed')
})
```
## Listening to keys
There are 3 types of events you can listen to :
- [`on`](/api/event/classes/FKeyboard#on) : Triggered each frame if the key is pressed.
- [`onKeyDown`](/api/event/classes/FKeyboard#onkeydown) : Triggered once when the key is pressed.
- [`onKeyUp`](/api/event/classes/FKeyboard#onkeyup) : Triggered once when the key is released.
```typescript
keyboard.on('a', () => {
console.log('The "a" key is being pressed the current frame')
})
keyboard.onKeyDown('a', () => {
console.log('The "a" key was pressed')
})
keyboard.onKeyUp('a', () => {
console.log('The "a" key was released')
})
```
## Clearing events
You can clear all the events on a keyboard instance using the [`clear`](/api/event/classes/FKeyboard#clear) method.
```typescript
keyboard.clear()
```
---
---
url: 'https://fibbo.dev/guide/core/lights.md'
---
# Lights
For now, lights are only available in 3D.
The 3D starter includes a basic [AmbientLight](/api/3d/classes/FAmbientLight) and a [DirectionalLight](/api/3d/classes/FDirectionalLight) to light the scene.
## Configuration
Lights already work out of the box, but as shadows are disabled by default, you may want to enable them.
Fibbo provides a default shadow configuration which can be activated by setting the `shadows` option to `true` when creating a scene.
```ts
const scene = new FScene({
shadows: true,
})
```
::: tip
Note that shadows do not cast on certain materials, such as the [MeshBasicMaterial](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial)
:::
## Usage
Lights can be created as follows (they will be automatically added to the scene) :
```ts
import { FAmbientLight, FDirectionalLight, FSpotLight } from '@fibbojs/3d'
// Add directional light to represent the sun
new FDirectionalLight({
position: { x: 20, y: 20, z: 0 },
color: 0xFFFFFF,
intensity: 3,
shadowQuality: 12,
})
// Add spot light
new FSpotLight({
position: { x: 4, y: 4, z: 4 },
angle: 1,
distance: 8,
color: 0xFFFFFF,
intensity: 30,
lookAt: { x: 8, y: 0, z: 8 },
shadowQuality: 7,
})
// Add ambient light
new FAmbientLight({
color: 0x404040,
intensity: 20,
})
```
They can also be removed using the `removeLight` method.
```ts
scene.removeLight(light)
```
::: tip
The shadow quality is a very important parameter. The higher the quality, the better the shadows will look, but the more resources will be used.
It will be interpreted as a power of 2, so for example the default value of 5 will result in a shadow map of 32x32 pixels.
Generally, the farther the light is from the objects, the higher the quality should be.
:::
### Available lights
Here are the available lights in 3D :
| Camera | Description | Can cast shadows |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| FAmbientLight | This light globally illuminates all objects in the scene equally. This light cannot be used to cast shadows as it does not have a direction. | ❌ |
| FDirectionalLight | A light that gets emitted in a specific direction. This light will behave as though it is infinitely far away and the rays produced from it are all parallel. The common use case for this is to simulate daylight; the sun is far enough away that its position can be considered to be infinite, and all light rays coming from it are parallel. | ✅ |
| FHemisphereLight | A light source positioned directly above the scene, with color fading from the sky color to the ground color. This light cannot be used to cast shadows. | ❌ |
| FLight | `(abstract)` A light. | ❌ |
| FLightProbe | See [Three.js LightProbe](https://threejs.org/docs/?q=light#api/en/lights/LightProbe) | ❌ |
| FPointLight | A light that gets emitted from a single point in all directions. A common use case for this is to replicate the light emitted from a bare lightbulb. | ✅ |
| FSpotLight | This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets. | ✅ |
---
---
url: 'https://fibbo.dev/guide/3d/mesh.md'
---
# Mesh
Every [`FComponent`](/api/3d/classes/FComponent) in `@fibbojs/3d` has a [`__MESH__`](/api/3d/classes/FComponent#mesh) attribute that corresponds to the [Three.js Mesh](https://threejs.org/docs/#api/en/objects/Mesh) that will be used to render the component.
It will either be one of [classic polyhedrons](https://threejs.org/docs/#api/en/geometries/PolyhedronGeometry) (like a [BoxGeometry](https://threejs.org/docs/#api/en/geometries/BoxGeometry) or a [SphereGeometry](https://threejs.org/docs/#api/en/geometries/SphereGeometry)) or a [custom 3D model](https://threejs.org/docs/#manual/en/introduction/Loading-3D-models).
Unless you have a good reason to do so, you should not modify the [`__MESH__`](/api/3d/classes/FComponent#mesh) attribute directly, but use the provided methods instead.
## What is a mesh ?
A [mesh](https://en.wikipedia.org/wiki/Polygon_mesh) is a 3D object that is composed of vertices, edges, and faces. It is the basic building block of any 3D computer graphics.
---
---
url: 'https://fibbo.dev/guide/3d/models.md'
---
# Models
## Introduction
Models are the core of any 3D application. They are the objects that are rendered in the scene.
They can be simple shapes like cubes or spheres ; but in Fibbo, we will use the term to refer to complex 3D models that are created in a 3D modeling software like [Blender](https://www.blender.org/).
Here is a brief overview of the most common 3D models file formats :
- [.fbx](https://en.wikipedia.org/wiki/FBX) : A proprietary file format developed by Autodesk. It is widely used in the game industry.
- [.obj](https://en.wikipedia.org/wiki/Wavefront_.obj_file) : A simple text-based file format, one of the most basic formats. It often comes with a [`.mtl`](https://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_template_library) file that contains the materials of the model.
- [.gltf](https://en.wikipedia.org/wiki/GlTF) : Often defined as [the JPEG for 3D](https://www.khronos.org/gltf/), it is a very extensible format that is widely supported by 3D engines.
- [.glb](https://fr.wikipedia.org/wiki/GlTF) : Based on the `GlTF` format, but it is a binary format that can contain all the assets of a 3D model (like textures, animations...).
## Loading a model
To load a model in Fibbo, you can use the appropriate class from the `@fibbojs/3d` library, depending on the format of the model.
All the classes share the same options for the constructor :
- `name` : The name of the model, if provided, the path will be computed as `/assets/${name}/${name}.${fileExtension || 'obj'}`. e.g. `cube` will load `/assets/cube/cube.obj`.
- `path` : The path to the model file.
- `fileExtension` : The extension of the model file. If not provided, it will default depending on the class used (`.obj` for `FOBJ`, `.fbx` for `FFBX`...).
- `texture` : If the model file indicates there are textures, you can provide a path to the texture file for each material. By default, the texture URL will be considered `/assets/${name}/Textures/colormap.png`. It can be useful if the texture referenced in the file are not named as expected or if you want to use a different texture. e.g. :
```json
{
"default": "/assets/cube/Textures/colormap.png"
}
```
Here the `default` material will use the texture `/assets/cube/Textures/colormap.png`.
### FBX
To load a `.fbx` model, you can use the `FFBX` class. Here is an example :
```typescript
import { FFBX } from '@fibbojs/3d'
const fbx = new FFBX({
path: 'path/to/your/model.fbx',
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
})
```
### OBJ
To load a `.obj` model, you can use the `FOBJ` class. Here is an example :
```typescript
import { FOBJ } from '@fibbojs/3d'
const obj = new FOBJ({
path: 'path/to/your/model.obj',
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
})
```
### GLB
To load a `.glb` model, you can use the `FGLB` class. Here is an example :
```typescript
import { FGLB } from '@fibbojs/3d'
const glb = new FGLB({
path: 'path/to/your/model.glb',
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
})
```
::: tip
For now, `FLGB` is just a wrapper around `FGLTF`, but it could be extended in the future to support the specific features of the `.glb` format, so it is recommended to use `FGLB` for `.glb` files.
:::
### GLTF
To load a `.gltf` model, you can use the `FGLTF` class. Here is an example :
```typescript
import { FGLTF } from '@fibbojs/3d'
const gltf = new FGLTF({
path: 'path/to/your/model.gltf',
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
})
```
---
---
url: 'https://fibbo.dev/guide/2d/polygons.md'
---
# Polygons
Polygons are a fundamental part of 2D graphics. They are used to create shapes like rectangles, circles, and more complex shapes.
## What is a polygon ?
A polygon is a 2D shape that is made up of straight lines. It is a type of [polytope](https://en.wikipedia.org/wiki/Polytope) in two dimensions.
For now, only 2 types of polygons are supported by Fibbo : rectangles and circles.
## Rectangles
To create a rectangle, you can use the `FRectangle` class. Here is an example:
```typescript
import { FRectangle } from '@fibbojs/2d'
const square = new FRectangle({
position: { x: 0, y: 5 },
scale: { x: 1, y: 1 },
color: 0xFF0000,
})
```
This will create a rectangles with a size of `1` at the position `(0, 5)`. As the scale is `(1, 1)`, the rectangle will be a square.
## Circles
To create a circle, you can use the `FCircle` class. Here is an example:
```typescript
import { FCircle } from '@fibbojs/2d'
const circle = new FCircle({
position: { x: 0, y: 5 },
scale: { x: 1, y: 1 },
color: 0xFF0000,
})
```
This will create a circle with a radius of `1` at the position `(0, 5)`.
---
---
url: 'https://fibbo.dev/guide/3d/polyhedrons.md'
---
# Polyhedrons
Polyhedrons are 3D shapes that are made up of flat faces. Theoritically, almost any 3D objects can be represented as a polyhedron ; but in Fibbo, we will use the term to refer to basic shapes like cuboids, spheres, capsules...
## What is a polyhedron ?
A polyhedron is a 3D shape that is made up of flat faces. It is a type of [polytope](https://en.wikipedia.org/wiki/Polytope) in three dimensions.
The faces of a polyhedron are usually polygons, and the edges are the lines where two faces meet. The vertices are the points where three or more edges meet.
For now, only 3 types of polyhedrons are supported by Fibbo : cuboids, spheres and capsules.
## Cuboids
To create a cuboid, you can use the `FCuboid` class. Here is an example:
```typescript
import { FCuboid } from '@fibbojs/3d'
const cube = new FCuboid({
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
color: 0x00FF00,
})
```
This will create a cuboid with a size of `1` at the position `(0, 5, 0)`. As the scale is `(1, 1, 1)`, the cuboid will be a cube.
## Spheres
To create a sphere, you can use the `FSphere` class. Here is an example:
```typescript
import { FSphere } from '@fibbojs/3d'
const sphere = new FSphere({
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
color: 0x00FF00,
})
```
This will create a sphere with a radius of `1` at the position `(0, 5, 0)`.
## Capsules
To create a capsule, you can use the `FCapsule` class. Here is an example:
```typescript
import { FCapsule } from '@fibbojs/3d'
const capsule = new FCapsule({
position: { x: 0, y: 5, z: 0 },
scale: { x: 1, y: 1, z: 1 },
color: 0x00FF00,
})
```
This will create a capsule with a radius of `1` and a height of `1` at the position `(0, 5, 0)`.
---
---
url: 'https://fibbo.dev/guide/physics/rigidbody.md'
---
# RigidBody
The real-time simulation of rigidBodies subjected to forces and contacts is the main feature of a physics engine. rigidBodies are responsible for the dynamics and kinematics of a solid.
rigidBodies are typically used to simulate the dynamics of non-deformable solids as well as to integrate the trajectory of solids which velocities are controlled by the user (e.g. moving platforms).
On the other hand, rigidBodies are not enough to simulate, e.g., cars, ragdolls, or robotic systems, as those use-cases require adding restrictions on the relative motion between their parts using [joints](/guide/physics/joints).
## Relation with colliders
A [collider](/guide/physics/colliders) can be attached to a rigidBody to specify its shape and enable collision-detection.
A rigidBody without collider attached to it will not be affected by contacts (because there is no shape to compute contact against).
::: tip
By default, Fibbo always create a collider when a rigidBody is created.
:::
## Types of RigidBody
There are 4 types of rigidbody :
- Dynamic (`FRigidBodyType.DYNAMIC`) : Indicates that the body is affected by external forces and contacts. This is the one used for objects affeted by gravity, forces, etc.
- Fixed (`FRigidBodyType.FIXED`) : Indicates the body cannot move. It acts as if it has an infinite mass and will not be affected by any force. It will continue to collide with dynamic bodies but not with fixed nor with kinematic bodies. This is typically used for the ground or for temporarily freezing a body.
- Kinematic Position Based (`FRigidBodyType.KINEMATIC_POSITION_BASED`): Indicates that the body position must not be altered by the physics engine. The user is free to set its next position and the body velocity will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc.
- Kinematic Velocity Based (`FRigidBodyType.KINEMATIC_VELOCITY_BASED`): Indicates that the body velocity must not be altered by the physics engine. The user is free to set its velocity and the next body position will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc.
## Adding a rigidBody to a component
Every [`FComponent`](/api/core/classes/FComponent) has a [`initRigidBody`](/api/3d/classes/FComponent#initrigidbody) method that allows you to create a rigidBody and attach it to the component directly.
::: code-group
```typescript [2d]
import { FRectangle, FShapes } from '@fibbojs/2d'
const rectangle = new FRectangle()
rectangle.initRigidBody({
positionOffset: { x: 0, y: 0 },
rotationOffset: 0,
rotationDegreeOffset: 0,
scaleOffset: { x: 1, y: 1 },
shape: FShapes.CUBE,
rigidBodyType: FRigidBodyType.DYNAMIC
})
```
```typescript [3d]
import { FCuboid, FShapes } from '@fibbojs/3d'
const cube = new FCuboid()
cube.initRigidBody({
positionOffset: { x: 0, y: 0, z: 0 },
rotationOffset: { x: 0, y: 0, z: 0 },
rotationDegreeOffset: { x: 0, y: 0, z: 0 },
scaleOffset: { x: 1, y: 1, z: 1 },
shape: FShapes.CUBE,
rigidBodyType: FRigidBodyType.DYNAMIC
})
```
:::
Apart from the classic [transform](/guide/core/transforms) properties, the `initRigidBody` method accepts the following parameters :
- `position` : The position of the rigidBody.
- `rotation` : The rotation of the rigidBody.
- `rotationDegree` : The rotation of the rigidBody in degrees.
- `scale` : The scale of the rigidBody.
- `positionOffset` : The offset of the position of the rigidBody.
- `rotationOffset` : The offset of the rotation of the rigidBody.
- `rotationDegreeOffset` : The offset of the rotation of the rigidBody in degrees.
- `scaleOffset` : The offset of the scale of the rigidBody.
- `shape` : The shape of the collider attached to the rigidBody. This is required to compute contacts.
- `rigidBodyType` : The type of the rigidBody.
- `lockTranslations` : A boolean indicating if the translations of the rigidBody should be locked.
- `enabledTranslations` : An object containing the enabled translations of the rigidBody.
- `enableX` : A boolean indicating if the translation along the x-axis is enabled.
- `enableY` : A boolean indicating if the translation along the y-axis is enabled.
- `enableZ` : A boolean indicating if the translation along the z-axis is enabled. (only exist on 3d rigidBodies)
- `lockRotations` : A boolean indicating if the rotations of the rigidBody should be locked.
- `enabledRotations` : An object containing the enabled rotations of the rigidBody. (only exist on 3d rigidBodies)
- `enableX` : A boolean indicating if the rotation around the x-axis is enabled.
- `enableY` : A boolean indicating if the rotation around the y-axis is enabled.
- `enableZ` : A boolean indicating if the rotation around the z-axis is enabled.
As soon as a rigidBody is attached to a component, the component's transform will be updated relatively to the rigidBody's transform.
An offset can be applied to the rigidBody's transform so it can be placed relatively to the component's transform.
To learn more about rigidBodies, you can refer to the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/rigid_bodies).
---
---
url: 'https://fibbo.dev/guide/core/scene.md'
---
# Scene
The `Scene` class represents the 2D or 3D scene that will be responsible for storing and rendering all the components.
## What is a scene ?
A scene is a class that extends the [`FScene`](/api/core/classes/FScene) core class. It represents a 2D or 3D environment where you can add components, cameras, lights, and more.
Its main purpose is to initialize the technical environment for your game, aswell as managing the lifecycle of the components and render them on the screen.
## Creating a scene
Creating a scene involves a few steps :
- Import the `FScene` class from the `@fibbojs/3d` or `@fibbojs/2d` library.
- Create a new instance of the `FScene` class.
- Calling the `init` method to initialize the scene.
- (optional) Calling the `initPhysics` method to initialize the physics engine.
So every Fibbo application should start with something like this :
::: code-group
```typescript [2d]
import { FScene } from '@fibbojs/2d'
// As the `init` and `initPhysics` methods are asynchronous, we need to use an async function.
// Not required if your environment supports top-level await.
(async () => {
const scene = new FScene()
await scene.init()
await scene.initPhysics()
})()
```
```typescript [3d]
import { FScene } from '@fibbojs/3d'
// As the `initPhysics` methods is asynchronous, we need to use an async function.
// Not required if your environment supports top-level await.
(async () => {
const scene = new FScene()
scene.init()
await scene.initPhysics()
})()
```
:::
## Options
The `FScene` class accepts several options that you can pass to the constructor :
| Option | Type | Description |
| ------ | ---- | ----------- |
| `gravity` | `{ x: number, y: number, z: number }` or `{ x: number, y: number }` | The gravity of the scene if you are using the physics engine. |
| `domNode` | [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) | The [DOM](https://developer.mozilla.org/en-US/docs/Glossary/DOM) [node](https://developer.mozilla.org/en-US/docs/Web/API/Node) where the scene will be rendered. |
| `autoLoop` | `boolean` | Whether the scene should automatically be rendered every frame. Note that if you set this to `false`, you will have to call the [`frame`](/api/core/classes/FScene#frame) method manually. |
## Methods
### `removeComponent`
The `removeComponent` method allows you to remove a given component from the scene.
```typescript
scene.removeComponent(component)
```
## Hooks
The `Scene` class exposes hooks that you can use to interact with the scene and its components. This feature took inspiration from the [Vue Lifecycle Hooks](https://vuejs.org/guide/essentials/lifecycle.html) system, but it is still very experimental.
Here is a list of the available hooks :
- [`onReady`](/api/core/classes/FScene#onready) : Called when the scene is ready to be used.
- [`onFrame`](/api/core/classes/FScene#onframe) : Called every frame by the scene. Delta time is passed as an argument.
- [`onComponentAdded`](/api/core/classes/FScene#oncomponentadded) : Called when a component is added to the scene.
- [`onComponentRemoved`](/api/core/classes/FScene#oncomponentremoved) : Called when a component is removed from the scene.
- [`onLightAdded`](/api/core/classes/FScene#onlightadded) : Called when a light is added to the scene.
- [`onLightRemoved`](/api/core/classes/FScene#onlightremoved) : Called when a light is removed from the scene.
```typescript
scene.onReady(() => {
// Do something when the scene is ready
})
scene.onFrame((delta) => {
// Do something on the scene every frame
})
scene.onComponentAdded((component: FComponent) => {
// Do something on a component added to the scene
})
scene.onComponentRemoved((component: FComponent) => {
// Do something on a component removed from the scene
})
scene.onLightAdded((light: FLight) => {
// Do something on a light added to the scene
})
scene.onLightRemoved((light: FLight) => {
// Do something on a light removed from the scene
})
```
---
---
url: 'https://fibbo.dev/guide/2d/sprites.md'
---
# Sprites
Sprites are the most common way to display objects in a 2D game. They are essentially 2D images that can be moved, rotated, and scaled in the scene.
## Creating a sprite
To create a sprite, you can use the `FSprite` class. Here is an example:
```typescript
import { FSprite } from '@fibbojs/2d'
const sprite = new FSprite({
texture: 'path/to/texture.png',
position: { x: 0, y: 5 },
scale: { x: 1, y: 1 },
})
```
This will create a sprite with the image located at `path/to/texture.png` at the position `(0, 5)`.
---
---
url: 'https://fibbo.dev/guide/core/transforms.md'
---
# Transforms
In most game engines, a transform is an object responsible for handling the position, rotation, and scale of a component in the scene.
In Fibbo, each component (sprites, lights, cameras, ...) or physic object (colliders, rigidbodies, ...) has a `transform` property that exposes these attributes.
The transform is meant to be accessed and modified using getters and setters.
You can find the API reference for a [2d transform here](/api/2d/classes/FTransform) and for a [3d transform here](/api/3d/classes/FTransform).
::: warning
For now, transforms are not deeply reactive, so you need to use the provided setters to update the values. For example :
- `transform.position = { x: 1, y: 2 }` is reactive
- `transform.x = 1` is reactive
- `transform.position.x = 1` is **NOT** reactive
:::
## Position
The position of an object is a 2D/3D vector that represents its location in the scene. For more information on the unit system, see the [fundamentals](/guide/fundamentals#unit-system) section.
You can set the position as follows :
::: code-group
```typescript [2d]
const rectangle = new FRectangle()
rectangle.transform.position = { x: 1, y: 2 }
// Or using the function directly :
rectangle.transform.setPosition({ x: 1, y: 2 })
// Accessing a specific axis :
rectangle.transform.x = 1
rectangle.transform.y = 2
```
```typescript [3d]
const cube = new FCuboid()
cube.transform.position = { x: 1, y: 2, z: 3 }
// Or using the function directly :
cube.transform.setPosition({ x: 1, y: 2, z: 3 })
// Accessing a specific axis :
cube.transform.x = 1
cube.transform.y = 2
cube.transform.z = 3
```
:::
## Rotation
The rotation of an object is a either a number (in 2D scenes) or a 3D vector (in 3D scenes) that represents its orientation in the scene. The rotation is expressed in [radians](https://en.wikipedia.org/wiki/Radian).
You can set the rotation as follows :
::: code-group
```typescript [2d]
const rectangle = new FRectangle()
rectangle.transform.rotation = Math.PI / 2
// Or using the function directly :
rectangle.transform.setRotation(Math.PI / 2)
```
```typescript [3d]
const cube = new FCuboid()
cube.transform.rotation = { x: Math.PI / 2, y: Math.PI / 2, z: Math.PI / 2 }
// Or using the function directly :
cube.transform.setRotation({ x: Math.PI / 2, y: Math.PI / 2, z: Math.PI / 2 })
// Accessing a specific axis :
cube.transform.rotationX = Math.PI / 2
cube.transform.rotationY = Math.PI / 2
cube.transform.rotationZ = Math.PI / 2
```
:::
Alternatively, you can use the `rotationDegree` property to set the rotation in degrees :
::: code-group
```typescript [2d]
const rectangle = new FRectangle()
rectangle.transform.rotationDegree = 90
// Or using the function directly :
rectangle.transform.setRotationDegree(90)
```
```typescript [3d]
const cube = new FCuboid()
cube.transform.rotationDegree = { x: 90, y: 90, z: 90 }
// Or using the function directly :
cube.transform.setRotationDegree({ x: 90, y: 90, z: 90 })
// Accessing a specific axis :
cube.transform.rotationDegreeX = 90
cube.transform.rotationDegreeY = 90
cube.transform.rotationDegreeZ = 90
```
:::
## Scale
The scale of an object is a 2D/3D vector that represents its size in the scene. For more information on the units system, see the [fundamentals](/guide/fundamentals#unit-system) section.
You can set the scale as follows :
::: code-group
```typescript [2d]
const rectangle = new FRectangle()
rectangle.transform.scale = { x: 2, y: 2 }
// Or using the function directly :
rectangle.transform.setScale({ x: 2, y: 2 })
// Accessing a specific axis :
rectangle.transform.scaleX = 2
rectangle.transform.scaleY = 2
```
```typescript [3d]
const cube = new FCuboid()
cube.transform.scale = { x: 2, y: 2, z: 2 }
// Or using the function directly :
cube.transform.setScale({ x: 2, y: 2, z: 2 })
// Accessing a specific axis :
cube.transform.scaleX = 2
cube.transform.scaleY = 2
cube.transform.scaleZ = 2
```
:::
---
---
url: 'https://fibbo.dev/index.md'
---
## Made with Fibbo
- [Fibbo's 2D Playground](https://fibbo.dev/playground-2d/) - A 2D playground to test Fibbo's 2D features.
- [Fibbo's 3D Playground](https://fibbo.dev/playground-3d/) - A 3D playground to test Fibbo's 3D features.
- [Rocket Starflop](https://gugustinette.github.io/rocket-starflop/) - An arcade shoot'em up game.
## Stargazers
## Our Team
---
---
url: 'https://fibbo.dev/api/util/index.md'
---
[@fibbojs](/api/index) / util
# util
## Index
### Classes
#### Core
- [FAssetUtil](classes/FAssetUtil.md)
- [FMathUtil](classes/FMathUtil.md)