diff --git a/apps/playground-3d/pages/rainbowls/main.ts b/apps/playground-3d/pages/rainbowls/main.ts index 2f5ef42b..b62f4df9 100644 --- a/apps/playground-3d/pages/rainbowls/main.ts +++ b/apps/playground-3d/pages/rainbowls/main.ts @@ -51,7 +51,9 @@ import * as THREE from 'three' const cameraTarget = new FCuboid(scene) cameraTarget.setPosition({ x: 0, y: 1, z: 0 }) // Create a camera - const camera = new FOrbitCamera(cameraTarget) + const camera = new FOrbitCamera({ + target: cameraTarget, + }) camera.setPosition(14, 12, 14) camera.lookAt(0, 0, 0) scene.camera = camera diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 6a106bc9..997a17e4 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -44,6 +44,7 @@ export default defineConfig({ { text: 'Cameras', link: '/guide/core/cameras' }, { text: 'Lights', link: '/guide/core/lights' }, { text: 'Assets', link: '/guide/core/assets' }, + { text: 'Controllers', link: '/guide/core/controllers' }, ] }, { text: '2D', collapsed: true, items: [ { text: 'Container', link: '/guide/2d/container' }, @@ -94,12 +95,13 @@ export default defineConfig({ { text: 'FFixedCamera', link: '/api/3d/classes/FFixedCamera' }, { text: 'FFreeCamera', link: '/api/3d/classes/FFreeCamera' }, ] }, - { text: 'Character Classes', items: [ - { text: 'FCharacter', link: '/api/2d/classes/FCharacter' }, - { text: 'FCharacterDynamic', link: '/api/2d/classes/FCharacterDynamic' }, - { text: 'FCharacterKinematic', link: '/api/2d/classes/FCharacterKinematic' }, - { text: 'FCharacterKP', link: '/api/2d/classes/FCharacterKP' }, - { text: 'FCharacterKV', link: '/api/2d/classes/FCharacterKV' }, + { text: 'Controller Classes', items: [ + { text: 'FController', link: '/api/2d/classes/FController' }, + { text: 'FCharacterController', link: '/api/2d/classes/FCharacterController' }, + { text: 'FCharacterControllerD', link: '/api/2d/classes/FCharacterControllerD' }, + { text: 'FCharacterControllerK', link: '/api/2d/classes/FCharacterControllerK' }, + { text: 'FCharacterControllerKP', link: '/api/2d/classes/FCharacterControllerKP' }, + { text: 'FCharacterControllerKV', link: '/api/2d/classes/FCharacterControllerKV' }, ] }, { text: 'Core Classes', items: [ { text: 'FComponent', link: '/api/2d/classes/FComponent' }, @@ -108,6 +110,7 @@ export default defineConfig({ { text: 'FTransform', link: '/api/2d/classes/FTransform' }, ] }, { text: 'Polygons Classes', items: [ + { text: 'FPolygon', link: '/api/2d/classes/FPolygon' }, { text: 'FCircle', link: '/api/2d/classes/FCircle' }, { text: 'FRectangle', link: '/api/2d/classes/FRectangle' }, ] }, @@ -119,9 +122,10 @@ export default defineConfig({ ] }, { text: 'Interfaces', items: [ { text: 'FCameraOptions', link: '/api/2d/interfaces/FCameraOptions' }, - { text: 'FCharacterOptions', link: '/api/2d/interfaces/FCharacterOptions' }, - { text: 'FComponentOptions', link: '/api/2d/interfaces/FComponentOptions' }, + { text: 'FCharacterControllerOptions', link: '/api/2d/interfaces/FCharacterControllerOptions' }, { text: 'FColliderOptions', link: '/api/2d/interfaces/FColliderOptions' }, + { text: 'FComponentOptions', link: '/api/2d/interfaces/FComponentOptions' }, + { text: 'FControllerOptions', link: '/api/2d/interfaces/FControllerOptions' }, { text: 'FRigidBodyOptions', link: '/api/2d/interfaces/FRigidBodyOptions' }, { text: 'FSceneOptions', link: '/api/2d/interfaces/FSceneOptions' }, { text: 'FTransformOptions', link: '/api/2d/interfaces/FTransformOptions' }, @@ -136,11 +140,12 @@ export default defineConfig({ { text: 'FOrbitCamera', link: '/api/3d/classes/FOrbitCamera' }, ] }, { text: 'Character Classes', items: [ - { text: 'FCharacter', link: '/api/3d/classes/FCharacter' }, - { text: 'FCharacterDynamic', link: '/api/3d/classes/FCharacterDynamic' }, - { text: 'FCharacterKinematic', link: '/api/3d/classes/FCharacterKinematic' }, - { text: 'FCharacterKP', link: '/api/3d/classes/FCharacterKP' }, - { text: 'FCharacterKV', link: '/api/3d/classes/FCharacterKV' }, + { text: 'FController', link: '/api/3d/classes/FController' }, + { text: 'FCharacterController', link: '/api/3d/classes/FCharacterController' }, + { text: 'FCharacterControllerD', link: '/api/3d/classes/FCharacterControllerD' }, + { text: 'FCharacterControllerK', link: '/api/3d/classes/FCharacterControllerK' }, + { text: 'FCharacterControllerKP', link: '/api/3d/classes/FCharacterControllerKP' }, + { text: 'FCharacterControllerKV', link: '/api/3d/classes/FCharacterControllerKV' }, ] }, { text: 'Core Classes', items: [ { text: 'FComponent', link: '/api/3d/classes/FComponent' }, @@ -148,30 +153,45 @@ export default defineConfig({ { text: 'FScene', link: '/api/3d/classes/FScene' }, { text: 'FTransform', link: '/api/3d/classes/FTransform' }, ] }, - { text: 'Model Classes', items: [ + { text: 'Polyhedrons Classes', items: [ { text: 'FCapsule', link: '/api/3d/classes/FCapsule' }, { text: 'FCuboid', link: '/api/3d/classes/FCuboid' }, - { text: 'FGLTF', link: '/api/3d/classes/FGLTF' }, { text: 'FPolyhedron', link: '/api/3d/classes/FPolyhedron' }, { text: 'FSphere', link: '/api/3d/classes/FSphere' }, ] }, + { text: 'Model Classes', items: [ + { text: 'FModel', link: '/api/3d/classes/FModel' }, + { text: 'FGLTF', link: '/api/3d/classes/FGLTF' }, + { text: 'FGLB', link: '/api/3d/classes/FGLB' }, + { text: 'FOBJ', link: '/api/3d/classes/FOBJ' }, + { text: 'FFBX', link: '/api/3d/classes/FFBX' }, + ] }, { text: 'Enumerations', items: [ { text: 'FShapes', link: '/api/3d/enumerations/FShapes' }, ] }, { text: 'Interfaces', items: [ - { text: 'FCharacterOptions', link: '/api/3d/interfaces/FCharacterOptions' }, - { text: 'FComponentOptions', link: '/api/3d/interfaces/FComponentOptions' }, + { text: 'FAttachedCameraOptions', link: '/api/3d/interfaces/FAttachedCameraOptions' }, + { text: 'FCameraOptions', link: '/api/3d/interfaces/FCameraOptions' }, + { text: 'FCharacterControllerOptions', link: '/api/3d/interfaces/FCharacterControllerOptions' }, { text: 'FColliderOptions', link: '/api/3d/interfaces/FColliderOptions' }, + { text: 'FComponentOptions', link: '/api/3d/interfaces/FComponentOptions' }, + { text: 'FControllerOptions', link: '/api/3d/interfaces/FControllerOptions' }, { text: 'FRigidBodyOptions', link: '/api/3d/interfaces/FRigidBodyOptions' }, { text: 'FSceneOptions', link: '/api/3d/interfaces/FSceneOptions' }, { text: 'FTransformOptions', link: '/api/3d/interfaces/FTransformOptions' }, ] }, ] }, { text: 'core', link: '/api/core/index.md', collapsed: true, items: [ - { text: 'FCamera', link: '/api/core/classes/FCamera' }, - { text: 'FComponent', link: '/api/core/classes/FComponent' }, - { text: 'FGroup', link: '/api/core/classes/FGroup' }, - { text: 'FScene', link: '/api/core/classes/FScene' }, + { text: 'Core Classes', items: [ + { text: 'FCamera', link: '/api/core/classes/FCamera' }, + { text: 'FComponent', link: '/api/core/classes/FComponent' }, + { text: 'FController', link: '/api/core/classes/FController' }, + { text: 'FGroup', link: '/api/core/classes/FGroup' }, + { text: 'FScene', link: '/api/core/classes/FScene' }, + ] }, + { text: 'Interfaces', items: [ + { text: 'FControllerOptions', link: '/api/core/interfaces/FControllerOptions' }, + ] }, ] }, { text: 'devtools', link: '/api/devtools/index.md', collapsed: true, items: [ { text: 'FDebug', link: '/api/devtools/classes/FDebug' }, diff --git a/docs/api/2d/classes/FAttachedCamera.md b/docs/api/2d/classes/FAttachedCamera.md index 7b018c67..fdf55831 100644 --- a/docs/api/2d/classes/FAttachedCamera.md +++ b/docs/api/2d/classes/FAttachedCamera.md @@ -32,7 +32,7 @@ A camera attached to a given target. #### Defined in -[packages/2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FAttachedCamera.ts#L20) +[packages/2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FAttachedCamera.ts#L20) ## Methods @@ -50,7 +50,7 @@ A camera attached to a given target. #### Defined in -[packages/2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FAttachedCamera.ts#L33) +[packages/2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FAttachedCamera.ts#L33) *** @@ -92,7 +92,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -142,7 +142,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -packages/core/dist/index.d.ts:53 +packages/core/dist/index.d.ts:83 *** @@ -160,8 +160,9 @@ packages/core/dist/index.d.ts:53 #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -169,7 +170,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FAttachedCamera.ts#L25) +[packages/2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FAttachedCamera.ts#L25) ## Properties @@ -192,7 +193,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -211,7 +212,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -227,7 +228,7 @@ Internal flags #### Defined in -[packages/2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L17) +[packages/2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -243,23 +244,47 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 + +*** + +### controller? + +> `optional` **controller**: `FController` + +The controller attached to the component. + +#### Inherited from + +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) + +#### Defined in + +packages/core/dist/index.d.ts:53 *** ### position -> **position**: `PointData` +> **position**: `object` Position of the camera. +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + #### Inherited from [`FCamera`](FCamera.md).[`position`](FCamera.md#position) #### Defined in -[packages/2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L28) +[packages/2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -277,7 +302,7 @@ The scene the camera is in. #### Defined in -[packages/2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L22) +[packages/2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L21) *** @@ -291,4 +316,4 @@ The target to follow. #### Defined in -[packages/2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FAttachedCamera.ts#L18) +[packages/2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FAttachedCamera.ts#L18) diff --git a/docs/api/2d/classes/FCamera.md b/docs/api/2d/classes/FCamera.md index 967fa0fc..280b8d5d 100644 --- a/docs/api/2d/classes/FCamera.md +++ b/docs/api/2d/classes/FCamera.md @@ -46,7 +46,7 @@ Create a new 2D camera. #### Defined in -[packages/2d/src/cameras/FCamera.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L35) +[packages/2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L34) ## Methods @@ -60,7 +60,7 @@ Create a new 2D camera. #### Defined in -[packages/2d/src/cameras/FCamera.ts:56](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L56) +[packages/2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L55) *** @@ -102,7 +102,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -152,7 +152,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -packages/core/dist/index.d.ts:53 +packages/core/dist/index.d.ts:83 *** @@ -170,8 +170,9 @@ packages/core/dist/index.d.ts:53 #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -179,7 +180,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/cameras/FCamera.ts:54](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L54) +[packages/2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L53) ## Properties @@ -202,7 +203,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -221,7 +222,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -237,7 +238,7 @@ Internal flags #### Defined in -[packages/2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L17) +[packages/2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -253,19 +254,43 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 + +*** + +### controller? + +> `optional` **controller**: `FController` + +The controller attached to the component. + +#### Inherited from + +`FCameraCore.controller` + +#### Defined in + +packages/core/dist/index.d.ts:53 *** ### position -> **position**: `PointData` +> **position**: `object` Position of the camera. +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + #### Defined in -[packages/2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L28) +[packages/2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -279,4 +304,4 @@ The scene the camera is in. #### Defined in -[packages/2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L22) +[packages/2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FCharacterController.md b/docs/api/2d/classes/FCharacterController.md new file mode 100644 index 00000000..08f12be3 --- /dev/null +++ b/docs/api/2d/classes/FCharacterController.md @@ -0,0 +1,139 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterController + +# Class: `abstract` FCharacterController + +## Description + +An abstract pre-defined character controller. + +## Extends + +- [`FController`](FController.md) + +## Extended by + +- [`FCharacterControllerD`](FCharacterControllerD.md) +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterController() + +> **new FCharacterController**(`scene`, `options`): [`FCharacterController`](FCharacterController.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterController`](FCharacterController.md) + +#### Overrides + +[`FController`](FController.md).[`constructor`](FController.md#constructors) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:42](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L42) + +## Methods + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +[`FController`](FController.md).[`onFrame`](FController.md#onframe) + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/2d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L25) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L40) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L35) diff --git a/docs/api/2d/classes/FCharacterControllerD.md b/docs/api/2d/classes/FCharacterControllerD.md new file mode 100644 index 00000000..7acd7c1b --- /dev/null +++ b/docs/api/2d/classes/FCharacterControllerD.md @@ -0,0 +1,156 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerD + +# Class: FCharacterControllerD + +## Description + +A pre-defined character controller based on a Dynamic RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerD(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterController`](FCharacterController.md) + +## Constructors + +### new FCharacterControllerD() + +> **new FCharacterControllerD**(`scene`, `options`): [`FCharacterControllerD`](FCharacterControllerD.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerD`](FCharacterControllerD.md) + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerD.ts#L22) + +## Methods + +### onFrame() + +> **onFrame**(`_delta`): `void` + +#### Parameters + +• **\_delta**: `number` + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerD.ts#L38) + +## Properties + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/2d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L25) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L40) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L35) diff --git a/docs/api/2d/classes/FCharacterControllerK.md b/docs/api/2d/classes/FCharacterControllerK.md new file mode 100644 index 00000000..1dd579c9 --- /dev/null +++ b/docs/api/2d/classes/FCharacterControllerK.md @@ -0,0 +1,199 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerK + +# Class: `abstract` FCharacterControllerK + +## Description + +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**(`scene`, `options`): [`FCharacterControllerK`](FCharacterControllerK.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerK`](FCharacterControllerK.md) + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L22) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L44) + +*** + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### characterController + +> **characterController**: `KinematicCharacterController` + +The character controller that will be used to move the character. + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L20) + +*** + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/2d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L25) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L40) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L35) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to simulate gravity. + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKP.md b/docs/api/2d/classes/FCharacterControllerKP.md new file mode 100644 index 00000000..2b8fc298 --- /dev/null +++ b/docs/api/2d/classes/FCharacterControllerKP.md @@ -0,0 +1,218 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerKP + +# Class: FCharacterControllerKP + +## Description + +A pre-defined character controller based on a Kinematic Position RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerKP(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterControllerKP() + +> **new FCharacterControllerKP**(`scene`, `options`): [`FCharacterControllerKP`](FCharacterControllerKP.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerKP`](FCharacterControllerKP.md) + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L44) + +*** + +### onFrame() + +> **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) + +## Properties + +### 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 + +[packages/2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L20) + +*** + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/2d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L25) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L40) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L35) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to simulate gravity. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKV.md b/docs/api/2d/classes/FCharacterControllerKV.md new file mode 100644 index 00000000..b7d9ba75 --- /dev/null +++ b/docs/api/2d/classes/FCharacterControllerKV.md @@ -0,0 +1,218 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterControllerKV + +# Class: FCharacterControllerKV + +## Description + +A pre-defined character controller based on a Kinematic Velocity RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerKV(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterControllerKV() + +> **new FCharacterControllerKV**(`scene`, `options`): [`FCharacterControllerKV`](FCharacterControllerKV.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerKV`](FCharacterControllerKV.md) + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L44) + +*** + +### onFrame() + +> **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) + +## Properties + +### 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 + +[packages/2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L20) + +*** + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/2d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L25) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L40) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed) + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L35) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to simulate gravity. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity) + +#### Defined in + +[packages/2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterDynamic.md b/docs/api/2d/classes/FCharacterDynamic.md deleted file mode 100644 index 08b028af..00000000 --- a/docs/api/2d/classes/FCharacterDynamic.md +++ /dev/null @@ -1,872 +0,0 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterDynamic - -# Class: FCharacterDynamic - -## Description - -A pre-defined character controller based on a Dynamic RigidBody. - -## Example - -```ts -import { FScene, FCharacterDynamic } from '@fibbojs/2d' - -const scene = new FScene() - -const capsule = new FCharacterDynamic(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacter`](FCharacter.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`p`): `void` - -#### Parameters - -• **p** - -• **p.x**: `number` - -• **p.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`position`](FCharacter.md#position) - -#### Defined in - -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) - -*** - -### rotation - -> `get` **rotation**(): `number` - -> `set` **rotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotation`](FCharacter.md#rotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegree`](FCharacter.md#rotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` - -#### Parameters - -• **s** - -• **s.x**: `number` - -• **s.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scale`](FCharacter.md#scale) - -#### Defined in - -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleX`](FCharacter.md#scalex) - -#### Defined in - -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleY`](FCharacter.md#scaley) - -#### Defined in - -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`x`](FCharacter.md#x) - -#### Defined in - -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`y`](FCharacter.md#y) - -#### Defined in - -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) - -## Constructors - -### new FCharacterDynamic() - -> **new FCharacterDynamic**(`scene`, `options`?): [`FCharacterDynamic`](FCharacterDynamic.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterDynamic`](FCharacterDynamic.md) - -#### Overrides - -[`FCharacter`](FCharacter.md).[`constructor`](FCharacter.md#constructors) - -#### Defined in - -[packages/2d/src/character/FCharacterDynamic.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterDynamic.ts#L22) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`emitCollisionWith`](FCharacter.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initCollider`](FCharacter.md#initcollider) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:129](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L129) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the model. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides - -[`FCharacter`](FCharacter.md).[`initRigidBody`](FCharacter.md#initrigidbody) - -#### Defined in - -[packages/2d/src/character/FCharacterDynamic.ts:50](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterDynamic.ts#L50) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initSensor`](FCharacter.md#initsensor) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:136](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L136) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onCollisionWith`](FCharacter.md#oncollisionwith) - -#### Defined in - -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacter`](FCharacter.md).[`onFrame`](FCharacter.md#onframe) - -#### Defined in - -[packages/2d/src/character/FCharacterDynamic.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterDynamic.ts#L31) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` - -The y position. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setPosition`](FCharacter.md#setposition) - -#### Defined in - -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in radians. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in radians. - -#### Example - -```ts -component.setRotation(Math.PI / 2) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotation`](FCharacter.md#setrotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in degrees. - -#### Example - -```ts -component.setRotationDegree(90) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotationDegree`](FCharacter.md#setrotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setScale`](FCharacter.md#setscale) - -#### Defined in - -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__CALLBACKS_ON_COLLISION__`](FCharacter.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__ID__`](FCharacter.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_2D__`](FCharacter.md#__is_2d__) - -#### Defined in - -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_3D__`](FCharacter.md#__is_3d__) - -#### Defined in - -packages/core/dist/index.d.ts:11 - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -RAPIER Collider - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`collider`](FCharacter.md#collider) - -#### Defined in - -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`container`](FCharacter.md#container) - -#### Defined in - -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) - -*** - -### 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 - -[`FCharacter`](FCharacter.md).[`inputs`](FCharacter.md#inputs) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L25) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RAPIER RigidBody - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rigidBody`](FCharacter.md#rigidbody) - -#### Defined in - -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scene`](FCharacter.md#scene) - -#### Defined in - -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`sensor`](FCharacter.md#sensor) - -#### Defined in - -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`speed`](FCharacter.md#speed) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`transform`](FCharacter.md#transform) - -#### Defined in - -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) diff --git a/docs/api/2d/classes/FCharacterKP.md b/docs/api/2d/classes/FCharacterKP.md deleted file mode 100644 index e44bb471..00000000 --- a/docs/api/2d/classes/FCharacterKP.md +++ /dev/null @@ -1,938 +0,0 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterKP - -# Class: FCharacterKP - -## Description - -A pre-defined character controller based on a Kinematic Position RigidBody. - -## Example - -```ts -import { FScene, FCharacterKP } from '@fibbojs/2d' - -const scene = new FScene() - -const capsule = new FCharacterKP(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacterKinematic`](FCharacterKinematic.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`p`): `void` - -#### Parameters - -• **p** - -• **p.x**: `number` - -• **p.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`position`](FCharacterKinematic.md#position) - -#### Defined in - -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) - -*** - -### rotation - -> `get` **rotation**(): `number` - -> `set` **rotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotation`](FCharacterKinematic.md#rotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegree`](FCharacterKinematic.md#rotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` - -#### Parameters - -• **s** - -• **s.x**: `number` - -• **s.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scale`](FCharacterKinematic.md#scale) - -#### Defined in - -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleX`](FCharacterKinematic.md#scalex) - -#### Defined in - -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleY`](FCharacterKinematic.md#scaley) - -#### Defined in - -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`x`](FCharacterKinematic.md#x) - -#### Defined in - -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`y`](FCharacterKinematic.md#y) - -#### Defined in - -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) - -## Constructors - -### new FCharacterKP() - -> **new FCharacterKP**(`scene`, `options`?): [`FCharacterKP`](FCharacterKP.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterKP`](FCharacterKP.md) - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`constructor`](FCharacterKinematic.md#constructors) - -#### Defined in - -[packages/2d/src/character/FCharacterKP.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKP.ts#L22) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`emitCollisionWith`](FCharacterKinematic.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`getCorrectedMovements`](FCharacterKinematic.md#getcorrectedmovements) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initCollider`](FCharacterKinematic.md#initcollider) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:85](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L85) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the model. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initRigidBody`](FCharacterKinematic.md#initrigidbody) - -#### Defined in - -[packages/2d/src/character/FCharacterKP.ts:39](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKP.ts#L39) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initSensor`](FCharacterKinematic.md#initsensor) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:136](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L136) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onCollisionWith`](FCharacterKinematic.md#oncollisionwith) - -#### Defined in - -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) - -*** - -### onFrame() - -> **onFrame**(`delta`): `void` - -#### Parameters - -• **delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onFrame`](FCharacterKinematic.md#onframe) - -#### Defined in - -[packages/2d/src/character/FCharacterKP.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKP.ts#L26) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` - -The y position. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setPosition`](FCharacterKinematic.md#setposition) - -#### Defined in - -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in radians. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in radians. - -#### Example - -```ts -component.setRotation(Math.PI / 2) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotation`](FCharacterKinematic.md#setrotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in degrees. - -#### Example - -```ts -component.setRotationDegree(90) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotationDegree`](FCharacterKinematic.md#setrotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setScale`](FCharacterKinematic.md#setscale) - -#### Defined in - -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__CALLBACKS_ON_COLLISION__`](FCharacterKinematic.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__ID__`](FCharacterKinematic.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_2D__`](FCharacterKinematic.md#__is_2d__) - -#### Defined in - -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_3D__`](FCharacterKinematic.md#__is_3d__) - -#### Defined in - -packages/core/dist/index.d.ts:11 - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`characterController`](FCharacterKinematic.md#charactercontroller) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L23) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -RAPIER Collider - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`collider`](FCharacterKinematic.md#collider) - -#### Defined in - -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`container`](FCharacterKinematic.md#container) - -#### Defined in - -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) - -*** - -### 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 - -[`FCharacterKinematic`](FCharacterKinematic.md).[`inputs`](FCharacterKinematic.md#inputs) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L25) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RAPIER RigidBody - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rigidBody`](FCharacterKinematic.md#rigidbody) - -#### Defined in - -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scene`](FCharacterKinematic.md#scene) - -#### Defined in - -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`sensor`](FCharacterKinematic.md#sensor) - -#### Defined in - -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`speed`](FCharacterKinematic.md#speed) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`transform`](FCharacterKinematic.md#transform) - -#### Defined in - -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to simulate gravity. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`yVelocity`](FCharacterKinematic.md#yvelocity) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L18) diff --git a/docs/api/2d/classes/FCharacterKV.md b/docs/api/2d/classes/FCharacterKV.md deleted file mode 100644 index 278f41ee..00000000 --- a/docs/api/2d/classes/FCharacterKV.md +++ /dev/null @@ -1,938 +0,0 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterKV - -# Class: FCharacterKV - -## Description - -A pre-defined character controller based on a Kinematic Velocity RigidBody. - -## Example - -```ts -import { FScene, FCharacterKV } from '@fibbojs/2d' - -const scene = new FScene() - -const capsule = new FCharacterKV(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacterKinematic`](FCharacterKinematic.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`p`): `void` - -#### Parameters - -• **p** - -• **p.x**: `number` - -• **p.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`position`](FCharacterKinematic.md#position) - -#### Defined in - -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) - -*** - -### rotation - -> `get` **rotation**(): `number` - -> `set` **rotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotation`](FCharacterKinematic.md#rotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegree`](FCharacterKinematic.md#rotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` - -#### Parameters - -• **s** - -• **s.x**: `number` - -• **s.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scale`](FCharacterKinematic.md#scale) - -#### Defined in - -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleX`](FCharacterKinematic.md#scalex) - -#### Defined in - -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleY`](FCharacterKinematic.md#scaley) - -#### Defined in - -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`x`](FCharacterKinematic.md#x) - -#### Defined in - -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`y`](FCharacterKinematic.md#y) - -#### Defined in - -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) - -## Constructors - -### new FCharacterKV() - -> **new FCharacterKV**(`scene`, `options`?): [`FCharacterKV`](FCharacterKV.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterKV`](FCharacterKV.md) - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`constructor`](FCharacterKinematic.md#constructors) - -#### Defined in - -[packages/2d/src/character/FCharacterKV.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKV.ts#L21) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`emitCollisionWith`](FCharacterKinematic.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`getCorrectedMovements`](FCharacterKinematic.md#getcorrectedmovements) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initCollider`](FCharacterKinematic.md#initcollider) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:85](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L85) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the model. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initRigidBody`](FCharacterKinematic.md#initrigidbody) - -#### Defined in - -[packages/2d/src/character/FCharacterKV.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKV.ts#L38) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initSensor`](FCharacterKinematic.md#initsensor) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:136](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L136) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onCollisionWith`](FCharacterKinematic.md#oncollisionwith) - -#### Defined in - -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) - -*** - -### onFrame() - -> **onFrame**(`delta`): `void` - -#### Parameters - -• **delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onFrame`](FCharacterKinematic.md#onframe) - -#### Defined in - -[packages/2d/src/character/FCharacterKV.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKV.ts#L25) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` - -The y position. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setPosition`](FCharacterKinematic.md#setposition) - -#### Defined in - -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in radians. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in radians. - -#### Example - -```ts -component.setRotation(Math.PI / 2) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotation`](FCharacterKinematic.md#setrotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in degrees. - -#### Example - -```ts -component.setRotationDegree(90) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotationDegree`](FCharacterKinematic.md#setrotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setScale`](FCharacterKinematic.md#setscale) - -#### Defined in - -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__CALLBACKS_ON_COLLISION__`](FCharacterKinematic.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__ID__`](FCharacterKinematic.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_2D__`](FCharacterKinematic.md#__is_2d__) - -#### Defined in - -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_3D__`](FCharacterKinematic.md#__is_3d__) - -#### Defined in - -packages/core/dist/index.d.ts:11 - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`characterController`](FCharacterKinematic.md#charactercontroller) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L23) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -RAPIER Collider - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`collider`](FCharacterKinematic.md#collider) - -#### Defined in - -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`container`](FCharacterKinematic.md#container) - -#### Defined in - -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) - -*** - -### 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 - -[`FCharacterKinematic`](FCharacterKinematic.md).[`inputs`](FCharacterKinematic.md#inputs) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L25) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RAPIER RigidBody - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rigidBody`](FCharacterKinematic.md#rigidbody) - -#### Defined in - -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scene`](FCharacterKinematic.md#scene) - -#### Defined in - -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`sensor`](FCharacterKinematic.md#sensor) - -#### Defined in - -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`speed`](FCharacterKinematic.md#speed) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`transform`](FCharacterKinematic.md#transform) - -#### Defined in - -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to simulate gravity. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`yVelocity`](FCharacterKinematic.md#yvelocity) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L18) diff --git a/docs/api/2d/classes/FCharacterKinematic.md b/docs/api/2d/classes/FCharacterKinematic.md deleted file mode 100644 index 847af827..00000000 --- a/docs/api/2d/classes/FCharacterKinematic.md +++ /dev/null @@ -1,920 +0,0 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterKinematic - -# Class: `abstract` FCharacterKinematic - -## Description - -An abstract pre-defined character controller based on Kinematic rigidbodies. - -## Extends - -- [`FCharacter`](FCharacter.md) - -## Extended by - -- [`FCharacterKP`](FCharacterKP.md) -- [`FCharacterKV`](FCharacterKV.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`p`): `void` - -#### Parameters - -• **p** - -• **p.x**: `number` - -• **p.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`position`](FCharacter.md#position) - -#### Defined in - -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) - -*** - -### rotation - -> `get` **rotation**(): `number` - -> `set` **rotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotation`](FCharacter.md#rotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegree`](FCharacter.md#rotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` - -#### Parameters - -• **s** - -• **s.x**: `number` - -• **s.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scale`](FCharacter.md#scale) - -#### Defined in - -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleX`](FCharacter.md#scalex) - -#### Defined in - -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleY`](FCharacter.md#scaley) - -#### Defined in - -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`x`](FCharacter.md#x) - -#### Defined in - -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`y`](FCharacter.md#y) - -#### Defined in - -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) - -## Constructors - -### new FCharacterKinematic() - -> **new FCharacterKinematic**(`scene`, `options`?): [`FCharacterKinematic`](FCharacterKinematic.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FCharacterOptions`](../interfaces/FCharacterOptions.md) - -#### Returns - -[`FCharacterKinematic`](FCharacterKinematic.md) - -#### Overrides - -[`FCharacter`](FCharacter.md).[`constructor`](FCharacter.md#constructors) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L25) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`emitCollisionWith`](FCharacter.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides - -[`FCharacter`](FCharacter.md).[`initCollider`](FCharacter.md#initcollider) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:85](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L85) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the model. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides - -[`FCharacter`](FCharacter.md).[`initRigidBody`](FCharacter.md#initrigidbody) - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:78](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L78) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initSensor`](FCharacter.md#initsensor) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:136](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L136) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onCollisionWith`](FCharacter.md#oncollisionwith) - -#### Defined in - -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onFrame`](FCharacter.md#onframe) - -#### Defined in - -[packages/2d/src/FComponent.ts:98](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L98) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` - -The y position. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setPosition`](FCharacter.md#setposition) - -#### Defined in - -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in radians. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in radians. - -#### Example - -```ts -component.setRotation(Math.PI / 2) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotation`](FCharacter.md#setrotation) - -#### Defined in - -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component in degrees. - -#### Example - -```ts -component.setRotationDegree(90) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotationDegree`](FCharacter.md#setrotationdegree) - -#### Defined in - -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setScale`](FCharacter.md#setscale) - -#### Defined in - -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__CALLBACKS_ON_COLLISION__`](FCharacter.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__ID__`](FCharacter.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_2D__`](FCharacter.md#__is_2d__) - -#### Defined in - -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_3D__`](FCharacter.md#__is_3d__) - -#### Defined in - -packages/core/dist/index.d.ts:11 - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L23) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -RAPIER Collider - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`collider`](FCharacter.md#collider) - -#### Defined in - -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`container`](FCharacter.md#container) - -#### Defined in - -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) - -*** - -### 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 - -[`FCharacter`](FCharacter.md).[`inputs`](FCharacter.md#inputs) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L25) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RAPIER RigidBody - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rigidBody`](FCharacter.md#rigidbody) - -#### Defined in - -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scene`](FCharacter.md#scene) - -#### Defined in - -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`sensor`](FCharacter.md#sensor) - -#### Defined in - -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`speed`](FCharacter.md#speed) - -#### Defined in - -[packages/2d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`transform`](FCharacter.md#transform) - -#### Defined in - -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to simulate gravity. - -#### Defined in - -[packages/2d/src/character/FCharacterKinematic.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacterKinematic.ts#L18) diff --git a/docs/api/2d/classes/FCircle.md b/docs/api/2d/classes/FCircle.md index ea17d556..6f69d0c3 100644 --- a/docs/api/2d/classes/FCircle.md +++ b/docs/api/2d/classes/FCircle.md @@ -19,7 +19,7 @@ scene.addComponent(circle) ## Extends -- [`FComponent`](FComponent.md) +- [`FPolygon`](FPolygon.md) ## Accessors @@ -53,11 +53,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FPolygon`](FPolygon.md).[`position`](FPolygon.md#position) #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -77,11 +77,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FPolygon`](FPolygon.md).[`rotation`](FPolygon.md#rotation) #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -101,11 +101,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FPolygon`](FPolygon.md).[`rotationDegree`](FPolygon.md#rotationdegree) #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -137,11 +137,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FPolygon`](FPolygon.md).[`scale`](FPolygon.md#scale) #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -161,11 +161,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) +[`FPolygon`](FPolygon.md).[`scaleX`](FPolygon.md#scalex) #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -185,11 +185,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) +[`FPolygon`](FPolygon.md).[`scaleY`](FPolygon.md#scaley) #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -209,11 +209,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FPolygon`](FPolygon.md).[`x`](FPolygon.md#x) #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -233,11 +233,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) +[`FPolygon`](FPolygon.md).[`y`](FPolygon.md#y) #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors @@ -257,11 +257,11 @@ Setters & getters for transform properties #### Overrides -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) +[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) #### Defined in -[packages/2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FCircle.ts#L21) +[packages/2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FCircle.ts#L21) ## Methods @@ -299,11 +299,11 @@ player.emitCollisionWith(enemy) #### Inherited from -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) +[`FPolygon`](FPolygon.md).[`emitCollisionWith`](FPolygon.md#emitcollisionwith) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -355,11 +355,11 @@ component.initCollider({ #### Overrides -[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider) +[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider) #### Defined in -[packages/2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FCircle.ts#L51) +[packages/2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FCircle.ts#L51) *** @@ -426,11 +426,11 @@ component.initRigidBody({ #### Overrides -[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) +[`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody) #### Defined in -[packages/2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FCircle.ts#L33) +[packages/2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FCircle.ts#L33) *** @@ -466,11 +466,11 @@ component.initSensor({ #### Inherited from -[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) +[`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor) #### Defined in -[packages/2d/src/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L308) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -516,11 +516,11 @@ player.onCollisionWith(enemy, () => { #### Inherited from -[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith) +[`FPolygon`](FPolygon.md).[`onCollisionWith`](FPolygon.md#oncollisionwith) #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** @@ -538,16 +538,17 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) +[`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe) #### Defined in -[packages/2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FCircle.ts#L29) +[packages/2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FCircle.ts#L29) *** @@ -585,11 +586,11 @@ component.setPosition({ x: 0, y: 0 }) #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FPolygon`](FPolygon.md).[`setPosition`](FPolygon.md#setposition) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -619,11 +620,11 @@ component.setRotation(Math.PI / 2) #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FPolygon`](FPolygon.md).[`setRotation`](FPolygon.md#setrotation) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -653,11 +654,11 @@ component.setRotationDegree(90) #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FPolygon`](FPolygon.md).[`setRotationDegree`](FPolygon.md#setrotationdegree) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -695,11 +696,11 @@ component.setScale({ x: 1, y: 1 }) #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FPolygon`](FPolygon.md).[`setScale`](FPolygon.md#setscale) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) ## Properties @@ -718,11 +719,11 @@ It is a dictionary where the key is the class name or object id and the value is #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -737,11 +738,11 @@ It is generated automatically. #### Inherited from -[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__) +[`FPolygon`](FPolygon.md).[`__ID__`](FPolygon.md#__id__) #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -753,11 +754,11 @@ Internal flags #### Inherited from -[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__) +[`FPolygon`](FPolygon.md).[`__IS_2D__`](FPolygon.md#__is_2d__) #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -769,11 +770,11 @@ Internal flags #### Inherited from -[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__) +[`FPolygon`](FPolygon.md).[`__IS_3D__`](FPolygon.md#__is_3d__) #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -785,11 +786,11 @@ RAPIER Collider #### Inherited from -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) +[`FPolygon`](FPolygon.md).[`collider`](FPolygon.md#collider) #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -801,11 +802,27 @@ PIXI container #### Inherited from -[`FComponent`](FComponent.md).[`container`](FComponent.md#container) +[`FPolygon`](FPolygon.md).[`container`](FPolygon.md#container) #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FPolygon`](FPolygon.md).[`controller`](FPolygon.md#controller) + +#### Defined in + +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -817,11 +834,11 @@ RAPIER RigidBody #### Inherited from -[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody) +[`FPolygon`](FPolygon.md).[`rigidBody`](FPolygon.md#rigidbody) #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -833,27 +850,27 @@ The scene which the component is in. #### Inherited from -[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene) +[`FPolygon`](FPolygon.md).[`scene`](FPolygon.md#scene) #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Inherited from -[`FComponent`](FComponent.md).[`sensor`](FComponent.md#sensor) +[`FPolygon`](FPolygon.md).[`sensor`](FPolygon.md#sensor) #### Defined in -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -865,8 +882,8 @@ Transforms #### Inherited from -[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform) +[`FPolygon`](FPolygon.md).[`transform`](FPolygon.md#transform) #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FComponent.md b/docs/api/2d/classes/FComponent.md index 71b39b40..9205cd5d 100644 --- a/docs/api/2d/classes/FComponent.md +++ b/docs/api/2d/classes/FComponent.md @@ -13,9 +13,7 @@ The base class for all 2D components in Fibbo. ## Extended by - [`FComponentEmpty`](FComponentEmpty.md) -- [`FCharacter`](FCharacter.md) -- [`FRectangle`](FRectangle.md) -- [`FCircle`](FCircle.md) +- [`FPolygon`](FPolygon.md) - [`FSprite`](FSprite.md) ## Accessors @@ -50,7 +48,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -70,7 +68,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -90,7 +88,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -122,7 +120,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -142,7 +140,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -162,7 +160,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -182,7 +180,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -202,7 +200,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors @@ -230,7 +228,7 @@ The options for the component. #### Defined in -[packages/2d/src/FComponent.ts:65](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L65) +[packages/2d/src/core/FComponent.ts:70](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L70) ## Methods @@ -272,7 +270,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -308,7 +306,7 @@ component.initCollider({ #### Defined in -[packages/2d/src/FComponent.ts:284](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L284) +[packages/2d/src/core/FComponent.ts:290](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L290) *** @@ -343,7 +341,7 @@ component.initRigidBody({ #### Defined in -[packages/2d/src/FComponent.ts:257](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L257) +[packages/2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L263) *** @@ -379,7 +377,7 @@ component.initSensor({ #### Defined in -[packages/2d/src/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L308) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -429,7 +427,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** @@ -447,8 +445,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -456,7 +455,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/FComponent.ts:98](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L98) +[packages/2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L103) *** @@ -494,7 +493,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -524,7 +523,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -554,7 +553,7 @@ component.setRotationDegree(90) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -592,7 +591,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) ## Properties @@ -615,7 +614,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -634,7 +633,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -650,7 +649,7 @@ Internal flags #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -666,7 +665,7 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -678,7 +677,7 @@ RAPIER Collider #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -690,7 +689,23 @@ PIXI container #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Overrides + +`FComponentCore.controller` + +#### Defined in + +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -702,7 +717,7 @@ RAPIER RigidBody #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -714,19 +729,19 @@ The scene which the component is in. #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Defined in -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -738,4 +753,4 @@ Transforms #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FComponentEmpty.md b/docs/api/2d/classes/FComponentEmpty.md index c0eaa48b..9b1e70d2 100644 --- a/docs/api/2d/classes/FComponentEmpty.md +++ b/docs/api/2d/classes/FComponentEmpty.md @@ -46,7 +46,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -70,7 +70,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -94,7 +94,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -130,7 +130,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -154,7 +154,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -178,7 +178,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -202,7 +202,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -226,7 +226,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors @@ -250,7 +250,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponentEmpty.ts#L10) +[packages/2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -292,7 +292,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -332,7 +332,7 @@ component.initCollider({ #### Defined in -[packages/2d/src/FComponent.ts:284](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L284) +[packages/2d/src/core/FComponent.ts:290](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L290) *** @@ -371,7 +371,7 @@ component.initRigidBody({ #### Defined in -[packages/2d/src/FComponent.ts:257](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L257) +[packages/2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L263) *** @@ -411,7 +411,7 @@ component.initSensor({ #### Defined in -[packages/2d/src/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L308) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -461,7 +461,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** @@ -479,8 +479,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -488,7 +489,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponentEmpty.ts#L14) +[packages/2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponentEmpty.ts#L14) *** @@ -530,7 +531,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -564,7 +565,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -598,7 +599,7 @@ component.setRotationDegree(90) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -640,7 +641,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) ## Properties @@ -663,7 +664,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -682,7 +683,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -698,7 +699,7 @@ Internal flags #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -714,7 +715,7 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -730,7 +731,7 @@ RAPIER Collider #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -746,7 +747,23 @@ PIXI container #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -762,7 +779,7 @@ RAPIER RigidBody #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -778,13 +795,13 @@ The scene which the component is in. #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -794,7 +811,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -810,4 +827,4 @@ Transforms #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FController.md b/docs/api/2d/classes/FController.md new file mode 100644 index 00000000..c0c68616 --- /dev/null +++ b/docs/api/2d/classes/FController.md @@ -0,0 +1,86 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FController + +# Class: `abstract` FController + +## Description + +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 + +[packages/2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FController.ts#L23) + +## Methods + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +`FControllerCore.onFrame` + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### 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 + +[packages/2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FController.ts#L17) diff --git a/docs/api/2d/classes/FFixedCamera.md b/docs/api/2d/classes/FFixedCamera.md index d3de8c27..782f4fdf 100644 --- a/docs/api/2d/classes/FFixedCamera.md +++ b/docs/api/2d/classes/FFixedCamera.md @@ -32,7 +32,7 @@ A fixed camera. #### Defined in -[packages/2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFixedCamera.ts#L10) +[packages/2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFixedCamera.ts#L10) ## Methods @@ -50,7 +50,7 @@ A fixed camera. #### Defined in -[packages/2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFixedCamera.ts#L17) +[packages/2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFixedCamera.ts#L17) *** @@ -92,7 +92,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -142,7 +142,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -packages/core/dist/index.d.ts:53 +packages/core/dist/index.d.ts:83 *** @@ -160,8 +160,9 @@ packages/core/dist/index.d.ts:53 #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -169,7 +170,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFixedCamera.ts#L14) +[packages/2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFixedCamera.ts#L14) ## Properties @@ -192,7 +193,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -211,7 +212,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -227,7 +228,7 @@ Internal flags #### Defined in -[packages/2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L17) +[packages/2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -243,23 +244,47 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 + +*** + +### controller? + +> `optional` **controller**: `FController` + +The controller attached to the component. + +#### Inherited from + +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) + +#### Defined in + +packages/core/dist/index.d.ts:53 *** ### position -> **position**: `PointData` +> **position**: `object` Position of the camera. +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + #### Inherited from [`FCamera`](FCamera.md).[`position`](FCamera.md#position) #### Defined in -[packages/2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L28) +[packages/2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -277,4 +302,4 @@ The scene the camera is in. #### Defined in -[packages/2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L22) +[packages/2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FFreeCamera.md b/docs/api/2d/classes/FFreeCamera.md index 6e109de5..0ecbd1e0 100644 --- a/docs/api/2d/classes/FFreeCamera.md +++ b/docs/api/2d/classes/FFreeCamera.md @@ -32,7 +32,7 @@ A free camera that can be moved around. #### Defined in -[packages/2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFreeCamera.ts#L10) +[packages/2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFreeCamera.ts#L10) ## Methods @@ -50,7 +50,7 @@ A free camera that can be moved around. #### Defined in -[packages/2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFreeCamera.ts#L17) +[packages/2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFreeCamera.ts#L17) *** @@ -92,7 +92,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -142,7 +142,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -packages/core/dist/index.d.ts:53 +packages/core/dist/index.d.ts:83 *** @@ -160,8 +160,9 @@ packages/core/dist/index.d.ts:53 #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -169,7 +170,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FFreeCamera.ts#L14) +[packages/2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FFreeCamera.ts#L14) ## Properties @@ -192,7 +193,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -211,7 +212,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -227,7 +228,7 @@ Internal flags #### Defined in -[packages/2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L17) +[packages/2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -243,23 +244,47 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 + +*** + +### controller? + +> `optional` **controller**: `FController` + +The controller attached to the component. + +#### Inherited from + +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) + +#### Defined in + +packages/core/dist/index.d.ts:53 *** ### position -> **position**: `PointData` +> **position**: `object` Position of the camera. +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + #### Inherited from [`FCamera`](FCamera.md).[`position`](FCamera.md#position) #### Defined in -[packages/2d/src/cameras/FCamera.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L28) +[packages/2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -277,4 +302,4 @@ The scene the camera is in. #### Defined in -[packages/2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L22) +[packages/2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FSquare.md b/docs/api/2d/classes/FPolygon.md similarity index 65% rename from docs/api/2d/classes/FSquare.md rename to docs/api/2d/classes/FPolygon.md index 42b19080..5410194a 100644 --- a/docs/api/2d/classes/FSquare.md +++ b/docs/api/2d/classes/FPolygon.md @@ -1,26 +1,20 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FRectangle +[@fibbojs](/api/index) / [2d](/api/2d) / FPolygon -# Class: FRectangle +# Class: `abstract` FPolygon ## Description -A simple square in Fibbo. - -## Example - -```ts -import { FScene, FRectangle } from '@fibbojs/2d' - -const scene = new FScene() - -const square = new FRectangle(scene) -scene.addComponent(square) -``` +A simple polygon in Fibbo. ## Extends - [`FComponent`](FComponent.md) +## Extended by + +- [`FRectangle`](FRectangle.md) +- [`FCircle`](FCircle.md) + ## Accessors ### position @@ -57,7 +51,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -81,7 +75,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -105,7 +99,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -141,7 +135,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -165,7 +159,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -189,7 +183,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -213,7 +207,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -237,13 +231,13 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors -### new FRectangle() +### new FPolygon() -> **new FRectangle**(`scene`, `options`?): [`FRectangle`](FRectangle.md) +> **new FPolygon**(`scene`, `options`?): [`FPolygon`](FPolygon.md) #### Parameters @@ -253,7 +247,7 @@ Setters & getters for transform properties #### Returns -[`FRectangle`](FRectangle.md) +[`FPolygon`](FPolygon.md) #### Overrides @@ -261,7 +255,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/polygons/FRectangle.ts:20](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FRectangle.ts#L20) +[packages/2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FPolygon.ts#L11) ## Methods @@ -303,7 +297,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -343,7 +337,7 @@ component.initCollider({ #### Defined in -[packages/2d/src/FComponent.ts:284](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L284) +[packages/2d/src/core/FComponent.ts:290](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L290) *** @@ -382,7 +376,7 @@ component.initRigidBody({ #### Defined in -[packages/2d/src/FComponent.ts:257](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L257) +[packages/2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L263) *** @@ -422,7 +416,7 @@ component.initSensor({ #### Defined in -[packages/2d/src/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L308) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -472,7 +466,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** @@ -490,8 +484,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -499,7 +494,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/polygons/FRectangle.ts:30](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/polygons/FRectangle.ts#L30) +[packages/2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FPolygon.ts#L21) *** @@ -541,7 +536,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -575,7 +570,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -609,7 +604,7 @@ component.setRotationDegree(90) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -651,7 +646,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) ## Properties @@ -674,7 +669,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -693,7 +688,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -709,7 +704,7 @@ Internal flags #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -725,7 +720,7 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -741,7 +736,7 @@ RAPIER Collider #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -757,7 +752,23 @@ PIXI container #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -773,7 +784,7 @@ RAPIER RigidBody #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -789,13 +800,13 @@ The scene which the component is in. #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -805,7 +816,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -821,4 +832,4 @@ Transforms #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FCharacter.md b/docs/api/2d/classes/FRectangle.md similarity index 51% rename from docs/api/2d/classes/FCharacter.md rename to docs/api/2d/classes/FRectangle.md index 7d958acc..0d2dfd3e 100644 --- a/docs/api/2d/classes/FCharacter.md +++ b/docs/api/2d/classes/FRectangle.md @@ -1,19 +1,25 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacter +[@fibbojs](/api/index) / [2d](/api/2d) / FRectangle -# Class: `abstract` FCharacter +# Class: FRectangle ## Description -An abstract pre-defined character controller. +A simple square in Fibbo. -## Extends +## Example + +```ts +import { FScene, FRectangle } from '@fibbojs/2d' + +const scene = new FScene() -- [`FComponent`](FComponent.md) +const square = new FRectangle(scene) +scene.addComponent(square) +``` -## Extended by +## Extends -- [`FCharacterDynamic`](FCharacterDynamic.md) -- [`FCharacterKinematic`](FCharacterKinematic.md) +- [`FPolygon`](FPolygon.md) ## Accessors @@ -47,11 +53,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FPolygon`](FPolygon.md).[`position`](FPolygon.md#position) #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -71,11 +77,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FPolygon`](FPolygon.md).[`rotation`](FPolygon.md#rotation) #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -95,11 +101,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FPolygon`](FPolygon.md).[`rotationDegree`](FPolygon.md#rotationdegree) #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -131,11 +137,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FPolygon`](FPolygon.md).[`scale`](FPolygon.md#scale) #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -155,11 +161,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) +[`FPolygon`](FPolygon.md).[`scaleX`](FPolygon.md#scalex) #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -179,11 +185,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) +[`FPolygon`](FPolygon.md).[`scaleY`](FPolygon.md#scaley) #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -203,11 +209,11 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FPolygon`](FPolygon.md).[`x`](FPolygon.md#x) #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -227,35 +233,35 @@ Setters & getters for transform properties #### Inherited from -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) +[`FPolygon`](FPolygon.md).[`y`](FPolygon.md#y) #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors -### new FCharacter() +### new FRectangle() -> **new FCharacter**(`scene`, `options`?): [`FCharacter`](FCharacter.md) +> **new FRectangle**(`scene`, `options`?): [`FRectangle`](FRectangle.md) #### Parameters • **scene**: [`FScene`](FScene.md) -• **options?**: [`FCharacterOptions`](../interfaces/FCharacterOptions.md) +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -[`FCharacter`](FCharacter.md) +[`FRectangle`](FRectangle.md) #### Overrides -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) +[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) #### Defined in -[packages/2d/src/character/FCharacter.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L37) +[packages/2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FRectangle.ts#L19) ## Methods @@ -293,11 +299,11 @@ player.emitCollisionWith(enemy) #### Inherited from -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) +[`FPolygon`](FPolygon.md).[`emitCollisionWith`](FPolygon.md#emitcollisionwith) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -331,13 +337,13 @@ component.initCollider({ }) ``` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider) +[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider) #### Defined in -[packages/2d/src/character/FCharacter.ts:129](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L129) +[packages/2d/src/core/FComponent.ts:290](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L290) *** @@ -370,13 +376,13 @@ component.initRigidBody({ }) ``` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) +[`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody) #### Defined in -[packages/2d/src/character/FCharacter.ts:122](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L122) +[packages/2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L263) *** @@ -410,13 +416,13 @@ component.initSensor({ }) ``` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) +[`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor) #### Defined in -[packages/2d/src/character/FCharacter.ts:136](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L136) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -462,21 +468,21 @@ player.onCollisionWith(enemy, () => { #### Inherited from -[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith) +[`FPolygon`](FPolygon.md).[`onCollisionWith`](FPolygon.md#oncollisionwith) #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`delta`): `void` #### Parameters -• **\_delta**: `number` +• **delta**: `number` #### Returns @@ -484,16 +490,17 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) +[`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe) #### Defined in -[packages/2d/src/FComponent.ts:98](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L98) +[packages/2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/polygons/FRectangle.ts#L23) *** @@ -531,11 +538,11 @@ component.setPosition({ x: 0, y: 0 }) #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FPolygon`](FPolygon.md).[`setPosition`](FPolygon.md#setposition) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -565,11 +572,11 @@ component.setRotation(Math.PI / 2) #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FPolygon`](FPolygon.md).[`setRotation`](FPolygon.md#setrotation) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -599,11 +606,11 @@ component.setRotationDegree(90) #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FPolygon`](FPolygon.md).[`setRotationDegree`](FPolygon.md#setrotationdegree) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -641,11 +648,11 @@ component.setScale({ x: 1, y: 1 }) #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FPolygon`](FPolygon.md).[`setScale`](FPolygon.md#setscale) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) ## Properties @@ -664,11 +671,11 @@ It is a dictionary where the key is the class name or object id and the value is #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -683,11 +690,11 @@ It is generated automatically. #### Inherited from -[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__) +[`FPolygon`](FPolygon.md).[`__ID__`](FPolygon.md#__id__) #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -699,11 +706,11 @@ Internal flags #### Inherited from -[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__) +[`FPolygon`](FPolygon.md).[`__IS_2D__`](FPolygon.md#__is_2d__) #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -715,11 +722,11 @@ Internal flags #### Inherited from -[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__) +[`FPolygon`](FPolygon.md).[`__IS_3D__`](FPolygon.md#__is_3d__) #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -731,11 +738,11 @@ RAPIER Collider #### Inherited from -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) +[`FPolygon`](FPolygon.md).[`collider`](FPolygon.md#collider) #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -747,39 +754,27 @@ PIXI container #### Inherited from -[`FComponent`](FComponent.md).[`container`](FComponent.md#container) +[`FPolygon`](FPolygon.md).[`container`](FPolygon.md#container) #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) *** -### inputs - -> **inputs**: `object` +### controller? -The inputs that will be used to move the character. +> `optional` **controller**: [`FController`](FController.md) -#### down +The controller attached to the component. -> **down**: `boolean` - -#### left - -> **left**: `boolean` - -#### right - -> **right**: `boolean` - -#### up +#### Inherited from -> **up**: `boolean` +[`FPolygon`](FPolygon.md).[`controller`](FPolygon.md#controller) #### Defined in -[packages/2d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L25) +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -791,11 +786,11 @@ RAPIER RigidBody #### Inherited from -[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody) +[`FPolygon`](FPolygon.md).[`rigidBody`](FPolygon.md#rigidbody) #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -807,39 +802,27 @@ The scene which the component is in. #### Inherited from -[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene) +[`FPolygon`](FPolygon.md).[`scene`](FPolygon.md#scene) #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` 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 - -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. +[`FPolygon`](FPolygon.md).[`sensor`](FPolygon.md#sensor) #### Defined in -[packages/2d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L35) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -851,8 +834,8 @@ Transforms #### Inherited from -[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform) +[`FPolygon`](FPolygon.md).[`transform`](FPolygon.md#transform) #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FScene.md b/docs/api/2d/classes/FScene.md index 461ac90d..1ece7bf3 100644 --- a/docs/api/2d/classes/FScene.md +++ b/docs/api/2d/classes/FScene.md @@ -54,7 +54,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[packages/2d/src/FScene.ts:251](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L251) +[packages/2d/src/core/FScene.ts:251](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L251) ## Constructors @@ -76,7 +76,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[packages/2d/src/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L60) +[packages/2d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L60) ## Methods @@ -102,7 +102,7 @@ Add a component to the scene. #### Defined in -[packages/2d/src/FScene.ts:216](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L216) +[packages/2d/src/core/FScene.ts:216](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L216) *** @@ -134,7 +134,7 @@ Handle a collision event between two colliders. #### Defined in -[packages/2d/src/FScene.ts:190](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L190) +[packages/2d/src/core/FScene.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L190) *** @@ -155,7 +155,7 @@ and the root stage PIXI.Container. #### Defined in -[packages/2d/src/FScene.ts:98](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L98) +[packages/2d/src/core/FScene.ts:98](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L98) *** @@ -169,7 +169,7 @@ and the root stage PIXI.Container. #### Defined in -[packages/2d/src/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L159) +[packages/2d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L159) *** @@ -195,7 +195,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -packages/core/dist/index.d.ts:154 +packages/core/dist/index.d.ts:184 *** @@ -221,7 +221,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -packages/core/dist/index.d.ts:150 +packages/core/dist/index.d.ts:180 *** @@ -239,7 +239,7 @@ packages/core/dist/index.d.ts:150 #### Defined in -[packages/2d/src/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L243) +[packages/2d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L243) ## Properties @@ -249,7 +249,7 @@ packages/core/dist/index.d.ts:150 #### Defined in -[packages/2d/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L49) +[packages/2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L49) *** @@ -268,7 +268,7 @@ It is an array of functions that take the component as an argument. #### Defined in -packages/core/dist/index.d.ts:141 +packages/core/dist/index.d.ts:171 *** @@ -287,7 +287,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -packages/core/dist/index.d.ts:136 +packages/core/dist/index.d.ts:166 *** @@ -297,7 +297,7 @@ packages/core/dist/index.d.ts:136 #### Defined in -[packages/2d/src/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L43) +[packages/2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L43) *** @@ -309,7 +309,7 @@ DOM element that the renderer will be appended to #### Defined in -[packages/2d/src/FScene.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L47) +[packages/2d/src/core/FScene.ts:47](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L47) *** @@ -325,7 +325,7 @@ Internal flags #### Defined in -[packages/2d/src/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L38) +[packages/2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L38) *** @@ -341,7 +341,7 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:120 +packages/core/dist/index.d.ts:150 *** @@ -351,7 +351,7 @@ packages/core/dist/index.d.ts:120 #### Defined in -[packages/2d/src/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L56) +[packages/2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L56) *** @@ -361,7 +361,7 @@ packages/core/dist/index.d.ts:120 #### Defined in -[packages/2d/src/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L50) +[packages/2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L50) *** @@ -377,7 +377,7 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L41) +[packages/2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L41) *** @@ -387,7 +387,7 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L55) +[packages/2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L55) *** @@ -413,7 +413,7 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L53) +[packages/2d/src/core/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L53) *** @@ -423,7 +423,7 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:58](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L58) +[packages/2d/src/core/FScene.ts:58](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L58) *** @@ -433,7 +433,7 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L51) +[packages/2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L51) *** @@ -447,4 +447,4 @@ The components in the scene. #### Defined in -[packages/2d/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L54) +[packages/2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L54) diff --git a/docs/api/2d/classes/FSprite.md b/docs/api/2d/classes/FSprite.md index 3ed676d2..b1cdc22f 100644 --- a/docs/api/2d/classes/FSprite.md +++ b/docs/api/2d/classes/FSprite.md @@ -57,7 +57,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:328](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L328) +[packages/2d/src/core/FComponent.ts:335](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L335) *** @@ -81,7 +81,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:352](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L352) +[packages/2d/src/core/FComponent.ts:359](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L359) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L360) +[packages/2d/src/core/FComponent.ts:367](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L367) *** @@ -141,7 +141,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:368](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L368) +[packages/2d/src/core/FComponent.ts:375](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L375) *** @@ -165,7 +165,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:376](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L376) +[packages/2d/src/core/FComponent.ts:383](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L383) *** @@ -189,7 +189,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:384](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L384) +[packages/2d/src/core/FComponent.ts:391](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L391) *** @@ -213,7 +213,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L336) +[packages/2d/src/core/FComponent.ts:343](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L343) *** @@ -237,21 +237,19 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/FComponent.ts:344](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L344) +[packages/2d/src/core/FComponent.ts:351](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L351) ## Constructors ### new FSprite() -> **new FSprite**(`scene`, `texture`, `options`?): [`FSprite`](FSprite.md) +> **new FSprite**(`scene`, `options`): [`FSprite`](FSprite.md) #### Parameters • **scene**: [`FScene`](FScene.md) -• **texture**: `string` - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) +• **options**: [`FSpriteOptions`](../interfaces/FSpriteOptions.md) #### Returns @@ -263,7 +261,7 @@ Setters & getters for transform properties #### Defined in -[packages/2d/src/sprite/FSprite.ts:29](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L29) +[packages/2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L33) ## Methods @@ -305,7 +303,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -323,7 +321,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/2d/src/sprite/FSprite.ts:94](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L94) +[packages/2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L119) *** @@ -363,7 +361,7 @@ component.initCollider({ #### Defined in -[packages/2d/src/FComponent.ts:284](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L284) +[packages/2d/src/core/FComponent.ts:290](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L290) *** @@ -402,7 +400,7 @@ component.initRigidBody({ #### Defined in -[packages/2d/src/FComponent.ts:257](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L257) +[packages/2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L263) *** @@ -442,7 +440,7 @@ component.initSensor({ #### Defined in -[packages/2d/src/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L308) +[packages/2d/src/core/FComponent.ts:314](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L314) *** @@ -466,7 +464,7 @@ Load a texture from a path. #### Defined in -[packages/2d/src/sprite/FSprite.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L47) +[packages/2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L52) *** @@ -516,7 +514,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/2d/src/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L316) +[packages/2d/src/core/FComponent.ts:323](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L323) *** @@ -534,8 +532,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -543,7 +542,7 @@ Should be called every frame. #### Defined in -[packages/2d/src/sprite/FSprite.ts:79](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L79) +[packages/2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L104) *** @@ -567,7 +566,7 @@ Add a callback to be called when the texture is loaded. #### Defined in -[packages/2d/src/sprite/FSprite.ts:87](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L87) +[packages/2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L112) *** @@ -609,7 +608,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[packages/2d/src/FComponent.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L163) +[packages/2d/src/core/FComponent.ts:169](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L169) *** @@ -643,7 +642,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[packages/2d/src/FComponent.ts:212](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L212) +[packages/2d/src/core/FComponent.ts:218](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L218) *** @@ -677,7 +676,7 @@ component.setRotationDegree(90) #### Defined in -[packages/2d/src/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L231) +[packages/2d/src/core/FComponent.ts:237](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L237) *** @@ -719,7 +718,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[packages/2d/src/FComponent.ts:184](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L184) +[packages/2d/src/core/FComponent.ts:190](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L190) *** @@ -744,7 +743,7 @@ The width will be calculated according to the aspect ratio of the texture. #### Defined in -[packages/2d/src/sprite/FSprite.ts:75](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L75) +[packages/2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L100) *** @@ -769,7 +768,7 @@ The height will be calculated according to the aspect ratio of the texture. #### Defined in -[packages/2d/src/sprite/FSprite.ts:66](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L66) +[packages/2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L91) ## Properties @@ -792,7 +791,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -804,7 +803,7 @@ Callbacks for when the texture is loaded #### Defined in -[packages/2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L27) +[packages/2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L31) *** @@ -823,7 +822,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -839,7 +838,7 @@ Internal flags #### Defined in -[packages/2d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L26) +[packages/2d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L27) *** @@ -855,7 +854,7 @@ Internal flags #### Defined in -packages/core/dist/index.d.ts:11 +packages/core/dist/index.d.ts:36 *** @@ -871,7 +870,7 @@ RAPIER Collider #### Defined in -[packages/2d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L51) +[packages/2d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L56) *** @@ -887,7 +886,23 @@ PIXI container #### Defined in -[packages/2d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L36) +[packages/2d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L41) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/2d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L36) *** @@ -903,7 +918,7 @@ RAPIER RigidBody #### Defined in -[packages/2d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L47) +[packages/2d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L52) *** @@ -919,13 +934,13 @@ The scene which the component is in. #### Defined in -[packages/2d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L31) +[packages/2d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -935,7 +950,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/2d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L55) +[packages/2d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L60) *** @@ -947,7 +962,7 @@ The texture of the sprite. #### Defined in -[packages/2d/src/sprite/FSprite.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/sprite/FSprite.ts#L23) +[packages/2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L27) *** @@ -963,4 +978,4 @@ Transforms #### Defined in -[packages/2d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L41) +[packages/2d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L46) diff --git a/docs/api/2d/classes/FTransform.md b/docs/api/2d/classes/FTransform.md index 3cd6782e..f5b14545 100644 --- a/docs/api/2d/classes/FTransform.md +++ b/docs/api/2d/classes/FTransform.md @@ -38,7 +38,7 @@ const collider = new FTransform({ #### Defined in -[packages/2d/src/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L42) +[packages/2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L42) ## Properties @@ -58,7 +58,7 @@ Position of the component. #### Defined in -[packages/2d/src/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L16) +[packages/2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L16) *** @@ -70,7 +70,7 @@ Rotation of the component. #### Defined in -[packages/2d/src/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L24) +[packages/2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L24) *** @@ -90,4 +90,4 @@ Scale of the component. #### Defined in -[packages/2d/src/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L20) +[packages/2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L20) diff --git a/docs/api/2d/enumerations/FShapes.md b/docs/api/2d/enumerations/FShapes.md index 390a5613..6fd59158 100644 --- a/docs/api/2d/enumerations/FShapes.md +++ b/docs/api/2d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[packages/2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/types/FShapes.ts#L4) +[packages/2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/types/FShapes.ts#L4) *** @@ -20,4 +20,4 @@ #### Defined in -[packages/2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/types/FShapes.ts#L3) +[packages/2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/types/FShapes.ts#L3) diff --git a/docs/api/2d/index.md b/docs/api/2d/index.md index ee841127..aa163462 100644 --- a/docs/api/2d/index.md +++ b/docs/api/2d/index.md @@ -15,11 +15,14 @@ #### Character -- [FCharacter](classes/FCharacter.md) -- [FCharacterDynamic](classes/FCharacterDynamic.md) -- [FCharacterKP](classes/FCharacterKP.md) -- [FCharacterKV](classes/FCharacterKV.md) -- [FCharacterKinematic](classes/FCharacterKinematic.md) +- [FCharacterController](classes/FCharacterController.md) + +#### Controller + +- [FCharacterControllerD](classes/FCharacterControllerD.md) +- [FCharacterControllerK](classes/FCharacterControllerK.md) +- [FCharacterControllerKP](classes/FCharacterControllerKP.md) +- [FCharacterControllerKV](classes/FCharacterControllerKV.md) #### Core @@ -28,9 +31,14 @@ - [FScene](classes/FScene.md) - [FTransform](classes/FTransform.md) +#### Other + +- [FController](classes/FController.md) + #### Polygons - [FCircle](classes/FCircle.md) +- [FPolygon](classes/FPolygon.md) - [FRectangle](classes/FRectangle.md) #### Sprite @@ -44,9 +52,11 @@ ### Interfaces - [FCameraOptions](interfaces/FCameraOptions.md) -- [FCharacterOptions](interfaces/FCharacterOptions.md) +- [FCharacterControllerOptions](interfaces/FCharacterControllerOptions.md) - [FColliderOptions](interfaces/FColliderOptions.md) - [FComponentOptions](interfaces/FComponentOptions.md) +- [FControllerOptions](interfaces/FControllerOptions.md) - [FRigidBodyOptions](interfaces/FRigidBodyOptions.md) - [FSceneOptions](interfaces/FSceneOptions.md) +- [FSpriteOptions](interfaces/FSpriteOptions.md) - [FTransformOptions](interfaces/FTransformOptions.md) diff --git a/docs/api/2d/interfaces/FCameraOptions.md b/docs/api/2d/interfaces/FCameraOptions.md index 1b108c30..e9e4d787 100644 --- a/docs/api/2d/interfaces/FCameraOptions.md +++ b/docs/api/2d/interfaces/FCameraOptions.md @@ -6,8 +6,16 @@ ### position? -> `optional` **position**: `PointData` +> `optional` **position**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` #### Defined in -[packages/2d/src/cameras/FCamera.ts:6](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/cameras/FCamera.ts#L6) +[packages/2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/cameras/FCamera.ts#L5) diff --git a/docs/api/2d/interfaces/FCharacterControllerOptions.md b/docs/api/2d/interfaces/FCharacterControllerOptions.md new file mode 100644 index 00000000..878893f6 --- /dev/null +++ b/docs/api/2d/interfaces/FCharacterControllerOptions.md @@ -0,0 +1,33 @@ +[@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 + +[packages/2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FController.ts#L6) + +*** + +### speed? + +> `optional` **speed**: `number` + +The speed of the character. + +#### Defined in + +[packages/2d/src/controllers/FCharacterController.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FCharacterController.ts#L14) diff --git a/docs/api/2d/interfaces/FColliderOptions.md b/docs/api/2d/interfaces/FColliderOptions.md index 8f52adf1..5d5ae6d4 100644 --- a/docs/api/2d/interfaces/FColliderOptions.md +++ b/docs/api/2d/interfaces/FColliderOptions.md @@ -18,7 +18,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:6](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L6) +[packages/2d/src/core/FCollider.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L6) *** @@ -28,7 +28,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L11) +[packages/2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L11) *** @@ -38,7 +38,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L8) +[packages/2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L8) *** @@ -48,7 +48,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L9) +[packages/2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L9) *** @@ -66,7 +66,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L7) +[packages/2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L7) *** @@ -76,7 +76,7 @@ #### Defined in -[packages/2d/src/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L12) +[packages/2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L12) *** @@ -86,4 +86,4 @@ #### Defined in -[packages/2d/src/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FCollider.ts#L10) +[packages/2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FCollider.ts#L10) diff --git a/docs/api/2d/interfaces/FComponentOptions.md b/docs/api/2d/interfaces/FComponentOptions.md index 320601b8..5e275dfc 100644 --- a/docs/api/2d/interfaces/FComponentOptions.md +++ b/docs/api/2d/interfaces/FComponentOptions.md @@ -4,7 +4,7 @@ ## Extended by -- [`FCharacterOptions`](FCharacterOptions.md) +- [`FSpriteOptions`](FSpriteOptions.md) ## Properties @@ -22,7 +22,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L12) +[packages/2d/src/core/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L13) *** @@ -32,7 +32,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L14) +[packages/2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L15) *** @@ -42,7 +42,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L15) +[packages/2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L16) *** @@ -60,4 +60,4 @@ #### Defined in -[packages/2d/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L13) +[packages/2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L14) diff --git a/docs/api/2d/interfaces/FControllerOptions.md b/docs/api/2d/interfaces/FControllerOptions.md new file mode 100644 index 00000000..1725f5c4 --- /dev/null +++ b/docs/api/2d/interfaces/FControllerOptions.md @@ -0,0 +1,25 @@ +[@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 + +[packages/2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/controllers/FController.ts#L6) diff --git a/docs/api/2d/interfaces/FRigidBodyOptions.md b/docs/api/2d/interfaces/FRigidBodyOptions.md index 3466a61d..facce50a 100644 --- a/docs/api/2d/interfaces/FRigidBodyOptions.md +++ b/docs/api/2d/interfaces/FRigidBodyOptions.md @@ -18,7 +18,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L15) +[packages/2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L16) *** @@ -28,7 +28,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L14) +[packages/2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L15) *** @@ -38,7 +38,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L13) +[packages/2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L14) *** @@ -56,7 +56,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L7) +[packages/2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L7) *** @@ -66,7 +66,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L12) +[packages/2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L12) *** @@ -76,7 +76,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L9) +[packages/2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L9) *** @@ -86,7 +86,7 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L10) +[packages/2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L10) *** @@ -104,7 +104,17 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L8) +[packages/2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L8) + +*** + +### sensor? + +> `optional` **sensor**: `boolean` + +#### Defined in + +[packages/2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L13) *** @@ -114,4 +124,4 @@ #### Defined in -[packages/2d/src/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FRigidBody.ts#L11) +[packages/2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FRigidBody.ts#L11) diff --git a/docs/api/2d/interfaces/FSceneOptions.md b/docs/api/2d/interfaces/FSceneOptions.md index 1196c190..44bb8162 100644 --- a/docs/api/2d/interfaces/FSceneOptions.md +++ b/docs/api/2d/interfaces/FSceneOptions.md @@ -10,7 +10,7 @@ #### Defined in -[packages/2d/src/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L13) +[packages/2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L13) *** @@ -32,4 +32,4 @@ #### Defined in -[packages/2d/src/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FScene.ts#L12) +[packages/2d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FScene.ts#L12) diff --git a/docs/api/2d/interfaces/FCharacterOptions.md b/docs/api/2d/interfaces/FSpriteOptions.md similarity index 50% rename from docs/api/2d/interfaces/FCharacterOptions.md rename to docs/api/2d/interfaces/FSpriteOptions.md index 81c3074d..ae07461f 100644 --- a/docs/api/2d/interfaces/FCharacterOptions.md +++ b/docs/api/2d/interfaces/FSpriteOptions.md @@ -1,6 +1,6 @@ -[@fibbojs](/api/index) / [2d](/api/2d) / FCharacterOptions +[@fibbojs](/api/index) / [2d](/api/2d) / FSpriteOptions -# Interface: FCharacterOptions +# Interface: FSpriteOptions ## Extends @@ -26,7 +26,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L12) +[packages/2d/src/core/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L13) *** @@ -40,7 +40,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L14) +[packages/2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L15) *** @@ -54,7 +54,7 @@ #### Defined in -[packages/2d/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L15) +[packages/2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L16) *** @@ -76,16 +76,14 @@ #### Defined in -[packages/2d/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FComponent.ts#L13) +[packages/2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FComponent.ts#L14) *** -### speed? +### texture -> `optional` **speed**: `number` - -The speed of the character. +> **texture**: `string` #### Defined in -[packages/2d/src/character/FCharacter.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/character/FCharacter.ts#L14) +[packages/2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/sprite/FSprite.ts#L7) diff --git a/docs/api/2d/interfaces/FTransformOptions.md b/docs/api/2d/interfaces/FTransformOptions.md index adc1c782..b09eae8f 100644 --- a/docs/api/2d/interfaces/FTransformOptions.md +++ b/docs/api/2d/interfaces/FTransformOptions.md @@ -18,7 +18,7 @@ #### Defined in -[packages/2d/src/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L2) +[packages/2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L2) *** @@ -28,7 +28,7 @@ #### Defined in -[packages/2d/src/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L4) +[packages/2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L4) *** @@ -38,7 +38,7 @@ #### Defined in -[packages/2d/src/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L5) +[packages/2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L5) *** @@ -56,4 +56,4 @@ #### Defined in -[packages/2d/src/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/2d/src/FTransform.ts#L3) +[packages/2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/2d/src/core/FTransform.ts#L3) diff --git a/docs/api/3d/classes/FAttachedCamera.md b/docs/api/3d/classes/FAttachedCamera.md index 213eb9c2..395c7192 100644 --- a/docs/api/3d/classes/FAttachedCamera.md +++ b/docs/api/3d/classes/FAttachedCamera.md @@ -45,7 +45,7 @@ Model that the camera is attached to #### Defined in -[packages/3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FAttachedCamera.ts#L29) +[packages/3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L34) ## Methods @@ -392,7 +392,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -417,7 +417,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1177,7 +1177,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1195,8 +1195,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -1204,7 +1205,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FAttachedCamera.ts#L34) +[packages/3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L39) *** @@ -1585,7 +1586,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FAttachedCamera.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FAttachedCamera.ts#L46) +[packages/3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L51) *** @@ -1615,7 +1616,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1757,7 +1758,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2226,7 +2227,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2245,7 +2246,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2259,7 +2260,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2275,7 +2276,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2329,7 +2330,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:64 #### Defined in -[packages/3d/src/cameras/FAttachedCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FAttachedCamera.ts#L22) +[packages/3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L27) *** @@ -2928,7 +2929,7 @@ node\_modules/@types/three/src/core/Object3D.d.ts:140 #### Defined in -[packages/3d/src/cameras/FAttachedCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FAttachedCamera.ts#L24) +[packages/3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L29) *** @@ -3122,6 +3123,22 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Inherited from + +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FCamera.md b/docs/api/3d/classes/FCamera.md index 0d169a7a..9e4b36b5 100644 --- a/docs/api/3d/classes/FCamera.md +++ b/docs/api/3d/classes/FCamera.md @@ -25,7 +25,11 @@ The base class for cameras in Fibbo. ### new FCamera() -> **new FCamera**(): [`FCamera`](FCamera.md) +> **new FCamera**(`options`?): [`FCamera`](FCamera.md) + +#### Parameters + +• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) #### Returns @@ -37,7 +41,7 @@ The base class for cameras in Fibbo. #### Defined in -[packages/3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L18) +[packages/3d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L27) ## Methods @@ -384,7 +388,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -405,7 +409,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1165,7 +1169,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1183,8 +1187,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Implementation of @@ -1192,7 +1197,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L22) +[packages/3d/src/cameras/FCamera.ts:54](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L54) *** @@ -1569,7 +1574,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L27) +[packages/3d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L59) *** @@ -1595,7 +1600,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1733,7 +1738,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2202,7 +2207,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2221,7 +2226,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2235,7 +2240,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2251,7 +2256,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3066,6 +3071,18 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FCapsule.md b/docs/api/3d/classes/FCapsule.md index 35f3f3b4..c732a5b6 100644 --- a/docs/api/3d/classes/FCapsule.md +++ b/docs/api/3d/classes/FCapsule.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCapsule.ts#L23) +[packages/3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCapsule.ts#L23) ## Methods @@ -543,7 +543,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -583,7 +583,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/polyhedrons/FCapsule.ts:42](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCapsule.ts#L42) +[packages/3d/src/polyhedrons/FCapsule.ts:42](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCapsule.ts#L42) *** @@ -622,7 +622,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/polyhedrons/FCapsule.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCapsule.ts#L35) +[packages/3d/src/polyhedrons/FCapsule.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCapsule.ts#L35) *** @@ -662,7 +662,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -712,7 +712,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -730,8 +730,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -739,7 +740,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/polyhedrons/FCapsule.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCapsule.ts#L31) +[packages/3d/src/polyhedrons/FCapsule.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCapsule.ts#L31) *** @@ -773,7 +774,7 @@ cube.setColor(0xff0000) #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) +[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) *** @@ -819,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -865,7 +866,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -911,7 +912,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -957,7 +958,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -980,7 +981,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -999,7 +1000,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1013,7 +1014,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1029,7 +1030,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1045,7 +1046,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1062,7 +1079,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1078,7 +1095,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1094,13 +1111,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1110,7 +1127,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1126,4 +1143,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FCharacter.md b/docs/api/3d/classes/FCharacter.md deleted file mode 100644 index 91d47d16..00000000 --- a/docs/api/3d/classes/FCharacter.md +++ /dev/null @@ -1,1128 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacter - -# Class: `abstract` FCharacter - -## Description - -An abstract pre-defined character controller. - -## Extends - -- [`FComponent`](FComponent.md) - -## Extended by - -- [`FCharacterDynamic`](FCharacterDynamic.md) -- [`FCharacterKinematic`](FCharacterKinematic.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -• **position.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) - -*** - -### rotation - -> `get` **rotation**(): `object` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotationDegree`): `void` - -#### Parameters - -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeX`](FComponent.md#rotationdegreex) - -#### Defined in - -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeY`](FComponent.md#rotationdegreey) - -#### Defined in - -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeZ`](FComponent.md#rotationdegreez) - -#### Defined in - -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationX`](FComponent.md#rotationx) - -#### Defined in - -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationY`](FComponent.md#rotationy) - -#### Defined in - -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationZ`](FComponent.md#rotationz) - -#### Defined in - -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) - -#### Defined in - -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) - -#### Defined in - -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleZ`](FComponent.md#scalez) - -#### Defined in - -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) - -#### Defined in - -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) - -#### Defined in - -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) - -*** - -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`z`](FComponent.md#z) - -#### Defined in - -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) - -## Constructors - -### new FCharacter() - -> **new FCharacter**(`scene`, `options`?): [`FCharacter`](FCharacter.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FCharacterOptions`](../interfaces/FCharacterOptions.md) - -#### Returns - -[`FCharacter`](FCharacter.md) - -#### Overrides - -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L37) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:119](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L119) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the component. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:112](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L112) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:126](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L126) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`onCollisionWith`](FComponent.md#oncollisionwith) - -#### Defined in - -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Inherited from - -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) - -#### Defined in - -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The position on the x-axis. - -• **options.y**: `number` - -The position on the y-axis. - -• **options.z**: `number` - -The position on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) - -#### Defined in - -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from radians. - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` - -The rotation in degrees on the y-axis. - -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from degrees. - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) - -#### Defined in - -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` - -#### Inherited from - -[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__) - -#### Defined in - -packages/core/dist/index.d.ts:12 - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__) - -#### Defined in - -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -Collider - -#### Inherited from - -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) - -#### Defined in - -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) - -*** - -### 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 - -[packages/3d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L25) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FComponent`](FComponent.md).[`mesh`](FComponent.md#mesh) - -#### Defined in - -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RigidBody - -#### Inherited from - -[`FComponent`](FComponent.md).[`rigidBody`](FComponent.md#rigidbody) - -#### Defined in - -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene) - -#### Defined in - -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -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 - -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FComponent`](FComponent.md).[`transform`](FComponent.md#transform) - -#### Defined in - -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) diff --git a/docs/api/3d/classes/FCharacterController.md b/docs/api/3d/classes/FCharacterController.md new file mode 100644 index 00000000..41a72cb6 --- /dev/null +++ b/docs/api/3d/classes/FCharacterController.md @@ -0,0 +1,139 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterController + +# Class: `abstract` FCharacterController + +## Description + +An abstract pre-defined character controller. + +## Extends + +- [`FController`](FController.md) + +## Extended by + +- [`FCharacterControllerD`](FCharacterControllerD.md) +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterController() + +> **new FCharacterController**(`scene`, `options`): [`FCharacterController`](FCharacterController.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterController`](FCharacterController.md) + +#### Overrides + +[`FController`](FController.md).[`constructor`](FController.md#constructors) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L39) + +## Methods + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +[`FController`](FController.md).[`onFrame`](FController.md#onframe) + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### 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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FCharacterController.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L22) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L37) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L32) diff --git a/docs/api/3d/classes/FCharacterControllerD.md b/docs/api/3d/classes/FCharacterControllerD.md new file mode 100644 index 00000000..2ff14359 --- /dev/null +++ b/docs/api/3d/classes/FCharacterControllerD.md @@ -0,0 +1,156 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerD + +# Class: FCharacterControllerD + +## Description + +A pre-defined character controller based on a Dynamic RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerD(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterController`](FCharacterController.md) + +## Constructors + +### new FCharacterControllerD() + +> **new FCharacterControllerD**(`scene`, `options`): [`FCharacterControllerD`](FCharacterControllerD.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerD`](FCharacterControllerD.md) + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerD.ts#L23) + +## Methods + +### onFrame() + +> **onFrame**(`_delta`): `void` + +#### Parameters + +• **\_delta**: `number` + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerD.ts#L39) + +## Properties + +### 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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FCharacterController.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L22) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L37) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L32) diff --git a/docs/api/3d/classes/FCharacterControllerK.md b/docs/api/3d/classes/FCharacterControllerK.md new file mode 100644 index 00000000..d8d53076 --- /dev/null +++ b/docs/api/3d/classes/FCharacterControllerK.md @@ -0,0 +1,203 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerK + +# Class: `abstract` FCharacterControllerK + +## Description + +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**(`scene`, `options`): [`FCharacterControllerK`](FCharacterControllerK.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerK`](FCharacterControllerK.md) + +#### Overrides + +[`FCharacterController`](FCharacterController.md).[`constructor`](FCharacterController.md#constructors) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L23) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +##### z + +> **z**: `number` + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L47) + +*** + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### characterController + +> **characterController**: `KinematicCharacterController` + +The character controller that will be used to move the character. + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FCharacterController.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L22) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`scene`](FCharacterController.md#scene) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L37) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`speed`](FCharacterController.md#speed) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L32) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to apply gravity. + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKP.md b/docs/api/3d/classes/FCharacterControllerKP.md new file mode 100644 index 00000000..f2f9ff90 --- /dev/null +++ b/docs/api/3d/classes/FCharacterControllerKP.md @@ -0,0 +1,222 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerKP + +# Class: FCharacterControllerKP + +## Description + +A pre-defined character controller based on a Kinematic Position RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerKP(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterControllerKP() + +> **new FCharacterControllerKP**(`scene`, `options`): [`FCharacterControllerKP`](FCharacterControllerKP.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerKP`](FCharacterControllerKP.md) + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +##### z + +> **z**: `number` + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L47) + +*** + +### onFrame() + +> **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) + +## Properties + +### 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 + +[packages/3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FCharacterController.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L22) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L37) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L32) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to apply gravity. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKV.md b/docs/api/3d/classes/FCharacterControllerKV.md new file mode 100644 index 00000000..33c2d40f --- /dev/null +++ b/docs/api/3d/classes/FCharacterControllerKV.md @@ -0,0 +1,222 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterControllerKV + +# Class: FCharacterControllerKV + +## Description + +A pre-defined character controller based on a Kinematic Velocity RigidBody. + +## Example + +```ts +import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/3d' + +const scene = new FScene() + +const capsule = new FCapsule(scene) +capsule.controller = new FCharacterControllerKV(scene) +scene.addComponent(capsule) +``` + +## Extends + +- [`FCharacterControllerK`](FCharacterControllerK.md) + +## Constructors + +### new FCharacterControllerKV() + +> **new FCharacterControllerKV**(`scene`, `options`): [`FCharacterControllerKV`](FCharacterControllerKV.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options**: [`FCharacterControllerOptions`](../interfaces/FCharacterControllerOptions.md) + +#### Returns + +[`FCharacterControllerKV`](FCharacterControllerKV.md) + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`constructor`](FCharacterControllerK.md#constructors) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) + +## Methods + +### getCorrectedMovements() + +> **getCorrectedMovements**(): `object` + +Return the corrected movements for the current frame. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +##### z + +> **z**: `number` + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L47) + +*** + +### onFrame() + +> **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Overrides + +[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) + +## Properties + +### 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 + +[packages/3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/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 + +[packages/3d/src/controllers/FCharacterController.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L22) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene where the character is. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`scene`](FCharacterControllerK.md#scene) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L37) + +*** + +### speed + +> **speed**: `number` + +The speed of the character. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`speed`](FCharacterControllerK.md#speed) + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L32) + +*** + +### yVelocity + +> **yVelocity**: `number` + +The y velocity of the character. Used to apply gravity. + +#### Inherited from + +[`FCharacterControllerK`](FCharacterControllerK.md).[`yVelocity`](FCharacterControllerK.md#yvelocity) + +#### Defined in + +[packages/3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterDynamic.md b/docs/api/3d/classes/FCharacterDynamic.md deleted file mode 100644 index 4ee001ec..00000000 --- a/docs/api/3d/classes/FCharacterDynamic.md +++ /dev/null @@ -1,1142 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterDynamic - -# Class: FCharacterDynamic - -## Description - -A pre-defined character controller based on a Dynamic RigidBody. - -## Example - -```ts -import { FScene, FCharacterDynamic } from '@fibbojs/3d' - -const scene = new FScene() - -const capsule = new FCharacterDynamic(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacter`](FCharacter.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -• **position.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`position`](FCharacter.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) - -*** - -### rotation - -> `get` **rotation**(): `object` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotation`](FCharacter.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotationDegree`): `void` - -#### Parameters - -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegree`](FCharacter.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeX`](FCharacter.md#rotationdegreex) - -#### Defined in - -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeY`](FCharacter.md#rotationdegreey) - -#### Defined in - -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeZ`](FCharacter.md#rotationdegreez) - -#### Defined in - -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationX`](FCharacter.md#rotationx) - -#### Defined in - -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationY`](FCharacter.md#rotationy) - -#### Defined in - -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationZ`](FCharacter.md#rotationz) - -#### Defined in - -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scale`](FCharacter.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleX`](FCharacter.md#scalex) - -#### Defined in - -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleY`](FCharacter.md#scaley) - -#### Defined in - -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleZ`](FCharacter.md#scalez) - -#### Defined in - -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`x`](FCharacter.md#x) - -#### Defined in - -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`y`](FCharacter.md#y) - -#### Defined in - -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) - -*** - -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`z`](FCharacter.md#z) - -#### Defined in - -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) - -## Constructors - -### new FCharacterDynamic() - -> **new FCharacterDynamic**(`scene`, `options`?): [`FCharacterDynamic`](FCharacterDynamic.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterDynamic`](FCharacterDynamic.md) - -#### Overrides - -[`FCharacter`](FCharacter.md).[`constructor`](FCharacter.md#constructors) - -#### Defined in - -[packages/3d/src/character/FCharacterDynamic.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterDynamic.ts#L23) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`emitCollisionWith`](FCharacter.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initCollider`](FCharacter.md#initcollider) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:119](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L119) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the component. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FCharacter`](FCharacter.md).[`initRigidBody`](FCharacter.md#initrigidbody) - -#### Defined in - -[packages/3d/src/character/FCharacterDynamic.ts:62](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterDynamic.ts#L62) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initSensor`](FCharacter.md#initsensor) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:126](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L126) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onCollisionWith`](FCharacter.md#oncollisionwith) - -#### Defined in - -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacter`](FCharacter.md).[`onFrame`](FCharacter.md#onframe) - -#### Defined in - -[packages/3d/src/character/FCharacterDynamic.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterDynamic.ts#L37) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The position on the x-axis. - -• **options.y**: `number` - -The position on the y-axis. - -• **options.z**: `number` - -The position on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setPosition`](FCharacter.md#setposition) - -#### Defined in - -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from radians. - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotation`](FCharacter.md#setrotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` - -The rotation in degrees on the y-axis. - -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from degrees. - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotationDegree`](FCharacter.md#setrotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setScale`](FCharacter.md#setscale) - -#### Defined in - -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__CALLBACKS_ON_COLLISION__`](FCharacter.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__ID__`](FCharacter.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_2D__`](FCharacter.md#__is_2d__) - -#### Defined in - -packages/core/dist/index.d.ts:12 - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_3D__`](FCharacter.md#__is_3d__) - -#### Defined in - -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -Collider - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`collider`](FCharacter.md#collider) - -#### Defined in - -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) - -*** - -### 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 - -[`FCharacter`](FCharacter.md).[`inputs`](FCharacter.md#inputs) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L25) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`mesh`](FCharacter.md#mesh) - -#### Defined in - -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RigidBody - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rigidBody`](FCharacter.md#rigidbody) - -#### Defined in - -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scene`](FCharacter.md#scene) - -#### Defined in - -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`sensor`](FCharacter.md#sensor) - -#### Defined in - -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`speed`](FCharacter.md#speed) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`transform`](FCharacter.md#transform) - -#### Defined in - -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) diff --git a/docs/api/3d/classes/FCharacterKP.md b/docs/api/3d/classes/FCharacterKP.md deleted file mode 100644 index 9a9c0c43..00000000 --- a/docs/api/3d/classes/FCharacterKP.md +++ /dev/null @@ -1,1212 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterKP - -# Class: FCharacterKP - -## Description - -A pre-defined character controller based on a Kinematic Position RigidBody. - -## Example - -```ts -import { FScene, FCharacterKP } from '@fibbojs/3d' - -const scene = new FScene() - -const capsule = new FCharacterKP(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacterKinematic`](FCharacterKinematic.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -• **position.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`position`](FCharacterKinematic.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) - -*** - -### rotation - -> `get` **rotation**(): `object` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotation`](FCharacterKinematic.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotationDegree`): `void` - -#### Parameters - -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegree`](FCharacterKinematic.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeX`](FCharacterKinematic.md#rotationdegreex) - -#### Defined in - -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeY`](FCharacterKinematic.md#rotationdegreey) - -#### Defined in - -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeZ`](FCharacterKinematic.md#rotationdegreez) - -#### Defined in - -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationX`](FCharacterKinematic.md#rotationx) - -#### Defined in - -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationY`](FCharacterKinematic.md#rotationy) - -#### Defined in - -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationZ`](FCharacterKinematic.md#rotationz) - -#### Defined in - -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scale`](FCharacterKinematic.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleX`](FCharacterKinematic.md#scalex) - -#### Defined in - -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleY`](FCharacterKinematic.md#scaley) - -#### Defined in - -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleZ`](FCharacterKinematic.md#scalez) - -#### Defined in - -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`x`](FCharacterKinematic.md#x) - -#### Defined in - -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`y`](FCharacterKinematic.md#y) - -#### Defined in - -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) - -*** - -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`z`](FCharacterKinematic.md#z) - -#### Defined in - -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) - -## Constructors - -### new FCharacterKP() - -> **new FCharacterKP**(`scene`, `options`?): [`FCharacterKP`](FCharacterKP.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterKP`](FCharacterKP.md) - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`constructor`](FCharacterKinematic.md#constructors) - -#### Defined in - -[packages/3d/src/character/FCharacterKP.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKP.ts#L21) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`emitCollisionWith`](FCharacterKinematic.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`getCorrectedMovements`](FCharacterKinematic.md#getcorrectedmovements) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initCollider`](FCharacterKinematic.md#initcollider) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:119](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L119) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the component. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initRigidBody`](FCharacterKinematic.md#initrigidbody) - -#### Defined in - -[packages/3d/src/character/FCharacterKP.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKP.ts#L47) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initSensor`](FCharacterKinematic.md#initsensor) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:126](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L126) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onCollisionWith`](FCharacterKinematic.md#oncollisionwith) - -#### Defined in - -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) - -*** - -### onFrame() - -> **onFrame**(`delta`): `void` - -#### Parameters - -• **delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onFrame`](FCharacterKinematic.md#onframe) - -#### Defined in - -[packages/3d/src/character/FCharacterKP.ts:30](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKP.ts#L30) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The position on the x-axis. - -• **options.y**: `number` - -The position on the y-axis. - -• **options.z**: `number` - -The position on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setPosition`](FCharacterKinematic.md#setposition) - -#### Defined in - -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from radians. - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotation`](FCharacterKinematic.md#setrotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` - -The rotation in degrees on the y-axis. - -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from degrees. - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotationDegree`](FCharacterKinematic.md#setrotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setScale`](FCharacterKinematic.md#setscale) - -#### Defined in - -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__CALLBACKS_ON_COLLISION__`](FCharacterKinematic.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__ID__`](FCharacterKinematic.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_2D__`](FCharacterKinematic.md#__is_2d__) - -#### Defined in - -packages/core/dist/index.d.ts:12 - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_3D__`](FCharacterKinematic.md#__is_3d__) - -#### Defined in - -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`characterController`](FCharacterKinematic.md#charactercontroller) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L21) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -Collider - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`collider`](FCharacterKinematic.md#collider) - -#### Defined in - -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) - -*** - -### 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 - -[`FCharacterKinematic`](FCharacterKinematic.md).[`inputs`](FCharacterKinematic.md#inputs) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L25) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`mesh`](FCharacterKinematic.md#mesh) - -#### Defined in - -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RigidBody - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rigidBody`](FCharacterKinematic.md#rigidbody) - -#### Defined in - -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scene`](FCharacterKinematic.md#scene) - -#### Defined in - -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`sensor`](FCharacterKinematic.md#sensor) - -#### Defined in - -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`speed`](FCharacterKinematic.md#speed) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`transform`](FCharacterKinematic.md#transform) - -#### Defined in - -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to apply gravity. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`yVelocity`](FCharacterKinematic.md#yvelocity) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L16) diff --git a/docs/api/3d/classes/FCharacterKV.md b/docs/api/3d/classes/FCharacterKV.md deleted file mode 100644 index 6eadbf0c..00000000 --- a/docs/api/3d/classes/FCharacterKV.md +++ /dev/null @@ -1,1212 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterKV - -# Class: FCharacterKV - -## Description - -A pre-defined character controller based on a Kinematic Velocity RigidBody. - -## Example - -```ts -import { FScene, FCharacterKV } from '@fibbojs/3d' - -const scene = new FScene() - -const capsule = new FCharacterKV(scene) -scene.addComponent(capsule) -``` - -## Extends - -- [`FCharacterKinematic`](FCharacterKinematic.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -• **position.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`position`](FCharacterKinematic.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) - -*** - -### rotation - -> `get` **rotation**(): `object` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotation`](FCharacterKinematic.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotationDegree`): `void` - -#### Parameters - -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegree`](FCharacterKinematic.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeX`](FCharacterKinematic.md#rotationdegreex) - -#### Defined in - -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeY`](FCharacterKinematic.md#rotationdegreey) - -#### Defined in - -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationDegreeZ`](FCharacterKinematic.md#rotationdegreez) - -#### Defined in - -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationX`](FCharacterKinematic.md#rotationx) - -#### Defined in - -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationY`](FCharacterKinematic.md#rotationy) - -#### Defined in - -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rotationZ`](FCharacterKinematic.md#rotationz) - -#### Defined in - -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scale`](FCharacterKinematic.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleX`](FCharacterKinematic.md#scalex) - -#### Defined in - -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleY`](FCharacterKinematic.md#scaley) - -#### Defined in - -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scaleZ`](FCharacterKinematic.md#scalez) - -#### Defined in - -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`x`](FCharacterKinematic.md#x) - -#### Defined in - -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`y`](FCharacterKinematic.md#y) - -#### Defined in - -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) - -*** - -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`z`](FCharacterKinematic.md#z) - -#### Defined in - -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) - -## Constructors - -### new FCharacterKV() - -> **new FCharacterKV**(`scene`, `options`?): [`FCharacterKV`](FCharacterKV.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCharacterKV`](FCharacterKV.md) - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`constructor`](FCharacterKinematic.md#constructors) - -#### Defined in - -[packages/3d/src/character/FCharacterKV.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKV.ts#L22) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`emitCollisionWith`](FCharacterKinematic.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`getCorrectedMovements`](FCharacterKinematic.md#getcorrectedmovements) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initCollider`](FCharacterKinematic.md#initcollider) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:119](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L119) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the component. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initRigidBody`](FCharacterKinematic.md#initrigidbody) - -#### Defined in - -[packages/3d/src/character/FCharacterKV.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKV.ts#L48) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`initSensor`](FCharacterKinematic.md#initsensor) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:126](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L126) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onCollisionWith`](FCharacterKinematic.md#oncollisionwith) - -#### Defined in - -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) - -*** - -### onFrame() - -> **onFrame**(`delta`): `void` - -#### Parameters - -• **delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Overrides - -[`FCharacterKinematic`](FCharacterKinematic.md).[`onFrame`](FCharacterKinematic.md#onframe) - -#### Defined in - -[packages/3d/src/character/FCharacterKV.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKV.ts#L31) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The position on the x-axis. - -• **options.y**: `number` - -The position on the y-axis. - -• **options.z**: `number` - -The position on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setPosition`](FCharacterKinematic.md#setposition) - -#### Defined in - -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from radians. - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotation`](FCharacterKinematic.md#setrotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` - -The rotation in degrees on the y-axis. - -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from degrees. - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setRotationDegree`](FCharacterKinematic.md#setrotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`setScale`](FCharacterKinematic.md#setscale) - -#### Defined in - -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__CALLBACKS_ON_COLLISION__`](FCharacterKinematic.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__ID__`](FCharacterKinematic.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_2D__`](FCharacterKinematic.md#__is_2d__) - -#### Defined in - -packages/core/dist/index.d.ts:12 - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`__IS_3D__`](FCharacterKinematic.md#__is_3d__) - -#### Defined in - -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`characterController`](FCharacterKinematic.md#charactercontroller) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L21) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -Collider - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`collider`](FCharacterKinematic.md#collider) - -#### Defined in - -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) - -*** - -### 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 - -[`FCharacterKinematic`](FCharacterKinematic.md).[`inputs`](FCharacterKinematic.md#inputs) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L25) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`mesh`](FCharacterKinematic.md#mesh) - -#### Defined in - -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RigidBody - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`rigidBody`](FCharacterKinematic.md#rigidbody) - -#### Defined in - -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`scene`](FCharacterKinematic.md#scene) - -#### Defined in - -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`sensor`](FCharacterKinematic.md#sensor) - -#### Defined in - -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`speed`](FCharacterKinematic.md#speed) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`transform`](FCharacterKinematic.md#transform) - -#### Defined in - -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to apply gravity. - -#### Inherited from - -[`FCharacterKinematic`](FCharacterKinematic.md).[`yVelocity`](FCharacterKinematic.md#yvelocity) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L16) diff --git a/docs/api/3d/classes/FCharacterKinematic.md b/docs/api/3d/classes/FCharacterKinematic.md deleted file mode 100644 index 5927154b..00000000 --- a/docs/api/3d/classes/FCharacterKinematic.md +++ /dev/null @@ -1,1194 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterKinematic - -# Class: `abstract` FCharacterKinematic - -## Description - -An abstract pre-defined character controller based on Kinematic rigidbodies. - -## Extends - -- [`FCharacter`](FCharacter.md) - -## Extended by - -- [`FCharacterKP`](FCharacterKP.md) -- [`FCharacterKV`](FCharacterKV.md) - -## Accessors - -### position - -> `get` **position**(): `object` - -Setters & getters for transform properties - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -• **position.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`position`](FCharacter.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) - -*** - -### rotation - -> `get` **rotation**(): `object` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotation`](FCharacter.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotationDegree`): `void` - -#### Parameters - -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegree`](FCharacter.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeX`](FCharacter.md#rotationdegreex) - -#### Defined in - -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeY`](FCharacter.md#rotationdegreey) - -#### Defined in - -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationDegreeZ`](FCharacter.md#rotationdegreez) - -#### Defined in - -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationX`](FCharacter.md#rotationx) - -#### Defined in - -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationY`](FCharacter.md#rotationy) - -#### Defined in - -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rotationZ`](FCharacter.md#rotationz) - -#### Defined in - -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scale`](FCharacter.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleX`](FCharacter.md#scalex) - -#### Defined in - -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleY`](FCharacter.md#scaley) - -#### Defined in - -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scaleZ`](FCharacter.md#scalez) - -#### Defined in - -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`x`](FCharacter.md#x) - -#### Defined in - -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`y`](FCharacter.md#y) - -#### Defined in - -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) - -*** - -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`z`](FCharacter.md#z) - -#### Defined in - -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) - -## Constructors - -### new FCharacterKinematic() - -> **new FCharacterKinematic**(`scene`, `options`?): [`FCharacterKinematic`](FCharacterKinematic.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FCharacterOptions`](../interfaces/FCharacterOptions.md) - -#### Returns - -[`FCharacterKinematic`](FCharacterKinematic.md) - -#### Overrides - -[`FCharacter`](FCharacter.md).[`constructor`](FCharacter.md#constructors) - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L23) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`classOrObject`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to emit the collision event with. - -#### Returns - -`void` - -#### Description - -Emit a collision event with a given class. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(Enemy) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith(enemy) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`emitCollisionWith`](FCharacter.md#emitcollisionwith) - -#### Defined in - -packages/core/dist/index.d.ts:70 - -*** - -### getCorrectedMovements() - -> **getCorrectedMovements**(`delta`): `object` - -Return the corrected movements for the current frame. - -#### Parameters - -• **delta**: `number` - -The time elapsed since the last frame. - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:48](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L48) - -*** - -### initCollider() - -> **initCollider**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Only init a collider for the component, without a rigid body. -This is useful for static objects. - -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initCollider`](FCharacter.md#initcollider) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:119](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L119) - -*** - -### initRigidBody() - -> **initRigidBody**(`options`?): `void` - -#### Parameters - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigid body. - -#### Returns - -`void` - -#### Description - -Init a rigid body for the component. - -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initRigidBody`](FCharacter.md#initrigidbody) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:112](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L112) - -*** - -### initSensor() - -> **initSensor**(`options`?): `void` - -#### Parameters - -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. - -#### Returns - -`void` - -#### Description - -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`initSensor`](FCharacter.md#initsensor) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:126](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L126) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): `void` - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`void` - -#### Description - -Add a callback to be called when a collision occurs. - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onCollisionWith`](FCharacter.md#oncollisionwith) - -#### Defined in - -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Description - -Update the component. -Should be called every frame. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`onFrame`](FCharacter.md#onframe) - -#### Defined in - -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The position on the x-axis. - -• **options.y**: `number` - -The position on the y-axis. - -• **options.z**: `number` - -The position on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the position of the component. - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setPosition`](FCharacter.md#setposition) - -#### Defined in - -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from radians. - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotation`](FCharacter.md#setrotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` - -The rotation in degrees on the y-axis. - -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the rotation of the component from degrees. - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setRotationDegree`](FCharacter.md#setrotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Description - -Set the scale of the component. - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`setScale`](FCharacter.md#setscale) - -#### Defined in - -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Description - -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. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__CALLBACKS_ON_COLLISION__`](FCharacter.md#__callbacks_on_collision__) - -#### Defined in - -packages/core/dist/index.d.ts:22 - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -#### Description - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__ID__`](FCharacter.md#__id__) - -#### Defined in - -packages/core/dist/index.d.ts:17 - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_2D__`](FCharacter.md#__is_2d__) - -#### Defined in - -packages/core/dist/index.d.ts:12 - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`__IS_3D__`](FCharacter.md#__is_3d__) - -#### Defined in - -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) - -*** - -### characterController - -> **characterController**: `KinematicCharacterController` - -The character controller that will be used to move the character. - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L21) - -*** - -### collider? - -> `optional` **collider**: `FCollider` - -Collider - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`collider`](FCharacter.md#collider) - -#### Defined in - -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) - -*** - -### 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 - -[`FCharacter`](FCharacter.md).[`inputs`](FCharacter.md#inputs) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L25) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`mesh`](FCharacter.md#mesh) - -#### Defined in - -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) - -*** - -### rigidBody? - -> `optional` **rigidBody**: `FRigidBody` - -RigidBody - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`rigidBody`](FCharacter.md#rigidbody) - -#### Defined in - -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) - -*** - -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene which the component is in. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`scene`](FCharacter.md#scene) - -#### Defined in - -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) - -*** - -### sensor? - -> `optional` **sensor**: `FCollider` - -Sensor (a collider that doesn't collide with other colliders, but still triggers events) - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`sensor`](FCharacter.md#sensor) - -#### Defined in - -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) - -*** - -### speed - -> **speed**: `number` - -The speed of the character. - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`speed`](FCharacter.md#speed) - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L35) - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transforms - -#### Inherited from - -[`FCharacter`](FCharacter.md).[`transform`](FCharacter.md#transform) - -#### Defined in - -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) - -*** - -### yVelocity - -> **yVelocity**: `number` - -The y velocity of the character. Used to apply gravity. - -#### Defined in - -[packages/3d/src/character/FCharacterKinematic.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacterKinematic.ts#L16) diff --git a/docs/api/3d/classes/FComponent.md b/docs/api/3d/classes/FComponent.md index de801714..56ec5ff0 100644 --- a/docs/api/3d/classes/FComponent.md +++ b/docs/api/3d/classes/FComponent.md @@ -13,7 +13,6 @@ The base class for all 3D objects in Fibbo. ## Extended by - [`FComponentEmpty`](FComponentEmpty.md) -- [`FCharacter`](FCharacter.md) - [`FModel`](FModel.md) - [`FPolyhedron`](FPolyhedron.md) @@ -55,7 +54,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -93,7 +92,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -131,7 +130,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -151,7 +150,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -171,7 +170,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -191,7 +190,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -211,7 +210,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -231,7 +230,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -251,7 +250,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -289,7 +288,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -309,7 +308,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -329,7 +328,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -349,7 +348,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -369,7 +368,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -389,7 +388,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -409,7 +408,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -437,7 +436,7 @@ The options for the component. #### Defined in -[packages/3d/src/FComponent.ts:77](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L77) +[packages/3d/src/core/FComponent.ts:82](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L82) ## Methods @@ -479,7 +478,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -515,7 +514,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -550,7 +549,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -586,7 +585,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -636,7 +635,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -654,8 +653,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -663,7 +663,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -705,7 +705,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -747,7 +747,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -789,7 +789,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -831,7 +831,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -854,7 +854,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -873,7 +873,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -887,7 +887,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -903,7 +903,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -915,7 +915,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Overrides + +`FComponentCore.controller` + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -927,7 +943,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -939,7 +955,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -951,19 +967,19 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -975,4 +991,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FComponentEmpty.md b/docs/api/3d/classes/FComponentEmpty.md index 3fd0d680..1e902cb8 100644 --- a/docs/api/3d/classes/FComponentEmpty.md +++ b/docs/api/3d/classes/FComponentEmpty.md @@ -52,7 +52,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -94,7 +94,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -136,7 +136,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -160,7 +160,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -184,7 +184,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -208,7 +208,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -232,7 +232,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -256,7 +256,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -280,7 +280,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -322,7 +322,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -346,7 +346,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -370,7 +370,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -394,7 +394,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -418,7 +418,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -442,7 +442,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -466,7 +466,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -490,7 +490,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponentEmpty.ts#L10) +[packages/3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -532,7 +532,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -572,7 +572,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -611,7 +611,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -651,7 +651,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -701,7 +701,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -719,8 +719,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -728,7 +729,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponentEmpty.ts#L14) +[packages/3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponentEmpty.ts#L14) *** @@ -774,7 +775,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -820,7 +821,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -866,7 +867,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -912,7 +913,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -935,7 +936,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -954,7 +955,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -968,7 +969,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -984,7 +985,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1000,7 +1001,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1016,7 +1033,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1032,7 +1049,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1048,13 +1065,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1064,7 +1081,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1080,4 +1097,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FController.md b/docs/api/3d/classes/FController.md new file mode 100644 index 00000000..34496486 --- /dev/null +++ b/docs/api/3d/classes/FController.md @@ -0,0 +1,86 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FController + +# Class: `abstract` FController + +## Description + +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 + +[packages/3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FController.ts#L23) + +## Methods + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Inherited from + +`FControllerCore.onFrame` + +#### Defined in + +packages/core/dist/index.d.ts:26 + +## Properties + +### 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 + +[packages/3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FController.ts#L17) diff --git a/docs/api/3d/classes/FCube.md b/docs/api/3d/classes/FCuboid.md similarity index 71% rename from docs/api/3d/classes/FCube.md rename to docs/api/3d/classes/FCuboid.md index b8edd642..099cc1b9 100644 --- a/docs/api/3d/classes/FCube.md +++ b/docs/api/3d/classes/FCuboid.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCuboid.ts#L19) +[packages/3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCuboid.ts#L19) ## Methods @@ -543,7 +543,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -583,7 +583,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -622,7 +622,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -662,7 +662,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -712,7 +712,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -730,8 +730,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -739,7 +740,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FCuboid.ts#L23) +[packages/3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FCuboid.ts#L23) *** @@ -773,7 +774,7 @@ cube.setColor(0xff0000) #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) +[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) *** @@ -819,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -865,7 +866,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -911,7 +912,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -957,7 +958,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -980,7 +981,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -999,7 +1000,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1013,7 +1014,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1029,7 +1030,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1045,7 +1046,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1062,7 +1079,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1078,7 +1095,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1094,13 +1111,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1110,7 +1127,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1126,4 +1143,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FFBX.md b/docs/api/3d/classes/FFBX.md index 223468f4..f9a8dba4 100644 --- a/docs/api/3d/classes/FFBX.md +++ b/docs/api/3d/classes/FFBX.md @@ -65,7 +65,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -107,7 +107,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -149,7 +149,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -173,7 +173,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -197,7 +197,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -221,7 +221,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -245,7 +245,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -269,7 +269,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -293,7 +293,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -335,7 +335,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -359,7 +359,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -383,7 +383,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -407,7 +407,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -431,7 +431,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -455,7 +455,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -479,7 +479,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -503,7 +503,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FFBX.ts#L23) +[packages/3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FFBX.ts#L23) ## Methods @@ -525,7 +525,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[packages/3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FFBX.ts#L65) +[packages/3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FFBX.ts#L65) *** @@ -567,7 +567,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -589,7 +589,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L116) +[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L116) *** @@ -629,7 +629,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -708,7 +708,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -742,7 +742,7 @@ model.loadTextureFor(material) #### Defined in -[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L151) +[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L151) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -810,8 +810,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -819,7 +820,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -847,7 +848,7 @@ Add a callback to be called when the model is loaded. #### Defined in -[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L109) +[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L109) *** @@ -893,7 +894,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -939,7 +940,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -985,7 +986,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -1031,7 +1032,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -1054,7 +1055,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -1070,7 +1071,7 @@ Callbacks for when the model is loaded #### Defined in -[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L21) +[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L21) *** @@ -1089,7 +1090,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1103,7 +1104,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1119,7 +1120,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1135,7 +1136,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FModel`](FModel.md).[`controller`](FModel.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1152,7 +1169,7 @@ Default is 'obj'. #### Defined in -[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L52) +[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L52) *** @@ -1168,7 +1185,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1185,7 +1202,7 @@ Shouldn't contain file extensions. #### Defined in -[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L27) +[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L27) *** @@ -1204,7 +1221,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L35) +[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L35) *** @@ -1220,7 +1237,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1236,13 +1253,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1252,7 +1269,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1276,7 +1293,7 @@ A record containing texture path for each material. #### Defined in -[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L46) +[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L46) *** @@ -1292,4 +1309,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FFixedCamera.md b/docs/api/3d/classes/FFixedCamera.md index 62454bf7..cdc7aec6 100644 --- a/docs/api/3d/classes/FFixedCamera.md +++ b/docs/api/3d/classes/FFixedCamera.md @@ -26,7 +26,11 @@ scene.camera.lookAt(0, 0, 0) ### new FFixedCamera() -> **new FFixedCamera**(): [`FFixedCamera`](FFixedCamera.md) +> **new FFixedCamera**(`options`?): [`FFixedCamera`](FFixedCamera.md) + +#### Parameters + +• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) #### Returns @@ -38,7 +42,7 @@ scene.camera.lookAt(0, 0, 0) #### Defined in -[packages/3d/src/cameras/FFixedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FFixedCamera.ts#L18) +[packages/3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FFixedCamera.ts#L19) ## Methods @@ -385,7 +389,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -410,7 +414,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1170,7 +1174,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1188,8 +1192,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -1197,7 +1202,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FFixedCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FFixedCamera.ts#L22) +[packages/3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FFixedCamera.ts#L23) *** @@ -1578,7 +1583,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L27) +[packages/3d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L59) *** @@ -1608,7 +1613,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1750,7 +1755,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2219,7 +2224,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2238,7 +2243,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2252,7 +2257,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2268,7 +2273,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3083,6 +3088,22 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Inherited from + +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FGLB.md b/docs/api/3d/classes/FGLB.md index c58d5991..ab4610e4 100644 --- a/docs/api/3d/classes/FGLB.md +++ b/docs/api/3d/classes/FGLB.md @@ -66,7 +66,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -108,7 +108,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -150,7 +150,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -174,7 +174,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -198,7 +198,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -222,7 +222,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -246,7 +246,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -270,7 +270,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -294,7 +294,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -336,7 +336,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -360,7 +360,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -384,7 +384,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -408,7 +408,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -432,7 +432,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -456,7 +456,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -480,7 +480,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -504,7 +504,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FGLB.ts#L22) +[packages/3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FGLB.ts#L22) ## Methods @@ -526,7 +526,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L125) +[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L125) *** @@ -568,7 +568,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -590,7 +590,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L116) +[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L116) *** @@ -630,7 +630,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -669,7 +669,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -709,7 +709,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -743,7 +743,7 @@ model.loadTextureFor(material) #### Defined in -[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L151) +[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L151) *** @@ -793,7 +793,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -811,8 +811,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -820,7 +821,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -848,7 +849,7 @@ Add a callback to be called when the model is loaded. #### Defined in -[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L109) +[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L109) *** @@ -894,7 +895,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -940,7 +941,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -986,7 +987,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -1032,7 +1033,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -1055,7 +1056,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -1071,7 +1072,7 @@ Callbacks for when the model is loaded #### Defined in -[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L21) +[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L21) *** @@ -1090,7 +1091,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1104,7 +1105,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1120,7 +1121,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1136,7 +1137,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FGLTF`](FGLTF.md).[`controller`](FGLTF.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1153,7 +1170,7 @@ Default is 'obj'. #### Defined in -[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L52) +[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L52) *** @@ -1169,7 +1186,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1186,7 +1203,7 @@ Shouldn't contain file extensions. #### Defined in -[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L27) +[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L27) *** @@ -1205,7 +1222,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L35) +[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L35) *** @@ -1221,7 +1238,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1237,13 +1254,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1253,7 +1270,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1277,7 +1294,7 @@ A record containing texture path for each material. #### Defined in -[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L46) +[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L46) *** @@ -1293,4 +1310,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FGLTF.md b/docs/api/3d/classes/FGLTF.md index 45fd85c4..21f12d5e 100644 --- a/docs/api/3d/classes/FGLTF.md +++ b/docs/api/3d/classes/FGLTF.md @@ -69,7 +69,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -111,7 +111,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -153,7 +153,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -177,7 +177,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -201,7 +201,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -225,7 +225,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -249,7 +249,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -273,7 +273,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -297,7 +297,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -339,7 +339,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -363,7 +363,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -387,7 +387,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -411,7 +411,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -435,7 +435,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -459,7 +459,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -483,7 +483,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -507,7 +507,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FGLTF.ts#L37) +[packages/3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FGLTF.ts#L37) ## Methods @@ -529,7 +529,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L125) +[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L125) *** @@ -571,7 +571,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -593,7 +593,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L116) +[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L116) *** @@ -633,7 +633,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -672,7 +672,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -712,7 +712,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -746,7 +746,7 @@ model.loadTextureFor(material) #### Defined in -[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L151) +[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L151) *** @@ -796,7 +796,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -814,8 +814,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -823,7 +824,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -851,7 +852,7 @@ Add a callback to be called when the model is loaded. #### Defined in -[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L109) +[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L109) *** @@ -897,7 +898,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -943,7 +944,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -989,7 +990,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -1035,7 +1036,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -1058,7 +1059,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -1074,7 +1075,7 @@ Callbacks for when the model is loaded #### Defined in -[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L21) +[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L21) *** @@ -1093,7 +1094,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1107,7 +1108,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1123,7 +1124,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1139,7 +1140,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FModel`](FModel.md).[`controller`](FModel.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1156,7 +1173,7 @@ Default is 'obj'. #### Defined in -[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L52) +[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L52) *** @@ -1172,7 +1189,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1189,7 +1206,7 @@ Shouldn't contain file extensions. #### Defined in -[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L27) +[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L27) *** @@ -1208,7 +1225,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L35) +[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L35) *** @@ -1224,7 +1241,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1240,13 +1257,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1256,7 +1273,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1280,7 +1297,7 @@ A record containing texture path for each material. #### Defined in -[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L46) +[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L46) *** @@ -1296,4 +1313,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FGameCamera.md b/docs/api/3d/classes/FGameCamera.md index aeed20e2..eb8bc6c1 100644 --- a/docs/api/3d/classes/FGameCamera.md +++ b/docs/api/3d/classes/FGameCamera.md @@ -27,13 +27,13 @@ scene.camera = new FGameCamera(cube) ### new FGameCamera() -> **new FGameCamera**(`attachedComponent`): [`FGameCamera`](FGameCamera.md) +> **new FGameCamera**(`options`): [`FGameCamera`](FGameCamera.md) #### Parameters -• **attachedComponent**: [`FComponent`](FComponent.md) +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -Component that the camera is attached to +Options for the camera. #### Returns @@ -45,7 +45,7 @@ Component that the camera is attached to #### Defined in -[packages/3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FGameCamera.ts#L31) +[packages/3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FGameCamera.ts#L31) ## Methods @@ -392,7 +392,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -417,7 +417,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1177,7 +1177,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1195,8 +1195,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -1204,7 +1205,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FGameCamera.ts#L57) +[packages/3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FGameCamera.ts#L57) *** @@ -1585,7 +1586,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L45) +[packages/3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1615,7 +1616,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1757,7 +1758,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2226,7 +2227,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2245,7 +2246,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2259,7 +2260,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2275,7 +2276,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2333,7 +2334,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:64 #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L22) +[packages/3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2391,7 +2392,7 @@ node\_modules/@types/three/src/core/Object3D.d.ts:100 #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L24) +[packages/3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -2696,7 +2697,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:38 #### Defined in -[packages/3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FGameCamera.ts#L24) +[packages/3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FGameCamera.ts#L24) *** @@ -2706,7 +2707,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:38 #### Defined in -[packages/3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FGameCamera.ts#L26) +[packages/3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FGameCamera.ts#L26) *** @@ -3138,6 +3139,22 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Inherited from + +[`FOrbitCamera`](FOrbitCamera.md).[`transform`](FOrbitCamera.md#transform) + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FModel.md b/docs/api/3d/classes/FModel.md index f6fd0e5a..ef846419 100644 --- a/docs/api/3d/classes/FModel.md +++ b/docs/api/3d/classes/FModel.md @@ -58,7 +58,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -100,7 +100,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -142,7 +142,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -166,7 +166,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -190,7 +190,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -214,7 +214,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -238,7 +238,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -262,7 +262,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -286,7 +286,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -328,7 +328,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -352,7 +352,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -376,7 +376,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -400,7 +400,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -424,7 +424,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -448,7 +448,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -472,7 +472,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -500,7 +500,7 @@ The options for the component (inherits from FComponent). #### Defined in -[packages/3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L59) +[packages/3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L59) ## Methods @@ -518,7 +518,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L125) +[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L125) *** @@ -560,7 +560,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -578,7 +578,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L116) +[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L116) *** @@ -618,7 +618,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -657,7 +657,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -697,7 +697,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -727,7 +727,7 @@ model.loadTextureFor(material) #### Defined in -[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L151) +[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L151) *** @@ -777,7 +777,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -795,8 +795,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -804,7 +805,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -828,7 +829,7 @@ Add a callback to be called when the model is loaded. #### Defined in -[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L109) +[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L109) *** @@ -874,7 +875,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -920,7 +921,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -966,7 +967,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -1012,7 +1013,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -1035,7 +1036,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -1047,7 +1048,7 @@ Callbacks for when the model is loaded #### Defined in -[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L21) +[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L21) *** @@ -1066,7 +1067,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1080,7 +1081,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1096,7 +1097,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1112,7 +1113,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1125,7 +1142,7 @@ Default is 'obj'. #### Defined in -[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L52) +[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L52) *** @@ -1141,7 +1158,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1154,7 +1171,7 @@ Shouldn't contain file extensions. #### Defined in -[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L27) +[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L27) *** @@ -1169,7 +1186,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L35) +[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L35) *** @@ -1185,7 +1202,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1201,13 +1218,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1217,7 +1234,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1237,7 +1254,7 @@ A record containing texture path for each material. #### Defined in -[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L46) +[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L46) *** @@ -1253,4 +1270,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FOBJ.md b/docs/api/3d/classes/FOBJ.md index c8fa2d9a..cff54572 100644 --- a/docs/api/3d/classes/FOBJ.md +++ b/docs/api/3d/classes/FOBJ.md @@ -65,7 +65,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -107,7 +107,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -149,7 +149,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -173,7 +173,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -197,7 +197,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -221,7 +221,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -245,7 +245,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -269,7 +269,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -293,7 +293,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -335,7 +335,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -359,7 +359,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -383,7 +383,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -407,7 +407,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -431,7 +431,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -455,7 +455,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -479,7 +479,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -503,7 +503,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FOBJ.ts#L23) +[packages/3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FOBJ.ts#L23) ## Methods @@ -525,7 +525,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L125) +[packages/3d/src/model/FModel.ts:125](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L125) *** @@ -567,7 +567,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -589,7 +589,7 @@ Emit the onLoaded callbacks. #### Defined in -[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L116) +[packages/3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L116) *** @@ -629,7 +629,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -708,7 +708,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -742,7 +742,7 @@ model.loadTextureFor(material) #### Defined in -[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L151) +[packages/3d/src/model/FModel.ts:151](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L151) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -810,8 +810,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -819,7 +820,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/FComponent.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L102) +[packages/3d/src/core/FComponent.ts:107](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L107) *** @@ -847,7 +848,7 @@ Add a callback to be called when the model is loaded. #### Defined in -[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L109) +[packages/3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L109) *** @@ -893,7 +894,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -939,7 +940,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -985,7 +986,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -1031,7 +1032,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -1054,7 +1055,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -1070,7 +1071,7 @@ Callbacks for when the model is loaded #### Defined in -[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L21) +[packages/3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L21) *** @@ -1089,7 +1090,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1103,7 +1104,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1119,7 +1120,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1135,7 +1136,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FModel`](FModel.md).[`controller`](FModel.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1152,7 +1169,7 @@ Default is 'obj'. #### Defined in -[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L52) +[packages/3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L52) *** @@ -1168,7 +1185,7 @@ Mesh #### Defined in -[packages/3d/src/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L36) +[packages/3d/src/core/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L41) *** @@ -1185,7 +1202,7 @@ Shouldn't contain file extensions. #### Defined in -[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L27) +[packages/3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L27) *** @@ -1204,7 +1221,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L35) +[packages/3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L35) *** @@ -1220,7 +1237,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1236,13 +1253,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1252,7 +1269,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1276,7 +1293,7 @@ A record containing texture path for each material. #### Defined in -[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L46) +[packages/3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L46) *** @@ -1292,4 +1309,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FOrbitCamera.md b/docs/api/3d/classes/FOrbitCamera.md index 14d1b923..93a7222d 100644 --- a/docs/api/3d/classes/FOrbitCamera.md +++ b/docs/api/3d/classes/FOrbitCamera.md @@ -31,13 +31,13 @@ scene.camera = new FOrbitCamera(cube) ### new FOrbitCamera() -> **new FOrbitCamera**(`attachedComponent`): [`FOrbitCamera`](FOrbitCamera.md) +> **new FOrbitCamera**(`options`): [`FOrbitCamera`](FOrbitCamera.md) #### Parameters -• **attachedComponent**: [`FComponent`](FComponent.md) +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -Component that the camera is attached to +Options for the camera. #### Returns @@ -49,7 +49,7 @@ Component that the camera is attached to #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:29](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L29) +[packages/3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L30) ## Methods @@ -396,7 +396,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -421,7 +421,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1181,7 +1181,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1199,8 +1199,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -1208,7 +1209,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L37) +[packages/3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L38) *** @@ -1589,7 +1590,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L45) +[packages/3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1619,7 +1620,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1761,7 +1762,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2230,7 +2231,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2249,7 +2250,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2263,7 +2264,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2279,7 +2280,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2333,7 +2334,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:64 #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L22) +[packages/3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2387,7 +2388,7 @@ node\_modules/@types/three/src/core/Object3D.d.ts:100 #### Defined in -[packages/3d/src/cameras/FOrbitCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FOrbitCamera.ts#L24) +[packages/3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -3114,6 +3115,22 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Inherited from + +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FPointerLockCamera.md b/docs/api/3d/classes/FPointerLockCamera.md index 821bea83..a3d6d9f5 100644 --- a/docs/api/3d/classes/FPointerLockCamera.md +++ b/docs/api/3d/classes/FPointerLockCamera.md @@ -27,13 +27,13 @@ scene.camera = new FPointerLockCamera(cube) ### new FPointerLockCamera() -> **new FPointerLockCamera**(`attachedComponent`): [`FPointerLockCamera`](FPointerLockCamera.md) +> **new FPointerLockCamera**(`options`): [`FPointerLockCamera`](FPointerLockCamera.md) #### Parameters -• **attachedComponent**: [`FComponent`](FComponent.md) +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -Component that the camera is attached to +Options for the camera. #### Returns @@ -45,7 +45,7 @@ Component that the camera is attached to #### Defined in -[packages/3d/src/cameras/FPointerLockCamera.ts:29](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FPointerLockCamera.ts#L29) +[packages/3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FPointerLockCamera.ts#L30) ## Methods @@ -392,7 +392,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/3d/src/cameras/FCamera.ts:52](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L52) +[packages/3d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L84) *** @@ -417,7 +417,7 @@ This method is useful to get the direction of the camera to apply forces in the #### Defined in -[packages/3d/src/cameras/FCamera.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L61) +[packages/3d/src/cameras/FCamera.ts:93](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L93) *** @@ -1177,7 +1177,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/cameras/FCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L45) +[packages/3d/src/cameras/FCamera.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L77) *** @@ -1195,8 +1195,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -1204,7 +1205,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/cameras/FPointerLockCamera.ts:44](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FPointerLockCamera.ts#L44) +[packages/3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FPointerLockCamera.ts#L45) *** @@ -1585,7 +1586,7 @@ Set the position of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L27) +[packages/3d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L59) *** @@ -1615,7 +1616,7 @@ Set the rotation of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L41) +[packages/3d/src/cameras/FCamera.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L73) *** @@ -1757,7 +1758,7 @@ Set the scale of the camera. #### Defined in -[packages/3d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L34) +[packages/3d/src/cameras/FCamera.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L66) *** @@ -2226,7 +2227,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L16) +[packages/3d/src/cameras/FCamera.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L20) *** @@ -2245,7 +2246,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L15) +[packages/3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2259,7 +2260,7 @@ It is generated automatically. #### Defined in -[packages/3d/src/cameras/FCamera.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L13) +[packages/3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2275,7 +2276,7 @@ Internal flags #### Defined in -[packages/3d/src/cameras/FCamera.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FCamera.ts#L12) +[packages/3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2329,7 +2330,7 @@ node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:64 #### Defined in -[packages/3d/src/cameras/FPointerLockCamera.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FPointerLockCamera.ts#L22) +[packages/3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FPointerLockCamera.ts#L23) *** @@ -2383,7 +2384,7 @@ node\_modules/@types/three/src/core/Object3D.d.ts:100 #### Defined in -[packages/3d/src/cameras/FPointerLockCamera.ts:24](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/cameras/FPointerLockCamera.ts#L24) +[packages/3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FPointerLockCamera.ts#L25) *** @@ -3110,6 +3111,22 @@ node\_modules/@types/three/src/core/Object3D.d.ts:130 *** +### transform + +> **transform**: [`FTransform`](FTransform.md) + +Transform of the camera. + +#### Inherited from + +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) + +#### Defined in + +[packages/3d/src/cameras/FCamera.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FCamera.ts#L25) + +*** + ### type > `readonly` **type**: `string` diff --git a/docs/api/3d/classes/FPolyhedron.md b/docs/api/3d/classes/FPolyhedron.md index e7570142..6e8ae7c8 100644 --- a/docs/api/3d/classes/FPolyhedron.md +++ b/docs/api/3d/classes/FPolyhedron.md @@ -59,7 +59,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -101,7 +101,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -143,7 +143,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -167,7 +167,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -191,7 +191,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -215,7 +215,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -239,7 +239,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -263,7 +263,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -287,7 +287,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -329,7 +329,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -353,7 +353,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -377,7 +377,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -401,7 +401,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -425,7 +425,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -449,7 +449,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -473,7 +473,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -497,7 +497,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) +[packages/3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) ## Methods @@ -539,7 +539,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -579,7 +579,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/FComponent.ts:330](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L330) +[packages/3d/src/core/FComponent.ts:336](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L336) *** @@ -618,7 +618,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/FComponent.ts:301](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L301) +[packages/3d/src/core/FComponent.ts:307](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L307) *** @@ -658,7 +658,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -708,7 +708,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -726,8 +726,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -735,7 +736,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L26) +[packages/3d/src/polyhedrons/FPolyhedron.ts:26](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L26) *** @@ -765,7 +766,7 @@ cube.setColor(0xff0000) #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) +[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) *** @@ -811,7 +812,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -857,7 +858,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -903,7 +904,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -949,7 +950,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -972,7 +973,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -991,7 +992,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1005,7 +1006,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1021,7 +1022,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1037,7 +1038,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1054,7 +1071,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1070,7 +1087,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1086,13 +1103,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1102,7 +1119,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1118,4 +1135,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FScene.md b/docs/api/3d/classes/FScene.md index d42df59d..101ef5a4 100644 --- a/docs/api/3d/classes/FScene.md +++ b/docs/api/3d/classes/FScene.md @@ -59,7 +59,7 @@ import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d' #### Defined in -[packages/3d/src/FScene.ts:70](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L70) +[packages/3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L68) ## Methods @@ -85,7 +85,7 @@ Add a component to the scene. #### Defined in -[packages/3d/src/FScene.ts:189](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L189) +[packages/3d/src/core/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L180) *** @@ -117,7 +117,7 @@ Handle a collision event between two colliders. #### Defined in -[packages/3d/src/FScene.ts:163](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L163) +[packages/3d/src/core/FScene.ts:154](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L154) *** @@ -131,7 +131,7 @@ Handle a collision event between two colliders. #### Defined in -[packages/3d/src/FScene.ts:102](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L102) +[packages/3d/src/core/FScene.ts:100](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L100) *** @@ -145,7 +145,7 @@ Handle a collision event between two colliders. #### Defined in -[packages/3d/src/FScene.ts:134](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L134) +[packages/3d/src/core/FScene.ts:125](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L125) *** @@ -171,7 +171,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -packages/core/dist/index.d.ts:154 +packages/core/dist/index.d.ts:184 *** @@ -197,7 +197,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -packages/core/dist/index.d.ts:150 +packages/core/dist/index.d.ts:180 ## Properties @@ -207,7 +207,7 @@ packages/core/dist/index.d.ts:150 #### Defined in -[packages/3d/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L59) +[packages/3d/src/core/FScene.ts:58](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L58) *** @@ -226,7 +226,7 @@ It is an array of functions that take the component as an argument. #### Defined in -packages/core/dist/index.d.ts:141 +packages/core/dist/index.d.ts:171 *** @@ -245,7 +245,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -packages/core/dist/index.d.ts:136 +packages/core/dist/index.d.ts:166 *** @@ -257,7 +257,7 @@ DOM element that the renderer will be appended to #### Defined in -[packages/3d/src/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L57) +[packages/3d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L56) *** @@ -271,7 +271,7 @@ DOM element that the renderer will be appended to #### Defined in -packages/core/dist/index.d.ts:121 +packages/core/dist/index.d.ts:151 *** @@ -287,7 +287,7 @@ Internal flags #### Defined in -[packages/3d/src/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L50) +[packages/3d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L49) *** @@ -297,7 +297,7 @@ Internal flags #### Defined in -[packages/3d/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L68) +[packages/3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L66) *** @@ -307,7 +307,7 @@ Internal flags #### Defined in -[packages/3d/src/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L62) +[packages/3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L61) *** @@ -323,17 +323,7 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L53) - -*** - -### controls? - -> `optional` **controls**: `OrbitControls` - -#### Defined in - -[packages/3d/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L63) +[packages/3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L52) *** @@ -343,7 +333,7 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L67) +[packages/3d/src/core/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L65) *** @@ -369,7 +359,7 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L65) +[packages/3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L63) *** @@ -379,7 +369,7 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L61) +[packages/3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L60) *** @@ -389,7 +379,7 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L60) +[packages/3d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L59) *** @@ -403,4 +393,4 @@ The components in the scene. #### Defined in -[packages/3d/src/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L66) +[packages/3d/src/core/FScene.ts:64](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L64) diff --git a/docs/api/3d/classes/FSphere.md b/docs/api/3d/classes/FSphere.md index 708ed91c..e129483d 100644 --- a/docs/api/3d/classes/FSphere.md +++ b/docs/api/3d/classes/FSphere.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:374](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L374) +[packages/3d/src/core/FComponent.ts:381](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L381) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:406](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L406) +[packages/3d/src/core/FComponent.ts:413](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L413) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:438](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L438) +[packages/3d/src/core/FComponent.ts:445](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L445) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:450](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L450) +[packages/3d/src/core/FComponent.ts:457](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L457) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:458](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L458) +[packages/3d/src/core/FComponent.ts:465](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L465) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:466](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L466) +[packages/3d/src/core/FComponent.ts:473](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L473) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:414](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L414) +[packages/3d/src/core/FComponent.ts:421](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L421) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:422](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L422) +[packages/3d/src/core/FComponent.ts:429](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L429) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:430](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L430) +[packages/3d/src/core/FComponent.ts:437](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L437) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:474](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L474) +[packages/3d/src/core/FComponent.ts:481](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L481) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:482](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L482) +[packages/3d/src/core/FComponent.ts:489](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L489) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:490](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L490) +[packages/3d/src/core/FComponent.ts:497](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L497) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:498](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L498) +[packages/3d/src/core/FComponent.ts:505](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L505) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:382](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L382) +[packages/3d/src/core/FComponent.ts:389](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L389) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:390](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L390) +[packages/3d/src/core/FComponent.ts:397](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L397) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/FComponent.ts:398](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L398) +[packages/3d/src/core/FComponent.ts:405](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L405) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[packages/3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FSphere.ts#L23) +[packages/3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FSphere.ts#L23) ## Methods @@ -543,7 +543,7 @@ player.emitCollisionWith(enemy) #### Defined in -packages/core/dist/index.d.ts:70 +packages/core/dist/index.d.ts:100 *** @@ -583,7 +583,7 @@ component.initCollider({ #### Defined in -[packages/3d/src/polyhedrons/FSphere.ts:42](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FSphere.ts#L42) +[packages/3d/src/polyhedrons/FSphere.ts:42](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FSphere.ts#L42) *** @@ -622,7 +622,7 @@ component.initRigidBody({ #### Defined in -[packages/3d/src/polyhedrons/FSphere.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FSphere.ts#L35) +[packages/3d/src/polyhedrons/FSphere.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FSphere.ts#L35) *** @@ -662,7 +662,7 @@ component.initSensor({ #### Defined in -[packages/3d/src/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L354) +[packages/3d/src/core/FComponent.ts:360](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L360) *** @@ -712,7 +712,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/3d/src/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L362) +[packages/3d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L369) *** @@ -730,8 +730,9 @@ player.onCollisionWith(enemy, () => { #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Overrides @@ -739,7 +740,7 @@ Should be called every frame. #### Defined in -[packages/3d/src/polyhedrons/FSphere.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FSphere.ts#L31) +[packages/3d/src/polyhedrons/FSphere.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FSphere.ts#L31) *** @@ -773,7 +774,7 @@ cube.setColor(0xff0000) #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) +[packages/3d/src/polyhedrons/FPolyhedron.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L38) *** @@ -819,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:173](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L173) +[packages/3d/src/core/FComponent.ts:179](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L179) *** @@ -865,7 +866,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:238](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L238) +[packages/3d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L244) *** @@ -911,7 +912,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[packages/3d/src/FComponent.ts:262](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L262) +[packages/3d/src/core/FComponent.ts:268](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L268) *** @@ -957,7 +958,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[packages/3d/src/FComponent.ts:197](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L197) +[packages/3d/src/core/FComponent.ts:203](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L203) ## Properties @@ -980,7 +981,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -packages/core/dist/index.d.ts:22 +packages/core/dist/index.d.ts:47 *** @@ -999,7 +1000,7 @@ It is generated automatically. #### Defined in -packages/core/dist/index.d.ts:17 +packages/core/dist/index.d.ts:42 *** @@ -1013,7 +1014,7 @@ packages/core/dist/index.d.ts:17 #### Defined in -packages/core/dist/index.d.ts:12 +packages/core/dist/index.d.ts:37 *** @@ -1029,7 +1030,7 @@ Internal flags #### Defined in -[packages/3d/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L26) +[packages/3d/src/core/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L27) *** @@ -1045,7 +1046,23 @@ Collider #### Defined in -[packages/3d/src/FComponent.ts:51](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L51) +[packages/3d/src/core/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L56) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) + +#### Defined in + +[packages/3d/src/core/FComponent.ts:36](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L36) *** @@ -1062,7 +1079,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[packages/3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1078,7 +1095,7 @@ RigidBody #### Defined in -[packages/3d/src/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L47) +[packages/3d/src/core/FComponent.ts:52](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L52) *** @@ -1094,13 +1111,13 @@ The scene which the component is in. #### Defined in -[packages/3d/src/FComponent.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L31) +[packages/3d/src/core/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L32) *** ### sensor? -> `optional` **sensor**: `FCollider` +> `optional` **sensor**: `FRigidBody` Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1110,7 +1127,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[packages/3d/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L55) +[packages/3d/src/core/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L60) *** @@ -1126,4 +1143,4 @@ Transforms #### Defined in -[packages/3d/src/FComponent.ts:41](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L41) +[packages/3d/src/core/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L46) diff --git a/docs/api/3d/classes/FTransform.md b/docs/api/3d/classes/FTransform.md index 225ea39c..259f1ca5 100644 --- a/docs/api/3d/classes/FTransform.md +++ b/docs/api/3d/classes/FTransform.md @@ -38,7 +38,7 @@ const collider = new FTransform({ #### Defined in -[packages/3d/src/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L44) +[packages/3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L44) ## Properties @@ -50,7 +50,7 @@ The position of the component. #### Defined in -[packages/3d/src/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L18) +[packages/3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L18) *** @@ -62,7 +62,7 @@ The rotation of the component. #### Defined in -[packages/3d/src/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L26) +[packages/3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L26) *** @@ -74,4 +74,4 @@ The scale of the component. #### Defined in -[packages/3d/src/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L22) +[packages/3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L22) diff --git a/docs/api/3d/enumerations/FShapes.md b/docs/api/3d/enumerations/FShapes.md index 96cd8362..451643ca 100644 --- a/docs/api/3d/enumerations/FShapes.md +++ b/docs/api/3d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[packages/3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/types/FShapes.ts#L5) +[packages/3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/types/FShapes.ts#L5) *** @@ -20,7 +20,7 @@ #### Defined in -[packages/3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/types/FShapes.ts#L3) +[packages/3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/types/FShapes.ts#L3) *** @@ -30,7 +30,7 @@ #### Defined in -[packages/3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/types/FShapes.ts#L6) +[packages/3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/types/FShapes.ts#L6) *** @@ -40,4 +40,4 @@ #### Defined in -[packages/3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/types/FShapes.ts#L4) +[packages/3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/types/FShapes.ts#L4) diff --git a/docs/api/3d/index.md b/docs/api/3d/index.md index 63289a52..3c891c9d 100644 --- a/docs/api/3d/index.md +++ b/docs/api/3d/index.md @@ -17,11 +17,14 @@ #### Character -- [FCharacter](classes/FCharacter.md) -- [FCharacterDynamic](classes/FCharacterDynamic.md) -- [FCharacterKP](classes/FCharacterKP.md) -- [FCharacterKV](classes/FCharacterKV.md) -- [FCharacterKinematic](classes/FCharacterKinematic.md) +- [FCharacterControllerKV](classes/FCharacterControllerKV.md) + +#### Controller + +- [FCharacterController](classes/FCharacterController.md) +- [FCharacterControllerD](classes/FCharacterControllerD.md) +- [FCharacterControllerK](classes/FCharacterControllerK.md) +- [FCharacterControllerKP](classes/FCharacterControllerKP.md) #### Core @@ -42,15 +45,22 @@ - [FPolyhedron](classes/FPolyhedron.md) - [FSphere](classes/FSphere.md) +#### Other + +- [FController](classes/FController.md) + ### Enumerations - [FShapes](enumerations/FShapes.md) ### Interfaces -- [FCharacterOptions](interfaces/FCharacterOptions.md) +- [FAttachedCameraOptions](interfaces/FAttachedCameraOptions.md) +- [FCameraOptions](interfaces/FCameraOptions.md) +- [FCharacterControllerOptions](interfaces/FCharacterControllerOptions.md) - [FColliderOptions](interfaces/FColliderOptions.md) - [FComponentOptions](interfaces/FComponentOptions.md) +- [FControllerOptions](interfaces/FControllerOptions.md) - [FModelOptions](interfaces/FModelOptions.md) - [FRigidBodyOptions](interfaces/FRigidBodyOptions.md) - [FSceneOptions](interfaces/FSceneOptions.md) diff --git a/docs/api/3d/interfaces/FAttachedCameraOptions.md b/docs/api/3d/interfaces/FAttachedCameraOptions.md new file mode 100644 index 00000000..c2585487 --- /dev/null +++ b/docs/api/3d/interfaces/FAttachedCameraOptions.md @@ -0,0 +1,121 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FAttachedCameraOptions + +# Interface: FAttachedCameraOptions + +## Extends + +- [`FCameraOptions`](FCameraOptions.md) + +## Properties + +### position? + +> `optional` **position**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FCameraOptions`](FCameraOptions.md).[`position`](FCameraOptions.md#position) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L4) + +*** + +### rotation? + +> `optional` **rotation**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FCameraOptions`](FCameraOptions.md).[`rotation`](FCameraOptions.md#rotation) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L6) + +*** + +### rotationDegree? + +> `optional` **rotationDegree**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FCameraOptions`](FCameraOptions.md).[`rotationDegree`](FCameraOptions.md#rotationdegree) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L7) + +*** + +### scale? + +> `optional` **scale**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FCameraOptions`](FCameraOptions.md).[`scale`](FCameraOptions.md#scale) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L5) + +*** + +### target + +> **target**: [`FComponent`](../classes/FComponent.md) + +#### Defined in + +[packages/3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/3d/interfaces/FCameraOptions.md b/docs/api/3d/interfaces/FCameraOptions.md new file mode 100644 index 00000000..0532610e --- /dev/null +++ b/docs/api/3d/interfaces/FCameraOptions.md @@ -0,0 +1,115 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FCameraOptions + +# Interface: FCameraOptions + +## Extends + +- [`FTransformOptions`](FTransformOptions.md) + +## Extended by + +- [`FAttachedCameraOptions`](FAttachedCameraOptions.md) + +## Properties + +### position? + +> `optional` **position**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FTransformOptions`](FTransformOptions.md).[`position`](FTransformOptions.md#position) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L4) + +*** + +### rotation? + +> `optional` **rotation**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FTransformOptions`](FTransformOptions.md).[`rotation`](FTransformOptions.md#rotation) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L6) + +*** + +### rotationDegree? + +> `optional` **rotationDegree**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FTransformOptions`](FTransformOptions.md).[`rotationDegree`](FTransformOptions.md#rotationdegree) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L7) + +*** + +### scale? + +> `optional` **scale**: `object` + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Inherited from + +[`FTransformOptions`](FTransformOptions.md).[`scale`](FTransformOptions.md#scale) + +#### Defined in + +[packages/3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FCharacterControllerOptions.md b/docs/api/3d/interfaces/FCharacterControllerOptions.md new file mode 100644 index 00000000..847d3dab --- /dev/null +++ b/docs/api/3d/interfaces/FCharacterControllerOptions.md @@ -0,0 +1,33 @@ +[@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 + +[packages/3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FController.ts#L6) + +*** + +### speed? + +> `optional` **speed**: `number` + +The speed of the character. + +#### Defined in + +[packages/3d/src/controllers/FCharacterController.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FCharacterController.ts#L11) diff --git a/docs/api/3d/interfaces/FCharacterOptions.md b/docs/api/3d/interfaces/FCharacterOptions.md deleted file mode 100644 index 8d027ebf..00000000 --- a/docs/api/3d/interfaces/FCharacterOptions.md +++ /dev/null @@ -1,123 +0,0 @@ -[@fibbojs](/api/index) / [3d](/api/3d) / FCharacterOptions - -# Interface: FCharacterOptions - -## Extends - -- [`FComponentOptions`](FComponentOptions.md) - -## Properties - -### position? - -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` - -#### Inherited from - -[`FComponentOptions`](FComponentOptions.md).[`position`](FComponentOptions.md#position) - -#### Defined in - -[packages/3d/src/FComponent.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L12) - -*** - -### rotation? - -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` - -#### Inherited from - -[`FComponentOptions`](FComponentOptions.md).[`rotation`](FComponentOptions.md#rotation) - -#### Defined in - -[packages/3d/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L14) - -*** - -### rotationDegree? - -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` - -#### Inherited from - -[`FComponentOptions`](FComponentOptions.md).[`rotationDegree`](FComponentOptions.md#rotationdegree) - -#### Defined in - -[packages/3d/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L15) - -*** - -### scale? - -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` - -#### Inherited from - -[`FComponentOptions`](FComponentOptions.md).[`scale`](FComponentOptions.md#scale) - -#### Defined in - -[packages/3d/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L13) - -*** - -### speed? - -> `optional` **speed**: `number` - -The speed of the character. - -#### Defined in - -[packages/3d/src/character/FCharacter.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/character/FCharacter.ts#L14) diff --git a/docs/api/3d/interfaces/FColliderOptions.md b/docs/api/3d/interfaces/FColliderOptions.md index a813aa99..db1fae1e 100644 --- a/docs/api/3d/interfaces/FColliderOptions.md +++ b/docs/api/3d/interfaces/FColliderOptions.md @@ -22,7 +22,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L7) +[packages/3d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L7) *** @@ -32,7 +32,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L12) +[packages/3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L12) *** @@ -54,7 +54,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L9) +[packages/3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L9) *** @@ -76,7 +76,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L10) +[packages/3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L10) *** @@ -98,7 +98,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L8) +[packages/3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L8) *** @@ -108,7 +108,7 @@ #### Defined in -[packages/3d/src/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L13) +[packages/3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L13) *** @@ -118,4 +118,4 @@ #### Defined in -[packages/3d/src/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FCollider.ts#L11) +[packages/3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FCollider.ts#L11) diff --git a/docs/api/3d/interfaces/FComponentOptions.md b/docs/api/3d/interfaces/FComponentOptions.md index 3da2ba35..b76eb71c 100644 --- a/docs/api/3d/interfaces/FComponentOptions.md +++ b/docs/api/3d/interfaces/FComponentOptions.md @@ -4,7 +4,6 @@ ## Extended by -- [`FCharacterOptions`](FCharacterOptions.md) - [`FModelOptions`](FModelOptions.md) ## Properties @@ -27,7 +26,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L12) +[packages/3d/src/core/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L13) *** @@ -49,7 +48,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L14) +[packages/3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L15) *** @@ -71,7 +70,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L15) +[packages/3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L16) *** @@ -93,4 +92,4 @@ #### Defined in -[packages/3d/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L13) +[packages/3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L14) diff --git a/docs/api/3d/interfaces/FControllerOptions.md b/docs/api/3d/interfaces/FControllerOptions.md new file mode 100644 index 00000000..6863e764 --- /dev/null +++ b/docs/api/3d/interfaces/FControllerOptions.md @@ -0,0 +1,25 @@ +[@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 + +[packages/3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/controllers/FController.ts#L6) diff --git a/docs/api/3d/interfaces/FModelOptions.md b/docs/api/3d/interfaces/FModelOptions.md index f46826b5..daae48dd 100644 --- a/docs/api/3d/interfaces/FModelOptions.md +++ b/docs/api/3d/interfaces/FModelOptions.md @@ -14,7 +14,7 @@ #### Defined in -[packages/3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L10) +[packages/3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L10) *** @@ -24,7 +24,7 @@ #### Defined in -[packages/3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L7) +[packages/3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L7) *** @@ -34,7 +34,7 @@ #### Defined in -[packages/3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L8) +[packages/3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L8) *** @@ -60,7 +60,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L12) +[packages/3d/src/core/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L13) *** @@ -86,7 +86,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L14) +[packages/3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L15) *** @@ -112,7 +112,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L15) +[packages/3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L16) *** @@ -138,7 +138,7 @@ #### Defined in -[packages/3d/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FComponent.ts#L13) +[packages/3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FComponent.ts#L14) *** @@ -148,4 +148,4 @@ #### Defined in -[packages/3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/model/FModel.ts#L9) +[packages/3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/model/FModel.ts#L9) diff --git a/docs/api/3d/interfaces/FRigidBodyOptions.md b/docs/api/3d/interfaces/FRigidBodyOptions.md index ec88ceea..f60dee15 100644 --- a/docs/api/3d/interfaces/FRigidBodyOptions.md +++ b/docs/api/3d/interfaces/FRigidBodyOptions.md @@ -22,7 +22,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L21) +[packages/3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L22) *** @@ -44,7 +44,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L16) +[packages/3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L17) *** @@ -54,7 +54,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L15) +[packages/3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L16) *** @@ -64,7 +64,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L14) +[packages/3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L15) *** @@ -86,7 +86,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L8) +[packages/3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L8) *** @@ -96,7 +96,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L13) +[packages/3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L13) *** @@ -118,7 +118,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L10) +[packages/3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L10) *** @@ -140,7 +140,7 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L11) +[packages/3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L11) *** @@ -162,7 +162,17 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L9) +[packages/3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L9) + +*** + +### sensor? + +> `optional` **sensor**: `boolean` + +#### Defined in + +[packages/3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L14) *** @@ -172,4 +182,4 @@ #### Defined in -[packages/3d/src/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FRigidBody.ts#L12) +[packages/3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FRigidBody.ts#L12) diff --git a/docs/api/3d/interfaces/FSceneOptions.md b/docs/api/3d/interfaces/FSceneOptions.md index bb3d7b9d..13db508a 100644 --- a/docs/api/3d/interfaces/FSceneOptions.md +++ b/docs/api/3d/interfaces/FSceneOptions.md @@ -10,7 +10,7 @@ #### Defined in -[packages/3d/src/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L12) +[packages/3d/src/core/FScene.ts:11](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L11) *** @@ -32,4 +32,4 @@ #### Defined in -[packages/3d/src/FScene.ts:11](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FScene.ts#L11) +[packages/3d/src/core/FScene.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FScene.ts#L10) diff --git a/docs/api/3d/interfaces/FTransformOptions.md b/docs/api/3d/interfaces/FTransformOptions.md index 0933dc0e..43803530 100644 --- a/docs/api/3d/interfaces/FTransformOptions.md +++ b/docs/api/3d/interfaces/FTransformOptions.md @@ -2,6 +2,10 @@ # Interface: FTransformOptions +## Extended by + +- [`FCameraOptions`](FCameraOptions.md) + ## Properties ### position? @@ -22,7 +26,7 @@ #### Defined in -[packages/3d/src/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L4) +[packages/3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L4) *** @@ -44,7 +48,7 @@ #### Defined in -[packages/3d/src/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L6) +[packages/3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L6) *** @@ -66,7 +70,7 @@ #### Defined in -[packages/3d/src/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L7) +[packages/3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L7) *** @@ -88,4 +92,4 @@ #### Defined in -[packages/3d/src/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/3d/src/FTransform.ts#L5) +[packages/3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/core/classes/FCamera.md b/docs/api/core/classes/FCamera.md index b3987f13..4933b73a 100644 --- a/docs/api/core/classes/FCamera.md +++ b/docs/api/core/classes/FCamera.md @@ -26,7 +26,7 @@ The base class for cameras in Fibbo. #### Defined in -[packages/core/src/FCamera.ts:7](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FCamera.ts#L7) +[packages/core/src/FCamera.ts:7](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FCamera.ts#L7) ## Methods @@ -68,7 +68,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/core/src/FComponent.ts:97](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L97) +[packages/core/src/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L110) *** @@ -118,13 +118,13 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L60) +[packages/core/src/FComponent.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L73) *** ### onFrame() -> `abstract` **onFrame**(`delta`): `void` +> **onFrame**(`delta`): `void` #### Parameters @@ -138,8 +138,9 @@ The time since the last frame. #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Inherited from @@ -147,7 +148,7 @@ Should be called every frame. #### Defined in -[packages/core/src/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L37) +[packages/core/src/FComponent.ts:45](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L45) ## Properties @@ -170,7 +171,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L26) +[packages/core/src/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L28) *** @@ -189,7 +190,7 @@ It is generated automatically. #### Defined in -[packages/core/src/FComponent.ts:20](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L20) +[packages/core/src/FComponent.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L22) *** @@ -203,7 +204,7 @@ It is generated automatically. #### Defined in -[packages/core/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L14) +[packages/core/src/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L16) *** @@ -219,4 +220,20 @@ Internal flags #### Defined in -[packages/core/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L13) +[packages/core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L15) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Inherited from + +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) + +#### Defined in + +[packages/core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L33) diff --git a/docs/api/core/classes/FComponent.md b/docs/api/core/classes/FComponent.md index 1da346fa..efc97612 100644 --- a/docs/api/core/classes/FComponent.md +++ b/docs/api/core/classes/FComponent.md @@ -22,7 +22,7 @@ The base class for all 2D and 3D components in Fibbo. #### Defined in -[packages/core/src/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L28) +[packages/core/src/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L35) ## Methods @@ -60,7 +60,7 @@ player.emitCollisionWith(enemy) #### Defined in -[packages/core/src/FComponent.ts:97](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L97) +[packages/core/src/FComponent.ts:110](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L110) *** @@ -106,13 +106,13 @@ player.onCollisionWith(enemy, () => { #### Defined in -[packages/core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L60) +[packages/core/src/FComponent.ts:73](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L73) *** ### onFrame() -> `abstract` **onFrame**(`delta`): `void` +> **onFrame**(`delta`): `void` #### Parameters @@ -126,12 +126,13 @@ The time since the last frame. #### Description -Update the component. -Should be called every frame. +Update the component. Should be called every frame. +The purpose of `onFrame` on FComponent is really to render the component, its mesh/sprite and its properties. +Any changes on its transform should be done on the controller, not here. #### Defined in -[packages/core/src/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L37) +[packages/core/src/FComponent.ts:45](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L45) ## Properties @@ -150,7 +151,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[packages/core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L26) +[packages/core/src/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L28) *** @@ -165,7 +166,7 @@ It is generated automatically. #### Defined in -[packages/core/src/FComponent.ts:20](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L20) +[packages/core/src/FComponent.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L22) *** @@ -175,7 +176,7 @@ It is generated automatically. #### Defined in -[packages/core/src/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L14) +[packages/core/src/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L16) *** @@ -187,4 +188,16 @@ Internal flags #### Defined in -[packages/core/src/FComponent.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FComponent.ts#L13) +[packages/core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L15) + +*** + +### controller? + +> `optional` **controller**: [`FController`](FController.md) + +The controller attached to the component. + +#### Defined in + +[packages/core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FComponent.ts#L33) diff --git a/docs/api/core/classes/FController.md b/docs/api/core/classes/FController.md new file mode 100644 index 00000000..2a46d6a1 --- /dev/null +++ b/docs/api/core/classes/FController.md @@ -0,0 +1,65 @@ +[@fibbojs](/api/index) / [core](/api/core) / FController + +# Class: `abstract` FController + +## Description + +The base class for all 2D and 3D 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 + +[packages/core/src/FController.ts:20](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FController.ts#L20) + +## Methods + +### onFrame() + +> `abstract` **onFrame**(`delta`): `void` + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Description + +Update the controller. Should be called every frame. +The purpose of `onFrame` on FController is to update the component's transform in the desired way. +Any rendering process should be done on the component, not here. + +#### Defined in + +[packages/core/src/FController.ts:30](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FController.ts#L30) + +## Properties + +### component + +> **component**: [`FComponent`](FComponent.md) + +The component attached to the controller. + +#### Defined in + +[packages/core/src/FController.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FController.ts#L14) diff --git a/docs/api/core/classes/FGroup.md b/docs/api/core/classes/FGroup.md index 896e0dbf..74dbeac7 100644 --- a/docs/api/core/classes/FGroup.md +++ b/docs/api/core/classes/FGroup.md @@ -33,7 +33,7 @@ If no components are provided, the group will be empty. #### Defined in -[packages/core/src/FGroup.ts:18](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FGroup.ts#L18) +[packages/core/src/FGroup.ts:18](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FGroup.ts#L18) ## Methods @@ -55,7 +55,7 @@ Add a component to the group. #### Defined in -[packages/core/src/FGroup.ts:25](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FGroup.ts#L25) +[packages/core/src/FGroup.ts:25](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FGroup.ts#L25) *** @@ -79,7 +79,7 @@ Update all components in the group. #### Defined in -[packages/core/src/FGroup.ts:40](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FGroup.ts#L40) +[packages/core/src/FGroup.ts:40](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FGroup.ts#L40) *** @@ -101,7 +101,7 @@ Remove a component from the group. #### Defined in -[packages/core/src/FGroup.ts:32](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FGroup.ts#L32) +[packages/core/src/FGroup.ts:32](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FGroup.ts#L32) ## Properties @@ -115,4 +115,4 @@ The components in the group. #### Defined in -[packages/core/src/FGroup.ts:10](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FGroup.ts#L10) +[packages/core/src/FGroup.ts:10](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FGroup.ts#L10) diff --git a/docs/api/core/classes/FScene.md b/docs/api/core/classes/FScene.md index 3c1997e3..3c8a7cf8 100644 --- a/docs/api/core/classes/FScene.md +++ b/docs/api/core/classes/FScene.md @@ -19,7 +19,7 @@ Also contains the Rapier world if physics is enabled. #### Defined in -[packages/core/src/FScene.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L35) +[packages/core/src/FScene.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L35) ## Methods @@ -41,7 +41,7 @@ Add a component to the scene. #### Defined in -[packages/core/src/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L67) +[packages/core/src/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L67) *** @@ -63,7 +63,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -[packages/core/src/FScene.ts:82](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L82) +[packages/core/src/FScene.ts:82](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L82) *** @@ -85,7 +85,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -[packages/core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L75) +[packages/core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L75) ## Properties @@ -100,7 +100,7 @@ It is an array of functions that take the component as an argument. #### Defined in -[packages/core/src/FScene.ts:33](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L33) +[packages/core/src/FScene.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L33) *** @@ -115,7 +115,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -[packages/core/src/FScene.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L28) +[packages/core/src/FScene.ts:28](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L28) *** @@ -125,7 +125,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -[packages/core/src/FScene.ts:14](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L14) +[packages/core/src/FScene.ts:14](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L14) *** @@ -137,7 +137,7 @@ Internal flags #### Defined in -[packages/core/src/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L13) +[packages/core/src/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L13) *** @@ -149,7 +149,7 @@ The components in the scene. #### Defined in -[packages/core/src/FScene.ts:19](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L19) +[packages/core/src/FScene.ts:19](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L19) *** @@ -171,7 +171,7 @@ The components in the scene. #### Defined in -[packages/core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L21) +[packages/core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L21) *** @@ -181,4 +181,4 @@ The components in the scene. #### Defined in -[packages/core/src/FScene.ts:22](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/core/src/FScene.ts#L22) +[packages/core/src/FScene.ts:22](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FScene.ts#L22) diff --git a/docs/api/core/index.md b/docs/api/core/index.md index 656073c7..17ca950d 100644 --- a/docs/api/core/index.md +++ b/docs/api/core/index.md @@ -8,5 +8,10 @@ - [FCamera](classes/FCamera.md) - [FComponent](classes/FComponent.md) +- [FController](classes/FController.md) - [FGroup](classes/FGroup.md) - [FScene](classes/FScene.md) + +### Interfaces + +- [FControllerOptions](interfaces/FControllerOptions.md) diff --git a/docs/api/core/interfaces/FControllerOptions.md b/docs/api/core/interfaces/FControllerOptions.md new file mode 100644 index 00000000..48fee057 --- /dev/null +++ b/docs/api/core/interfaces/FControllerOptions.md @@ -0,0 +1,13 @@ +[@fibbojs](/api/index) / [core](/api/core) / FControllerOptions + +# Interface: FControllerOptions + +## Properties + +### component + +> **component**: [`FComponent`](../classes/FComponent.md) + +#### Defined in + +[packages/core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/core/src/FController.ts#L4) diff --git a/docs/api/devtools/classes/FDebug.md b/docs/api/devtools/classes/FDebug.md index e8eefe34..f86d4347 100644 --- a/docs/api/devtools/classes/FDebug.md +++ b/docs/api/devtools/classes/FDebug.md @@ -30,7 +30,7 @@ The scene to be debugged #### Defined in -[packages/devtools/src/FDebug.ts:38](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/devtools/src/FDebug.ts#L38) +[packages/devtools/src/FDebug.ts:38](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/devtools/src/FDebug.ts#L38) ## Properties @@ -42,7 +42,7 @@ The scene to be debugged #### Defined in -[packages/devtools/src/FDebug.ts:33](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/devtools/src/FDebug.ts#L33) +[packages/devtools/src/FDebug.ts:33](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/devtools/src/FDebug.ts#L33) *** @@ -54,7 +54,7 @@ The scene to be debugged #### Defined in -[packages/devtools/src/FDebug.ts:28](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/devtools/src/FDebug.ts#L28) +[packages/devtools/src/FDebug.ts:28](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/devtools/src/FDebug.ts#L28) *** @@ -68,4 +68,4 @@ The scene being debugged by this instance #### Defined in -[packages/devtools/src/FDebug.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/devtools/src/FDebug.ts#L23) +[packages/devtools/src/FDebug.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/devtools/src/FDebug.ts#L23) diff --git a/docs/api/devtools/functions/fDebug.md b/docs/api/devtools/functions/fDebug.md index d2b59acd..3afdb23f 100644 --- a/docs/api/devtools/functions/fDebug.md +++ b/docs/api/devtools/functions/fDebug.md @@ -26,4 +26,4 @@ fDebug(scene) ## Defined in -[packages/devtools/src/FDebug.ts:77](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/devtools/src/FDebug.ts#L77) +[packages/devtools/src/FDebug.ts:77](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/devtools/src/FDebug.ts#L77) diff --git a/docs/api/event/classes/FKeyboard.md b/docs/api/event/classes/FKeyboard.md index d2f5dbdd..78ba01ee 100644 --- a/docs/api/event/classes/FKeyboard.md +++ b/docs/api/event/classes/FKeyboard.md @@ -37,7 +37,7 @@ keyboard.on('ArrowUp', () => { #### Defined in -[packages/event/src/FKeyboard.ts:37](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L37) +[packages/event/src/FKeyboard.ts:37](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L37) ## Methods @@ -65,7 +65,7 @@ keyboard.clear() #### Defined in -[packages/event/src/FKeyboard.ts:191](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L191) +[packages/event/src/FKeyboard.ts:191](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L191) *** @@ -118,7 +118,7 @@ removeListener() #### Defined in -[packages/event/src/FKeyboard.ts:99](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L99) +[packages/event/src/FKeyboard.ts:99](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L99) *** @@ -169,7 +169,7 @@ removeListener() #### Defined in -[packages/event/src/FKeyboard.ts:133](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L133) +[packages/event/src/FKeyboard.ts:133](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L133) *** @@ -220,7 +220,7 @@ removeListener() #### Defined in -[packages/event/src/FKeyboard.ts:167](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L167) +[packages/event/src/FKeyboard.ts:167](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L167) ## Properties @@ -234,7 +234,7 @@ An map of all the callbacks for each key being pressed #### Defined in -[packages/event/src/FKeyboard.ts:27](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L27) +[packages/event/src/FKeyboard.ts:27](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L27) *** @@ -248,7 +248,7 @@ An map of all the callbacks for each key being released #### Defined in -[packages/event/src/FKeyboard.ts:31](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L31) +[packages/event/src/FKeyboard.ts:31](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L31) *** @@ -262,7 +262,7 @@ An map of all the callbacks for each key being released #### Defined in -[packages/event/src/FKeyboard.ts:35](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L35) +[packages/event/src/FKeyboard.ts:35](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L35) *** @@ -276,4 +276,4 @@ A map of all the keys being pressed #### Defined in -[packages/event/src/FKeyboard.ts:23](https://github.com/fibbojs/fibbo/blob/ebbfce6158465f6309c7f36dadb4e328deefcf24/packages/event/src/FKeyboard.ts#L23) +[packages/event/src/FKeyboard.ts:23](https://github.com/fibbojs/fibbo/blob/ca6e10de1cfed8b8d44a28a82c206333ede11c84/packages/event/src/FKeyboard.ts#L23) diff --git a/docs/guide/core/controllers.md b/docs/guide/core/controllers.md new file mode 100644 index 00000000..c96bc0c1 --- /dev/null +++ b/docs/guide/core/controllers.md @@ -0,0 +1,29 @@ +# 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. + +A controller's [`onFrame`](/api/core/classes/FController#onframe) method is where you should put your typical movement logic. 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 cube rotate around its Y axis : + +```typescript +import { FController, FCube } from '@fibbojs/core' +import type { FControllerOptions } from '@fibbojs/core' + +export class MyRotateController extends FController { + constructor(options?: FControllerOptions) { + super(options) + } + + onFrame() { + this.component.rotation.y += 0.01 + } +} + +// Usage +const cube = new FCube() +cube.controller = new MyRotateController({ + component: cube +}) +``` + +In this example, the `onFrame` method is called every frame by the cube itself, and it updates the cube's rotation around the Y axis. +If you want to learn more about controllers, Fibbo provides a default [character controller](/more/recipes/character-controller) that you can use as a base for your own controllers. diff --git a/packages/2d/src/index.ts b/packages/2d/src/index.ts index a9952fa4..544244ee 100644 --- a/packages/2d/src/index.ts +++ b/packages/2d/src/index.ts @@ -13,7 +13,8 @@ export { FAttachedCamera } from './cameras/FAttachedCamera' export { FFixedCamera } from './cameras/FFixedCamera' export { FFreeCamera } from './cameras/FFreeCamera' -// Character controllers +// Controllers +export { FController } from './controllers/FController' export { FCharacterController } from './controllers/FCharacterController' export { FCharacterControllerD } from './controllers/FCharacterControllerD' export { FCharacterControllerK } from './controllers/FCharacterControllerK' @@ -31,10 +32,10 @@ export { FSprite } from './sprite/FSprite' // Types export { FShapes } from './types/FShapes' export type { FComponentOptions } from './core/FComponent' +export type { FControllerOptions } from './controllers/FController' export type { FColliderOptions } from './core/FCollider' export type { FRigidBodyOptions } from './core/FRigidBody' export type { FCameraOptions } from './cameras/FCamera' -export type { FControllerOptions } from './controllers/FController' export type { FCharacterControllerOptions } from './controllers/FCharacterController' export type { FSceneOptions } from './core/FScene' export type { FSpriteOptions } from './sprite/FSprite' diff --git a/packages/3d/src/index.ts b/packages/3d/src/index.ts index 31ff130a..f043ca94 100644 --- a/packages/3d/src/index.ts +++ b/packages/3d/src/index.ts @@ -8,6 +8,7 @@ export { FComponentEmpty } from './core/FComponentEmpty' export { FTransform } from './core/FTransform' // Character controllers +export { FController } from './controllers/FController' export { FCharacterController } from './controllers/FCharacterController' export { FCharacterControllerD } from './controllers/FCharacterControllerD' export { FCharacterControllerK } from './controllers/FCharacterControllerK'