From 82ed517643dfe9247e440884ba82d8281e5b5983 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 30 Sep 2024 10:29:53 +0200 Subject: [PATCH 01/36] feat: start refactor with 2d --- apps/playground-2d/src/main.ts | 3 + docs/api/2d/classes/FAttachedCamera.md | 28 +-- docs/api/2d/classes/FCamera.md | 26 +-- docs/api/2d/classes/FCharacterController.md | 12 +- docs/api/2d/classes/FCharacterControllerD.md | 12 +- docs/api/2d/classes/FCharacterControllerK.md | 18 +- docs/api/2d/classes/FCharacterControllerKP.md | 18 +- docs/api/2d/classes/FCharacterControllerKV.md | 18 +- docs/api/2d/classes/FCircle.md | 80 +++---- docs/api/2d/classes/FCollider.md | 212 +++++++++++++++++- docs/api/2d/classes/FComponent.md | 66 +++--- docs/api/2d/classes/FComponentEmpty.md | 66 +++--- docs/api/2d/classes/FController.md | 6 +- docs/api/2d/classes/FFixedCamera.md | 26 +-- docs/api/2d/classes/FFreeCamera.md | 26 +-- docs/api/2d/classes/FLight.md | 34 +-- docs/api/2d/classes/FPolygon.md | 66 +++--- docs/api/2d/classes/FRectangle.md | 66 +++--- docs/api/2d/classes/FRigidBody.md | 167 +++++++++++++- docs/api/2d/classes/FScene.md | 68 +++--- docs/api/2d/classes/FSprite.md | 80 +++---- docs/api/2d/classes/FTransform.md | 8 +- docs/api/2d/enumerations/FShapes.md | 4 +- .../2d/interfaces/FAttachedCameraOptions.md | 4 +- docs/api/2d/interfaces/FCameraOptions.md | 2 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/2d/interfaces/FColliderOptions.md | 14 +- docs/api/2d/interfaces/FComponentOptions.md | 8 +- docs/api/2d/interfaces/FControllerOptions.md | 2 +- docs/api/2d/interfaces/FLightOptions.md | 14 +- docs/api/2d/interfaces/FRigidBodyOptions.md | 20 +- docs/api/2d/interfaces/FSceneOptions.md | 4 +- docs/api/2d/interfaces/FSpriteOptions.md | 10 +- docs/api/2d/interfaces/FTransformOptions.md | 8 +- docs/api/3d/classes/FAmbientLight.md | 34 +-- docs/api/3d/classes/FAttachedCamera.md | 32 +-- docs/api/3d/classes/FCamera.md | 28 +-- docs/api/3d/classes/FCapsule.md | 84 +++---- docs/api/3d/classes/FCharacterController.md | 14 +- docs/api/3d/classes/FCharacterControllerD.md | 14 +- docs/api/3d/classes/FCharacterControllerK.md | 20 +- docs/api/3d/classes/FCharacterControllerKP.md | 20 +- docs/api/3d/classes/FCharacterControllerKV.md | 20 +- docs/api/3d/classes/FCollider.md | 8 +- docs/api/3d/classes/FComponent.md | 82 +++---- docs/api/3d/classes/FComponentEmpty.md | 82 +++---- docs/api/3d/classes/FController.md | 6 +- docs/api/3d/classes/FCuboid.md | 84 +++---- docs/api/3d/classes/FDirectionalLight.md | 34 +-- docs/api/3d/classes/FFBX.md | 100 ++++----- docs/api/3d/classes/FFixedCamera.md | 28 +-- docs/api/3d/classes/FGLB.md | 100 ++++----- docs/api/3d/classes/FGLTF.md | 100 ++++----- docs/api/3d/classes/FGameCamera.md | 36 +-- docs/api/3d/classes/FHemisphereLight.md | 34 +-- docs/api/3d/classes/FLight.md | 34 +-- docs/api/3d/classes/FLightProbe.md | 34 +-- docs/api/3d/classes/FModel.md | 100 ++++----- docs/api/3d/classes/FOBJ.md | 100 ++++----- docs/api/3d/classes/FOrbitCamera.md | 32 +-- docs/api/3d/classes/FPointLight.md | 34 +-- docs/api/3d/classes/FPointerLockCamera.md | 32 +-- docs/api/3d/classes/FPolyhedron.md | 84 +++---- docs/api/3d/classes/FRigidBody.md | 10 +- docs/api/3d/classes/FScene.md | 68 +++--- docs/api/3d/classes/FSphere.md | 84 +++---- docs/api/3d/classes/FSpotLight.md | 34 +-- docs/api/3d/classes/FTransform.md | 8 +- docs/api/3d/enumerations/FShapes.md | 8 +- .../3d/interfaces/FAttachedCameraOptions.md | 10 +- docs/api/3d/interfaces/FCameraOptions.md | 8 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/3d/interfaces/FColliderOptions.md | 14 +- docs/api/3d/interfaces/FComponentOptions.md | 8 +- docs/api/3d/interfaces/FControllerOptions.md | 2 +- .../3d/interfaces/FHemisphereLightOptions.md | 18 +- docs/api/3d/interfaces/FLightOptions.md | 14 +- docs/api/3d/interfaces/FLightProbeOptions.md | 16 +- docs/api/3d/interfaces/FModelOptions.md | 16 +- docs/api/3d/interfaces/FRigidBodyOptions.md | 22 +- docs/api/3d/interfaces/FSceneOptions.md | 6 +- docs/api/3d/interfaces/FSpotLightOptions.md | 22 +- docs/api/3d/interfaces/FTransformOptions.md | 8 +- docs/api/core/classes/FCamera.md | 20 +- docs/api/core/classes/FComponent.md | 18 +- docs/api/core/classes/FController.md | 6 +- docs/api/core/classes/FGroup.md | 10 +- docs/api/core/classes/FLight.md | 18 +- docs/api/core/classes/FScene.md | 52 ++--- .../api/core/interfaces/FControllerOptions.md | 2 +- docs/api/core/interfaces/FSceneOptions.md | 4 +- .../core/interfaces/OnCollisionWithData.md | 2 +- docs/api/event/classes/FKeyboard.md | 18 +- docs/guide/core/components.md | 4 +- docs/more/recipes/custom-controller.md | 10 +- .../src/controllers/FCharacterControllerD.ts | 12 +- .../src/controllers/FCharacterControllerK.ts | 2 +- .../src/controllers/FCharacterControllerKP.ts | 10 +- .../src/controllers/FCharacterControllerKV.ts | 6 +- packages/2d/src/core/FCollider.ts | 119 +++++++++- packages/2d/src/core/FComponent.ts | 138 ++++++------ packages/2d/src/core/FRigidBody.ts | 122 +++++++--- packages/2d/src/core/FScene.ts | 18 +- .../src/controllers/FCharacterControllerD.ts | 2 +- .../src/controllers/FCharacterControllerKP.ts | 6 +- .../src/controllers/FCharacterControllerKV.ts | 4 +- packages/3d/src/core/FCollider.ts | 4 +- packages/3d/src/core/FComponent.ts | 48 ++-- packages/3d/src/core/FRigidBody.ts | 36 +-- 109 files changed, 2089 insertions(+), 1592 deletions(-) diff --git a/apps/playground-2d/src/main.ts b/apps/playground-2d/src/main.ts index bad96b60..ec315ed6 100644 --- a/apps/playground-2d/src/main.ts +++ b/apps/playground-2d/src/main.ts @@ -118,6 +118,9 @@ import Character from './classes/Character' // Remove the collision callback with FRectangle removeCollisionCallbackWithFRectangle() + // Make character 2 times bigger on Y axis + character.setScale({ x: 0.5, y: 1 }) + // Zoom in the camera scene.camera.setZoom(1) }) diff --git a/docs/api/2d/classes/FAttachedCamera.md b/docs/api/2d/classes/FAttachedCamera.md index eee41b9e..fa533735 100644 --- a/docs/api/2d/classes/FAttachedCamera.md +++ b/docs/api/2d/classes/FAttachedCamera.md @@ -30,7 +30,7 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FAttachedCamera.ts#L20) +[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L20) ## Methods @@ -48,7 +48,7 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FAttachedCamera.ts#L33) +[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L33) *** @@ -100,7 +100,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -154,7 +154,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FAttachedCamera.ts#L25) +[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L25) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -225,7 +225,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -242,7 +242,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -274,7 +274,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -290,7 +290,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,7 +330,7 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) *** @@ -342,4 +342,4 @@ The target to follow. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FAttachedCamera.ts#L18) +[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L18) diff --git a/docs/api/2d/classes/FCamera.md b/docs/api/2d/classes/FCamera.md index aac57724..627280c0 100644 --- a/docs/api/2d/classes/FCamera.md +++ b/docs/api/2d/classes/FCamera.md @@ -42,7 +42,7 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L34) +[2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L34) ## Methods @@ -56,7 +56,7 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L55) +[2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L55) *** @@ -108,7 +108,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -162,7 +162,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -188,7 +188,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L53) +[2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L53) *** @@ -212,7 +212,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -233,7 +233,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -250,7 +250,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -266,7 +266,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -282,7 +282,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -298,7 +298,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -318,7 +318,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FCharacterController.md b/docs/api/2d/classes/FCharacterController.md index cf0c9d8f..a44ba149 100644 --- a/docs/api/2d/classes/FCharacterController.md +++ b/docs/api/2d/classes/FCharacterController.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller. #### Defined in -[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L38) +[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L38) ## Methods @@ -63,7 +63,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -80,7 +80,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) *** @@ -108,7 +108,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -120,7 +120,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -132,4 +132,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerD.md b/docs/api/2d/classes/FCharacterControllerD.md index bd7344a9..ed30d79c 100644 --- a/docs/api/2d/classes/FCharacterControllerD.md +++ b/docs/api/2d/classes/FCharacterControllerD.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerD.ts#L22) +[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerD.ts#L22) ## Methods @@ -68,7 +68,7 @@ Any rendering process should be done on the component, not here. #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerD.ts#L38) +[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerD.ts#L38) ## Properties @@ -85,7 +85,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) *** @@ -117,7 +117,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -133,7 +133,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -149,4 +149,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerK.md b/docs/api/2d/classes/FCharacterControllerK.md index b0b6ac2f..6217488d 100644 --- a/docs/api/2d/classes/FCharacterControllerK.md +++ b/docs/api/2d/classes/FCharacterControllerK.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L22) +[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L22) ## Methods @@ -59,7 +59,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -87,7 +87,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -99,7 +99,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -116,7 +116,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) *** @@ -148,7 +148,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -164,7 +164,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -180,7 +180,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -192,4 +192,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKP.md b/docs/api/2d/classes/FCharacterControllerKP.md index 0bb55581..cc3c6345 100644 --- a/docs/api/2d/classes/FCharacterControllerKP.md +++ b/docs/api/2d/classes/FCharacterControllerKP.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) +[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) ## Methods @@ -70,7 +70,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -98,7 +98,7 @@ The time since the last frame. #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) +[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) ## Properties @@ -114,7 +114,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +131,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +163,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +179,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +195,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +211,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKV.md b/docs/api/2d/classes/FCharacterControllerKV.md index b2bb09f4..e24fba1c 100644 --- a/docs/api/2d/classes/FCharacterControllerKV.md +++ b/docs/api/2d/classes/FCharacterControllerKV.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) +[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) ## Methods @@ -70,7 +70,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -98,7 +98,7 @@ The time since the last frame. #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) +[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) ## Properties @@ -114,7 +114,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +131,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +163,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +179,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +195,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +211,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCircle.md b/docs/api/2d/classes/FCircle.md index 298d0181..595c1d47 100644 --- a/docs/api/2d/classes/FCircle.md +++ b/docs/api/2d/classes/FCircle.md @@ -55,7 +55,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -79,7 +79,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -139,7 +139,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -163,7 +163,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -187,7 +187,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -211,7 +211,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -235,7 +235,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -259,7 +259,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FCircle.ts#L21) +[2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L21) ## Methods @@ -311,7 +311,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -319,7 +319,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -365,7 +365,7 @@ component.initCollider({ #### Defined in -[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FCircle.ts#L51) +[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L51) *** @@ -373,17 +373,17 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?** -The options for the rigid body. +The options for the rigidBody. • **options.enabledTranslations?** -Enable only specific translations of the rigid body. +Enable only specific translations of the rigidBody. • **options.enabledTranslations.enableX?**: `boolean` @@ -391,27 +391,27 @@ Enable only specific translations of the rigid body. • **options.lockRotations?**: `boolean` -Lock the rotations of the rigid body. +Lock the rotations of the rigidBody. • **options.lockTranslations?**: `boolean` -Lock the translations of the rigid body. +Lock the translations of the rigidBody. • **options.position?**: `PointData` -The position of the rigid body. +The position of the rigidBody. • **options.rotation?**: `number` -The rotation of the rigid body. +The rotation of the rigidBody. • **options.scale?**: `PointData` -The scale of the rigid body. +The scale of the rigidBody. • **options.shape?**: [`FShapes`](../enumerations/FShapes.md) -The shape of the rigid body. +The shape of the rigidBody. #### Returns @@ -434,7 +434,7 @@ component.initRigidBody({ #### Defined in -[2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FCircle.ts#L33) +[2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L33) *** @@ -472,7 +472,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -526,7 +526,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -552,7 +552,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FCircle.ts#L29) +[2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L29) *** @@ -592,7 +592,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -624,7 +624,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -656,7 +656,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -696,7 +696,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) ## Properties @@ -717,7 +717,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -734,7 +734,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -750,7 +750,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -766,7 +766,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -782,7 +782,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -798,7 +798,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -814,7 +814,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -830,7 +830,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -846,7 +846,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -862,7 +862,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -878,4 +878,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FCollider.md b/docs/api/2d/classes/FCollider.md index 12a458a0..c382c9e1 100644 --- a/docs/api/2d/classes/FCollider.md +++ b/docs/api/2d/classes/FCollider.md @@ -39,25 +39,168 @@ const collider = new FCollider(component, { #### Defined in -[2d/src/core/FCollider.ts:56](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L56) +[2d/src/core/FCollider.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L65) -## Properties +## Methods -### collider +### setPosition() -> **collider**: `Collider` +> **setPosition**(`position`): `void` -RAPIER Collider +Set the position of the collider. + +#### Parameters + +• **position** + +The new position of the collider. + +• **position.x**: `number` + +The new x position of the collider. + +• **position.y**: `number` + +The new y position of the collider. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:149](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L149) + +*** + +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set the rotation of the collider. + +#### Parameters + +• **rotation**: `number` + +The new rotation of the collider. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:157](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L157) + +*** + +### setRotationDegree() + +> **setRotationDegree**(`rotation`): `void` + +Set the rotation of the collider in degrees. + +#### Parameters + +• **rotation**: `number` + +The new rotation of the collider in degrees. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:165](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L165) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set the scale of the collider. + +#### Parameters + +• **scale** + +The new scale of the collider. + +• **scale.x**: `number` + +The new x scale of the collider. + +• **scale.y**: `number` + +The new y scale of the collider. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:175](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L175) + +*** + +### updatePosition() + +> **updatePosition**(): `void` + +Update the position of the collider according to the component's position. +This takes into account the position offset. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:193](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L193) + +*** + +### updateRotation() + +> **updateRotation**(): `void` + +Update the rotation of the collider according to the component's rotation. +This takes into account the rotation offset. + +#### Returns + +`void` #### Defined in -[2d/src/core/FCollider.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L23) +[2d/src/core/FCollider.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L204) *** -### colliderPositionOffset +### updateScale() + +> **updateScale**(): `void` + +Update the scale of the collider according to the component's scale. +This takes into account the scale offset. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FCollider.ts:212](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L212) -> **colliderPositionOffset**: `object` +## Properties + +### \_\_COLLIDER\_POSITION\_OFFSET\_\_ + +> **\_\_COLLIDER\_POSITION\_OFFSET\_\_**: `object` Position Offset for the collider. This is used to adjust the collider position relative to the mesh. @@ -72,17 +215,62 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[2d/src/core/FCollider.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L28) +[2d/src/core/FCollider.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L28) *** -### colliderRotationOffset +### \_\_COLLIDER\_ROTATION\_OFFSET\_\_ -> **colliderRotationOffset**: `number` +> **\_\_COLLIDER\_ROTATION\_OFFSET\_\_**: `number` Rotation Offset for the collider. This is used to adjust the collider position relative to the mesh. #### Defined in -[2d/src/core/FCollider.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L33) +[2d/src/core/FCollider.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L33) + +*** + +### \_\_COLLIDER\_SCALE\_OFFSET\_\_ + +> **\_\_COLLIDER\_SCALE\_OFFSET\_\_**: `object` + +Scale Offset for the collider. +This is used to adjust the collider scale relative to the mesh. + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FCollider.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L38) + +*** + +### \_\_COLLIDER\_\_ + +> **\_\_COLLIDER\_\_**: `Collider` + +RAPIER Collider + +#### Defined in + +[2d/src/core/FCollider.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L23) + +*** + +### component + +> **component**: [`FComponent`](FComponent.md) + +The component the collider is attached to. + +#### Defined in + +[2d/src/core/FCollider.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L42) diff --git a/docs/api/2d/classes/FComponent.md b/docs/api/2d/classes/FComponent.md index e58c96ff..caed450c 100644 --- a/docs/api/2d/classes/FComponent.md +++ b/docs/api/2d/classes/FComponent.md @@ -46,7 +46,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -66,7 +66,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -86,7 +86,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -118,7 +118,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -138,7 +138,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -158,7 +158,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -178,7 +178,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -198,7 +198,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -226,7 +226,7 @@ The options for the component. #### Defined in -[2d/src/core/FComponent.ts:71](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L71) +[2d/src/core/FComponent.ts:71](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L71) ## Methods @@ -278,7 +278,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -286,7 +286,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -312,7 +312,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L316) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) *** @@ -320,13 +320,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -345,7 +345,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:289](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L289) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) *** @@ -379,7 +379,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -433,7 +433,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -459,7 +459,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/core/FComponent.ts:104](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L104) +[2d/src/core/FComponent.ts:104](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L104) *** @@ -495,7 +495,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -523,7 +523,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -551,7 +551,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -587,7 +587,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) ## Properties @@ -608,7 +608,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -625,7 +625,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -641,7 +641,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -657,7 +657,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -669,7 +669,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -681,7 +681,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -697,7 +697,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -709,7 +709,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -721,7 +721,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -733,7 +733,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -745,4 +745,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FComponentEmpty.md b/docs/api/2d/classes/FComponentEmpty.md index 0fb84c1c..a1f90b45 100644 --- a/docs/api/2d/classes/FComponentEmpty.md +++ b/docs/api/2d/classes/FComponentEmpty.md @@ -44,7 +44,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -68,7 +68,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -92,7 +92,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -128,7 +128,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -152,7 +152,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -176,7 +176,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -200,7 +200,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -224,7 +224,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -248,7 +248,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponentEmpty.ts#L10) +[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -300,7 +300,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -308,7 +308,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -338,7 +338,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L316) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) *** @@ -346,13 +346,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -375,7 +375,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:289](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L289) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) *** @@ -413,7 +413,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -467,7 +467,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -493,7 +493,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponentEmpty.ts#L14) +[2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponentEmpty.ts#L14) *** @@ -533,7 +533,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -565,7 +565,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -597,7 +597,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -637,7 +637,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) ## Properties @@ -658,7 +658,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -675,7 +675,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -691,7 +691,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -707,7 +707,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -723,7 +723,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -739,7 +739,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -755,7 +755,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -771,7 +771,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -787,7 +787,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -803,7 +803,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -819,4 +819,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FController.md b/docs/api/2d/classes/FController.md index 440ca641..a4b80f81 100644 --- a/docs/api/2d/classes/FController.md +++ b/docs/api/2d/classes/FController.md @@ -34,7 +34,7 @@ The options for the controller. #### Defined in -[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L23) +[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L23) ## Methods @@ -62,7 +62,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -79,4 +79,4 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) diff --git a/docs/api/2d/classes/FFixedCamera.md b/docs/api/2d/classes/FFixedCamera.md index 9b6ecda0..d2374737 100644 --- a/docs/api/2d/classes/FFixedCamera.md +++ b/docs/api/2d/classes/FFixedCamera.md @@ -30,7 +30,7 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFixedCamera.ts#L10) +[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L10) ## Methods @@ -48,7 +48,7 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFixedCamera.ts#L17) +[2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L17) *** @@ -100,7 +100,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -154,7 +154,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFixedCamera.ts#L14) +[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L14) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -225,7 +225,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -242,7 +242,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -274,7 +274,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -290,7 +290,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FFreeCamera.md b/docs/api/2d/classes/FFreeCamera.md index f8a5d3b3..cefae8d3 100644 --- a/docs/api/2d/classes/FFreeCamera.md +++ b/docs/api/2d/classes/FFreeCamera.md @@ -30,7 +30,7 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFreeCamera.ts#L10) +[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L10) ## Methods @@ -48,7 +48,7 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFreeCamera.ts#L17) +[2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L17) *** @@ -100,7 +100,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -154,7 +154,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FFreeCamera.ts#L14) +[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L14) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -225,7 +225,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -242,7 +242,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -274,7 +274,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -290,7 +290,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FLight.md b/docs/api/2d/classes/FLight.md index 2248b458..7ea1a3b4 100644 --- a/docs/api/2d/classes/FLight.md +++ b/docs/api/2d/classes/FLight.md @@ -26,7 +26,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L88) +[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L88) *** @@ -46,7 +46,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L96) +[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L96) *** @@ -78,7 +78,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L100) +[2d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L100) ## Constructors @@ -102,7 +102,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L45) +[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L45) ## Methods @@ -116,7 +116,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:75](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L75) +[2d/src/lights/FLight.ts:75](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L75) *** @@ -168,7 +168,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -222,7 +222,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -248,7 +248,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/lights/FLight.ts:73](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L73) +[2d/src/lights/FLight.ts:73](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L73) ## Properties @@ -269,7 +269,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L23) +[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L23) *** @@ -286,7 +286,7 @@ It is generated automatically. #### Defined in -[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L22) +[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L22) *** @@ -300,7 +300,7 @@ It is generated automatically. #### Defined in -[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L21) +[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L21) *** @@ -316,7 +316,7 @@ Internal flags #### Defined in -[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L20) +[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L20) *** @@ -336,7 +336,7 @@ Look at target of the light. #### Defined in -[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L43) +[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L43) *** @@ -352,7 +352,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -364,7 +364,7 @@ The original light object from PIXI.js. #### Defined in -[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L28) +[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L28) *** @@ -376,7 +376,7 @@ Scene the light is in. #### Defined in -[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L33) +[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L33) *** @@ -388,4 +388,4 @@ Transform of the light. #### Defined in -[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L38) +[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L38) diff --git a/docs/api/2d/classes/FPolygon.md b/docs/api/2d/classes/FPolygon.md index a755f09f..16c8ad47 100644 --- a/docs/api/2d/classes/FPolygon.md +++ b/docs/api/2d/classes/FPolygon.md @@ -49,7 +49,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -73,7 +73,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -97,7 +97,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -133,7 +133,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -157,7 +157,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -181,7 +181,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -205,7 +205,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -229,7 +229,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -253,7 +253,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FPolygon.ts#L11) +[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FPolygon.ts#L11) ## Methods @@ -305,7 +305,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -313,7 +313,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -343,7 +343,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L316) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) *** @@ -351,13 +351,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -380,7 +380,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:289](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L289) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) *** @@ -418,7 +418,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -472,7 +472,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -498,7 +498,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FPolygon.ts#L21) +[2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FPolygon.ts#L21) *** @@ -538,7 +538,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -570,7 +570,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -602,7 +602,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -642,7 +642,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) ## Properties @@ -663,7 +663,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -680,7 +680,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -696,7 +696,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -712,7 +712,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -728,7 +728,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -744,7 +744,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -760,7 +760,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -776,7 +776,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -792,7 +792,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -808,7 +808,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -824,4 +824,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FRectangle.md b/docs/api/2d/classes/FRectangle.md index daf31d8a..18ccd9fd 100644 --- a/docs/api/2d/classes/FRectangle.md +++ b/docs/api/2d/classes/FRectangle.md @@ -55,7 +55,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -79,7 +79,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -139,7 +139,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -163,7 +163,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -187,7 +187,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -211,7 +211,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -235,7 +235,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -259,7 +259,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FRectangle.ts#L19) +[2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FRectangle.ts#L19) ## Methods @@ -311,7 +311,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -319,7 +319,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -349,7 +349,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L316) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) *** @@ -357,13 +357,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -386,7 +386,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:289](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L289) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) *** @@ -424,7 +424,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -478,7 +478,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -504,7 +504,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/polygons/FRectangle.ts#L23) +[2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FRectangle.ts#L23) *** @@ -544,7 +544,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -576,7 +576,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -608,7 +608,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -648,7 +648,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) ## Properties @@ -669,7 +669,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -686,7 +686,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -702,7 +702,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -718,7 +718,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -734,7 +734,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -750,7 +750,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -766,7 +766,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -782,7 +782,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -798,7 +798,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -814,7 +814,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -830,4 +830,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FRigidBody.md b/docs/api/2d/classes/FRigidBody.md index 4a668eba..a3380f45 100644 --- a/docs/api/2d/classes/FRigidBody.md +++ b/docs/api/2d/classes/FRigidBody.md @@ -10,17 +10,17 @@ A 3d RigidBody. > **new FRigidBody**(`component`, `options`?): [`FRigidBody`](FRigidBody.md) -Creates a rigid body for the given component. +Creates a rigidBody for the given component. #### Parameters • **component**: [`FComponent`](FComponent.md) -The component which the collider will be attached to. +The component which the rigidBody will be attached to. • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -39,10 +39,159 @@ const rigidBody = new FRigidBody({ #### Defined in -[2d/src/core/FRigidBody.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L65) +[2d/src/core/FRigidBody.ts:79](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L79) + +## Methods + +### setPosition() + +> **setPosition**(`position`): `void` + +Set the position of the rigidBody. + +#### Parameters + +• **position** + +The new position of the rigidBody. + +• **position.x**: `number` + +The new x position of the rigidBody. + +• **position.y**: `number` + +The new y position of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:157](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L157) + +*** + +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set the rotation of the rigidBody. + +#### Parameters + +• **rotation**: `number` + +The new rotation of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:166](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L166) + +*** + +### updatePosition() + +> **updatePosition**(): `void` + +Update the position of the rigidBody according to the component's position. +This takes into account the position offset. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:175](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L175) + +*** + +### updateRotation() + +> **updateRotation**(): `void` + +Update the rotation of the rigidBody according to the component's rotation. +This takes into account the rotation offset. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:187](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L187) + +*** + +### updateScale() + +> **updateScale**(): `void` + +Update the scale of the rigidBody's collider according to the component's scale. +This takes into account the scale offset. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:197](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L197) ## Properties +### \_\_RIGIDBODY\_POSITION\_OFFSET\_\_ + +> **\_\_RIGIDBODY\_POSITION\_OFFSET\_\_**: `object` + +Position Offset for the rigidBody. +This is used to adjust the rigidBody position relative to the mesh. + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L39) + +*** + +### \_\_RIGIDBODY\_ROTATION\_OFFSET\_\_ + +> **\_\_RIGIDBODY\_ROTATION\_OFFSET\_\_**: `number` + +Rotation Offset for the rigidBody. +This is used to adjust the rigidBody position relative to the mesh. + +#### Defined in + +[2d/src/core/FRigidBody.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L44) + +*** + +### \_\_RIGIDBODY\_\_ + +> **\_\_RIGIDBODY\_\_**: `RigidBody` + +RAPIER RigidBody + +#### Defined in + +[2d/src/core/FRigidBody.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L30) + +*** + ### collider > **collider**: [`FCollider`](FCollider.md) @@ -51,16 +200,16 @@ Fibbo Collider #### Defined in -[2d/src/core/FRigidBody.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L34) +[2d/src/core/FRigidBody.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L34) *** -### rigidBody +### component -> **rigidBody**: `RigidBody` +> **component**: [`FComponent`](FComponent.md) -RAPIER RigidBody +The component the rigidBody is attached to. #### Defined in -[2d/src/core/FRigidBody.ts:30](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L30) +[2d/src/core/FRigidBody.ts:48](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L48) diff --git a/docs/api/2d/classes/FScene.md b/docs/api/2d/classes/FScene.md index 70563df4..51b9f81d 100644 --- a/docs/api/2d/classes/FScene.md +++ b/docs/api/2d/classes/FScene.md @@ -48,7 +48,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L248) +[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L248) ## Constructors @@ -70,7 +70,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L59) +[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L59) ## Methods @@ -94,7 +94,7 @@ Add a component to the scene. #### Defined in -[2d/src/core/FScene.ts:193](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L193) +[2d/src/core/FScene.ts:193](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L193) *** @@ -118,7 +118,7 @@ Add a light to the scene. #### Defined in -[2d/src/core/FScene.ts:261](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L261) +[2d/src/core/FScene.ts:261](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L261) *** @@ -148,7 +148,7 @@ If the collision has started or ended #### Defined in -[2d/src/core/FScene.ts:169](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L169) +[2d/src/core/FScene.ts:169](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L169) *** @@ -167,7 +167,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:77](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L77) +[2d/src/core/FScene.ts:77](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L77) *** @@ -181,7 +181,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:138](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L138) +[2d/src/core/FScene.ts:138](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L138) *** @@ -205,7 +205,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -core/dist/index.d.ts:269 +core/dist/index.d.ts:275 *** @@ -229,7 +229,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -core/dist/index.d.ts:273 +core/dist/index.d.ts:279 *** @@ -253,7 +253,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -core/dist/index.d.ts:265 +core/dist/index.d.ts:271 *** @@ -277,7 +277,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -core/dist/index.d.ts:282 +core/dist/index.d.ts:288 *** @@ -301,7 +301,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -core/dist/index.d.ts:286 +core/dist/index.d.ts:292 *** @@ -326,7 +326,7 @@ The scene is ready when the `init` method has finished. #### Defined in -core/dist/index.d.ts:278 +core/dist/index.d.ts:284 *** @@ -350,7 +350,7 @@ Remove a component from the scene. #### Defined in -[2d/src/core/FScene.ts:223](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L223) +[2d/src/core/FScene.ts:223](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L223) *** @@ -374,7 +374,7 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:265](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L265) +[2d/src/core/FScene.ts:265](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L265) ## Properties @@ -384,7 +384,7 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L49) +[2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L49) *** @@ -401,7 +401,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:225 +core/dist/index.d.ts:231 *** @@ -418,7 +418,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:230 +core/dist/index.d.ts:236 *** @@ -435,7 +435,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -core/dist/index.d.ts:220 +core/dist/index.d.ts:226 *** @@ -452,7 +452,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:239 +core/dist/index.d.ts:245 *** @@ -469,7 +469,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:244 +core/dist/index.d.ts:250 *** @@ -485,7 +485,7 @@ Callbacks for when the scene is ready. #### Defined in -core/dist/index.d.ts:234 +core/dist/index.d.ts:240 *** @@ -495,7 +495,7 @@ core/dist/index.d.ts:234 #### Defined in -[2d/src/core/FScene.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L46) +[2d/src/core/FScene.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L46) *** @@ -511,7 +511,7 @@ DOM element that the renderer will be appended to #### Defined in -core/dist/index.d.ts:196 +core/dist/index.d.ts:202 *** @@ -527,7 +527,7 @@ Internal flags #### Defined in -[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L38) +[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L38) *** @@ -543,7 +543,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:191 +core/dist/index.d.ts:197 *** @@ -557,7 +557,7 @@ core/dist/index.d.ts:191 #### Defined in -[2d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L57) +[2d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L57) *** @@ -567,7 +567,7 @@ core/dist/index.d.ts:191 #### Defined in -[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L50) +[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L50) *** @@ -583,7 +583,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L41) +[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L41) *** @@ -597,7 +597,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L56) +[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L56) *** @@ -619,7 +619,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L54) +[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L54) *** @@ -635,7 +635,7 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L43) +[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L43) *** @@ -645,7 +645,7 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L51) +[2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L51) *** @@ -659,4 +659,4 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L55) +[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L55) diff --git a/docs/api/2d/classes/FSprite.md b/docs/api/2d/classes/FSprite.md index e913a6a0..15de2990 100644 --- a/docs/api/2d/classes/FSprite.md +++ b/docs/api/2d/classes/FSprite.md @@ -55,7 +55,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) *** @@ -79,7 +79,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) *** @@ -139,7 +139,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) *** @@ -163,7 +163,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) *** @@ -187,7 +187,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:418](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L418) +[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) *** @@ -211,7 +211,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) *** @@ -235,7 +235,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) ## Constructors @@ -259,7 +259,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L33) +[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L33) ## Methods @@ -311,7 +311,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -327,7 +327,7 @@ Emit the onLoaded callbacks. #### Defined in -[2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L119) +[2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L119) *** @@ -335,7 +335,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -365,7 +365,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:316](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L316) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) *** @@ -373,13 +373,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the model. +Init a rigidBody for the model. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -402,7 +402,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:289](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L289) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) *** @@ -440,7 +440,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:340](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L340) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) *** @@ -462,7 +462,7 @@ The path to the texture. #### Defined in -[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L52) +[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L52) *** @@ -516,7 +516,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:349](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L349) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) *** @@ -542,7 +542,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L104) +[2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L104) *** @@ -564,7 +564,7 @@ The callback function. #### Defined in -[2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L112) +[2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L112) *** @@ -604,7 +604,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L195) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) *** @@ -636,7 +636,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L244) +[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) *** @@ -668,7 +668,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:263](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L263) +[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) *** @@ -708,7 +708,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:216](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L216) +[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) *** @@ -731,7 +731,7 @@ The height of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L100) +[2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L100) *** @@ -754,7 +754,7 @@ The width of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L91) +[2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L91) ## Properties @@ -775,7 +775,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -787,7 +787,7 @@ Callbacks for when the texture is loaded #### Defined in -[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L31) +[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L31) *** @@ -804,7 +804,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -820,7 +820,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) *** @@ -836,7 +836,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:45 +core/dist/index.d.ts:47 *** @@ -852,7 +852,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) *** @@ -868,7 +868,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) *** @@ -884,7 +884,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) *** @@ -900,7 +900,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) *** @@ -916,7 +916,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) *** @@ -932,7 +932,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) *** @@ -944,7 +944,7 @@ The texture of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L27) +[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L27) *** @@ -960,4 +960,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FTransform.md b/docs/api/2d/classes/FTransform.md index faaf755f..76c52885 100644 --- a/docs/api/2d/classes/FTransform.md +++ b/docs/api/2d/classes/FTransform.md @@ -34,7 +34,7 @@ const collider = new FTransform({ #### Defined in -[2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L42) +[2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L42) ## Properties @@ -54,7 +54,7 @@ Position of the component. #### Defined in -[2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L16) +[2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L16) *** @@ -66,7 +66,7 @@ Rotation of the component. #### Defined in -[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L24) +[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L24) *** @@ -86,4 +86,4 @@ Scale of the component. #### Defined in -[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L20) +[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L20) diff --git a/docs/api/2d/enumerations/FShapes.md b/docs/api/2d/enumerations/FShapes.md index 8af99eaf..cf5e4473 100644 --- a/docs/api/2d/enumerations/FShapes.md +++ b/docs/api/2d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/types/FShapes.ts#L4) +[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/types/FShapes.ts#L4) *** @@ -20,4 +20,4 @@ #### Defined in -[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/types/FShapes.ts#L3) +[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/types/FShapes.ts#L3) diff --git a/docs/api/2d/interfaces/FAttachedCameraOptions.md b/docs/api/2d/interfaces/FAttachedCameraOptions.md index c50455c6..e0000ad8 100644 --- a/docs/api/2d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/2d/interfaces/FAttachedCameraOptions.md @@ -26,7 +26,7 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L5) *** @@ -36,4 +36,4 @@ #### Defined in -[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FAttachedCamera.ts#L7) +[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/2d/interfaces/FCameraOptions.md b/docs/api/2d/interfaces/FCameraOptions.md index e432959f..61952659 100644 --- a/docs/api/2d/interfaces/FCameraOptions.md +++ b/docs/api/2d/interfaces/FCameraOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L5) diff --git a/docs/api/2d/interfaces/FCharacterControllerOptions.md b/docs/api/2d/interfaces/FCharacterControllerOptions.md index 68d2e577..f7991c68 100644 --- a/docs/api/2d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/2d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FCharacterController.ts#L10) +[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L10) diff --git a/docs/api/2d/interfaces/FColliderOptions.md b/docs/api/2d/interfaces/FColliderOptions.md index 3a4d42f5..dc8a191a 100644 --- a/docs/api/2d/interfaces/FColliderOptions.md +++ b/docs/api/2d/interfaces/FColliderOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/core/FCollider.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L6) +[2d/src/core/FCollider.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L6) *** @@ -28,7 +28,7 @@ #### Defined in -[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L11) +[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L11) *** @@ -38,7 +38,7 @@ #### Defined in -[2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L8) +[2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L8) *** @@ -48,7 +48,7 @@ #### Defined in -[2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L9) +[2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L9) *** @@ -66,7 +66,7 @@ #### Defined in -[2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L7) +[2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L7) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L12) +[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L12) *** @@ -86,4 +86,4 @@ #### Defined in -[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FCollider.ts#L10) +[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L10) diff --git a/docs/api/2d/interfaces/FComponentOptions.md b/docs/api/2d/interfaces/FComponentOptions.md index 64f5d9e0..b965246e 100644 --- a/docs/api/2d/interfaces/FComponentOptions.md +++ b/docs/api/2d/interfaces/FComponentOptions.md @@ -22,7 +22,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L14) *** @@ -32,7 +32,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L16) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L17) *** @@ -60,4 +60,4 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L15) diff --git a/docs/api/2d/interfaces/FControllerOptions.md b/docs/api/2d/interfaces/FControllerOptions.md index 696dc3b4..102232eb 100644 --- a/docs/api/2d/interfaces/FControllerOptions.md +++ b/docs/api/2d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L6) diff --git a/docs/api/2d/interfaces/FLightOptions.md b/docs/api/2d/interfaces/FLightOptions.md index ac57f69d..385c7643 100644 --- a/docs/api/2d/interfaces/FLightOptions.md +++ b/docs/api/2d/interfaces/FLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L7) +[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L7) *** @@ -24,7 +24,7 @@ #### Defined in -[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L8) +[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L8) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/lights/FLight.ts#L9) +[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L9) *** @@ -64,7 +64,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L2) *** @@ -78,7 +78,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L4) *** @@ -92,7 +92,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L5) *** @@ -114,4 +114,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L3) diff --git a/docs/api/2d/interfaces/FRigidBodyOptions.md b/docs/api/2d/interfaces/FRigidBodyOptions.md index f9c3619a..febe44bb 100644 --- a/docs/api/2d/interfaces/FRigidBodyOptions.md +++ b/docs/api/2d/interfaces/FRigidBodyOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L16) +[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L16) *** @@ -28,7 +28,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L15) +[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L15) *** @@ -38,7 +38,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L14) +[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L14) *** @@ -56,7 +56,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L7) +[2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L7) *** @@ -66,7 +66,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L12) +[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L12) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L9) +[2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L9) *** @@ -86,7 +86,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L10) +[2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L10) *** @@ -104,7 +104,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L8) +[2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L8) *** @@ -114,7 +114,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L13) +[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L13) *** @@ -124,4 +124,4 @@ #### Defined in -[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FRigidBody.ts#L11) +[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L11) diff --git a/docs/api/2d/interfaces/FSceneOptions.md b/docs/api/2d/interfaces/FSceneOptions.md index af47fc48..90c8b771 100644 --- a/docs/api/2d/interfaces/FSceneOptions.md +++ b/docs/api/2d/interfaces/FSceneOptions.md @@ -18,7 +18,7 @@ #### Defined in -core/dist/index.d.ts:181 +core/dist/index.d.ts:186 *** @@ -40,4 +40,4 @@ core/dist/index.d.ts:181 #### Defined in -[2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FScene.ts#L13) +[2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L13) diff --git a/docs/api/2d/interfaces/FSpriteOptions.md b/docs/api/2d/interfaces/FSpriteOptions.md index 6ac667cf..fefdc182 100644 --- a/docs/api/2d/interfaces/FSpriteOptions.md +++ b/docs/api/2d/interfaces/FSpriteOptions.md @@ -26,7 +26,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L14) *** @@ -40,7 +40,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L16) *** @@ -54,7 +54,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L17) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L15) *** @@ -86,4 +86,4 @@ #### Defined in -[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/sprite/FSprite.ts#L7) +[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L7) diff --git a/docs/api/2d/interfaces/FTransformOptions.md b/docs/api/2d/interfaces/FTransformOptions.md index c503ba9b..b307e222 100644 --- a/docs/api/2d/interfaces/FTransformOptions.md +++ b/docs/api/2d/interfaces/FTransformOptions.md @@ -22,7 +22,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L2) *** @@ -32,7 +32,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L4) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L5) *** @@ -60,4 +60,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L3) diff --git a/docs/api/3d/classes/FAmbientLight.md b/docs/api/3d/classes/FAmbientLight.md index 5d86e596..cdf095a1 100644 --- a/docs/api/3d/classes/FAmbientLight.md +++ b/docs/api/3d/classes/FAmbientLight.md @@ -30,7 +30,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FAmbientLight.ts#L11) +[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FAmbientLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -190,7 +190,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -244,7 +244,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FAmbientLight.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FAmbientLight.ts#L31) +[3d/src/lights/FAmbientLight.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FAmbientLight.ts#L31) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -382,7 +382,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FAttachedCamera.md b/docs/api/3d/classes/FAttachedCamera.md index bd3420dc..b754651c 100644 --- a/docs/api/3d/classes/FAttachedCamera.md +++ b/docs/api/3d/classes/FAttachedCamera.md @@ -43,7 +43,7 @@ Model that the camera is attached to #### Defined in -[3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L34) +[3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L34) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L39) +[3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L39) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L51) +[3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L51) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2254,7 +2254,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L27) +[3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L27) *** @@ -2853,7 +2853,7 @@ The valid range is greater than `0` and less than the current value of the [.far #### Defined in -[3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L29) +[3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L29) *** @@ -3059,7 +3059,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FCamera.md b/docs/api/3d/classes/FCamera.md index 703c68f0..56e89ab4 100644 --- a/docs/api/3d/classes/FCamera.md +++ b/docs/api/3d/classes/FCamera.md @@ -39,7 +39,7 @@ The base class for 3d cameras in Fibbo. #### Defined in -[3d/src/cameras/FCamera.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L26) +[3d/src/cameras/FCamera.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L26) ## Methods @@ -358,7 +358,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -377,7 +377,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1117,7 +1117,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1143,7 +1143,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L53) +[3d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L53) *** @@ -1490,7 +1490,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1514,7 +1514,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1650,7 +1650,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1755,7 +1755,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2133,7 +2133,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2150,7 +2150,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2164,7 +2164,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2180,7 +2180,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3003,7 +3003,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FCapsule.md b/docs/api/3d/classes/FCapsule.md index 0545a24f..1820c4f9 100644 --- a/docs/api/3d/classes/FCapsule.md +++ b/docs/api/3d/classes/FCapsule.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCapsule.ts#L23) +[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L23) ## Methods @@ -551,7 +551,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -559,7 +559,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/polyhedrons/FCapsule.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCapsule.ts#L47) +[3d/src/polyhedrons/FCapsule.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L47) *** @@ -597,13 +597,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/polyhedrons/FCapsule.ts:40](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCapsule.ts#L40) +[3d/src/polyhedrons/FCapsule.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L40) *** @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FCapsule.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCapsule.ts#L36) +[3d/src/polyhedrons/FCapsule.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L36) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -973,7 +973,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -990,7 +990,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1004,7 +1004,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1020,7 +1020,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,7 +1069,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,7 +1101,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FCharacterController.md b/docs/api/3d/classes/FCharacterController.md index c314ce83..79c4a027 100644 --- a/docs/api/3d/classes/FCharacterController.md +++ b/docs/api/3d/classes/FCharacterController.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller. #### Defined in -[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L41) +[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L41) ## Methods @@ -52,7 +52,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -80,7 +80,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -97,7 +97,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) *** @@ -125,7 +125,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -137,7 +137,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -149,4 +149,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) diff --git a/docs/api/3d/classes/FCharacterControllerD.md b/docs/api/3d/classes/FCharacterControllerD.md index ebfa9d17..152a2376 100644 --- a/docs/api/3d/classes/FCharacterControllerD.md +++ b/docs/api/3d/classes/FCharacterControllerD.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerD.ts#L23) +[3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerD.ts#L23) ## Methods @@ -63,7 +63,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -89,7 +89,7 @@ Any rendering process should be done on the component, not here. #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerD.ts#L39) +[3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerD.ts#L39) ## Properties @@ -106,7 +106,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) *** @@ -138,7 +138,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -154,7 +154,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -170,4 +170,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) diff --git a/docs/api/3d/classes/FCharacterControllerK.md b/docs/api/3d/classes/FCharacterControllerK.md index a5826c68..b3f5d110 100644 --- a/docs/api/3d/classes/FCharacterControllerK.md +++ b/docs/api/3d/classes/FCharacterControllerK.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L23) +[3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L23) ## Methods @@ -63,7 +63,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -84,7 +84,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -112,7 +112,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -124,7 +124,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -141,7 +141,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) *** @@ -173,7 +173,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -189,7 +189,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -205,7 +205,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -217,4 +217,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKP.md b/docs/api/3d/classes/FCharacterControllerKP.md index 476f8e62..c4769a3f 100644 --- a/docs/api/3d/classes/FCharacterControllerKP.md +++ b/docs/api/3d/classes/FCharacterControllerKP.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) +[3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) ## Methods @@ -74,7 +74,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -95,7 +95,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -123,7 +123,7 @@ The time since the last frame. #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) +[3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) ## Properties @@ -139,7 +139,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -156,7 +156,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +188,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -204,7 +204,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -220,7 +220,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -236,4 +236,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKV.md b/docs/api/3d/classes/FCharacterControllerKV.md index 77432715..aa388e4a 100644 --- a/docs/api/3d/classes/FCharacterControllerKV.md +++ b/docs/api/3d/classes/FCharacterControllerKV.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) +[3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) ## Methods @@ -74,7 +74,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -95,7 +95,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -123,7 +123,7 @@ The time since the last frame. #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) +[3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) ## Properties @@ -139,7 +139,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -156,7 +156,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +188,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -204,7 +204,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -220,7 +220,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -236,4 +236,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCollider.md b/docs/api/3d/classes/FCollider.md index e715acb1..cd98da7a 100644 --- a/docs/api/3d/classes/FCollider.md +++ b/docs/api/3d/classes/FCollider.md @@ -39,7 +39,7 @@ const collider = new FCollider(component, { #### Defined in -[3d/src/core/FCollider.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L57) +[3d/src/core/FCollider.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L57) ## Properties @@ -51,7 +51,7 @@ RAPIER Collider #### Defined in -[3d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L24) +[3d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L24) *** @@ -76,7 +76,7 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[3d/src/core/FCollider.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L29) +[3d/src/core/FCollider.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L29) *** @@ -101,4 +101,4 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[3d/src/core/FCollider.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L34) +[3d/src/core/FCollider.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L34) diff --git a/docs/api/3d/classes/FComponent.md b/docs/api/3d/classes/FComponent.md index 45d749b2..522aeadd 100644 --- a/docs/api/3d/classes/FComponent.md +++ b/docs/api/3d/classes/FComponent.md @@ -52,7 +52,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -90,7 +90,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -128,7 +128,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -148,7 +148,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -168,7 +168,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -188,7 +188,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -208,7 +208,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -228,7 +228,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -248,7 +248,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -286,7 +286,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -306,7 +306,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -326,7 +326,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -346,7 +346,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -366,7 +366,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -386,7 +386,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -406,7 +406,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -434,7 +434,7 @@ The options for the component. #### Defined in -[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L83) +[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L83) ## Methods @@ -486,7 +486,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -494,7 +494,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -520,7 +520,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -528,13 +528,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -553,7 +553,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -587,7 +587,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -641,7 +641,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -667,7 +667,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -707,7 +707,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -747,7 +747,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -787,7 +787,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -827,7 +827,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -848,7 +848,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -865,7 +865,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -879,7 +879,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -895,7 +895,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -907,7 +907,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -923,7 +923,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -935,7 +935,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -947,7 +947,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -959,7 +959,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -971,7 +971,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -983,4 +983,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FComponentEmpty.md b/docs/api/3d/classes/FComponentEmpty.md index 86e05c07..e7e97beb 100644 --- a/docs/api/3d/classes/FComponentEmpty.md +++ b/docs/api/3d/classes/FComponentEmpty.md @@ -50,7 +50,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -92,7 +92,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -134,7 +134,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -158,7 +158,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -182,7 +182,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -206,7 +206,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -230,7 +230,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -254,7 +254,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -278,7 +278,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -320,7 +320,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -344,7 +344,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -368,7 +368,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -392,7 +392,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -416,7 +416,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -440,7 +440,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -464,7 +464,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -488,7 +488,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponentEmpty.ts#L10) +[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -540,7 +540,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -548,7 +548,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -578,7 +578,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -586,13 +586,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -615,7 +615,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -653,7 +653,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -707,7 +707,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -733,7 +733,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponentEmpty.ts#L14) +[3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponentEmpty.ts#L14) *** @@ -777,7 +777,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -821,7 +821,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -865,7 +865,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -909,7 +909,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -930,7 +930,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -947,7 +947,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -961,7 +961,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -977,7 +977,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -993,7 +993,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1009,7 +1009,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1025,7 +1025,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1041,7 +1041,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1057,7 +1057,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1073,7 +1073,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1089,4 +1089,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FController.md b/docs/api/3d/classes/FController.md index 4e383ebf..f0c02ecf 100644 --- a/docs/api/3d/classes/FController.md +++ b/docs/api/3d/classes/FController.md @@ -34,7 +34,7 @@ The options for the controller. #### Defined in -[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L23) +[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L23) ## Methods @@ -62,7 +62,7 @@ The time since the last frame. #### Defined in -core/dist/index.d.ts:26 +core/dist/index.d.ts:27 ## Properties @@ -79,4 +79,4 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) diff --git a/docs/api/3d/classes/FCuboid.md b/docs/api/3d/classes/FCuboid.md index 99943d85..e6685dbf 100644 --- a/docs/api/3d/classes/FCuboid.md +++ b/docs/api/3d/classes/FCuboid.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCuboid.ts#L19) +[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCuboid.ts#L19) ## Methods @@ -551,7 +551,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -559,7 +559,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -597,13 +597,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FCuboid.ts#L23) +[3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCuboid.ts#L23) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -973,7 +973,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -990,7 +990,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1004,7 +1004,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1020,7 +1020,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,7 +1069,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,7 +1101,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FDirectionalLight.md b/docs/api/3d/classes/FDirectionalLight.md index 4fc68ec5..7e5997a4 100644 --- a/docs/api/3d/classes/FDirectionalLight.md +++ b/docs/api/3d/classes/FDirectionalLight.md @@ -30,7 +30,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FDirectionalLight.ts#L11) +[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FDirectionalLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -190,7 +190,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -244,7 +244,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FDirectionalLight.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FDirectionalLight.ts#L46) +[3d/src/lights/FDirectionalLight.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FDirectionalLight.ts#L46) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -382,7 +382,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FFBX.md b/docs/api/3d/classes/FFBX.md index 716cd69f..66863f52 100644 --- a/docs/api/3d/classes/FFBX.md +++ b/docs/api/3d/classes/FFBX.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FFBX.ts#L23) +[3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FFBX.ts#L23) ## Methods @@ -521,7 +521,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FFBX.ts#L65) +[3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FFBX.ts#L65) *** @@ -573,7 +573,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -593,7 +593,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) *** @@ -601,7 +601,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -631,7 +631,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -639,13 +639,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -706,7 +706,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -738,7 +738,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -818,7 +818,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -844,7 +844,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) *** @@ -888,7 +888,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -932,7 +932,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -976,7 +976,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -1020,7 +1020,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -1041,7 +1041,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -1057,7 +1057,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) *** @@ -1074,7 +1074,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1088,7 +1088,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1104,7 +1104,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1120,7 +1120,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1136,7 +1136,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1153,7 +1153,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) *** @@ -1169,7 +1169,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1186,7 +1186,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) *** @@ -1205,7 +1205,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) *** @@ -1221,7 +1221,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1237,7 +1237,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1253,7 +1253,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1277,7 +1277,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) *** @@ -1293,4 +1293,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FFixedCamera.md b/docs/api/3d/classes/FFixedCamera.md index 453cfe00..0594b56c 100644 --- a/docs/api/3d/classes/FFixedCamera.md +++ b/docs/api/3d/classes/FFixedCamera.md @@ -40,7 +40,7 @@ scene.camera.lookAt(0, 0, 0) #### Defined in -[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FFixedCamera.ts#L19) +[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FFixedCamera.ts#L19) ## Methods @@ -359,7 +359,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -382,7 +382,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1122,7 +1122,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1148,7 +1148,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FFixedCamera.ts#L23) +[3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FFixedCamera.ts#L23) *** @@ -1499,7 +1499,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1527,7 +1527,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1667,7 +1667,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1772,7 +1772,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2150,7 +2150,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2167,7 +2167,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2181,7 +2181,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2197,7 +2197,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3024,7 +3024,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FGLB.md b/docs/api/3d/classes/FGLB.md index 39b2e6d5..5a53784f 100644 --- a/docs/api/3d/classes/FGLB.md +++ b/docs/api/3d/classes/FGLB.md @@ -64,7 +64,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -106,7 +106,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -148,7 +148,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -172,7 +172,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -196,7 +196,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -220,7 +220,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -244,7 +244,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -268,7 +268,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -292,7 +292,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -334,7 +334,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -358,7 +358,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -382,7 +382,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -406,7 +406,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -430,7 +430,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -454,7 +454,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -478,7 +478,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -502,7 +502,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FGLB.ts#L22) +[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FGLB.ts#L22) ## Methods @@ -522,7 +522,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) *** @@ -574,7 +574,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -594,7 +594,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) *** @@ -602,7 +602,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -632,7 +632,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -640,13 +640,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -669,7 +669,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -707,7 +707,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -739,7 +739,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) *** @@ -793,7 +793,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -819,7 +819,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -845,7 +845,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) *** @@ -889,7 +889,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -933,7 +933,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -977,7 +977,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -1021,7 +1021,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -1042,7 +1042,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -1058,7 +1058,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) *** @@ -1075,7 +1075,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1089,7 +1089,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1105,7 +1105,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1121,7 +1121,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1137,7 +1137,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1154,7 +1154,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) *** @@ -1170,7 +1170,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1187,7 +1187,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) *** @@ -1206,7 +1206,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) *** @@ -1222,7 +1222,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1238,7 +1238,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1254,7 +1254,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1278,7 +1278,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) *** @@ -1294,4 +1294,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FGLTF.md b/docs/api/3d/classes/FGLTF.md index eaca6d3d..83a4b021 100644 --- a/docs/api/3d/classes/FGLTF.md +++ b/docs/api/3d/classes/FGLTF.md @@ -67,7 +67,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -109,7 +109,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -151,7 +151,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -175,7 +175,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -199,7 +199,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -223,7 +223,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -247,7 +247,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -271,7 +271,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -295,7 +295,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -337,7 +337,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -361,7 +361,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -385,7 +385,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -409,7 +409,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -433,7 +433,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -457,7 +457,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -481,7 +481,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -505,7 +505,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FGLTF.ts#L37) +[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FGLTF.ts#L37) ## Methods @@ -525,7 +525,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) *** @@ -577,7 +577,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -597,7 +597,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) *** @@ -605,7 +605,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -635,7 +635,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -643,13 +643,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -672,7 +672,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -710,7 +710,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -742,7 +742,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) *** @@ -796,7 +796,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -822,7 +822,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -848,7 +848,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) *** @@ -892,7 +892,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -936,7 +936,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -980,7 +980,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -1024,7 +1024,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -1045,7 +1045,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -1061,7 +1061,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) *** @@ -1078,7 +1078,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1092,7 +1092,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1108,7 +1108,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1124,7 +1124,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1140,7 +1140,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1157,7 +1157,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) *** @@ -1173,7 +1173,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1190,7 +1190,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) *** @@ -1209,7 +1209,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) *** @@ -1225,7 +1225,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1241,7 +1241,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1257,7 +1257,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1281,7 +1281,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) *** @@ -1297,4 +1297,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FGameCamera.md b/docs/api/3d/classes/FGameCamera.md index 187fc681..56895f63 100644 --- a/docs/api/3d/classes/FGameCamera.md +++ b/docs/api/3d/classes/FGameCamera.md @@ -43,7 +43,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FGameCamera.ts#L31) +[3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L31) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FGameCamera.ts#L57) +[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L57) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L46) +[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L54) +[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L54) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2258,7 +2258,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L23) +[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2316,7 +2316,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L25) +[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -2621,7 +2621,7 @@ This is a _constant_ value #### Defined in -[3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FGameCamera.ts#L24) +[3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L24) *** @@ -2631,7 +2631,7 @@ This is a _constant_ value #### Defined in -[3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FGameCamera.ts#L26) +[3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L26) *** @@ -3075,7 +3075,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FHemisphereLight.md b/docs/api/3d/classes/FHemisphereLight.md index 659c9b70..03bb305e 100644 --- a/docs/api/3d/classes/FHemisphereLight.md +++ b/docs/api/3d/classes/FHemisphereLight.md @@ -30,7 +30,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FHemisphereLight.ts#L16) +[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L16) ## Methods @@ -138,7 +138,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -190,7 +190,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -244,7 +244,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FHemisphereLight.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FHemisphereLight.ts#L37) +[3d/src/lights/FHemisphereLight.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L37) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -382,7 +382,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FLight.md b/docs/api/3d/classes/FLight.md index 83adf033..a37e6d7a 100644 --- a/docs/api/3d/classes/FLight.md +++ b/docs/api/3d/classes/FLight.md @@ -35,7 +35,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -55,7 +55,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -93,7 +93,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -117,7 +117,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L46) +[3d/src/lights/FLight.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L46) ## Methods @@ -131,7 +131,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -183,7 +183,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -237,7 +237,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -263,7 +263,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FLight.ts:74](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L74) +[3d/src/lights/FLight.ts:74](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L74) ## Properties @@ -284,7 +284,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -301,7 +301,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -315,7 +315,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -331,7 +331,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -355,7 +355,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -371,7 +371,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -383,7 +383,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -395,7 +395,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -407,4 +407,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FLightProbe.md b/docs/api/3d/classes/FLightProbe.md index 6b65855d..a7570fa3 100644 --- a/docs/api/3d/classes/FLightProbe.md +++ b/docs/api/3d/classes/FLightProbe.md @@ -33,7 +33,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -57,7 +57,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -99,7 +99,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -123,7 +123,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLightProbe.ts#L18) +[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L18) ## Methods @@ -141,7 +141,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -193,7 +193,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -247,7 +247,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -273,7 +273,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FLightProbe.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLightProbe.ts#L47) +[3d/src/lights/FLightProbe.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L47) ## Properties @@ -294,7 +294,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -311,7 +311,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -325,7 +325,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -341,7 +341,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -369,7 +369,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -385,7 +385,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -401,7 +401,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -417,7 +417,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -433,4 +433,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FModel.md b/docs/api/3d/classes/FModel.md index 42edcecd..0db82995 100644 --- a/docs/api/3d/classes/FModel.md +++ b/docs/api/3d/classes/FModel.md @@ -56,7 +56,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -98,7 +98,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -140,7 +140,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -164,7 +164,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -188,7 +188,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -212,7 +212,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -236,7 +236,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -260,7 +260,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -284,7 +284,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -326,7 +326,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -350,7 +350,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -374,7 +374,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -398,7 +398,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -422,7 +422,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -446,7 +446,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -470,7 +470,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -498,7 +498,7 @@ The options for the component (inherits from FComponent). #### Defined in -[3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L59) +[3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L59) ## Methods @@ -514,7 +514,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) *** @@ -566,7 +566,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -582,7 +582,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) *** @@ -590,7 +590,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -620,7 +620,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -628,13 +628,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -657,7 +657,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -695,7 +695,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -723,7 +723,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) *** @@ -777,7 +777,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -803,7 +803,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -825,7 +825,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) *** @@ -869,7 +869,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -913,7 +913,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -957,7 +957,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -1001,7 +1001,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -1022,7 +1022,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -1034,7 +1034,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) *** @@ -1051,7 +1051,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1065,7 +1065,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1081,7 +1081,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1097,7 +1097,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1113,7 +1113,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1126,7 +1126,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) *** @@ -1142,7 +1142,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1155,7 +1155,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) *** @@ -1170,7 +1170,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) *** @@ -1186,7 +1186,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1202,7 +1202,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1218,7 +1218,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1238,7 +1238,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) *** @@ -1254,4 +1254,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FOBJ.md b/docs/api/3d/classes/FOBJ.md index 4ac930c5..079c81eb 100644 --- a/docs/api/3d/classes/FOBJ.md +++ b/docs/api/3d/classes/FOBJ.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FOBJ.ts#L23) +[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FOBJ.ts#L23) ## Methods @@ -521,7 +521,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) *** @@ -573,7 +573,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -593,7 +593,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) *** @@ -601,7 +601,7 @@ Emit the onLoaded callbacks. > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -631,7 +631,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -639,13 +639,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -706,7 +706,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -738,7 +738,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -818,7 +818,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) *** @@ -844,7 +844,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) *** @@ -888,7 +888,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -932,7 +932,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -976,7 +976,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -1020,7 +1020,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -1041,7 +1041,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -1057,7 +1057,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) *** @@ -1074,7 +1074,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1088,7 +1088,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1104,7 +1104,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1120,7 +1120,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1136,7 +1136,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1153,7 +1153,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) *** @@ -1169,7 +1169,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) *** @@ -1186,7 +1186,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) *** @@ -1205,7 +1205,7 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) *** @@ -1221,7 +1221,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1237,7 +1237,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1253,7 +1253,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1277,7 +1277,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) *** @@ -1293,4 +1293,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FOrbitCamera.md b/docs/api/3d/classes/FOrbitCamera.md index f64c5467..bd49b1e1 100644 --- a/docs/api/3d/classes/FOrbitCamera.md +++ b/docs/api/3d/classes/FOrbitCamera.md @@ -47,7 +47,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L30) +[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L30) ## Methods @@ -366,7 +366,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -389,7 +389,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1129,7 +1129,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1155,7 +1155,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L38) +[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L38) *** @@ -1506,7 +1506,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L46) +[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1534,7 +1534,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1674,7 +1674,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1779,7 +1779,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L54) +[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L54) *** @@ -2157,7 +2157,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2174,7 +2174,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2188,7 +2188,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2204,7 +2204,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2258,7 +2258,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L23) +[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2312,7 +2312,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FOrbitCamera.ts#L25) +[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -3051,7 +3051,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FPointLight.md b/docs/api/3d/classes/FPointLight.md index 2f2a0297..01887f90 100644 --- a/docs/api/3d/classes/FPointLight.md +++ b/docs/api/3d/classes/FPointLight.md @@ -30,7 +30,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FPointLight.ts#L11) +[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FPointLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -190,7 +190,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -244,7 +244,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FPointLight.ts:40](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FPointLight.ts#L40) +[3d/src/lights/FPointLight.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FPointLight.ts#L40) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -382,7 +382,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FPointerLockCamera.md b/docs/api/3d/classes/FPointerLockCamera.md index c559744e..3099a3fb 100644 --- a/docs/api/3d/classes/FPointerLockCamera.md +++ b/docs/api/3d/classes/FPointerLockCamera.md @@ -43,7 +43,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FPointerLockCamera.ts#L30) +[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L30) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FPointerLockCamera.ts#L45) +[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L45) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2254,7 +2254,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FPointerLockCamera.ts#L23) +[3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L23) *** @@ -2308,7 +2308,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FPointerLockCamera.ts#L25) +[3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L25) *** @@ -3047,7 +3047,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FPolyhedron.md b/docs/api/3d/classes/FPolyhedron.md index 3c44ac17..7c4b5108 100644 --- a/docs/api/3d/classes/FPolyhedron.md +++ b/docs/api/3d/classes/FPolyhedron.md @@ -57,7 +57,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -99,7 +99,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -141,7 +141,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -165,7 +165,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -189,7 +189,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -213,7 +213,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -237,7 +237,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -261,7 +261,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -285,7 +285,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -327,7 +327,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -351,7 +351,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -375,7 +375,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -399,7 +399,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -423,7 +423,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -447,7 +447,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -471,7 +471,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -495,7 +495,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) +[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) ## Methods @@ -547,7 +547,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -555,7 +555,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -585,7 +585,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) *** @@ -593,13 +593,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -622,7 +622,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) *** @@ -660,7 +660,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -714,7 +714,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -740,7 +740,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:35](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L35) +[3d/src/polyhedrons/FPolyhedron.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L35) *** @@ -768,7 +768,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -812,7 +812,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -856,7 +856,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -900,7 +900,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -944,7 +944,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -965,7 +965,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -982,7 +982,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -996,7 +996,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1012,7 +1012,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1028,7 +1028,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1044,7 +1044,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1061,7 +1061,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1077,7 +1077,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1093,7 +1093,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1109,7 +1109,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1125,4 +1125,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FRigidBody.md b/docs/api/3d/classes/FRigidBody.md index 2815b306..08253b97 100644 --- a/docs/api/3d/classes/FRigidBody.md +++ b/docs/api/3d/classes/FRigidBody.md @@ -10,7 +10,7 @@ A 3d RigidBody. > **new FRigidBody**(`component`, `options`?): [`FRigidBody`](FRigidBody.md) -Creates a rigid body for the given component. +Creates a rigidBody for the given component. #### Parameters @@ -20,7 +20,7 @@ The component which the collider will be attached to. • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -39,7 +39,7 @@ const rigidBody = new FRigidBody({ #### Defined in -[3d/src/core/FRigidBody.ts:72](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L72) +[3d/src/core/FRigidBody.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L72) ## Properties @@ -51,7 +51,7 @@ Fibbo Collider #### Defined in -[3d/src/core/FRigidBody.ts:41](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L41) +[3d/src/core/FRigidBody.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L41) *** @@ -63,4 +63,4 @@ RAPIER RigidBody #### Defined in -[3d/src/core/FRigidBody.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L37) +[3d/src/core/FRigidBody.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L37) diff --git a/docs/api/3d/classes/FScene.md b/docs/api/3d/classes/FScene.md index fab12756..078a88d4 100644 --- a/docs/api/3d/classes/FScene.md +++ b/docs/api/3d/classes/FScene.md @@ -57,7 +57,7 @@ import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d' #### Defined in -[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L71) +[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L71) ## Methods @@ -81,7 +81,7 @@ Add a component to the scene. #### Defined in -[3d/src/core/FScene.ts:183](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L183) +[3d/src/core/FScene.ts:183](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L183) *** @@ -105,7 +105,7 @@ Add a light to the scene. #### Defined in -[3d/src/core/FScene.ts:236](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L236) +[3d/src/core/FScene.ts:236](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L236) *** @@ -135,7 +135,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L159) +[3d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L159) *** @@ -149,7 +149,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:95](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L95) +[3d/src/core/FScene.ts:95](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L95) *** @@ -163,7 +163,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:130](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L130) +[3d/src/core/FScene.ts:130](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L130) *** @@ -187,7 +187,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -core/dist/index.d.ts:269 +core/dist/index.d.ts:275 *** @@ -211,7 +211,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -core/dist/index.d.ts:273 +core/dist/index.d.ts:279 *** @@ -235,7 +235,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -core/dist/index.d.ts:265 +core/dist/index.d.ts:271 *** @@ -259,7 +259,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -core/dist/index.d.ts:282 +core/dist/index.d.ts:288 *** @@ -283,7 +283,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -core/dist/index.d.ts:286 +core/dist/index.d.ts:292 *** @@ -308,7 +308,7 @@ The scene is ready when the `init` method has finished. #### Defined in -core/dist/index.d.ts:278 +core/dist/index.d.ts:284 *** @@ -332,7 +332,7 @@ Remove a component from the scene. #### Defined in -[3d/src/core/FScene.ts:214](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L214) +[3d/src/core/FScene.ts:214](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L214) *** @@ -356,7 +356,7 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L243) +[3d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L243) ## Properties @@ -366,7 +366,7 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L60) +[3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L60) *** @@ -383,7 +383,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:225 +core/dist/index.d.ts:231 *** @@ -400,7 +400,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:230 +core/dist/index.d.ts:236 *** @@ -417,7 +417,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -core/dist/index.d.ts:220 +core/dist/index.d.ts:226 *** @@ -434,7 +434,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:239 +core/dist/index.d.ts:245 *** @@ -451,7 +451,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:244 +core/dist/index.d.ts:250 *** @@ -467,7 +467,7 @@ Callbacks for when the scene is ready. #### Defined in -core/dist/index.d.ts:234 +core/dist/index.d.ts:240 *** @@ -483,7 +483,7 @@ DOM element that the renderer will be appended to #### Defined in -core/dist/index.d.ts:196 +core/dist/index.d.ts:202 *** @@ -493,7 +493,7 @@ core/dist/index.d.ts:196 #### Defined in -[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L52) +[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L52) *** @@ -507,7 +507,7 @@ core/dist/index.d.ts:196 #### Defined in -core/dist/index.d.ts:192 +core/dist/index.d.ts:198 *** @@ -523,7 +523,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L51) +[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L51) *** @@ -537,7 +537,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L69) +[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L69) *** @@ -547,7 +547,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L63) +[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L63) *** @@ -563,7 +563,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L55) +[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L55) *** @@ -577,7 +577,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L68) +[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L68) *** @@ -603,7 +603,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L66) +[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L66) *** @@ -619,7 +619,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L57) +[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L57) *** @@ -629,7 +629,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L62) +[3d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L62) *** @@ -639,7 +639,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L61) +[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L61) *** @@ -653,4 +653,4 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L67) +[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L67) diff --git a/docs/api/3d/classes/FSphere.md b/docs/api/3d/classes/FSphere.md index 755c29ce..894725ba 100644 --- a/docs/api/3d/classes/FSphere.md +++ b/docs/api/3d/classes/FSphere.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FSphere.ts#L23) +[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L23) ## Methods @@ -551,7 +551,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -559,7 +559,7 @@ core/dist/index.d.ts:116 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigid body. +Only init a collider for the component, without a rigidBody. This is useful for static objects. #### Parameters @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/polyhedrons/FSphere.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FSphere.ts#L47) +[3d/src/polyhedrons/FSphere.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L47) *** @@ -597,13 +597,13 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigid body for the component. +Init a rigidBody for the component. #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigid body. +The options for the rigidBody. #### Returns @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/polyhedrons/FSphere.ts:40](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FSphere.ts#L40) +[3d/src/polyhedrons/FSphere.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L40) *** @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FSphere.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FSphere.ts#L36) +[3d/src/polyhedrons/FSphere.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L36) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) ## Properties @@ -973,7 +973,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:56 +core/dist/index.d.ts:58 *** @@ -990,7 +990,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:51 +core/dist/index.d.ts:53 *** @@ -1004,7 +1004,7 @@ core/dist/index.d.ts:51 #### Defined in -core/dist/index.d.ts:46 +core/dist/index.d.ts:48 *** @@ -1020,7 +1020,7 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) *** @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,7 +1069,7 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,7 +1101,7 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) *** @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FSpotLight.md b/docs/api/3d/classes/FSpotLight.md index 1e3716af..10bad4f2 100644 --- a/docs/api/3d/classes/FSpotLight.md +++ b/docs/api/3d/classes/FSpotLight.md @@ -30,7 +30,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -124,7 +124,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L26) +[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L26) ## Methods @@ -142,7 +142,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) *** @@ -194,7 +194,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:116 +core/dist/index.d.ts:118 *** @@ -248,7 +248,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:93 +core/dist/index.d.ts:95 *** @@ -274,7 +274,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FSpotLight.ts:62](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L62) +[3d/src/lights/FSpotLight.ts:62](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L62) ## Properties @@ -295,7 +295,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) *** @@ -312,7 +312,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) *** @@ -326,7 +326,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) *** @@ -342,7 +342,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) *** @@ -370,7 +370,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) *** @@ -386,7 +386,7 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:62 +core/dist/index.d.ts:64 *** @@ -402,7 +402,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) *** @@ -418,7 +418,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) *** @@ -434,4 +434,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FTransform.md b/docs/api/3d/classes/FTransform.md index e4783c60..6c1b2ee0 100644 --- a/docs/api/3d/classes/FTransform.md +++ b/docs/api/3d/classes/FTransform.md @@ -34,7 +34,7 @@ const collider = new FTransform({ #### Defined in -[3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L44) +[3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L44) ## Properties @@ -46,7 +46,7 @@ The position of the component. #### Defined in -[3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L18) +[3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L18) *** @@ -58,7 +58,7 @@ The rotation of the component. #### Defined in -[3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L26) +[3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L26) *** @@ -70,4 +70,4 @@ The scale of the component. #### Defined in -[3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L22) +[3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L22) diff --git a/docs/api/3d/enumerations/FShapes.md b/docs/api/3d/enumerations/FShapes.md index 805faa57..560bc6f3 100644 --- a/docs/api/3d/enumerations/FShapes.md +++ b/docs/api/3d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/types/FShapes.ts#L5) +[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L5) *** @@ -20,7 +20,7 @@ #### Defined in -[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/types/FShapes.ts#L3) +[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L3) *** @@ -30,7 +30,7 @@ #### Defined in -[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/types/FShapes.ts#L6) +[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L6) *** @@ -40,4 +40,4 @@ #### Defined in -[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/types/FShapes.ts#L4) +[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L4) diff --git a/docs/api/3d/interfaces/FAttachedCameraOptions.md b/docs/api/3d/interfaces/FAttachedCameraOptions.md index 3a2bfc41..5454cfb8 100644 --- a/docs/api/3d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/3d/interfaces/FAttachedCameraOptions.md @@ -30,7 +30,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -56,7 +56,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -82,7 +82,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -108,7 +108,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) *** @@ -118,4 +118,4 @@ #### Defined in -[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/cameras/FAttachedCamera.ts#L7) +[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/3d/interfaces/FCameraOptions.md b/docs/api/3d/interfaces/FCameraOptions.md index f1da6a9a..4981bfb5 100644 --- a/docs/api/3d/interfaces/FCameraOptions.md +++ b/docs/api/3d/interfaces/FCameraOptions.md @@ -34,7 +34,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -60,7 +60,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -112,4 +112,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FCharacterControllerOptions.md b/docs/api/3d/interfaces/FCharacterControllerOptions.md index 5a5a387d..2d2b2a12 100644 --- a/docs/api/3d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/3d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FCharacterController.ts#L13) +[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L13) diff --git a/docs/api/3d/interfaces/FColliderOptions.md b/docs/api/3d/interfaces/FColliderOptions.md index 0b5f4062..6e0b253e 100644 --- a/docs/api/3d/interfaces/FColliderOptions.md +++ b/docs/api/3d/interfaces/FColliderOptions.md @@ -22,7 +22,7 @@ #### Defined in -[3d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L7) +[3d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L7) *** @@ -32,7 +32,7 @@ #### Defined in -[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L12) +[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L12) *** @@ -54,7 +54,7 @@ #### Defined in -[3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L9) +[3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L9) *** @@ -76,7 +76,7 @@ #### Defined in -[3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L10) +[3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L10) *** @@ -98,7 +98,7 @@ #### Defined in -[3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L8) +[3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L8) *** @@ -108,7 +108,7 @@ #### Defined in -[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L13) +[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L13) *** @@ -118,4 +118,4 @@ #### Defined in -[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FCollider.ts#L11) +[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L11) diff --git a/docs/api/3d/interfaces/FComponentOptions.md b/docs/api/3d/interfaces/FComponentOptions.md index 30cc7681..418096f3 100644 --- a/docs/api/3d/interfaces/FComponentOptions.md +++ b/docs/api/3d/interfaces/FComponentOptions.md @@ -26,7 +26,7 @@ #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L14) *** @@ -48,7 +48,7 @@ #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L16) *** @@ -70,7 +70,7 @@ #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L17) *** @@ -92,4 +92,4 @@ #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L15) diff --git a/docs/api/3d/interfaces/FControllerOptions.md b/docs/api/3d/interfaces/FControllerOptions.md index 9d14be93..76465497 100644 --- a/docs/api/3d/interfaces/FControllerOptions.md +++ b/docs/api/3d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L6) diff --git a/docs/api/3d/interfaces/FHemisphereLightOptions.md b/docs/api/3d/interfaces/FHemisphereLightOptions.md index b3a62126..fd75b2be 100644 --- a/docs/api/3d/interfaces/FHemisphereLightOptions.md +++ b/docs/api/3d/interfaces/FHemisphereLightOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FHemisphereLight.ts#L8) +[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L8) *** @@ -42,7 +42,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) *** @@ -68,7 +68,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) *** @@ -94,7 +94,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -120,7 +120,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -146,7 +146,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -172,7 +172,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) *** @@ -182,4 +182,4 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FHemisphereLight.ts#L7) +[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L7) diff --git a/docs/api/3d/interfaces/FLightOptions.md b/docs/api/3d/interfaces/FLightOptions.md index 5ef40582..e1925b46 100644 --- a/docs/api/3d/interfaces/FLightOptions.md +++ b/docs/api/3d/interfaces/FLightOptions.md @@ -20,7 +20,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) *** @@ -30,7 +30,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) *** @@ -52,7 +52,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) *** @@ -78,7 +78,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -104,7 +104,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -130,7 +130,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -156,4 +156,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FLightProbeOptions.md b/docs/api/3d/interfaces/FLightProbeOptions.md index 6be5d654..466ebad2 100644 --- a/docs/api/3d/interfaces/FLightProbeOptions.md +++ b/docs/api/3d/interfaces/FLightProbeOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) *** @@ -32,7 +32,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) *** @@ -58,7 +58,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) *** @@ -84,7 +84,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -110,7 +110,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -136,7 +136,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -162,7 +162,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) *** @@ -172,4 +172,4 @@ #### Defined in -[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLightProbe.ts#L7) +[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L7) diff --git a/docs/api/3d/interfaces/FModelOptions.md b/docs/api/3d/interfaces/FModelOptions.md index 1ea73c6c..6df54855 100644 --- a/docs/api/3d/interfaces/FModelOptions.md +++ b/docs/api/3d/interfaces/FModelOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L10) +[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L10) *** @@ -24,7 +24,7 @@ #### Defined in -[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L7) +[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L7) *** @@ -34,7 +34,7 @@ #### Defined in -[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L8) +[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L8) *** @@ -60,7 +60,7 @@ #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L14) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L16) *** @@ -112,7 +112,7 @@ #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L17) *** @@ -138,7 +138,7 @@ #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L15) *** @@ -148,4 +148,4 @@ #### Defined in -[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/model/FModel.ts#L9) +[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L9) diff --git a/docs/api/3d/interfaces/FRigidBodyOptions.md b/docs/api/3d/interfaces/FRigidBodyOptions.md index 76397068..65fa36b9 100644 --- a/docs/api/3d/interfaces/FRigidBodyOptions.md +++ b/docs/api/3d/interfaces/FRigidBodyOptions.md @@ -22,7 +22,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L22) +[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L22) *** @@ -44,7 +44,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L17) +[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L17) *** @@ -54,7 +54,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L16) +[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L16) *** @@ -64,7 +64,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L15) +[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L15) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L8) +[3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L8) *** @@ -96,7 +96,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L13) +[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L13) *** @@ -118,7 +118,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L10) +[3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L10) *** @@ -140,7 +140,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L11) +[3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L11) *** @@ -162,7 +162,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L9) +[3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L9) *** @@ -172,7 +172,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L14) +[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L14) *** @@ -182,4 +182,4 @@ #### Defined in -[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FRigidBody.ts#L12) +[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L12) diff --git a/docs/api/3d/interfaces/FSceneOptions.md b/docs/api/3d/interfaces/FSceneOptions.md index bd481dfa..c02d86b6 100644 --- a/docs/api/3d/interfaces/FSceneOptions.md +++ b/docs/api/3d/interfaces/FSceneOptions.md @@ -18,7 +18,7 @@ #### Defined in -core/dist/index.d.ts:181 +core/dist/index.d.ts:186 *** @@ -44,7 +44,7 @@ core/dist/index.d.ts:181 #### Defined in -[3d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L12) +[3d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L12) *** @@ -54,4 +54,4 @@ core/dist/index.d.ts:181 #### Defined in -[3d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FScene.ts#L13) +[3d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L13) diff --git a/docs/api/3d/interfaces/FSpotLightOptions.md b/docs/api/3d/interfaces/FSpotLightOptions.md index b89743b3..3b717437 100644 --- a/docs/api/3d/interfaces/FSpotLightOptions.md +++ b/docs/api/3d/interfaces/FSpotLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L8) +[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L8) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) *** @@ -38,7 +38,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L10) +[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L10) *** @@ -48,7 +48,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L7) +[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L7) *** @@ -62,7 +62,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) *** @@ -88,7 +88,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) *** @@ -98,7 +98,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/lights/FSpotLight.ts#L9) +[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L9) *** @@ -124,7 +124,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -150,7 +150,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -176,7 +176,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -202,4 +202,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FTransformOptions.md b/docs/api/3d/interfaces/FTransformOptions.md index 51ca2a57..6462dfe8 100644 --- a/docs/api/3d/interfaces/FTransformOptions.md +++ b/docs/api/3d/interfaces/FTransformOptions.md @@ -27,7 +27,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) *** @@ -49,7 +49,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) *** @@ -71,7 +71,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) *** @@ -93,4 +93,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/core/classes/FCamera.md b/docs/api/core/classes/FCamera.md index f375d33d..666bf3e9 100644 --- a/docs/api/core/classes/FCamera.md +++ b/docs/api/core/classes/FCamera.md @@ -24,7 +24,7 @@ The base class for cameras in Fibbo. #### Defined in -[core/src/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FCamera.ts#L8) +[core/src/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FCamera.ts#L8) ## Methods @@ -76,7 +76,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) *** @@ -130,7 +130,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) *** @@ -158,7 +158,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) *** @@ -178,7 +178,7 @@ Set the zoom of the camera. #### Defined in -[core/src/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FCamera.ts#L15) +[core/src/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FCamera.ts#L15) ## Properties @@ -199,7 +199,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) *** @@ -216,7 +216,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) *** @@ -230,7 +230,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) *** @@ -246,7 +246,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) *** @@ -262,4 +262,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FComponent.md b/docs/api/core/classes/FComponent.md index 9515cea3..60fdfcc6 100644 --- a/docs/api/core/classes/FComponent.md +++ b/docs/api/core/classes/FComponent.md @@ -21,7 +21,7 @@ The base class for all 2D and 3D components in Fibbo. #### Defined in -[core/src/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L46) +[core/src/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L46) ## Methods @@ -69,7 +69,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) *** @@ -119,7 +119,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) *** @@ -143,7 +143,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) ## Properties @@ -160,7 +160,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) *** @@ -173,7 +173,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) *** @@ -183,7 +183,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) *** @@ -195,7 +195,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) *** @@ -207,4 +207,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FController.md b/docs/api/core/classes/FController.md index acf33c27..13e9ded9 100644 --- a/docs/api/core/classes/FController.md +++ b/docs/api/core/classes/FController.md @@ -22,7 +22,7 @@ The options for the controller. #### Defined in -[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FController.ts#L21) +[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L21) ## Methods @@ -46,7 +46,7 @@ The time since the last frame. #### Defined in -[core/src/FController.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FController.ts#L31) +[core/src/FController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L31) ## Properties @@ -58,4 +58,4 @@ The component attached to the controller. #### Defined in -[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FController.ts#L15) +[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L15) diff --git a/docs/api/core/classes/FGroup.md b/docs/api/core/classes/FGroup.md index ad156bf9..30ff52c9 100644 --- a/docs/api/core/classes/FGroup.md +++ b/docs/api/core/classes/FGroup.md @@ -29,7 +29,7 @@ The components to add to the group. #### Defined in -[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FGroup.ts#L19) +[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L19) ## Methods @@ -49,7 +49,7 @@ Add a component to the group. #### Defined in -[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FGroup.ts#L26) +[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L26) *** @@ -71,7 +71,7 @@ The time since the last frame. #### Defined in -[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FGroup.ts#L41) +[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L41) *** @@ -91,7 +91,7 @@ Remove a component from the group. #### Defined in -[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FGroup.ts#L33) +[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L33) ## Properties @@ -103,4 +103,4 @@ The components in the group. #### Defined in -[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FGroup.ts#L11) +[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L11) diff --git a/docs/api/core/classes/FLight.md b/docs/api/core/classes/FLight.md index f29746a4..d50a02c1 100644 --- a/docs/api/core/classes/FLight.md +++ b/docs/api/core/classes/FLight.md @@ -24,7 +24,7 @@ The base class for lights in Fibbo. #### Defined in -[core/src/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FLight.ts#L8) +[core/src/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FLight.ts#L8) ## Methods @@ -76,7 +76,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) *** @@ -130,7 +130,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) *** @@ -158,7 +158,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) ## Properties @@ -179,7 +179,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) *** @@ -196,7 +196,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) *** @@ -210,7 +210,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) *** @@ -226,7 +226,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) *** @@ -242,4 +242,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FScene.md b/docs/api/core/classes/FScene.md index 76c9daec..5154e5c8 100644 --- a/docs/api/core/classes/FScene.md +++ b/docs/api/core/classes/FScene.md @@ -21,7 +21,7 @@ Also contains the Rapier world if physics is enabled. #### Defined in -[core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L75) +[core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L75) ## Methods @@ -41,7 +41,7 @@ Add a component to the scene. #### Defined in -[core/src/FScene.ts:128](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L128) +[core/src/FScene.ts:128](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L128) *** @@ -61,7 +61,7 @@ Add a light to the scene. #### Defined in -[core/src/FScene.ts:147](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L147) +[core/src/FScene.ts:147](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L147) *** @@ -81,7 +81,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -[core/src/FScene.ts:173](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L173) +[core/src/FScene.ts:173](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L173) *** @@ -101,7 +101,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -[core/src/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L180) +[core/src/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L180) *** @@ -121,7 +121,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L166) +[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L166) *** @@ -141,7 +141,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -[core/src/FScene.ts:195](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L195) +[core/src/FScene.ts:195](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L195) *** @@ -161,7 +161,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -[core/src/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L202) +[core/src/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L202) *** @@ -182,7 +182,7 @@ The scene is ready when the `init` method has finished. #### Defined in -[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L188) +[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L188) *** @@ -202,7 +202,7 @@ Remove a component from the scene. #### Defined in -[core/src/FScene.ts:136](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L136) +[core/src/FScene.ts:136](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L136) *** @@ -222,7 +222,7 @@ Remove a light from the scene. #### Defined in -[core/src/FScene.ts:155](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L155) +[core/src/FScene.ts:155](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L155) ## Properties @@ -235,7 +235,7 @@ It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L54) +[core/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L54) *** @@ -248,7 +248,7 @@ It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L59) +[core/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L59) *** @@ -261,7 +261,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L49) +[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L49) *** @@ -274,7 +274,7 @@ It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L68) +[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L68) *** @@ -287,7 +287,7 @@ It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L73) +[core/src/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L73) *** @@ -299,7 +299,7 @@ Callbacks for when the scene is ready. #### Defined in -[core/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L63) +[core/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L63) *** @@ -311,7 +311,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L26) +[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L26) *** @@ -321,7 +321,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L21) +[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L21) *** @@ -333,7 +333,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:20](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L20) +[core/src/FScene.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L20) *** @@ -343,7 +343,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L42) +[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L42) *** @@ -355,7 +355,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:31](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L31) +[core/src/FScene.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L31) *** @@ -365,7 +365,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L41) +[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L41) *** @@ -375,7 +375,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:39](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L39) +[core/src/FScene.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L39) *** @@ -387,7 +387,7 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L36) +[core/src/FScene.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L36) *** @@ -397,4 +397,4 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L40) +[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L40) diff --git a/docs/api/core/interfaces/FControllerOptions.md b/docs/api/core/interfaces/FControllerOptions.md index eddaf1d5..6d9e35eb 100644 --- a/docs/api/core/interfaces/FControllerOptions.md +++ b/docs/api/core/interfaces/FControllerOptions.md @@ -10,4 +10,4 @@ #### Defined in -[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FController.ts#L4) +[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L4) diff --git a/docs/api/core/interfaces/FSceneOptions.md b/docs/api/core/interfaces/FSceneOptions.md index 32b060c9..2d7ca79a 100644 --- a/docs/api/core/interfaces/FSceneOptions.md +++ b/docs/api/core/interfaces/FSceneOptions.md @@ -10,7 +10,7 @@ #### Defined in -[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L8) +[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L8) *** @@ -20,4 +20,4 @@ #### Defined in -[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FScene.ts#L7) +[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L7) diff --git a/docs/api/core/interfaces/OnCollisionWithData.md b/docs/api/core/interfaces/OnCollisionWithData.md index 72ef904b..6d90f6e8 100644 --- a/docs/api/core/interfaces/OnCollisionWithData.md +++ b/docs/api/core/interfaces/OnCollisionWithData.md @@ -14,4 +14,4 @@ The component that collided with the component. #### Defined in -[core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/core/src/FComponent.ts#L15) +[core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L15) diff --git a/docs/api/event/classes/FKeyboard.md b/docs/api/event/classes/FKeyboard.md index b2b885ea..e34d5f75 100644 --- a/docs/api/event/classes/FKeyboard.md +++ b/docs/api/event/classes/FKeyboard.md @@ -35,7 +35,7 @@ keyboard.on('ArrowUp', () => { #### Defined in -[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L38) +[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L38) ## Methods @@ -61,7 +61,7 @@ keyboard.clear() #### Defined in -[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L194) +[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L194) *** @@ -112,7 +112,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L102) +[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L102) *** @@ -161,7 +161,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L136) +[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L136) *** @@ -210,7 +210,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L170) +[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L170) ## Properties @@ -222,7 +222,7 @@ An map of all the callbacks for each key being pressed #### Defined in -[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L28) +[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L28) *** @@ -234,7 +234,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L32) +[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L32) *** @@ -246,7 +246,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L36) +[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L36) *** @@ -258,4 +258,4 @@ A map of all the keys being pressed #### Defined in -[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/d4e27f21b39d7470557f457413047335ba5e0d67/packages/event/src/FKeyboard.ts#L24) +[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L24) diff --git a/docs/guide/core/components.md b/docs/guide/core/components.md index 44f06c83..393def4e 100644 --- a/docs/guide/core/components.md +++ b/docs/guide/core/components.md @@ -9,13 +9,13 @@ A component is a class that extends the [`FComponent`](/api/core/classes/FCompon It is mainly composed of the following attributes : - [`transform`](/guide/transforms) : The position, rotation, and scale of the object. - `collider` : (optional) The collider of the object, used for physics interactions. -- `rigidBody` : (optional) The rigid body of the object, used for physics interactions. +- `rigidBody` : (optional) The rigidBody of the object, used for physics interactions. - `sensor` : (optional) The sensor of the object, used for detecting and emitting collisions events. And the following methods : - `onFrame` : Called every frame by the [Scene](/guide/scene) to update the component. - `initCollider` : Initialize the collider of the object. -- `initRigidBody` : Initialize the rigid body of the object. +- `initRigidBody` : Initialize the rigidBody of the object. - `initSensor` : Initialize the sensor of the object. - Various methods to modify the transform of the object. - `setPosition` : Set the position of the object. diff --git a/docs/more/recipes/custom-controller.md b/docs/more/recipes/custom-controller.md index 4cee8681..42e20f68 100644 --- a/docs/more/recipes/custom-controller.md +++ b/docs/more/recipes/custom-controller.md @@ -137,7 +137,7 @@ export class CustomController extends FController { // Create the character controller this.characterController = scene.world.createCharacterController(offset) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, lockRotations: true, @@ -187,7 +187,7 @@ export class CustomController extends FController { // Get the corrected movement const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body + // Apply the movement to the rigidBody this.component.rigidBody?.rigidBody.setNextKinematicTranslation({ x: this.component.rigidBody.rigidBody.translation().x + correctedMovement.x * delta * this.speed * 64, y: this.component.rigidBody.rigidBody.translation().y + correctedMovement.y * delta * this.speed * 64, @@ -336,7 +336,7 @@ export class CustomController extends FController { scale: { x: 1.1, y: 1.1, z: 1.1 }, }) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, ...options, @@ -403,7 +403,7 @@ export class CustomController extends FController { */ const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body + // Apply the movement to the rigidBody this.component.rigidBody?.rigidBody.setNextKinematicTranslation({ x: this.component.rigidBody.rigidBody.translation().x + correctedMovement.x * delta * this.speed * 64, y: this.component.rigidBody.rigidBody.translation().y + correctedMovement.y * delta * this.speed * 64, @@ -412,7 +412,7 @@ export class CustomController extends FController { // If one of the inputs is true, apply the corrected rotation if (this.inputs.forward || this.inputs.backward || this.inputs.left || this.inputs.right) { - // Apply the rotation to the rigid body + // Apply the rotation to the rigidBody this.component.rigidBody?.rigidBody.setNextKinematicRotation(this.getCorrectedRotation()) } } diff --git a/packages/2d/src/controllers/FCharacterControllerD.ts b/packages/2d/src/controllers/FCharacterControllerD.ts index 80a1c48a..856c7c43 100644 --- a/packages/2d/src/controllers/FCharacterControllerD.ts +++ b/packages/2d/src/controllers/FCharacterControllerD.ts @@ -24,10 +24,10 @@ export class FCharacterControllerD extends FCharacterController { const fKeyboard = new FKeyboard(scene) fKeyboard.onKeyDown(' ', () => { - this.component.rigidBody?.rigidBody.applyImpulse({ x: 0, y: 0.5 }, true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: 0, y: 0.5 }, true) }) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.Dynamic, lockRotations: true, @@ -38,17 +38,17 @@ export class FCharacterControllerD extends FCharacterController { onFrame(_delta: number): void { // Apply movement on the y axis if (this.inputs.up) { - this.component.rigidBody?.rigidBody.applyImpulse({ x: 0, y: 0.15 * this.speed }, true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: 0, y: 0.15 * this.speed }, true) } else if (this.inputs.down) { - this.component.rigidBody?.rigidBody.applyImpulse({ x: 0, y: -0.15 * this.speed }, true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: 0, y: -0.15 * this.speed }, true) } // Apply movement on the x axis if (this.inputs.left) { - this.component.rigidBody?.rigidBody.applyImpulse({ x: -0.15 * this.speed, y: 0 }, true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: -0.15 * this.speed, y: 0 }, true) } else if (this.inputs.right) { - this.component.rigidBody?.rigidBody.applyImpulse({ x: 0.15 * this.speed, y: 0 }, true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: 0.15 * this.speed, y: 0 }, true) } } } diff --git a/packages/2d/src/controllers/FCharacterControllerK.ts b/packages/2d/src/controllers/FCharacterControllerK.ts index dd955577..1072eb0c 100644 --- a/packages/2d/src/controllers/FCharacterControllerK.ts +++ b/packages/2d/src/controllers/FCharacterControllerK.ts @@ -53,7 +53,7 @@ export abstract class FCharacterControllerK extends FCharacterController { } // Compute the desired movement this.characterController.computeColliderMovement( - this.component.collider?.collider as RAPIER.Collider, + this.component.collider?.__COLLIDER__ as RAPIER.Collider, desiredMovement, RAPIER.QueryFilterFlags.EXCLUDE_SENSORS, ) diff --git a/packages/2d/src/controllers/FCharacterControllerKP.ts b/packages/2d/src/controllers/FCharacterControllerKP.ts index e0330ea2..a984073f 100644 --- a/packages/2d/src/controllers/FCharacterControllerKP.ts +++ b/packages/2d/src/controllers/FCharacterControllerKP.ts @@ -21,7 +21,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { constructor(scene: FScene, options: FCharacterControllerOptions) { super(scene, options) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, lockRotations: true, @@ -33,10 +33,10 @@ export class FCharacterControllerKP extends FCharacterControllerK { // Get the corrected movement const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body - this.component.rigidBody?.rigidBody.setNextKinematicTranslation({ - x: this.component.rigidBody.rigidBody.translation().x + correctedMovement.x * delta * this.speed * 64, - y: this.component.rigidBody.rigidBody.translation().y + correctedMovement.y * delta * this.speed * 64, + // Apply the movement to the rigidBody + this.component.rigidBody?.__RIGIDBODY__.setNextKinematicTranslation({ + x: this.component.rigidBody.__RIGIDBODY__.translation().x + correctedMovement.x * delta * this.speed * 64, + y: this.component.rigidBody.__RIGIDBODY__.translation().y + correctedMovement.y * delta * this.speed * 64, }) } } diff --git a/packages/2d/src/controllers/FCharacterControllerKV.ts b/packages/2d/src/controllers/FCharacterControllerKV.ts index 71eeb6d2..7b74e589 100644 --- a/packages/2d/src/controllers/FCharacterControllerKV.ts +++ b/packages/2d/src/controllers/FCharacterControllerKV.ts @@ -21,7 +21,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { constructor(scene: FScene, options: FCharacterControllerOptions) { super(scene, options) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicVelocityBased, lockRotations: true, @@ -33,8 +33,8 @@ export class FCharacterControllerKV extends FCharacterControllerK { // Get the corrected movement const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body - this.component.rigidBody?.rigidBody.setLinvel({ + // Apply the movement to the rigidBody + this.component.rigidBody?.__RIGIDBODY__.setLinvel({ x: correctedMovement.x / delta, y: correctedMovement.y / delta, }, true) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 5d233ede..0b948a33 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -20,17 +20,26 @@ export class FCollider { /** * RAPIER Collider */ - collider: RAPIER.Collider + __COLLIDER__: RAPIER.Collider /** * Position Offset for the collider. * This is used to adjust the collider position relative to the mesh. */ - colliderPositionOffset: { x: number, y: number } + __COLLIDER_POSITION_OFFSET__: { x: number, y: number } /** * Rotation Offset for the collider. * This is used to adjust the collider position relative to the mesh. */ - colliderRotationOffset: number + __COLLIDER_ROTATION_OFFSET__: number + /** + * Scale Offset for the collider. + * This is used to adjust the collider scale relative to the mesh. + */ + __COLLIDER_SCALE_OFFSET__: { x: number, y: number } + /** + * The component the collider is attached to. + */ + component: FComponent /** * Creates a collider for a given component. @@ -41,7 +50,7 @@ export class FCollider { * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBody The rigid body to attach the collider to. (optional) + * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example * ```ts @@ -71,7 +80,7 @@ export class FCollider { // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigid body') + throw new Error('FibboError: FScene must have a world to create a rigidBody') // If rotation degree is given, convert it to radians if (options.rotationDegree) { @@ -80,8 +89,11 @@ export class FCollider { } // Store the collider offset - this.colliderPositionOffset = { x: options.position.x, y: options.position.y } - this.colliderRotationOffset = options.rotation + this.__COLLIDER_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } + this.__COLLIDER_ROTATION_OFFSET__ = options.rotation + this.__COLLIDER_SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y } + // Store the component + this.component = component // Devide the scale by 2 for the collider (RAPIER uses half-extents) // Also interpete the scale as relative to the component's scale @@ -109,10 +121,10 @@ export class FCollider { // If no rigidbody given, the collider is free : set translation and rotation for the collider if (options.rigidBody === undefined) { // Interprete the given position as relative to the component's position - const finalPosition = component.transform.position - finalPosition.x += options.position.x - finalPosition.y += options.position.y - colliderDesc.setTranslation(finalPosition.x, finalPosition.y) + const newPosition = component.transform.position + newPosition.x += options.position.x + newPosition.y += options.position.y + colliderDesc.setTranslation(newPosition.x, newPosition.y) // Interprete the given rotation as relative to the component's rotation const finalRotation = component.transform.rotation + options.rotation @@ -125,6 +137,89 @@ export class FCollider { } // Create the collider - this.collider = component.scene.world.createCollider(colliderDesc, options.rigidBody) + this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody) + } + + /** + * Set the position of the collider. + * @param position The new position of the collider. + * @param position.x The new x position of the collider. + * @param position.y The new y position of the collider. + */ + setPosition(position: { x: number, y: number }) { + this.__COLLIDER__.setTranslation(position) + } + + /** + * Set the rotation of the collider. + * @param rotation The new rotation of the collider. + */ + setRotation(rotation: number) { + this.__COLLIDER__.setRotation(rotation) + } + + /** + * Set the rotation of the collider in degrees. + * @param rotation The new rotation of the collider in degrees. + */ + setRotationDegree(rotation: number) { + this.__COLLIDER__.setRotation((rotation * Math.PI) / 180) + } + + /** + * Set the scale of the collider. + * @param scale The new scale of the collider. + * @param scale.x The new x scale of the collider. + * @param scale.y The new y scale of the collider. + */ + setScale(scale: { x: number, y: number }) { + // If the collider is a cuboid, update its half extents + if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Cuboid) { + this.__COLLIDER__.setHalfExtents(new RAPIER.Vector2(scale.x / 2, scale.y / 2)) + } + // If the collider is a ball, update its radius + else if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Ball) { + this.__COLLIDER__.setRadius( + // Get the maximum value of x and y + Math.max(scale.x, scale.y) / 2, + ) + } + } + + /** + * Update the position of the collider according to the component's position. + * This takes into account the position offset. + */ + updatePosition() { + const newPosition = this.component.transform.position + newPosition.x += this.__COLLIDER_POSITION_OFFSET__.x + newPosition.y += this.__COLLIDER_POSITION_OFFSET__.y + this.setPosition(newPosition) + } + + /** + * Update the rotation of the collider according to the component's rotation. + * This takes into account the rotation offset. + */ + updateRotation() { + this.setRotation(this.component.transform.rotation + this.__COLLIDER_ROTATION_OFFSET__) + } + + /** + * Update the scale of the collider according to the component's scale. + * This takes into account the scale offset. + */ + updateScale() { + // If the collider is a cuboid, update its half extents + if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Cuboid) { + this.__COLLIDER__.setHalfExtents(new RAPIER.Vector2(this.component.scale.x / 2 * this.__COLLIDER_SCALE_OFFSET__.x, this.component.scale.y / 2 * this.__COLLIDER_SCALE_OFFSET__.y)) + } + // If the collider is a ball, update its radius + else if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Ball) { + this.__COLLIDER__.setRadius( + // Get the maximum value of x and y + Math.max(this.component.scale.x, this.component.scale.y) / 2 * this.__COLLIDER_SCALE_OFFSET__.x, + ) + } } } diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 820c520a..de79088a 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -103,52 +103,44 @@ export abstract class FComponent extends FComponentCore { onFrame(_delta: number): void { super.onFrame(_delta) - // If the rigid body exist, update the container position and rotation according to the rigid body + // If the rigidBody exist, update the container position and rotation according to the rigidBody if (this.rigidBody && this.collider) { // Translation - const newContainerPosition = this.rigidBody.rigidBody.translation() + const newContainerPosition = this.rigidBody.__RIGIDBODY__.translation() // Remove offset - newContainerPosition.x -= this.collider.colliderPositionOffset.x - newContainerPosition.y -= this.collider.colliderPositionOffset.y + newContainerPosition.x -= this.rigidBody.__RIGIDBODY_POSITION_OFFSET__.x + newContainerPosition.y -= this.rigidBody.__RIGIDBODY_POSITION_OFFSET__.y // Rotation - let newContainerRotation = this.rigidBody.rigidBody.rotation() + let newContainerRotation = this.rigidBody.__RIGIDBODY__.rotation() // Remove offset - newContainerRotation -= this.collider.colliderRotationOffset + newContainerRotation -= this.rigidBody.__RIGIDBODY_ROTATION_OFFSET__ // Apply the new transforms to the container this.container.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) this.container.rotation = -newContainerRotation - // Update position and rotation properties of the component according to the rigid body + // Update position and rotation properties of the component according to the rigidBody this.transform.position = { x: this.container.position.x / 100, y: -this.container.position.y / 100, } this.transform.rotation = this.container.rotation - // If a sensor exists, update its position and rotation according to the rigid body - if (this.sensor) { - // Apply offset to the sensor - newContainerPosition.x += this.sensor.collider.colliderPositionOffset.x - newContainerPosition.y += this.sensor.collider.colliderPositionOffset.y - this.sensor.rigidBody.setTranslation(newContainerPosition, true) - this.sensor.rigidBody.setRotation(newContainerRotation, true) - } } // Else if the collider exist, update the container position and rotation according to the collider else if (this.collider) { // Get the new transforms from the collider // Transforms - const newContainerPosition = this.collider.collider.translation() + const newContainerPosition = this.collider.__COLLIDER__.translation() // Remove offset - newContainerPosition.x -= this.collider.colliderPositionOffset.x - newContainerPosition.y -= this.collider.colliderPositionOffset.y + newContainerPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x + newContainerPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y // Rotation - let newContainerRotation = this.collider.collider.rotation() + let newContainerRotation = this.collider.__COLLIDER__.rotation() // Remove offset - newContainerRotation -= this.collider.colliderRotationOffset + newContainerRotation -= this.collider.__COLLIDER_ROTATION_OFFSET__ // Apply the new transforms to the container this.container.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) @@ -159,26 +151,25 @@ export abstract class FComponent extends FComponentCore { y: -this.container.position.y / 100, } this.transform.rotation = this.container.rotation - - // If a sensor exists, update its position and rotation according to the collider - if (this.sensor) { - // Apply offset to the sensor - newContainerPosition.x += this.sensor.collider.colliderPositionOffset.x - newContainerPosition.y += this.sensor.collider.colliderPositionOffset.y - this.sensor.rigidBody.setTranslation(newContainerPosition, true) - this.sensor.rigidBody.setRotation(newContainerRotation, true) - } } else { - // If the rigid body and collider doesn't exist, update the container position and rotation according to the default values + // If the rigidBody and collider doesn't exist, update the container position and rotation according to the default values // The y position is inverted because the y axis is inverted in PIXI.js compared to Rapier this.container.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) this.container.rotation = this.transform.rotation - // If a sensor exists, update its position and rotation according to the default values - if (this.sensor) { - this.sensor.rigidBody.setTranslation({ x: this.transform.position.x, y: this.transform.position.y }, true) - this.sensor.rigidBody.setRotation(this.transform.rotation, true) + // Update position and rotation properties of the component according to the default values + this.transform.position = { + x: this.container.position.x / 100, + y: -this.container.position.y / 100, } + this.transform.rotation = this.container.rotation + } + + // If a sensor exists, update its transforms + if (this.sensor) { + this.sensor.updatePosition() + this.sensor.updateRotation() + this.sensor.updateScale() } } @@ -195,12 +186,15 @@ export abstract class FComponent extends FComponentCore { setPosition(options: { x: number, y: number }): void { this.transform.position = { x: options.x, y: options.y } this.container.position.set(options.x * 100, -options.y * 100) - // If a collider exists, update its translation - if (this.collider) - this.collider.collider.setTranslation(new RAPIER.Vector2(options.x, options.y)) - // If a rigid body exists, update its translation + // If a rigidBody exists, update its position if (this.rigidBody) - this.rigidBody.rigidBody.setTranslation(new RAPIER.Vector2(options.x, options.y), true) + this.rigidBody.updatePosition() + // Else if a collider exists, update its position + else if (this.collider) + this.collider.updatePosition() + // If a sensor exists, update its position + if (this.sensor) + this.sensor.updatePosition() } /** @@ -217,20 +211,15 @@ export abstract class FComponent extends FComponentCore { this.transform.scale = { x: options.x, y: options.y } this.container.height = options.y * 100 this.container.width = options.x * 100 - // If a collider exists - if (this.collider) { - // If the collider is a cuboid, update its half extents - if (this.collider.collider.shape.type === RAPIER.ShapeType.Cuboid) { - this.collider.collider.setHalfExtents(new RAPIER.Vector2(options.x / 2, options.y / 2)) - } - // If the collider is a ball, update its radius - else if (this.collider.collider.shape.type === RAPIER.ShapeType.Ball) { - this.collider.collider.setRadius( - // Get the maximum value of x and y - Math.max(options.x, options.y) / 2, - ) - } - } + // If a rigidBody exists, update its scale + if (this.rigidBody) + this.rigidBody.updateScale() + // Else if a collider exists, update its scale + else if (this.collider) + this.collider.updateScale() + // If a sensor exists, update its scale + if (this.sensor) + this.sensor.updateScale() } /** @@ -244,12 +233,15 @@ export abstract class FComponent extends FComponentCore { setRotation(r: number): void { this.transform.rotation = r this.container.rotation = r - // If a collider exists, update its rotation - if (this.collider) - this.collider.collider.setRotation(r) - // If a rigid body exists, update its rotation + // If a rigidBody exists, update its rotation if (this.rigidBody) - this.rigidBody.rigidBody.setRotation(r, true) + this.rigidBody.updateRotation() + // Else if a collider exists, update its rotation + else if (this.collider) + this.collider.updateRotation() + // If a sensor exists, update its rotation + if (this.sensor) + this.sensor.updateRotation() } /** @@ -265,17 +257,17 @@ export abstract class FComponent extends FComponentCore { } /** - * Init a rigid body for the model. - * @param options The options for the rigid body. - * @param options.position The position of the rigid body. - * @param options.scale The scale of the rigid body. - * @param options.rotation The rotation of the rigid body. - * @param options.shape The shape of the rigid body. - * @param options.lockTranslations Lock the translations of the rigid body. - * @param options.lockRotations Lock the rotations of the rigid body. - * @param options.enabledTranslations Enable only specific translations of the rigid body. - * @param options.enabledTranslations.enableX Enable the x translation of the rigid body. - * @param options.enabledTranslations.enableY Enable the y translation of the rigid body. + * Init a rigidBody for the model. + * @param options The options for the rigidBody. + * @param options.position The position of the rigidBody. + * @param options.scale The scale of the rigidBody. + * @param options.rotation The rotation of the rigidBody. + * @param options.shape The shape of the rigidBody. + * @param options.lockTranslations Lock the translations of the rigidBody. + * @param options.lockRotations Lock the rotations of the rigidBody. + * @param options.enabledTranslations Enable only specific translations of the rigidBody. + * @param options.enabledTranslations.enableX Enable the x translation of the rigidBody. + * @param options.enabledTranslations.enableY Enable the y translation of the rigidBody. * @example * ```ts * component.initRigidBody({ @@ -287,7 +279,7 @@ export abstract class FComponent extends FComponentCore { * ``` */ initRigidBody(options?: FRigidBodyOptions): void { - // Initialize the rigid body + // Initialize the rigidBody this.rigidBody = new FRigidBody(this, options) // Set the collider @@ -295,7 +287,7 @@ export abstract class FComponent extends FComponentCore { } /** - * Only init a collider for the component, without a rigid body. + * Only init a collider for the component, without a rigidBody. * This is useful for static objects. * @param options The options for the collider. * @param options.position The position of the collider. @@ -348,9 +340,9 @@ export abstract class FComponent extends FComponentCore { onCollisionWith(classOrObject: any, callback: (data: OnCollisionWithData) => void): () => void { // Activate collision events if they are not already activated - if (this.sensor && this.sensor.collider.collider.activeEvents() === RAPIER.ActiveEvents.NONE) { + if (this.sensor && this.sensor.collider.__COLLIDER__.activeEvents() === RAPIER.ActiveEvents.NONE) { // Set the active events - this.sensor.collider.collider.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS) + this.sensor.collider.__COLLIDER__.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS) } // Call the core onCollisionWith method return super.onCollisionWith(classOrObject, callback) diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 713a0d1c..3f1f85db 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -27,31 +27,45 @@ export class FRigidBody { /** * RAPIER RigidBody */ - rigidBody: RAPIER.RigidBody + __RIGIDBODY__: RAPIER.RigidBody /** * Fibbo Collider */ collider: FCollider + /** + * Position Offset for the rigidBody. + * This is used to adjust the rigidBody position relative to the mesh. + */ + __RIGIDBODY_POSITION_OFFSET__: { x: number, y: number } + /** + * Rotation Offset for the rigidBody. + * This is used to adjust the rigidBody position relative to the mesh. + */ + __RIGIDBODY_ROTATION_OFFSET__: number + /** + * The component the rigidBody is attached to. + */ + component: FComponent /** - * Creates a rigid body for the given component. - * @param component The component which the collider will be attached to. - * @param options The options for the rigid body. - * @param options.position The position of the rigid body. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigid body. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigid body. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigid body. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBodyType The type of the rigid body. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. - * @param options.lockTranslations If true, the rigid body will not be able to move. - * @param options.lockRotations If true, the rigid body will not be able to rotate. + * Creates a rigidBody for the given component. + * @param component The component which the rigidBody will be attached to. + * @param options The options for the rigidBody. + * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. + * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. + * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.lockTranslations If true, the rigidBody will not be able to move. + * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. - * @param options.enabledTranslations.enableX If true, the rigid body will be able to move on the x-axis. - * @param options.enabledTranslations.enableY If true, the rigid body will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the rigid body will be able to move on the z-axis. + * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. + * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the rigid body will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the rigid body will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the rigid body will be able to rotate on the z-axis. + * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. + * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. + * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts * const rigidBody = new FRigidBody({ @@ -84,7 +98,13 @@ export class FRigidBody { // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigid body') + throw new Error('FibboError: FScene must have a world to create a rigidBody') + + // Store the offset + this.__RIGIDBODY_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } + this.__RIGIDBODY_ROTATION_OFFSET__ = options.rotation + // Store the component + this.component = component // If rotation degree is given, convert it to radians if (options.rotationDegree) { @@ -92,7 +112,7 @@ export class FRigidBody { options.rotation = (options.rotationDegree * Math.PI) / 180 } - // Create a rigid body description according to the type + // Create a rigidBody description according to the type const rigidBodyDesc = new RAPIER.RigidBodyDesc(options.rigidBodyType as RAPIER.RigidBodyType) // Interprete the given position as relative to the component's position rigidBodyDesc.setTranslation( @@ -103,28 +123,78 @@ export class FRigidBody { // Interprete the given rotation as relative to the component's rotation rigidBodyDesc.setRotation(component.transform.rotation + options.rotation) - // Create the rigid body - this.rigidBody = component.scene.world.createRigidBody(rigidBodyDesc) + // Create the rigidBody + this.__RIGIDBODY__ = component.scene.world.createRigidBody(rigidBodyDesc) // Lock the translation if needed if (options.lockTranslations) - this.rigidBody.lockTranslations(true, true) + this.__RIGIDBODY__.lockTranslations(true, true) // Lock the rotation if needed if (options.lockRotations) - this.rigidBody.lockRotations(true, true) + this.__RIGIDBODY__.lockRotations(true, true) // Enable only specific translations if needed if (options.enabledTranslations) { - this.rigidBody.setEnabledTranslations( + this.__RIGIDBODY__.setEnabledTranslations( options.enabledTranslations.enableX, options.enabledTranslations.enableY, true, ) } - // Create the collider + // Create the collider attached to the rigidBody this.collider = new FCollider(component, { ...options, - rigidBody: this.rigidBody, + rigidBody: this.__RIGIDBODY__, }) } + + /** + * Set the position of the rigidBody. + * @param position The new position of the rigidBody. + * @param position.x The new x position of the rigidBody. + * @param position.y The new y position of the rigidBody. + */ + setPosition(position: { x: number, y: number }) { + this.__RIGIDBODY__.setTranslation(position, true) + this.collider.setPosition(position) + } + + /** + * Set the rotation of the rigidBody. + * @param rotation The new rotation of the rigidBody. + */ + setRotation(rotation: number) { + this.__RIGIDBODY__.setRotation(rotation, true) + this.collider.setRotation(rotation) + } + + /** + * Update the position of the rigidBody according to the component's position. + * This takes into account the position offset. + */ + updatePosition() { + const newPosition = this.component.transform.position + newPosition.x += this.__RIGIDBODY_POSITION_OFFSET__.x + newPosition.y += this.__RIGIDBODY_POSITION_OFFSET__.y + this.setPosition(newPosition) + this.collider.setPosition(newPosition) + } + + /** + * Update the rotation of the rigidBody according to the component's rotation. + * This takes into account the rotation offset. + */ + updateRotation() { + const newRotation = this.component.transform.rotation + this.__RIGIDBODY_ROTATION_OFFSET__ + this.setRotation(newRotation) + this.collider.setRotation(newRotation) + } + + /** + * Update the scale of the rigidBody's collider according to the component's scale. + * This takes into account the scale offset. + */ + updateScale() { + this.collider.updateScale() + } } diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index 7c137b2c..2a797300 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -201,10 +201,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) }) } else { @@ -214,10 +214,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) } removeComponent(component: FComponent): void { @@ -228,17 +228,17 @@ export class FScene extends FSceneCore { // Remove colliders and rigidBodies from rapier world if (component.rigidBody) - this.world.removeRigidBody(component.rigidBody.rigidBody) + this.world.removeRigidBody(component.rigidBody.__RIGIDBODY__) if (component.collider) - this.world.removeCollider(component.collider.collider, false) + this.world.removeCollider(component.collider.__COLLIDER__, false) if (component.sensor) - this.world.removeCollider(component.sensor.collider.collider, false) + this.world.removeCollider(component.sensor.collider.__COLLIDER__, false) // Remove handle from rapier map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.collider.handle) + this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.__COLLIDER__.handle) if (component.collider) - this.__RAPIER_TO_COMPONENT__.delete(component.collider.collider.handle) + this.__RAPIER_TO_COMPONENT__.delete(component.collider.__COLLIDER__.handle) } /** diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index 52946919..7ac6b6a9 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -28,7 +28,7 @@ export class FCharacterControllerD extends FCharacterController { this.component.rigidBody?.rigidBody.applyImpulse(new THREE.Vector3(0, 0.1, 0), true) }) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.Dynamic, lockRotations: true, diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index 24366413..f4ee607c 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -21,7 +21,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { constructor(scene: FScene, options: FCharacterControllerOptions) { super(scene, options) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, ...options, @@ -34,7 +34,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { */ const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body + // Apply the movement to the rigidBody this.component.rigidBody?.rigidBody.setNextKinematicTranslation({ x: this.component.rigidBody.rigidBody.translation().x + correctedMovement.x * delta * this.speed * 64, y: this.component.rigidBody.rigidBody.translation().y + correctedMovement.y * delta * this.speed * 64, @@ -43,7 +43,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { // If one of the inputs is true, apply the corrected rotation if (this.inputs.forward || this.inputs.backward || this.inputs.left || this.inputs.right) { - // Apply the rotation to the rigid body + // Apply the rotation to the rigidBody this.component.rigidBody?.rigidBody.setNextKinematicRotation(this.getCorrectedRotation()) } } diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index 5e9b3fa5..d6f98b64 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -21,7 +21,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { constructor(scene: FScene, options: FCharacterControllerOptions) { super(scene, options) - // Initialize the rigid body + // Initialize the rigidBody this.component.initRigidBody({ rigidBodyType: RAPIER.RigidBodyType.KinematicVelocityBased, ...options, @@ -34,7 +34,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { */ const correctedMovement = this.getCorrectedMovements() - // Apply the movement to the rigid body + // Apply the movement to the rigidBody this.component.rigidBody?.rigidBody.setLinvel({ x: correctedMovement.x / delta, y: correctedMovement.y / delta, diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index 6dc2c542..1dbccf1e 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -42,7 +42,7 @@ export class FCollider { * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBody The rigid body to attach the collider to. (optional) + * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example * ```ts @@ -72,7 +72,7 @@ export class FCollider { // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigid body') + throw new Error('FibboError: FScene must have a world to create a rigidBody') // If rotation degree is given, convert it to radians if (options.rotationDegree) { diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 539f2850..78feedd8 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -107,7 +107,7 @@ export abstract class FComponent extends FComponentCore { onFrame(_delta: number): void { super.onFrame(_delta) - // If the rigid body and mesh exist, update the mesh position and rotation according to the rigid body + // If the rigidBody and mesh exist, update the mesh position and rotation according to the rigidBody if (this.rigidBody && this.collider && this.mesh) { // Translation const newMeshPosition = this.rigidBody.rigidBody.translation() @@ -134,10 +134,10 @@ export abstract class FComponent extends FComponentCore { this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) this.mesh.setRotationFromEuler(newMeshRotation) - // Update position and rotation properties of the component according to the rigid body + // Update position and rotation properties of the component according to the rigidBody this.transform.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) this.transform.rotation.set(newMeshRotation.x, newMeshRotation.y, newMeshRotation.z) - // If a sensor exists, update its position and rotation according to the rigid body + // If a sensor exists, update its position and rotation according to the rigidBody if (this.sensor) { // Apply offset to the sensor newMeshPosition.x += this.sensor.collider.colliderPositionOffset.x @@ -177,7 +177,7 @@ export abstract class FComponent extends FComponentCore { this.transform.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) this.transform.rotation.set(newMeshRotation.x, newMeshRotation.y, newMeshRotation.z) } - // If the rigid body and collider doesn't exist, update the mesh position and rotation according to the default values + // If the rigidBody and collider doesn't exist, update the mesh position and rotation according to the default values else if (this.mesh) { this.mesh.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) this.mesh.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) @@ -209,7 +209,7 @@ export abstract class FComponent extends FComponentCore { // If a collider exists, update its translation if (this.collider) this.collider.collider.setTranslation({ x: options.x, y: options.y, z: options.z }) - // If a rigid body exists, update its translation + // If a rigidBody exists, update its translation if (this.rigidBody) this.rigidBody.rigidBody.setTranslation({ x: options.x, y: options.y, z: options.z }, true) } @@ -274,7 +274,7 @@ export abstract class FComponent extends FComponentCore { // If a collider exists, update its rotation if (this.collider) this.collider.collider.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(options.x, options.y, options.z))) - // If a rigid body exists, update its rotation + // If a rigidBody exists, update its rotation if (this.rigidBody) this.rigidBody.rigidBody.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(options.x, options.y, options.z)), true) } @@ -302,23 +302,23 @@ export abstract class FComponent extends FComponentCore { } /** - * Init a rigid body for the component. - * @param options The options for the rigid body. - * @param options.position The position of the rigid body. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigid body. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigid body. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigid body. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBodyType The type of the rigid body. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. - * @param options.lockTranslations If true, the rigid body will not be able to move. - * @param options.lockRotations If true, the rigid body will not be able to rotate. + * Init a rigidBody for the component. + * @param options The options for the rigidBody. + * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. + * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. + * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.lockTranslations If true, the rigidBody will not be able to move. + * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. - * @param options.enabledTranslations.enableX If true, the rigid body will be able to move on the x-axis. - * @param options.enabledTranslations.enableY If true, the rigid body will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the rigid body will be able to move on the z-axis. + * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. + * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the rigid body will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the rigid body will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the rigid body will be able to rotate on the z-axis. + * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. + * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. + * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts * component.initRigidBody({ @@ -330,7 +330,7 @@ export abstract class FComponent extends FComponentCore { * ``` */ initRigidBody(options?: FRigidBodyOptions): void { - // Initialize the rigid body + // Initialize the rigidBody this.rigidBody = new FRigidBody(this, options) // Set the collider @@ -338,7 +338,7 @@ export abstract class FComponent extends FComponentCore { } /** - * Only init a collider for the component, without a rigid body. + * Only init a collider for the component, without a rigidBody. * This is useful for static objects. * @param options The options for the collider. * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. @@ -346,7 +346,7 @@ export abstract class FComponent extends FComponentCore { * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBody The rigid body to attach the collider to. (optional) + * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example * ```ts diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index c3494324..f12c4ce8 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -41,24 +41,24 @@ export class FRigidBody { collider: FCollider /** - * Creates a rigid body for the given component. + * Creates a rigidBody for the given component. * @param component The component which the collider will be attached to. - * @param options The options for the rigid body. - * @param options.position The position of the rigid body. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigid body. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigid body. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigid body. If not defined, it will default to FShapes.CUBE. - * @param options.rigidBodyType The type of the rigid body. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. - * @param options.lockTranslations If true, the rigid body will not be able to move. - * @param options.lockRotations If true, the rigid body will not be able to rotate. + * @param options The options for the rigidBody. + * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. + * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. + * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.lockTranslations If true, the rigidBody will not be able to move. + * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. - * @param options.enabledTranslations.enableX If true, the rigid body will be able to move on the x-axis. - * @param options.enabledTranslations.enableY If true, the rigid body will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the rigid body will be able to move on the z-axis. + * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. + * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the rigid body will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the rigid body will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the rigid body will be able to rotate on the z-axis. + * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. + * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. + * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts * const rigidBody = new FRigidBody({ @@ -91,7 +91,7 @@ export class FRigidBody { // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigid body') + throw new Error('FibboError: FScene must have a world to create a rigidBody') // If rotation degree is given, convert it to radians if (options.rotationDegree) { @@ -100,7 +100,7 @@ export class FRigidBody { options.rotation.z = THREE.MathUtils.degToRad(options.rotationDegree.z) } - // Create a rigid body description according to the type + // Create a rigidBody description according to the type const rigidBodyDesc = new RAPIER.RigidBodyDesc(options.rigidBodyType as RAPIER.RigidBodyType) // Interprete the given position as relative to the component's position rigidBodyDesc.setTranslation( @@ -118,7 +118,7 @@ export class FRigidBody { ), )) - // Create the rigid body + // Create the rigidBody this.rigidBody = component.scene.world.createRigidBody(rigidBodyDesc) // Lock the translation if needed From 089cd1c016f7b46d2d8be7273032b9c697408b04 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 30 Sep 2024 18:41:27 +0200 Subject: [PATCH 02/36] feat: setRotationDegree to RigidBody + sample not working test --- packages/2d/src/core/FRigidBody.ts | 10 ++++++++++ packages/2d/test/collider.test.ts | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 packages/2d/test/collider.test.ts diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 3f1f85db..c7ac930f 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -168,6 +168,16 @@ export class FRigidBody { this.collider.setRotation(rotation) } + /** + * Set the rotation of the rigidBody in degrees. + * @param rotation The new rotation of the rigidBody in degrees. + */ + setRotationDegree(rotation: number) { + const newRotation = (rotation * Math.PI) / 180 + this.__RIGIDBODY__.setRotation(newRotation, true) + this.collider.setRotation(newRotation) + } + /** * Update the position of the rigidBody according to the component's position. * This takes into account the position offset. diff --git a/packages/2d/test/collider.test.ts b/packages/2d/test/collider.test.ts new file mode 100644 index 00000000..6a9b5a06 --- /dev/null +++ b/packages/2d/test/collider.test.ts @@ -0,0 +1,18 @@ +import { beforeEach, describe, expect, it } from 'vitest' +import { FRectangle, FScene } from '@fibbojs/2d' + +describe('fCollider', () => { + let scene: FScene + + beforeEach(async () => { + scene = new FScene() + await scene.init() + await scene.initPhysics() + }) + + it('should create a collider with default options', () => { + const rectangle = new FRectangle(scene) + rectangle.initCollider() + expect(rectangle.collider).toBeDefined() + }) +}) From b4c3052b04bbce2fb3b535686f79ddb70b565732 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 30 Sep 2024 23:06:59 +0200 Subject: [PATCH 03/36] chore: configure browser tests --- .github/workflows/run-tests.yml | 11 +-- package-lock.json | 78 ++++++++++++++++++- package.json | 4 +- packages/2d/package.json | 2 +- .../2d/test/{ => browser}/collider.test.ts | 0 packages/2d/test/{ => unit}/index.test.ts | 0 vitest.workspace.ts | 34 ++++++++ 7 files changed, 121 insertions(+), 8 deletions(-) rename packages/2d/test/{ => browser}/collider.test.ts (100%) rename packages/2d/test/{ => unit}/index.test.ts (100%) create mode 100644 vitest.workspace.ts diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6ff13785..8b625626 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,16 +9,14 @@ on: paths: - package.json - package-lock.json - - 'src/**' - - 'test/**' + - 'packages/**' pull_request: branches: - main paths: - package.json - package-lock.json - - 'src/**' - - 'test/**' + - 'packages/**' jobs: test: @@ -29,6 +27,9 @@ jobs: with: node-version: 22 registry-url: https://registry.npmjs.org/ - - run: npm ci + - name: Install Dependencies + run: npm ci + - name: Install Playwright Browsers + run: npx playwright install --with-deps - name: Test all packages run: npx nx run-many --target=test --all diff --git a/package-lock.json b/package-lock.json index 08befca5..f67bd4cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,10 +33,12 @@ "@types/node": "^20.12.7", "@types/three": "^0.166.0", "@vitejs/plugin-vue": "^5.1.2", + "@vitest/browser": "^1.6.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.3.1", "eslint": "^9.7.0", "nx": "19.6.1", + "playwright": "^1.47.2", "rimraf": "^5.0.5", "sass": "^1.77.8", "typedoc": "^0.26.5", @@ -45,7 +47,7 @@ "unbuild": "^2.0.0", "vite": "^5.2.9", "vitepress": "^1.1.4", - "vitest": "^1.5.0", + "vitest": "^1.6.0", "vue": "^3.4.37", "vue-tsc": "^2.0.29" } @@ -5084,6 +5086,36 @@ "vue": "^3.2.25" } }, + "node_modules/@vitest/browser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-1.6.0.tgz", + "integrity": "sha512-3Wpp9h1hf++rRVPvoXevkdHybLhJVn7MwIMKMIh08tVaoDMmT6fnNhbP222Z48V9PptpYeA5zvH9Ct/ZcaAzmQ==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.6.0", + "magic-string": "^0.30.5", + "sirv": "^2.0.4" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "playwright": "*", + "vitest": "1.6.0", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, "node_modules/@vitest/coverage-v8": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", @@ -11003,6 +11035,50 @@ "pathe": "^1.1.2" } }, + "node_modules/playwright": { + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", + "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", + "dev": true, + "dependencies": { + "playwright-core": "1.47.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", + "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", diff --git a/package.json b/package.json index 50800818..a6a09690 100644 --- a/package.json +++ b/package.json @@ -55,10 +55,12 @@ "@types/node": "^20.12.7", "@types/three": "^0.166.0", "@vitejs/plugin-vue": "^5.1.2", + "@vitest/browser": "^1.6.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.3.1", "eslint": "^9.7.0", "nx": "19.6.1", + "playwright": "^1.47.2", "rimraf": "^5.0.5", "sass": "^1.77.8", "typedoc": "^0.26.5", @@ -67,7 +69,7 @@ "unbuild": "^2.0.0", "vite": "^5.2.9", "vitepress": "^1.1.4", - "vitest": "^1.5.0", + "vitest": "^1.6.0", "vue": "^3.4.37", "vue-tsc": "^2.0.29" }, diff --git a/packages/2d/package.json b/packages/2d/package.json index 6392025b..867792a3 100644 --- a/packages/2d/package.json +++ b/packages/2d/package.json @@ -40,7 +40,7 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run", + "test": "vitest run --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/packages/2d/test/collider.test.ts b/packages/2d/test/browser/collider.test.ts similarity index 100% rename from packages/2d/test/collider.test.ts rename to packages/2d/test/browser/collider.test.ts diff --git a/packages/2d/test/index.test.ts b/packages/2d/test/unit/index.test.ts similarity index 100% rename from packages/2d/test/index.test.ts rename to packages/2d/test/unit/index.test.ts diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 00000000..550e7370 --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,34 @@ +// vitest.workspace.ts +import { defineWorkspace } from 'vitest/config' +import wasm from 'vite-plugin-wasm' + +export default defineWorkspace([ + // Node-based tests + { + test: { + include: [ + './**/test/unit/**/*.test.ts', + ], + name: 'unit', + environment: 'node', + }, + }, + // Browser-based tests + { + plugins: [ + wasm(), + ], + test: { + include: [ + './**/test/browser/**/*.test.ts', + ], + name: 'browser', + browser: { + enabled: true, + provider: 'playwright', + name: 'chromium', + headless: true, + }, + }, + }, +]) From 9ce2a080b50fe9dcde102131565d25de3198815c Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 30 Sep 2024 23:15:37 +0200 Subject: [PATCH 04/36] chore: fix test config (but expect error for testing purpose here) --- .vscode/settings.json | 3 ++- nx.json | 2 +- packages/2d/test/browser/collider.test.ts | 2 +- vitest.workspace.ts | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ffa762d3..5d401540 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -52,6 +52,7 @@ "**/node_modules": true, "**/tsconfig.json": true, "**/*.d.ts": true, - "**/.gitignore": true + "**/.gitignore": true, + "**/vitest.workspace.ts": true } } diff --git a/nx.json b/nx.json index e0b08cf5..c9bc839d 100644 --- a/nx.json +++ b/nx.json @@ -32,7 +32,7 @@ "cache": true }, "test": { - "dependsOn": ["^build"], + "dependsOn": ["^build", "build"], "cache": true }, "docs:build": { diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 6a9b5a06..19d46931 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -12,7 +12,7 @@ describe('fCollider', () => { it('should create a collider with default options', () => { const rectangle = new FRectangle(scene) - rectangle.initCollider() + // rectangle.initCollider() expect(rectangle.collider).toBeDefined() }) }) diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 550e7370..5d03c182 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -2,6 +2,10 @@ import { defineWorkspace } from 'vitest/config' import wasm from 'vite-plugin-wasm' +/** + * This configuration will be used to run tests for all packages. + * This means paths are relative to the root of each package. + */ export default defineWorkspace([ // Node-based tests { From 3eae9a96a0fc245b7fbe428e4a9da9a95e8480c7 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 30 Sep 2024 23:17:55 +0200 Subject: [PATCH 05/36] chore: fix test --- packages/2d/test/browser/collider.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 19d46931..6a9b5a06 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -12,7 +12,7 @@ describe('fCollider', () => { it('should create a collider with default options', () => { const rectangle = new FRectangle(scene) - // rectangle.initCollider() + rectangle.initCollider() expect(rectangle.collider).toBeDefined() }) }) From 9eea0eee807c759dc851b881825469e288bca564 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 1 Oct 2024 22:19:16 +0200 Subject: [PATCH 06/36] test: add tests for FCollider in 2d --- .../src/controllers/FCharacterController.ts | 2 +- packages/2d/src/core/FCollider.ts | 106 ++++++++++++++++-- packages/2d/src/core/FComponent.ts | 11 +- packages/2d/src/core/FRigidBody.ts | 2 +- packages/2d/src/types/FShapes.ts | 2 +- packages/2d/test/browser/collider.test.ts | 66 ++++++++++- 6 files changed, 167 insertions(+), 22 deletions(-) diff --git a/packages/2d/src/controllers/FCharacterController.ts b/packages/2d/src/controllers/FCharacterController.ts index 51552e1d..2e106ce0 100644 --- a/packages/2d/src/controllers/FCharacterController.ts +++ b/packages/2d/src/controllers/FCharacterController.ts @@ -107,7 +107,7 @@ export abstract class FCharacterController extends FController { // Initialize a sensor this.component.initSensor({ - shape: FShapes.SQUARE, + shape: FShapes.RECTANGLE, scale: { x: 1.1, y: 1.1 }, }) } diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 0b948a33..01b3d894 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -40,6 +40,10 @@ export class FCollider { * The component the collider is attached to. */ component: FComponent + /** + * The shape of the collider. + */ + shape: FShapes /** * Creates a collider for a given component. @@ -69,7 +73,7 @@ export class FCollider { scale: { x: 1, y: 1 }, rotation: 0, rotationDegree: undefined, - shape: FShapes.SQUARE, + shape: FShapes.RECTANGLE, rigidBody: undefined, sensor: false, } @@ -80,7 +84,7 @@ export class FCollider { // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigidBody') + throw new Error('FibboError: FScene must have a world to create a collider') // If rotation degree is given, convert it to radians if (options.rotationDegree) { @@ -88,15 +92,15 @@ export class FCollider { options.rotation = (options.rotationDegree * Math.PI) / 180 } - // Store the collider offset + // Store the options this.__COLLIDER_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } this.__COLLIDER_ROTATION_OFFSET__ = options.rotation this.__COLLIDER_SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y } - // Store the component this.component = component + this.shape = options.shape // Devide the scale by 2 for the collider (RAPIER uses half-extents) - // Also interpete the scale as relative to the component's scale + // Also interpete the scale as relative to its component's scale options.scale = { x: component.transform.scale.x / 2 * options.scale.x, y: component.transform.scale.y / 2 * options.scale.y, @@ -105,7 +109,7 @@ export class FCollider { // Create a collider description according to the shape given let colliderDesc switch (options.shape) { - case FShapes.SQUARE: + case FShapes.RECTANGLE: colliderDesc = RAPIER.ColliderDesc.cuboid(options.scale.x, options.scale.y) break case FShapes.CIRCLE: @@ -120,13 +124,13 @@ export class FCollider { // If no rigidbody given, the collider is free : set translation and rotation for the collider if (options.rigidBody === undefined) { - // Interprete the given position as relative to the component's position + // Interprete the given position as relative to its component's position const newPosition = component.transform.position newPosition.x += options.position.x newPosition.y += options.position.y colliderDesc.setTranslation(newPosition.x, newPosition.y) - // Interprete the given rotation as relative to the component's rotation + // Interprete the given rotation as relative to its component's rotation const finalRotation = component.transform.rotation + options.rotation colliderDesc.setRotation(finalRotation) } @@ -187,7 +191,7 @@ export class FCollider { } /** - * Update the position of the collider according to the component's position. + * Update the position of the collider according to its component's position. * This takes into account the position offset. */ updatePosition() { @@ -198,7 +202,7 @@ export class FCollider { } /** - * Update the rotation of the collider according to the component's rotation. + * Update the rotation of the collider according to its component's rotation. * This takes into account the rotation offset. */ updateRotation() { @@ -206,7 +210,7 @@ export class FCollider { } /** - * Update the scale of the collider according to the component's scale. + * Update the scale of the collider according to its component's scale. * This takes into account the scale offset. */ updateScale() { @@ -222,4 +226,84 @@ export class FCollider { ) } } + + // Setters & getters for transform properties + + get position() { + return this.__COLLIDER__.translation() + } + + set position(position: { x: number, y: number }) { + this.setPosition(position) + } + + get x() { + return this.__COLLIDER__.translation().x + } + + set x(x: number) { + this.setPosition({ x, y: this.y }) + } + + get y() { + return this.__COLLIDER__.translation().y + } + + set y(y: number) { + this.setPosition({ x: this.x, y }) + } + + get rotation() { + return this.__COLLIDER__.rotation() + } + + set rotation(rotation: number) { + this.setRotation(rotation) + } + + get rotationDegree() { + return (this.__COLLIDER__.rotation() * 180) / Math.PI + } + + set rotationDegree(rotation: number) { + this.setRotationDegree(rotation) + } + + get scale() { + if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { + return { + x: this.__COLLIDER__.shape.halfExtents.x * 2, + y: this.__COLLIDER__.shape.halfExtents.y * 2, + } + } + else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + return { + x: this.__COLLIDER__.shape.radius * 2, + y: this.__COLLIDER__.shape.radius * 2, + } + } + else { + return { x: 0, y: 0 } + } + } + + set scale(scale: { x: number, y: number }) { + this.setScale(scale) + } + + get scaleX() { + return this.scale.x + } + + set scaleX(x: number) { + this.setScale({ x, y: this.scale.y }) + } + + get scaleY() { + return this.scale.y + } + + set scaleY(y: number) { + this.setScale({ x: this.scale.x, y }) + } } diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index de79088a..d401a5a7 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -50,15 +50,15 @@ export abstract class FComponent extends FComponentCore { /** * RAPIER RigidBody */ - rigidBody?: FRigidBody + declare rigidBody: FRigidBody /** * RAPIER Collider */ - collider?: FCollider + declare collider: FCollider /** * Sensor (a collider that doesn't collide with other colliders, but still triggers events) */ - sensor?: FRigidBody + declare sensor: FRigidBody /** * @param scene The 2D scene where the component will be added. @@ -348,9 +348,8 @@ export abstract class FComponent extends FComponentCore { return super.onCollisionWith(classOrObject, callback) } - /** - * Setters & getters for transform properties - */ + // Setters & getters for transform properties + get position(): { x: number, y: number } { return this.transform.position } diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index c7ac930f..e6c87404 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -83,7 +83,7 @@ export class FRigidBody { scale: { x: 1, y: 1, z: 1 }, rotation: 0, rotationDegree: undefined, - shape: FShapes.SQUARE, + shape: FShapes.RECTANGLE, sensor: false, rigidBodyType: RAPIER.RigidBodyType.Dynamic, lockTranslations: false, diff --git a/packages/2d/src/types/FShapes.ts b/packages/2d/src/types/FShapes.ts index 5993ac10..3223ce6f 100644 --- a/packages/2d/src/types/FShapes.ts +++ b/packages/2d/src/types/FShapes.ts @@ -1,5 +1,5 @@ // FShapes type export enum FShapes { - SQUARE = 'Square', + RECTANGLE = 'Rectangle', CIRCLE = 'Circle', } diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 6a9b5a06..3a13ae1b 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -1,5 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest' -import { FRectangle, FScene } from '@fibbojs/2d' +import { FRectangle, FScene, FShapes } from '@fibbojs/2d' +import RAPIER from '@dimforge/rapier2d' describe('fCollider', () => { let scene: FScene @@ -11,8 +12,69 @@ describe('fCollider', () => { }) it('should create a collider with default options', () => { - const rectangle = new FRectangle(scene) + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) rectangle.initCollider() expect(rectangle.collider).toBeDefined() + // Validate offset + expect(rectangle.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: 0, y: 0 }) + expect(rectangle.collider.__COLLIDER_ROTATION_OFFSET__).toEqual(0) + expect(rectangle.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1 }) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(0) + expect(rectangle.collider.position.y).toEqual(0) + expect(rectangle.collider.rotation).toEqual(0) + expect(rectangle.collider.scale.x).toEqual(1) + expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.shape).toEqual(FShapes.RECTANGLE) + }) + + it('should create a collider with custom transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 1, y: 1 }, + rotation: 0.1, + scale: { x: 1, y: 2 }, + }) + rectangle.initCollider({ + position: { x: -2, y: 3 }, + rotation: 0.3, + scale: { x: 2, y: 2 }, + }) + expect(rectangle.collider).toBeDefined() + // Validate offset + expect(rectangle.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: -2, y: 3 }) + expect(rectangle.collider.__COLLIDER_ROTATION_OFFSET__).toEqual(0.3) + expect(rectangle.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(-1) + expect(rectangle.collider.position.y).toEqual(4) + expect(rectangle.collider.rotation).closeTo(0.4, 0.0001) + expect(rectangle.collider.scale.x).toEqual(2) + expect(rectangle.collider.scale.y).toEqual(4) + }) + + it('should create a collider with a circle shape', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initCollider({ + shape: FShapes.CIRCLE, + }) + expect(rectangle.collider).toBeDefined() + // Validate shape + expect(rectangle.collider.shape).toEqual(FShapes.CIRCLE) + expect(rectangle.collider.__COLLIDER__.shape).toBeDefined() + expect(rectangle.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(0) + expect(rectangle.collider.position.y).toEqual(0) + expect(rectangle.collider.rotation).toEqual(0) + expect(rectangle.collider.scale.x).toEqual(1) + expect(rectangle.collider.scale.y).toEqual(1) }) }) From 8ad107af4621abb208f033a57687a5ce78d7123d Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 1 Oct 2024 22:29:26 +0200 Subject: [PATCH 07/36] fix: 3d internals in 2d --- packages/2d/src/controllers/FCharacterControllerD.ts | 2 +- packages/2d/src/controllers/FCharacterControllerKP.ts | 2 +- packages/2d/src/controllers/FCharacterControllerKV.ts | 2 +- packages/2d/src/core/FCollider.ts | 2 +- packages/2d/src/core/FRigidBody.ts | 2 +- packages/2d/src/lights/FLight.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/2d/src/controllers/FCharacterControllerD.ts b/packages/2d/src/controllers/FCharacterControllerD.ts index 856c7c43..0936c9f2 100644 --- a/packages/2d/src/controllers/FCharacterControllerD.ts +++ b/packages/2d/src/controllers/FCharacterControllerD.ts @@ -9,7 +9,7 @@ import { FCharacterController } from './FCharacterController' * @category Controller * @example * ```ts - * import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/3d' + * import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/2d' * * const scene = new FScene() * diff --git a/packages/2d/src/controllers/FCharacterControllerKP.ts b/packages/2d/src/controllers/FCharacterControllerKP.ts index a984073f..54bbc7cb 100644 --- a/packages/2d/src/controllers/FCharacterControllerKP.ts +++ b/packages/2d/src/controllers/FCharacterControllerKP.ts @@ -8,7 +8,7 @@ import type { FCharacterControllerOptions } from './FCharacterController' * @category Controller * @example * ```ts - * import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/3d' + * import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/2d' * * const scene = new FScene() * diff --git a/packages/2d/src/controllers/FCharacterControllerKV.ts b/packages/2d/src/controllers/FCharacterControllerKV.ts index 7b74e589..8b6d05d5 100644 --- a/packages/2d/src/controllers/FCharacterControllerKV.ts +++ b/packages/2d/src/controllers/FCharacterControllerKV.ts @@ -8,7 +8,7 @@ import type { FCharacterControllerOptions } from './FCharacterController' * @category Controller * @example * ```ts - * import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/3d' + * import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/2d' * * const scene = new FScene() * diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 01b3d894..8163633b 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -13,7 +13,7 @@ export interface FColliderOptions { } /** - * A 3d collider. + * A 2d collider that can be attached to a component. * @category Core */ export class FCollider { diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index e6c87404..7fa49875 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -20,7 +20,7 @@ export interface FRigidBodyOptions { } /** - * A 3d RigidBody. + * A 2d rigidBody that can be attached to a component. * @category Core */ export class FRigidBody { diff --git a/packages/2d/src/lights/FLight.ts b/packages/2d/src/lights/FLight.ts index c07d995f..538a383b 100644 --- a/packages/2d/src/lights/FLight.ts +++ b/packages/2d/src/lights/FLight.ts @@ -17,8 +17,8 @@ export abstract class FLight extends FLightCore { /** * Internal flags */ - public __IS_3D__: boolean = true - public __IS_2D__: boolean = false + public __IS_3D__: boolean = false + public __IS_2D__: boolean = true declare public __ID__: number public __CALLBACKS_ON_COLLISION__: { [key: string]: (() => void)[] } = {} From 46805d9c7f0c83f63ba1441c66ce6e715f7151d7 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 1 Oct 2024 23:00:41 +0200 Subject: [PATCH 08/36] test(2d): add collider test which do not pass idk why --- packages/2d/src/core/FCollider.ts | 12 ++++---- packages/2d/src/core/FRigidBody.ts | 7 ++--- packages/2d/test/browser/collider.test.ts | 36 +++++++++++++++++++++++ 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 8163633b..6548bf13 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -80,7 +80,7 @@ export class FCollider { options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || options.rotation === undefined || !options.shape || options.sensor === undefined) - throw new Error('FibboError: initCollider requires position, scale, rotation and shape options') + throw new Error('FibboError: initCollider requires transforms options') // Check if the world exists if (!component.scene.world) @@ -178,15 +178,13 @@ export class FCollider { */ setScale(scale: { x: number, y: number }) { // If the collider is a cuboid, update its half extents - if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Cuboid) { + if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { this.__COLLIDER__.setHalfExtents(new RAPIER.Vector2(scale.x / 2, scale.y / 2)) } // If the collider is a ball, update its radius - else if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Ball) { - this.__COLLIDER__.setRadius( - // Get the maximum value of x and y - Math.max(scale.x, scale.y) / 2, - ) + else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + this.__COLLIDER__.setRadius(scale.x / 2) + this.__COLLIDER__.setHalfHeight(scale.y / 2) } } diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 7fa49875..3f89664f 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -68,7 +68,7 @@ export class FRigidBody { * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts - * const rigidBody = new FRigidBody({ + * const rigidBody = new FRigidBody(component, { * position: { x: 0, y: 0 }, * scale: { x: 1, y: 1 }, * rotation: 0, @@ -94,16 +94,15 @@ export class FRigidBody { options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || options.rotation === undefined || !options.shape) - throw new Error('FibboError: initRigidBody requires position, scale, rotation, shape and rigidBodyType options') + throw new Error('FibboError: initRigidBody requires transforms options') // Check if the world exists if (!component.scene.world) throw new Error('FibboError: FScene must have a world to create a rigidBody') - // Store the offset + // Store the options this.__RIGIDBODY_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } this.__RIGIDBODY_ROTATION_OFFSET__ = options.rotation - // Store the component this.component = component // If rotation degree is given, convert it to radians diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 3a13ae1b..ede2fec9 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -77,4 +77,40 @@ describe('fCollider', () => { expect(rectangle.collider.scale.x).toEqual(1) expect(rectangle.collider.scale.y).toEqual(1) }) + + it('should modify collider transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initCollider() + expect(rectangle.collider).toBeDefined() + // Validate transforms + expect(rectangle.collider.position.x).toEqual(0) + expect(rectangle.collider.position.y).toEqual(0) + expect(rectangle.collider.rotation).toEqual(0) + expect(rectangle.collider.scale.x).toEqual(1) + expect(rectangle.collider.scale.y).toEqual(1) + // Modify transforms with functions + rectangle.collider.setPosition({ x: 1, y: 1 }) + rectangle.collider.setRotation(0.1) + rectangle.collider.setScale({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(1) + expect(rectangle.collider.position.y).toEqual(1) + expect(rectangle.collider.rotation).closeTo(0.1, 0.0001) + expect(rectangle.collider.scale.x).toEqual(2) + expect(rectangle.collider.scale.y).toEqual(2) + // Moify transforms with setters + rectangle.collider.position = { x: 2, y: 2 } + rectangle.collider.rotation = 0.2 + rectangle.collider.scale = { x: 3, y: 4 } + // Validate transforms + expect(rectangle.collider.position.x).toEqual(2) + expect(rectangle.collider.position.y).toEqual(2) + expect(rectangle.collider.rotation).toEqual(0.2) + expect(rectangle.collider.scale.x).toEqual(3) + expect(rectangle.collider.scale.y).toEqual(4) + }) }) From 1df53663d6fbe5dd6940d50114233682c5dae3fa Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Wed, 2 Oct 2024 18:41:54 +0200 Subject: [PATCH 09/36] fix(2d): improve collider testing and fix setScale --- packages/2d/src/core/FCollider.ts | 5 ++- packages/2d/test/browser/collider.test.ts | 41 ++++++++++++++++++++++- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 6548bf13..b4fd05cd 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -179,12 +179,11 @@ export class FCollider { setScale(scale: { x: number, y: number }) { // If the collider is a cuboid, update its half extents if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - this.__COLLIDER__.setHalfExtents(new RAPIER.Vector2(scale.x / 2, scale.y / 2)) + this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2)) } // If the collider is a ball, update its radius else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - this.__COLLIDER__.setRadius(scale.x / 2) - this.__COLLIDER__.setHalfHeight(scale.y / 2) + this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(scale.x, scale.y) / 2)) } } diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index ede2fec9..f0ec7785 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -109,8 +109,47 @@ describe('fCollider', () => { // Validate transforms expect(rectangle.collider.position.x).toEqual(2) expect(rectangle.collider.position.y).toEqual(2) - expect(rectangle.collider.rotation).toEqual(0.2) + expect(rectangle.collider.rotation).closeTo(0.2, 0.0001) expect(rectangle.collider.scale.x).toEqual(3) expect(rectangle.collider.scale.y).toEqual(4) }) + + it('should modify collider transforms with a circle shape', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initCollider({ + shape: FShapes.CIRCLE, + }) + expect(rectangle.collider).toBeDefined() + // Validate transforms + expect(rectangle.collider.position.x).toEqual(0) + expect(rectangle.collider.position.y).toEqual(0) + expect(rectangle.collider.rotation).toEqual(0) + expect(rectangle.collider.scale.x).toEqual(1) + expect(rectangle.collider.scale.y).toEqual(1) + // Modify transforms with functions + rectangle.collider.setPosition({ x: 1, y: 1 }) + rectangle.collider.setRotation(0.1) + rectangle.collider.setScale({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(1) + expect(rectangle.collider.position.y).toEqual(1) + expect(rectangle.collider.rotation).closeTo(0.1, 0.0001) + expect(rectangle.collider.scale.x).toEqual(2) + expect(rectangle.collider.scale.y).toEqual(2) + // Moify transforms with setters + rectangle.collider.position = { x: 2, y: 2 } + rectangle.collider.rotation = 0.2 + rectangle.collider.scale = { x: 3, y: 4 } + // Validate transforms + expect(rectangle.collider.position.x).toEqual(2) + expect(rectangle.collider.position.y).toEqual(2) + expect(rectangle.collider.rotation).closeTo(0.2, 0.0001) + // Circle shape has the same scale for x and y (the highest value is used) + expect(rectangle.collider.scale.x).toEqual(4) + expect(rectangle.collider.scale.y).toEqual(4) + }) }) From 545a7e22bb70e8cd522113d4b1319ce7a27900fd Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Wed, 2 Oct 2024 19:35:04 +0200 Subject: [PATCH 10/36] feat(2d): refactor FRigidBody and add tests --- packages/2d/src/core/FRigidBody.ts | 76 ++++++++++ packages/2d/test/browser/collider.test.ts | 4 + packages/2d/test/browser/rigidbody.test.ts | 159 +++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 packages/2d/test/browser/rigidbody.test.ts diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 3f89664f..92de41cd 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -177,6 +177,16 @@ export class FRigidBody { this.collider.setRotation(newRotation) } + /** + * Set the scale of the rigidBody. + * @param scale The new scale of the rigidBody. + * @param scale.x The new x scale of the rigidBody. + * @param scale.y The new y scale of the rigidBody. + */ + setScale(scale: { x: number, y: number }) { + this.collider.scale = scale + } + /** * Update the position of the rigidBody according to the component's position. * This takes into account the position offset. @@ -206,4 +216,70 @@ export class FRigidBody { updateScale() { this.collider.updateScale() } + + // Setters & getters for transform properties + + get position() { + return this.__RIGIDBODY__.translation() + } + + set position(position: { x: number, y: number }) { + this.setPosition(position) + } + + get x() { + return this.position.x + } + + set x(x: number) { + this.setPosition({ x, y: this.position.y }) + } + + get y() { + return this.position.y + } + + set y(y: number) { + this.setPosition({ x: this.position.x, y }) + } + + get rotation() { + return this.__RIGIDBODY__.rotation() + } + + set rotation(rotation: number) { + this.setRotation(rotation) + } + + get rotationDegree() { + return (this.rotation * 180) / Math.PI + } + + set rotationDegree(rotation: number) { + this.setRotationDegree(rotation) + } + + get scale() { + return this.collider.scale + } + + set scale(scale: { x: number, y: number }) { + this.setScale(scale) + } + + get scaleX() { + return this.collider.scaleX + } + + set scaleX(x: number) { + this.setScale({ x, y: this.scaleY }) + } + + get scaleY() { + return this.collider.scaleY + } + + set scaleY(y: number) { + this.setScale({ x: this.scaleX, y }) + } } diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index f0ec7785..0030b9fa 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -124,6 +124,10 @@ describe('fCollider', () => { shape: FShapes.CIRCLE, }) expect(rectangle.collider).toBeDefined() + // Validate shape + expect(rectangle.collider.shape).toEqual(FShapes.CIRCLE) + expect(rectangle.collider.__COLLIDER__.shape).toBeDefined() + expect(rectangle.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms expect(rectangle.collider.position.x).toEqual(0) expect(rectangle.collider.position.y).toEqual(0) diff --git a/packages/2d/test/browser/rigidbody.test.ts b/packages/2d/test/browser/rigidbody.test.ts new file mode 100644 index 00000000..e5e3230c --- /dev/null +++ b/packages/2d/test/browser/rigidbody.test.ts @@ -0,0 +1,159 @@ +import { beforeEach, describe, expect, it } from 'vitest' +import { FRectangle, FScene, FShapes } from '@fibbojs/2d' +import RAPIER from '@dimforge/rapier2d' + +describe('fRigidBody', () => { + let scene: FScene + + beforeEach(async () => { + scene = new FScene() + await scene.init() + await scene.initPhysics() + }) + + it('should create a rigidBody with default options', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initRigidBody() + expect(rectangle.rigidBody).toBeDefined() + // Validate offset + expect(rectangle.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: 0, y: 0 }) + expect(rectangle.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual(0) + expect(rectangle.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1 }) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toEqual(0) + expect(rectangle.rigidBody.rotation).toEqual(0) + expect(rectangle.rigidBody.scale.x).toEqual(1) + expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.RECTANGLE) + }) + + it('should create a rigidBody with custom transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 1, y: 1 }, + rotation: 0.1, + scale: { x: 1, y: 2 }, + }) + rectangle.initRigidBody({ + position: { x: -2, y: 3 }, + rotation: 0.3, + scale: { x: 2, y: 2 }, + }) + expect(rectangle.rigidBody).toBeDefined() + // Validate offset + expect(rectangle.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: -2, y: 3 }) + expect(rectangle.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual(0.3) + expect(rectangle.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(-1) + expect(rectangle.rigidBody.position.y).toEqual(4) + expect(rectangle.rigidBody.rotation).closeTo(0.4, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(2) + expect(rectangle.rigidBody.scale.y).toEqual(4) + }) + + it('should create a rigidBody with a circle shape', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initRigidBody({ + shape: FShapes.CIRCLE, + }) + expect(rectangle.rigidBody).toBeDefined() + // Validate shape + expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.CIRCLE) + expect(rectangle.rigidBody.collider.__COLLIDER__.shape).toBeDefined() + expect(rectangle.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toEqual(0) + expect(rectangle.rigidBody.rotation).toEqual(0) + expect(rectangle.rigidBody.scale.x).toEqual(1) + expect(rectangle.rigidBody.scale.y).toEqual(1) + }) + + it('should modify rigidBody transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initRigidBody() + expect(rectangle.rigidBody).toBeDefined() + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toEqual(0) + expect(rectangle.rigidBody.rotation).toEqual(0) + expect(rectangle.rigidBody.scale.x).toEqual(1) + expect(rectangle.rigidBody.scale.y).toEqual(1) + // Modify transforms with functions + rectangle.rigidBody.setPosition({ x: 1, y: 1 }) + rectangle.rigidBody.setRotation(0.1) + rectangle.rigidBody.setScale({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(1) + expect(rectangle.rigidBody.position.y).toEqual(1) + expect(rectangle.rigidBody.rotation).closeTo(0.1, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(2) + expect(rectangle.rigidBody.scale.y).toEqual(2) + // Moify transforms with setters + rectangle.rigidBody.position = { x: 2, y: 2 } + rectangle.rigidBody.rotation = 0.2 + rectangle.rigidBody.scale = { x: 3, y: 4 } + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(2) + expect(rectangle.rigidBody.position.y).toEqual(2) + expect(rectangle.rigidBody.rotation).closeTo(0.2, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(3) + expect(rectangle.rigidBody.scale.y).toEqual(4) + }) + + it('should modify rigidBody transforms with a circle shape', () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + rectangle.initRigidBody({ + shape: FShapes.CIRCLE, + }) + expect(rectangle.rigidBody).toBeDefined() + // Validate shape + expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.CIRCLE) + expect(rectangle.rigidBody.collider.__COLLIDER__.shape).toBeDefined() + expect(rectangle.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toEqual(0) + expect(rectangle.rigidBody.rotation).toEqual(0) + expect(rectangle.rigidBody.scale.x).toEqual(1) + expect(rectangle.rigidBody.scale.y).toEqual(1) + // Modify transforms with functions + rectangle.rigidBody.setPosition({ x: 1, y: 1 }) + rectangle.rigidBody.setRotation(0.1) + rectangle.rigidBody.setScale({ x: 2, y: 2 }) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(1) + expect(rectangle.rigidBody.position.y).toEqual(1) + expect(rectangle.rigidBody.rotation).closeTo(0.1, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(2) + expect(rectangle.rigidBody.scale.y).toEqual(2) + // Moify transforms with setters + rectangle.rigidBody.position = { x: 2, y: 2 } + rectangle.rigidBody.rotation = 0.2 + rectangle.rigidBody.scale = { x: 3, y: 4 } + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(2) + expect(rectangle.rigidBody.position.y).toEqual(2) + expect(rectangle.rigidBody.rotation).closeTo(0.2, 0.0001) + // Circle shape has the same scale for x and y (the highest value is used) + expect(rectangle.rigidBody.scale.x).toEqual(4) + expect(rectangle.rigidBody.scale.y).toEqual(4) + }) +}) From 6bcc4fb2376095c085925e14bad787cc8a807e33 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Thu, 3 Oct 2024 21:50:57 +0200 Subject: [PATCH 11/36] docs: add a section about internals --- docs/guide/fundamentals.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guide/fundamentals.md b/docs/guide/fundamentals.md index d155c6c4..56030731 100644 --- a/docs/guide/fundamentals.md +++ b/docs/guide/fundamentals.md @@ -27,3 +27,11 @@ That means that if you create a component with a size of `1` in Fibbo, it will b When using Fibbo's classes and methods, you should always use the Fibbo unit system and all the conversions will be done automatically for you. But if for some reason you need to use the underlying libraries directly, you should be aware of the unit system they use. + +## About internals + +Fibbo is built on top of other libraries and does a lot of work behind the scenes to make your life easier. + +This means that Fibbo's classes have a lot of internal properties that you should not use directly, but are exposed for convenience (in edge cases or when [extending Fibbo](/more/extending-fibbo) for example). These properties are formatted with uppercase letters and double underscores at the beginning and end of their name (e.g. `__INTERNAL__`). + +If you ever feel the need to use these properties, you are very likely to have found a bug or a feature missing in Fibbo. If you're not sure about it, feel free to [ask on the forum](https://github.com/orgs/fibbojs/discussions) ! From 2ddec82d73839a7ff2c50d9ec07351a585e623f1 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 4 Oct 2024 09:11:52 +0200 Subject: [PATCH 12/36] test(2d): add tests for update transforms methods --- packages/2d/src/core/FCollider.ts | 14 ++++---- packages/2d/test/browser/collider.test.ts | 37 ++++++++++++++++++++++ packages/2d/test/browser/rigidbody.test.ts | 37 ++++++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index b4fd05cd..bdd41a34 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -212,15 +212,17 @@ export class FCollider { */ updateScale() { // If the collider is a cuboid, update its half extents - if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Cuboid) { - this.__COLLIDER__.setHalfExtents(new RAPIER.Vector2(this.component.scale.x / 2 * this.__COLLIDER_SCALE_OFFSET__.x, this.component.scale.y / 2 * this.__COLLIDER_SCALE_OFFSET__.y)) + if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { + this.__COLLIDER__.setShape(new RAPIER.Cuboid( + this.component.scale.x / 2 * this.__COLLIDER_SCALE_OFFSET__.x, + this.component.scale.y / 2 * this.__COLLIDER_SCALE_OFFSET__.y, + )) } // If the collider is a ball, update its radius - else if (this.__COLLIDER__.shape.type === RAPIER.ShapeType.Ball) { - this.__COLLIDER__.setRadius( - // Get the maximum value of x and y + else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + this.__COLLIDER__.setShape(new RAPIER.Ball( Math.max(this.component.scale.x, this.component.scale.y) / 2 * this.__COLLIDER_SCALE_OFFSET__.x, - ) + )) } } diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 0030b9fa..8e683a35 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -30,6 +30,13 @@ describe('fCollider', () => { expect(rectangle.collider.scale.x).toEqual(1) expect(rectangle.collider.scale.y).toEqual(1) expect(rectangle.collider.shape).toEqual(FShapes.RECTANGLE) + // Validate scaleX and scaleY + rectangle.collider.scaleX = 2 + rectangle.collider.scaleY = 3 + expect(rectangle.collider.scaleX).toEqual(2) + expect(rectangle.collider.scaleY).toEqual(3) + expect(rectangle.collider.scaleX).toEqual(rectangle.collider.scale.x) + expect(rectangle.collider.scaleY).toEqual(rectangle.collider.scale.y) }) it('should create a collider with custom transforms', () => { @@ -156,4 +163,34 @@ describe('fCollider', () => { expect(rectangle.collider.scale.x).toEqual(4) expect(rectangle.collider.scale.y).toEqual(4) }) + + it('should update collider transforms with attached component transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 1, y: 1 }, + rotation: 0.1, + scale: { x: 1, y: 0.5 }, + }) + rectangle.initCollider({ + position: { x: -2, y: 3 }, + rotation: 0.3, + scale: { x: 2, y: 2 }, + }) + expect(rectangle.collider).toBeDefined() + // Validate transforms + expect(rectangle.collider.position.x).toEqual(-1) + expect(rectangle.collider.position.y).toEqual(4) + expect(rectangle.collider.rotation).closeTo(0.4, 0.0001) + expect(rectangle.collider.scale.x).toEqual(2) + expect(rectangle.collider.scale.y).toEqual(1) + // Modify component transforms + rectangle.setPosition({ x: 2, y: 2 }) + rectangle.setRotation(0.2) + rectangle.setScale({ x: 3, y: 4 }) + // Validate transforms + expect(rectangle.collider.position.x).toEqual(0) + expect(rectangle.collider.position.y).toEqual(5) + expect(rectangle.collider.rotation).closeTo(0.5, 0.0001) + expect(rectangle.collider.scale.x).toEqual(6) + expect(rectangle.collider.scale.y).toEqual(8) + }) }) diff --git a/packages/2d/test/browser/rigidbody.test.ts b/packages/2d/test/browser/rigidbody.test.ts index e5e3230c..8aea9749 100644 --- a/packages/2d/test/browser/rigidbody.test.ts +++ b/packages/2d/test/browser/rigidbody.test.ts @@ -30,6 +30,13 @@ describe('fRigidBody', () => { expect(rectangle.rigidBody.scale.x).toEqual(1) expect(rectangle.rigidBody.scale.y).toEqual(1) expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.RECTANGLE) + // Validate scaleX and scaleY + rectangle.rigidBody.scaleX = 2 + rectangle.rigidBody.scaleY = 3 + expect(rectangle.rigidBody.scaleX).toEqual(2) + expect(rectangle.rigidBody.scaleY).toEqual(3) + expect(rectangle.rigidBody.scaleX).toEqual(rectangle.rigidBody.scale.x) + expect(rectangle.rigidBody.scaleY).toEqual(rectangle.rigidBody.scale.y) }) it('should create a rigidBody with custom transforms', () => { @@ -156,4 +163,34 @@ describe('fRigidBody', () => { expect(rectangle.rigidBody.scale.x).toEqual(4) expect(rectangle.rigidBody.scale.y).toEqual(4) }) + + it('should update rigidBody transforms with attached component transforms', () => { + const rectangle = new FRectangle(scene, { + position: { x: 1, y: 1 }, + rotation: 0.1, + scale: { x: 1, y: 0.5 }, + }) + rectangle.initRigidBody({ + position: { x: -2, y: 3 }, + rotation: 0.3, + scale: { x: 2, y: 2 }, + }) + expect(rectangle.rigidBody).toBeDefined() + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(-1) + expect(rectangle.rigidBody.position.y).toEqual(4) + expect(rectangle.rigidBody.rotation).closeTo(0.4, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(2) + expect(rectangle.rigidBody.scale.y).toEqual(1) + // Modify component transforms + rectangle.setPosition({ x: 2, y: 2 }) + rectangle.setRotation(0.2) + rectangle.setScale({ x: 3, y: 4 }) + // Validate transforms + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toEqual(5) + expect(rectangle.rigidBody.rotation).closeTo(0.5, 0.0001) + expect(rectangle.rigidBody.scale.x).toEqual(6) + expect(rectangle.rigidBody.scale.y).toEqual(8) + }) }) From c8bca4c6d190e0a6b19c44fcd12f335601e086d6 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 4 Oct 2024 10:20:48 +0200 Subject: [PATCH 13/36] feat(3d): refactor collider & rigidBody + add tests --- packages/2d/src/core/FCollider.ts | 40 +-- packages/2d/src/core/FComponent.ts | 52 +-- packages/2d/src/core/FRigidBody.ts | 13 +- packages/3d/package.json | 2 +- .../src/controllers/FCharacterControllerD.ts | 12 +- .../src/controllers/FCharacterControllerK.ts | 2 +- .../src/controllers/FCharacterControllerKP.ts | 10 +- .../src/controllers/FCharacterControllerKV.ts | 2 +- packages/3d/src/core/FCollider.ts | 299 ++++++++++++++++-- packages/3d/src/core/FComponent.ts | 181 +++++------ packages/3d/src/core/FRigidBody.ts | 270 +++++++++++++++- packages/3d/src/core/FScene.ts | 18 +- packages/3d/src/types/FShapes.ts | 2 +- packages/3d/test/browser/collider.test.ts | 243 ++++++++++++++ packages/3d/test/browser/rigidbody.test.ts | 242 ++++++++++++++ 15 files changed, 1188 insertions(+), 200 deletions(-) create mode 100644 packages/3d/test/browser/collider.test.ts create mode 100644 packages/3d/test/browser/rigidbody.test.ts diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index bdd41a34..a0f2e0a3 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -1,6 +1,7 @@ import * as RAPIER from '@dimforge/rapier2d' import { FShapes } from '../types/FShapes' import type { FComponent } from './FComponent' +import type { FRigidBody } from './FRigidBody' export interface FColliderOptions { position?: { x: number, y: number } @@ -8,7 +9,7 @@ export interface FColliderOptions { rotation?: number rotationDegree?: number shape?: FShapes - rigidBody?: RAPIER.RigidBody + rigidBody?: FRigidBody sensor?: boolean } @@ -23,17 +24,17 @@ export class FCollider { __COLLIDER__: RAPIER.Collider /** * Position Offset for the collider. - * This is used to adjust the collider position relative to the mesh. + * This is used to adjust the collider position relative to the component. */ __COLLIDER_POSITION_OFFSET__: { x: number, y: number } /** * Rotation Offset for the collider. - * This is used to adjust the collider position relative to the mesh. + * This is used to adjust the collider position relative to the component. */ __COLLIDER_ROTATION_OFFSET__: number /** * Scale Offset for the collider. - * This is used to adjust the collider scale relative to the mesh. + * This is used to adjust the collider scale relative to the component. */ __COLLIDER_SCALE_OFFSET__: { x: number, y: number } /** @@ -53,7 +54,7 @@ export class FCollider { * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example @@ -62,7 +63,7 @@ export class FCollider { * position: { x: 0, y: 1 }, * scale: { x: 1, y: 1 }, * rotation: 0, - * shape: FShapes.CUBE + * shape: FShapes.RECTANGLE * }) * ``` */ @@ -141,7 +142,7 @@ export class FCollider { } // Create the collider - this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody) + this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) } /** @@ -192,10 +193,10 @@ export class FCollider { * This takes into account the position offset. */ updatePosition() { - const newPosition = this.component.transform.position - newPosition.x += this.__COLLIDER_POSITION_OFFSET__.x - newPosition.y += this.__COLLIDER_POSITION_OFFSET__.y - this.setPosition(newPosition) + this.setPosition({ + x: this.component.transform.position.x + this.__COLLIDER_POSITION_OFFSET__.x, + y: this.component.transform.position.y + this.__COLLIDER_POSITION_OFFSET__.y, + }) } /** @@ -211,19 +212,10 @@ export class FCollider { * This takes into account the scale offset. */ updateScale() { - // If the collider is a cuboid, update its half extents - if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - this.__COLLIDER__.setShape(new RAPIER.Cuboid( - this.component.scale.x / 2 * this.__COLLIDER_SCALE_OFFSET__.x, - this.component.scale.y / 2 * this.__COLLIDER_SCALE_OFFSET__.y, - )) - } - // If the collider is a ball, update its radius - else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - this.__COLLIDER__.setShape(new RAPIER.Ball( - Math.max(this.component.scale.x, this.component.scale.y) / 2 * this.__COLLIDER_SCALE_OFFSET__.x, - )) - } + this.setScale({ + x: this.component.transform.scale.x * this.__COLLIDER_SCALE_OFFSET__.x, + y: this.component.transform.scale.y * this.__COLLIDER_SCALE_OFFSET__.y, + }) } // Setters & getters for transform properties diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index d401a5a7..2ca8e533 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -197,31 +197,6 @@ export abstract class FComponent extends FComponentCore { this.sensor.updatePosition() } - /** - * Set the scale of the component. - * @param options The options for the scale. - * @param options.x The x scale. - * @param options.y The y scale. - * @example - * ```ts - * component.setScale({ x: 1, y: 1 }) - * ``` - */ - setScale(options: { x: number, y: number }): void { - this.transform.scale = { x: options.x, y: options.y } - this.container.height = options.y * 100 - this.container.width = options.x * 100 - // If a rigidBody exists, update its scale - if (this.rigidBody) - this.rigidBody.updateScale() - // Else if a collider exists, update its scale - else if (this.collider) - this.collider.updateScale() - // If a sensor exists, update its scale - if (this.sensor) - this.sensor.updateScale() - } - /** * Set the rotation of the component in radians. * @param r The rotation in radians. @@ -256,6 +231,31 @@ export abstract class FComponent extends FComponentCore { this.setRotation(r * (Math.PI / 180)) } + /** + * Set the scale of the component. + * @param options The options for the scale. + * @param options.x The x scale. + * @param options.y The y scale. + * @example + * ```ts + * component.setScale({ x: 1, y: 1 }) + * ``` + */ + setScale(options: { x: number, y: number }): void { + this.transform.scale = { x: options.x, y: options.y } + this.container.height = options.y * 100 + this.container.width = options.x * 100 + // If a rigidBody exists, update its scale + if (this.rigidBody) + this.rigidBody.updateScale() + // Else if a collider exists, update its scale + else if (this.collider) + this.collider.updateScale() + // If a sensor exists, update its scale + if (this.sensor) + this.sensor.updateScale() + } + /** * Init a rigidBody for the model. * @param options The options for the rigidBody. @@ -317,7 +317,7 @@ export abstract class FComponent extends FComponentCore { * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.sensor If true, the collider will be a sensor. * @example * ```ts diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 92de41cd..2fd53a2d 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -34,12 +34,12 @@ export class FRigidBody { collider: FCollider /** * Position Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the mesh. + * This is used to adjust the rigidBody position relative to the component. */ __RIGIDBODY_POSITION_OFFSET__: { x: number, y: number } /** * Rotation Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the mesh. + * This is used to adjust the rigidBody position relative to the component. */ __RIGIDBODY_ROTATION_OFFSET__: number /** @@ -54,7 +54,7 @@ export class FRigidBody { * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. * @param options.lockTranslations If true, the rigidBody will not be able to move. * @param options.lockRotations If true, the rigidBody will not be able to rotate. @@ -72,7 +72,7 @@ export class FRigidBody { * position: { x: 0, y: 0 }, * scale: { x: 1, y: 1 }, * rotation: 0, - * shape: FShapes.CUBE + * shape: FShapes.RECTANGLE * }) * ``` */ @@ -143,7 +143,7 @@ export class FRigidBody { // Create the collider attached to the rigidBody this.collider = new FCollider(component, { ...options, - rigidBody: this.__RIGIDBODY__, + rigidBody: this, }) } @@ -184,7 +184,7 @@ export class FRigidBody { * @param scale.y The new y scale of the rigidBody. */ setScale(scale: { x: number, y: number }) { - this.collider.scale = scale + this.collider.setScale(scale) } /** @@ -212,6 +212,7 @@ export class FRigidBody { /** * Update the scale of the rigidBody's collider according to the component's scale. * This takes into account the scale offset. + * As a rigidBody does not have a scale, this will only update the attached collider's scale. */ updateScale() { this.collider.updateScale() diff --git a/packages/3d/package.json b/packages/3d/package.json index e751b3e1..9f706314 100644 --- a/packages/3d/package.json +++ b/packages/3d/package.json @@ -40,7 +40,7 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run", + "test": "vitest run --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index 7ac6b6a9..f65f2216 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -25,7 +25,7 @@ export class FCharacterControllerD extends FCharacterController { const fKeyboard = new FKeyboard(scene) fKeyboard.on(' ', () => { - this.component.rigidBody?.rigidBody.applyImpulse(new THREE.Vector3(0, 0.1, 0), true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse(new THREE.Vector3(0, 0.1, 0), true) }) // Initialize the rigidBody @@ -44,23 +44,23 @@ export class FCharacterControllerD extends FCharacterController { // Apply movement on the x axis if (this.inputs.forward) { - this.component.rigidBody?.rigidBody.applyImpulse(cameraDirection.multiplyScalar(0.04 * this.speed), true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse(cameraDirection.multiplyScalar(0.04 * this.speed), true) } else if (this.inputs.backward) { - this.component.rigidBody?.rigidBody.applyImpulse(cameraDirection.multiplyScalar(-0.04 * this.speed), true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse(cameraDirection.multiplyScalar(-0.04 * this.speed), true) } // Apply movement on the z axis if (this.inputs.left) { - this.component.rigidBody?.rigidBody.applyImpulse(cameraDirection.multiplyScalar(0.04 * this.speed).applyAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2), true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse(cameraDirection.multiplyScalar(0.04 * this.speed).applyAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2), true) } else if (this.inputs.right) { - this.component.rigidBody?.rigidBody.applyImpulse(cameraDirection.multiplyScalar(-0.04 * this.speed).applyAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2), true) + this.component.rigidBody?.__RIGIDBODY__.applyImpulse(cameraDirection.multiplyScalar(-0.04 * this.speed).applyAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2), true) } // Apply corrected rotation if (this.inputs.forward || this.inputs.backward || this.inputs.left || this.inputs.right) { - this.component.rigidBody?.rigidBody.setRotation(this.getCorrectedRotation(), true) + this.component.rigidBody?.__RIGIDBODY__.setRotation(this.getCorrectedRotation(), true) } } } diff --git a/packages/3d/src/controllers/FCharacterControllerK.ts b/packages/3d/src/controllers/FCharacterControllerK.ts index 9dcf3797..784e604c 100644 --- a/packages/3d/src/controllers/FCharacterControllerK.ts +++ b/packages/3d/src/controllers/FCharacterControllerK.ts @@ -63,7 +63,7 @@ export abstract class FCharacterControllerK extends FCharacterController { } // Compute the desired movement this.characterController.computeColliderMovement( - this.component.collider?.collider as RAPIER.Collider, + this.component.collider?.__COLLIDER__ as RAPIER.Collider, desiredMovement, RAPIER.QueryFilterFlags.EXCLUDE_SENSORS, ) diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index f4ee607c..3a23fac1 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -35,16 +35,16 @@ export class FCharacterControllerKP extends FCharacterControllerK { const correctedMovement = this.getCorrectedMovements() // Apply the movement to the rigidBody - this.component.rigidBody?.rigidBody.setNextKinematicTranslation({ - x: this.component.rigidBody.rigidBody.translation().x + correctedMovement.x * delta * this.speed * 64, - y: this.component.rigidBody.rigidBody.translation().y + correctedMovement.y * delta * this.speed * 64, - z: this.component.rigidBody.rigidBody.translation().z + correctedMovement.z * delta * this.speed * 64, + this.component.rigidBody?.__RIGIDBODY__.setNextKinematicTranslation({ + x: this.component.rigidBody.__RIGIDBODY__.translation().x + correctedMovement.x * delta * this.speed * 64, + y: this.component.rigidBody.__RIGIDBODY__.translation().y + correctedMovement.y * delta * this.speed * 64, + z: this.component.rigidBody.__RIGIDBODY__.translation().z + correctedMovement.z * delta * this.speed * 64, }) // If one of the inputs is true, apply the corrected rotation if (this.inputs.forward || this.inputs.backward || this.inputs.left || this.inputs.right) { // Apply the rotation to the rigidBody - this.component.rigidBody?.rigidBody.setNextKinematicRotation(this.getCorrectedRotation()) + this.component.rigidBody?.__RIGIDBODY__.setNextKinematicRotation(this.getCorrectedRotation()) } } } diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index d6f98b64..19b9f2b3 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -35,7 +35,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { const correctedMovement = this.getCorrectedMovements() // Apply the movement to the rigidBody - this.component.rigidBody?.rigidBody.setLinvel({ + this.component.rigidBody?.__RIGIDBODY__.setLinvel({ x: correctedMovement.x / delta, y: correctedMovement.y / delta, z: correctedMovement.z / delta, diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index 1dbccf1e..1ad03642 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -2,6 +2,7 @@ import * as THREE from 'three' import * as RAPIER from '@dimforge/rapier3d' import { FShapes } from '../types/FShapes' import type { FComponent } from './FComponent' +import type { FRigidBody } from './FRigidBody' export interface FColliderOptions { position?: { x: number, y: number, z: number } @@ -9,29 +10,42 @@ export interface FColliderOptions { rotation?: { x: number, y: number, z: number } rotationDegree?: { x: number, y: number, z: number } shape?: FShapes - rigidBody?: RAPIER.RigidBody + rigidBody?: FRigidBody sensor?: boolean } /** - * A 3d collider. + * A 3d collider that can be attached to a component. * @category Core */ export class FCollider { /** * RAPIER Collider */ - collider: RAPIER.Collider + __COLLIDER__: RAPIER.Collider /** * Position Offset for the collider. - * This is used to adjust the collider position relative to the mesh. + * This is used to adjust the collider position relative to the component. */ - colliderPositionOffset: { x: number, y: number, z: number } + __COLLIDER_POSITION_OFFSET__: { x: number, y: number, z: number } /** * Rotation Offset for the collider. - * This is used to adjust the collider position relative to the mesh. + * This is used to adjust the collider position relative to the component. */ - colliderRotationOffset: { x: number, y: number, z: number } + __COLLIDER_ROTATION_OFFSET__: { x: number, y: number, z: number } + /** + * Scale Offset for the collider. + * This is used to adjust the collider scale relative to the component. + */ + __COLLIDER_SCALE_OFFSET__: { x: number, y: number, z: number } + /** + * The component the collider is attached to. + */ + component: FComponent + /** + * The shape of the collider. + */ + shape: FShapes /** * Creates a collider for a given component. @@ -41,7 +55,7 @@ export class FCollider { * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example @@ -50,7 +64,7 @@ export class FCollider { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, - * shape: FShapes.CUBE + * shape: FShapes.CUBOID * }) * ``` */ @@ -61,18 +75,18 @@ export class FCollider { scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, rotationDegree: undefined, - shape: FShapes.CUBE, + shape: FShapes.CUBOID, rigidBody: undefined, sensor: false, } options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || !options.rotation || !options.shape || options.sensor === undefined) - throw new Error('FibboError: initCollider requires position, scale, rotation and shape options') + throw new Error('FibboError: initCollider requires transforms options') // Check if the world exists if (!component.scene.world) - throw new Error('FibboError: FScene must have a world to create a rigidBody') + throw new Error('FibboError: FScene must have a world to create a collider') // If rotation degree is given, convert it to radians if (options.rotationDegree) { @@ -83,9 +97,12 @@ export class FCollider { } } - // Store the collider offset - this.colliderPositionOffset = { x: options.position.x, y: options.position.y, z: options.position.z } - this.colliderRotationOffset = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } + // Store the options + this.__COLLIDER_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } + this.__COLLIDER_ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } + this.__COLLIDER_SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y, z: options.scale.z } + this.component = component + this.shape = options.shape // Devide the scale by 2 for the collider (RAPIER uses half-extents) // Also interpete the scale as relative to the component's scale @@ -98,7 +115,7 @@ export class FCollider { // Create a collider description according to the shape given let colliderDesc switch (options.shape) { - case FShapes.CUBE: + case FShapes.CUBOID: colliderDesc = RAPIER.ColliderDesc.cuboid(options.scale.x, options.scale.y, options.scale.z) break case FShapes.SPHERE: @@ -144,7 +161,6 @@ export class FCollider { component.transform.position.y + options.position.y, component.transform.position.z + options.position.z, ) - finalPosition.add(this.colliderPositionOffset) colliderDesc.setTranslation(finalPosition.x, finalPosition.y, finalPosition.z) // Interprete the given rotation as relative to the component's rotation @@ -164,6 +180,253 @@ export class FCollider { } // Create the collider - this.collider = component.scene.world.createCollider(colliderDesc, options.rigidBody) + this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) + } + + /** + * Set the position of the collider. + * @param position The new position of the collider. + * @param position.x The new x position of the collider. + * @param position.y The new y position of the collider. + * @param position.z The new z position of the collider. + */ + setPosition(position: { x: number, y: number, z: number }) { + this.__COLLIDER__.setTranslation(position) + } + + /** + * Set the rotation of the collider. + * @param rotation The new rotation of the collider. + * @param rotation.x The new x rotation of the collider. + * @param rotation.y The new y rotation of the collider. + * @param rotation.z The new z rotation of the collider. + */ + setRotation(rotation: { x: number, y: number, z: number }) { + this.__COLLIDER__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z))) + } + + /** + * Set the rotation of the collider in degrees. + * @param rotation The new rotation of the collider in degrees. + * @param rotation.x The new x rotation of the collider in degrees. + * @param rotation.y The new y rotation of the collider in degrees. + * @param rotation.z The new z rotation of the collider in degrees. + */ + setRotationDegree(rotation: { x: number, y: number, z: number }) { + this.setRotation({ + x: THREE.MathUtils.degToRad(rotation.x), + y: THREE.MathUtils.degToRad(rotation.y), + z: THREE.MathUtils.degToRad(rotation.z), + }) + } + + /** + * Set the scale of the collider. + * @param scale The new scale of the collider. + * @param scale.x The new x scale of the collider. + * @param scale.y The new y scale of the collider. + * @param scale.z The new z scale of the collider. + */ + setScale(scale: { x: number, y: number, z: number }) { + // If the collider is a cuboid, update its half extents + if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { + this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2, scale.z / 2)) + } + // If the collider is a ball, update its radius + else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(scale.x, scale.y, scale.z) / 2)) + } + } + + /** + * Update the position of the collider according to its component's position. + * This takes into account the position offset. + */ + updatePosition() { + this.setPosition({ + x: this.component.transform.position.x + this.__COLLIDER_POSITION_OFFSET__.x, + y: this.component.transform.position.y + this.__COLLIDER_POSITION_OFFSET__.y, + z: this.component.transform.position.z + this.__COLLIDER_POSITION_OFFSET__.z, + }) + } + + /** + * Update the rotation of the collider according to its component's rotation. + * This takes into account the rotation offset. + */ + updateRotation() { + this.setRotation({ + x: this.component.transform.rotation.x + this.__COLLIDER_ROTATION_OFFSET__.x, + y: this.component.transform.rotation.y + this.__COLLIDER_ROTATION_OFFSET__.y, + z: this.component.transform.rotation.z + this.__COLLIDER_ROTATION_OFFSET__.z, + }) + } + + /** + * Update the scale of the collider according to its component's scale. + * This takes into account the scale offset. + */ + updateScale() { + this.setScale({ + x: this.component.transform.scale.x * this.__COLLIDER_SCALE_OFFSET__.x, + y: this.component.transform.scale.y * this.__COLLIDER_SCALE_OFFSET__.y, + z: this.component.transform.scale.z * this.__COLLIDER_SCALE_OFFSET__.z, + }) + } + + // Setters & getters for transform properties + + get position() { + return this.__COLLIDER__.translation() + } + + set position(position: { x: number, y: number, z: number }) { + this.setPosition(position) + } + + get x() { + return this.__COLLIDER__.translation().x + } + + set x(x: number) { + this.setPosition({ x, y: this.y, z: this.z }) + } + + get y() { + return this.__COLLIDER__.translation().y + } + + set y(y: number) { + this.setPosition({ x: this.x, y, z: this.z }) + } + + get z() { + return this.__COLLIDER__.translation().z + } + + set z(z: number) { + this.setPosition({ x: this.x, y: this.y, z }) + } + + get rotation() { + const quaternion = this.__COLLIDER__.rotation() + const euler = new THREE.Euler().setFromQuaternion( + new THREE.Quaternion( + quaternion.x, + quaternion.y, + quaternion.z, + quaternion.w, + ), + ) + return { x: euler.x, y: euler.y, z: euler.z } + } + + set rotation(rotation: { x: number, y: number, z: number }) { + this.setRotation(rotation) + } + + get rotationX() { + return this.rotation.x + } + + set rotationX(x: number) { + this.setRotation({ x, y: this.rotation.y, z: this.rotation.z }) + } + + get rotationY() { + return this.rotation.y + } + + set rotationY(y: number) { + this.setRotation({ x: this.rotation.x, y, z: this.rotation.z }) + } + + get rotationZ() { + return this.rotation.z + } + + set rotationZ(z: number) { + this.setRotation({ x: this.rotation.x, y: this.rotation.y, z }) + } + + get rotationDegree() { + const euler = this.rotation + return { x: THREE.MathUtils.radToDeg(euler.x), y: THREE.MathUtils.radToDeg(euler.y), z: THREE.MathUtils.radToDeg(euler.z) } + } + + set rotationDegree(rotation: { x: number, y: number, z: number }) { + this.setRotationDegree(rotation) + } + + get rotationDegreeX() { + return this.rotationDegree.x + } + + set rotationDegreeX(x: number) { + this.setRotationDegree({ x, y: this.rotationDegree.y, z: this.rotationDegree.z }) + } + + get rotationDegreeY() { + return this.rotationDegree.y + } + + set rotationDegreeY(y: number) { + this.setRotationDegree({ x: this.rotationDegree.x, y, z: this.rotationDegree.z }) + } + + get rotationDegreeZ() { + return this.rotationDegree.z + } + + set rotationDegreeZ(z: number) { + this.setRotationDegree({ x: this.rotationDegree.x, y: this.rotationDegree.y, z }) + } + + get scale() { + if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { + return { + x: this.__COLLIDER__.shape.halfExtents.x * 2, + y: this.__COLLIDER__.shape.halfExtents.y * 2, + z: this.__COLLIDER__.shape.halfExtents.z * 2, + } + } + else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + return { + x: this.__COLLIDER__.shape.radius * 2, + y: this.__COLLIDER__.shape.radius * 2, + z: this.__COLLIDER__.shape.radius * 2, + } + } + else { + return { x: 0, y: 0, z: 0 } + } + } + + set scale(scale: { x: number, y: number, z: number }) { + this.setScale(scale) + } + + get scaleX() { + return this.scale.x + } + + set scaleX(x: number) { + this.setScale({ x, y: this.scale.y, z: this.scale.z }) + } + + get scaleY() { + return this.scale.y + } + + set scaleY(y: number) { + this.setScale({ x: this.scale.x, y, z: this.scale.z }) + } + + get scaleZ() { + return this.scale.z + } + + set scaleZ(z: number) { + this.setScale({ x: this.scale.x, y: this.scale.y, z }) } } diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 78feedd8..d07515df 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -50,15 +50,15 @@ export abstract class FComponent extends FComponentCore { /** * RigidBody */ - rigidBody?: FRigidBody + declare rigidBody: FRigidBody /** * Collider */ - collider?: FCollider + declare collider: FCollider /** * Sensor (a collider that doesn't collide with other colliders, but still triggers events) */ - sensor?: FRigidBody + declare sensor: FRigidBody /** * @param scene The 3D scene where the component will be added. @@ -110,25 +110,25 @@ export abstract class FComponent extends FComponentCore { // If the rigidBody and mesh exist, update the mesh position and rotation according to the rigidBody if (this.rigidBody && this.collider && this.mesh) { // Translation - const newMeshPosition = this.rigidBody.rigidBody.translation() + const newMeshPosition = this.rigidBody.__RIGIDBODY__.translation() // Remove offset - newMeshPosition.x -= this.collider.colliderPositionOffset.x - newMeshPosition.y -= this.collider.colliderPositionOffset.y - newMeshPosition.z -= this.collider.colliderPositionOffset.z + newMeshPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x + newMeshPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y + newMeshPosition.z -= this.collider.__COLLIDER_POSITION_OFFSET__.z // Rotation const newMeshRotation = new THREE.Euler().setFromQuaternion( new THREE.Quaternion( - this.rigidBody.rigidBody.rotation().x, - this.rigidBody.rigidBody.rotation().y, - this.rigidBody.rigidBody.rotation().z, - this.rigidBody.rigidBody.rotation().w, + this.rigidBody.__RIGIDBODY__.rotation().x, + this.rigidBody.__RIGIDBODY__.rotation().y, + this.rigidBody.__RIGIDBODY__.rotation().z, + this.rigidBody.__RIGIDBODY__.rotation().w, ), ) // Remove offset - newMeshRotation.x -= this.collider.colliderRotationOffset.x - newMeshRotation.y -= this.collider.colliderRotationOffset.y - newMeshRotation.z -= this.collider.colliderRotationOffset.z + newMeshRotation.x -= this.collider.__COLLIDER_ROTATION_OFFSET__.x + newMeshRotation.y -= this.collider.__COLLIDER_ROTATION_OFFSET__.y + newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z // Apply the new transforms to the mesh this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) @@ -140,35 +140,35 @@ export abstract class FComponent extends FComponentCore { // If a sensor exists, update its position and rotation according to the rigidBody if (this.sensor) { // Apply offset to the sensor - newMeshPosition.x += this.sensor.collider.colliderPositionOffset.x - newMeshPosition.y += this.sensor.collider.colliderPositionOffset.y - newMeshPosition.z += this.sensor.collider.colliderPositionOffset.z - this.sensor.rigidBody.setTranslation(newMeshPosition, true) - this.sensor.rigidBody.setRotation(new THREE.Quaternion().setFromEuler(newMeshRotation), true) + newMeshPosition.x += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.x + newMeshPosition.y += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.y + newMeshPosition.z += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.z + this.sensor.__RIGIDBODY__.setTranslation(newMeshPosition, true) + this.sensor.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(newMeshRotation), true) } } // If the collider and mesh exist, update the mesh position and rotation according to the collider else if (this.collider && this.mesh) { // Translation - const newMeshPosition = this.collider.collider.translation() + const newMeshPosition = this.collider.__COLLIDER__.translation() // Remove offset - newMeshPosition.x -= this.collider.colliderPositionOffset.x - newMeshPosition.y -= this.collider.colliderPositionOffset.y - newMeshPosition.z -= this.collider.colliderPositionOffset.z + newMeshPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x + newMeshPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y + newMeshPosition.z -= this.collider.__COLLIDER_POSITION_OFFSET__.z // Rotation const newMeshRotation = new THREE.Euler().setFromQuaternion( new THREE.Quaternion( - this.collider.collider.rotation().x, - this.collider.collider.rotation().y, - this.collider.collider.rotation().z, - this.collider.collider.rotation().w, + this.collider.__COLLIDER__.rotation().x, + this.collider.__COLLIDER__.rotation().y, + this.collider.__COLLIDER__.rotation().z, + this.collider.__COLLIDER__.rotation().w, ), ) // Remove offset - newMeshRotation.x -= this.collider.colliderRotationOffset.x - newMeshRotation.y -= this.collider.colliderRotationOffset.y - newMeshRotation.z -= this.collider.colliderRotationOffset.z + newMeshRotation.x -= this.collider.__COLLIDER_ROTATION_OFFSET__.x + newMeshRotation.y -= this.collider.__COLLIDER_ROTATION_OFFSET__.y + newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z // Apply the new transforms to the mesh this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) @@ -183,8 +183,8 @@ export abstract class FComponent extends FComponentCore { this.mesh.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) // If a sensor exists, update its position and rotation according to the default values if (this.sensor) { - this.sensor.rigidBody.setTranslation({ x: this.transform.position.x, y: this.transform.position.y, z: this.transform.position.z }, true) - this.sensor.rigidBody.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z)), true) + this.sensor.__RIGIDBODY__.setTranslation({ x: this.transform.position.x, y: this.transform.position.y, z: this.transform.position.z }, true) + this.sensor.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z)), true) } } // If the mesh still doesn't exist, do nothing @@ -206,53 +206,15 @@ export abstract class FComponent extends FComponentCore { // If a mesh exists, update its position if (this.mesh) this.mesh.position.set(options.x, options.y, options.z) - // If a collider exists, update its translation - if (this.collider) - this.collider.collider.setTranslation({ x: options.x, y: options.y, z: options.z }) - // If a rigidBody exists, update its translation + // If a rigidBody exists, update its position if (this.rigidBody) - this.rigidBody.rigidBody.setTranslation({ x: options.x, y: options.y, z: options.z }, true) - } - - /** - * Set the scale of the component. - * @param options The options for the scale. - * @param options.x The scale on the x-axis. - * @param options.y The scale on the y-axis. - * @param options.z The scale on the z-axis. - * @example - * ```ts - * component.setScale({ x: 1, y: 1, z: 1 }) - * ``` - */ - setScale(options: { x: number, y: number, z: number }): void { - this.transform.scale.set(options.x, options.y, options.z) - // If a mesh exists - if (this.mesh) { - // If the mesh is a classic polyhedron - if (this.mesh instanceof THREE.Mesh && (this.mesh.geometry instanceof THREE.BoxGeometry || this.mesh.geometry instanceof THREE.SphereGeometry)) { - this.mesh.scale.set(options.x, options.y, options.z) - } - // We don't know the type of the mesh, probably a custom mesh - else { - // I don't really know why the scale should be devided by 2 for custom meshes, but it works - this.mesh.scale.set(options.x / 2, options.y / 2, options.z / 2) - } - } - // If a collider exists - if (this.collider) { - // If the collider is a cuboid, update its half extents - if (this.collider.collider.shape.type === RAPIER.ShapeType.Cuboid) { - this.collider.collider.setHalfExtents(new RAPIER.Vector3(options.x / 2, options.y / 2, options.z / 2)) - } - // If the collider is a ball, update its radius - else if (this.collider.collider.shape.type === RAPIER.ShapeType.Ball) { - this.collider.collider.setRadius( - // Get the maximum value of x, y and z - Math.max(options.x, options.y, options.z) / 2, - ) - } - } + this.rigidBody.updatePosition() + // Else if a collider exists, update its position + else if (this.collider) + this.collider.updatePosition() + // If a sensor exists, update its position + if (this.sensor) + this.sensor.updatePosition() } /** @@ -271,12 +233,15 @@ export abstract class FComponent extends FComponentCore { // If a mesh exists, update its rotation if (this.mesh) this.mesh.rotation.set(options.x, options.y, options.z) - // If a collider exists, update its rotation - if (this.collider) - this.collider.collider.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(options.x, options.y, options.z))) // If a rigidBody exists, update its rotation if (this.rigidBody) - this.rigidBody.rigidBody.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(options.x, options.y, options.z)), true) + this.rigidBody.updateRotation() + // Else if a collider exists, update its rotation + else if (this.collider) + this.collider.updateRotation() + // If a sensor exists, update its rotation + if (this.sensor) + this.sensor.updateRotation() } /** @@ -301,13 +266,49 @@ export abstract class FComponent extends FComponentCore { this.setRotation(radRotation) } + /** + * Set the scale of the component. + * @param options The options for the scale. + * @param options.x The scale on the x-axis. + * @param options.y The scale on the y-axis. + * @param options.z The scale on the z-axis. + * @example + * ```ts + * component.setScale({ x: 1, y: 1, z: 1 }) + * ``` + */ + setScale(options: { x: number, y: number, z: number }): void { + this.transform.scale.set(options.x, options.y, options.z) + // If a mesh exists + if (this.mesh) { + // If the mesh is a classic polyhedron + if (this.mesh instanceof THREE.Mesh && (this.mesh.geometry instanceof THREE.BoxGeometry || this.mesh.geometry instanceof THREE.SphereGeometry)) { + this.mesh.scale.set(options.x, options.y, options.z) + } + // We don't know the type of the mesh, probably a custom mesh + else { + // I don't really know why the scale should be devided by 2 for custom meshes, but it works + this.mesh.scale.set(options.x / 2, options.y / 2, options.z / 2) + } + } + // If a rigidBody exists, update its scale + if (this.rigidBody) + this.rigidBody.updateScale() + // Else if a collider exists, update its scale + else if (this.collider) + this.collider.updateScale() + // If a sensor exists, update its scale + if (this.sensor) + this.sensor.updateScale() + } + /** * Init a rigidBody for the component. * @param options The options for the rigidBody. * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. * @param options.lockTranslations If true, the rigidBody will not be able to move. * @param options.lockRotations If true, the rigidBody will not be able to rotate. @@ -325,7 +326,7 @@ export abstract class FComponent extends FComponentCore { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, - * shape: FShapes.CUBE + * shape: FShapes.CUBOID * }) * ``` */ @@ -345,7 +346,7 @@ export abstract class FComponent extends FComponentCore { * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example @@ -354,7 +355,7 @@ export abstract class FComponent extends FComponentCore { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, - * shape: FShapes.CUBE + * shape: FShapes.CUBOID * }) * ``` */ @@ -370,7 +371,7 @@ export abstract class FComponent extends FComponentCore { * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.sensor If true, the collider will be a sensor. * @example * ```ts @@ -378,7 +379,7 @@ export abstract class FComponent extends FComponentCore { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, - * shape: FShapes.CUBE + * shape: FShapes.CUBOID * }) * ``` */ @@ -393,9 +394,9 @@ export abstract class FComponent extends FComponentCore { onCollisionWith(classOrObject: any, callback: (data: OnCollisionWithData) => void): () => void { // Activate collision events if they are not already activated - if (this.sensor && this.sensor.collider.collider.activeEvents() === RAPIER.ActiveEvents.NONE) { + if (this.sensor && this.sensor.collider.__COLLIDER__.activeEvents() === RAPIER.ActiveEvents.NONE) { // Set the active events - this.sensor.collider.collider.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS) + this.sensor.collider.__COLLIDER__.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS) } // Call the core onCollisionWith method return super.onCollisionWith(classOrObject, callback) diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index f12c4ce8..a76af184 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -27,18 +27,32 @@ export interface FRigidBodyOptions { } /** - * A 3d RigidBody. + * A 3d rigidBody that can be attached to a component. * @category Core */ export class FRigidBody { /** * RAPIER RigidBody */ - rigidBody: RAPIER.RigidBody + __RIGIDBODY__: RAPIER.RigidBody /** * Fibbo Collider */ collider: FCollider + /** + * Position Offset for the rigidBody. + * This is used to adjust the rigidBody position relative to the component. + */ + __RIGIDBODY_POSITION_OFFSET__: { x: number, y: number, z: number } + /** + * Rotation Offset for the rigidBody. + * This is used to adjust the rigidBody position relative to the component. + */ + __RIGIDBODY_ROTATION_OFFSET__: { x: number, y: number, z: number } + /** + * The component the rigidBody is attached to. + */ + component: FComponent /** * Creates a rigidBody for the given component. @@ -47,7 +61,7 @@ export class FRigidBody { * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBE. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. * @param options.lockTranslations If true, the rigidBody will not be able to move. * @param options.lockRotations If true, the rigidBody will not be able to rotate. @@ -65,7 +79,7 @@ export class FRigidBody { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, - * shape: FShapes.CUBE + * shape: FShapes.CUBOID * }) * ``` */ @@ -76,7 +90,7 @@ export class FRigidBody { scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, rotationDegree: undefined, - shape: FShapes.CUBE, + shape: FShapes.CUBOID, rigidBodyType: RAPIER.RigidBodyType.Dynamic, sensor: false, lockTranslations: false, @@ -87,12 +101,17 @@ export class FRigidBody { options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || !options.rotation || !options.shape) - throw new Error('FibboError: initRigidBody requires position, scale, rotation, shape and rigidBodyType options') + throw new Error('FibboError: initRigidBody requires transforms options') // Check if the world exists if (!component.scene.world) throw new Error('FibboError: FScene must have a world to create a rigidBody') + // Store the options + this.__RIGIDBODY_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } + this.__RIGIDBODY_ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } + this.component = component + // If rotation degree is given, convert it to radians if (options.rotationDegree) { options.rotation.x = THREE.MathUtils.degToRad(options.rotationDegree.x) @@ -119,17 +138,17 @@ export class FRigidBody { )) // Create the rigidBody - this.rigidBody = component.scene.world.createRigidBody(rigidBodyDesc) + this.__RIGIDBODY__ = component.scene.world.createRigidBody(rigidBodyDesc) // Lock the translation if needed if (options.lockTranslations) - this.rigidBody.lockTranslations(true, true) + this.__RIGIDBODY__.lockTranslations(true, true) // Lock the rotation if needed if (options.lockRotations) - this.rigidBody.lockRotations(true, true) + this.__RIGIDBODY__.lockRotations(true, true) // Enable only specific translations if needed if (options.enabledTranslations) { - this.rigidBody.setEnabledTranslations( + this.__RIGIDBODY__.setEnabledTranslations( options.enabledTranslations.enableX, options.enabledTranslations.enableY, options.enabledTranslations.enableZ, @@ -138,7 +157,7 @@ export class FRigidBody { } // Enable only specific rotations if needed if (options.enabledRotations) { - this.rigidBody.setEnabledRotations( + this.__RIGIDBODY__.setEnabledRotations( options.enabledRotations.enableX, options.enabledRotations.enableY, options.enabledRotations.enableZ, @@ -149,7 +168,234 @@ export class FRigidBody { // Create the collider this.collider = new FCollider(component, { ...options, - rigidBody: this.rigidBody, + rigidBody: this, }) } + + /** + * Set the position of the rigidBody. + * @param position The new position of the rigidBody. + * @param position.x The new x position of the rigidBody. + * @param position.y The new y position of the rigidBody. + * @param position.z The new z position of the rigidBody. + */ + setPosition(position: { x: number, y: number, z: number }) { + this.__RIGIDBODY__.setTranslation(position, true) + this.collider.setPosition(position) + } + + /** + * Set the rotation of the rigidBody. + * @param rotation The new rotation of the rigidBody. + * @param rotation.x The new x rotation of the rigidBody. + * @param rotation.y The new y rotation of the rigidBody. + * @param rotation.z The new z rotation of the rigidBody. + */ + setRotation(rotation: { x: number, y: number, z: number }) { + this.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z)), true) + this.collider.setRotation(rotation) + } + + /** + * Set the rotation of the rigidBody in degrees. + * @param rotation The new rotation of the rigidBody in degrees. + * @param rotation.x The new x rotation of the rigidBody in degrees. + * @param rotation.y The new y rotation of the rigidBody in degrees. + * @param rotation.z The new z rotation of the rigidBody in degrees. + */ + setRotationDegree(rotation: { x: number, y: number, z: number }) { + this.setRotation({ + x: THREE.MathUtils.degToRad(rotation.x), + y: THREE.MathUtils.degToRad(rotation.y), + z: THREE.MathUtils.degToRad(rotation.z), + }) + } + + /** + * Set the scale of the rigidBody. + * @param scale The new scale of the rigidBody. + * @param scale.x The new x scale of the rigidBody. + * @param scale.y The new y scale of the rigidBody. + * @param scale.z The new z scale of the rigidBody. + */ + setScale(scale: { x: number, y: number, z: number }) { + this.collider.setScale(scale) + } + + /** + * Update the position of the rigidBody according to its component's position. + * This takes into account the position offset. + */ + updatePosition() { + const newPosition = { + x: this.component.transform.position.x + this.__RIGIDBODY_POSITION_OFFSET__.x, + y: this.component.transform.position.y + this.__RIGIDBODY_POSITION_OFFSET__.y, + z: this.component.transform.position.z + this.__RIGIDBODY_POSITION_OFFSET__.z, + } + this.setPosition(newPosition) + this.collider.setPosition(newPosition) + } + + /** + * Update the rotation of the rigidBody according to its component's rotation. + * This takes into account the rotation offset. + */ + updateRotation() { + const newRotation = { + x: this.component.transform.rotation.x + this.__RIGIDBODY_ROTATION_OFFSET__.x, + y: this.component.transform.rotation.y + this.__RIGIDBODY_ROTATION_OFFSET__.y, + z: this.component.transform.rotation.z + this.__RIGIDBODY_ROTATION_OFFSET__.z, + } + this.setRotation(newRotation) + this.collider.setRotation(newRotation) + } + + /** + * Update the scale of the rigidBody according to its component's scale. + * This takes into account the scale offset. + * As a rigidBody does not have a scale, this will only update the attached collider's scale. + */ + updateScale() { + this.collider.updateScale() + } + + // Setters & getters for transform properties + + get position() { + return this.__RIGIDBODY__.translation() + } + + set position(position: { x: number, y: number, z: number }) { + this.setPosition(position) + } + + get x() { + return this.__RIGIDBODY__.translation().x + } + + set x(x: number) { + this.setPosition({ x, y: this.y, z: this.z }) + } + + get y() { + return this.__RIGIDBODY__.translation().y + } + + set y(y: number) { + this.setPosition({ x: this.x, y, z: this.z }) + } + + get z() { + return this.__RIGIDBODY__.translation().z + } + + set z(z: number) { + this.setPosition({ x: this.x, y: this.y, z }) + } + + get rotation() { + const quaternion = this.__RIGIDBODY__.rotation() + const euler = new THREE.Euler().setFromQuaternion( + new THREE.Quaternion( + quaternion.x, + quaternion.y, + quaternion.z, + quaternion.w, + ), + ) + return { x: euler.x, y: euler.y, z: euler.z } + } + + set rotation(rotation: { x: number, y: number, z: number }) { + this.setRotation(rotation) + } + + get rotationX() { + return this.rotation.x + } + + set rotationX(x: number) { + this.setRotation({ x, y: this.rotation.y, z: this.rotation.z }) + } + + get rotationY() { + return this.rotation.y + } + + set rotationY(y: number) { + this.setRotation({ x: this.rotation.x, y, z: this.rotation.z }) + } + + get rotationZ() { + return this.rotation.z + } + + set rotationZ(z: number) { + this.setRotation({ x: this.rotation.x, y: this.rotation.y, z }) + } + + get rotationDegree() { + const euler = this.rotation + return { x: THREE.MathUtils.radToDeg(euler.x), y: THREE.MathUtils.radToDeg(euler.y), z: THREE.MathUtils.radToDeg(euler.z) } + } + + set rotationDegree(rotation: { x: number, y: number, z: number }) { + this.setRotationDegree(rotation) + } + + get rotationDegreeX() { + return this.rotationDegree.x + } + + set rotationDegreeX(x: number) { + this.setRotationDegree({ x, y: this.rotationDegree.y, z: this.rotationDegree.z }) + } + + get rotationDegreeY() { + return this.rotationDegree.y + } + + set rotationDegreeY(y: number) { + this.setRotationDegree({ x: this.rotationDegree.x, y, z: this.rotationDegree.z }) + } + + get rotationDegreeZ() { + return this.rotationDegree.z + } + + set rotationDegreeZ(z: number) { + this.setRotationDegree({ x: this.rotationDegree.x, y: this.rotationDegree.y, z }) + } + + get scale() { + return this.collider.scale + } + + set scale(scale: { x: number, y: number, z: number }) { + this.setScale(scale) + } + + get scaleX() { + return this.scale.x + } + + set scaleX(x: number) { + this.setScale({ x, y: this.scale.y, z: this.scale.z }) + } + + get scaleY() { + return this.scale.y + } + + set scaleY(y: number) { + this.setScale({ x: this.scale.x, y, z: this.scale.z }) + } + + get scaleZ() { + return this.scale.z + } + + set scaleZ(z: number) { + this.setScale({ x: this.scale.x, y: this.scale.y, z }) + } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 6d0d003f..4e3349ff 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -192,10 +192,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) }) } else { @@ -205,10 +205,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.collider.handle, component) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) } removeComponent(component: FComponent): void { @@ -220,17 +220,17 @@ export class FScene extends FSceneCore { // Remove colliders and rigidBodies from rapier world if (component.rigidBody) - this.world.removeRigidBody(component.rigidBody.rigidBody) + this.world.removeRigidBody(component.rigidBody.__RIGIDBODY__) if (component.collider) - this.world.removeCollider(component.collider.collider, false) + this.world.removeCollider(component.collider.__COLLIDER__, false) if (component.sensor) - this.world.removeCollider(component.sensor.collider.collider, false) + this.world.removeCollider(component.sensor.collider.__COLLIDER__, false) // Remove handle from rapier map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.collider.handle) + this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.__COLLIDER__.handle) if (component.collider) - this.__RAPIER_TO_COMPONENT__.delete(component.collider.collider.handle) + this.__RAPIER_TO_COMPONENT__.delete(component.collider.__COLLIDER__.handle) } addLight(light: FLight): void { diff --git a/packages/3d/src/types/FShapes.ts b/packages/3d/src/types/FShapes.ts index c1731162..839ad8a4 100644 --- a/packages/3d/src/types/FShapes.ts +++ b/packages/3d/src/types/FShapes.ts @@ -1,6 +1,6 @@ // FShapes type export enum FShapes { - CUBE = 'Cube', + CUBOID = 'Cuboid', SPHERE = 'Sphere', CAPSULE = 'Capsule', MESH = 'Mesh', diff --git a/packages/3d/test/browser/collider.test.ts b/packages/3d/test/browser/collider.test.ts new file mode 100644 index 00000000..64ee366e --- /dev/null +++ b/packages/3d/test/browser/collider.test.ts @@ -0,0 +1,243 @@ +import { beforeEach, describe, expect, it } from 'vitest' +import { FCuboid, FScene, FShapes } from '@fibbojs/3d' +import RAPIER from '@dimforge/rapier3d' + +describe('fCollider', () => { + let scene: FScene + + beforeEach(async () => { + scene = new FScene() + await scene.init() + await scene.initPhysics() + }) + + it('should create a collider with default options', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initCollider() + expect(cuboid.collider).toBeDefined() + // Validate offset + expect(cuboid.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.collider.__COLLIDER_ROTATION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1, z: 1 }) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(0) + expect(cuboid.collider.position.y).toEqual(0) + expect(cuboid.collider.position.z).toEqual(0) + expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.scale.x).toEqual(1) + expect(cuboid.collider.scale.y).toEqual(1) + expect(cuboid.collider.scale.z).toEqual(1) + expect(cuboid.collider.shape).toEqual(FShapes.CUBOID) + // Validate scaleX, scaleY and scaleZ + cuboid.collider.scaleX = 2 + cuboid.collider.scaleY = 3 + cuboid.collider.scaleZ = 4 + expect(cuboid.collider.scaleX).toEqual(2) + expect(cuboid.collider.scaleY).toEqual(3) + expect(cuboid.collider.scaleZ).toEqual(4) + expect(cuboid.collider.scaleX).toEqual(cuboid.collider.scale.x) + expect(cuboid.collider.scaleY).toEqual(cuboid.collider.scale.y) + expect(cuboid.collider.scaleZ).toEqual(cuboid.collider.scale.z) + }) + + it('should create a collider with custom transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 2, z: 3 }, + }) + cuboid.initCollider({ + position: { x: -2, y: 3, z: -4 }, + rotation: { x: -0.3, y: 0.2, z: 0.1 }, + scale: { x: 2, y: 2, z: 2 }, + }) + expect(cuboid.collider).toBeDefined() + // Validate offset + expect(cuboid.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: -2, y: 3, z: -4 }) + expect(cuboid.collider.__COLLIDER_ROTATION_OFFSET__).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) + expect(cuboid.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(-1) + expect(cuboid.collider.position.y).toEqual(4) + expect(cuboid.collider.position.z).toEqual(-3) + expect(cuboid.collider.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.collider.scale.x).toEqual(2) + expect(cuboid.collider.scale.y).toEqual(4) + expect(cuboid.collider.scale.z).toEqual(6) + }) + + it('should create a collider with a sphere shape', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initCollider({ + shape: FShapes.SPHERE, + }) + expect(cuboid.collider).toBeDefined() + // Validate shape + expect(cuboid.collider.shape).toEqual(FShapes.SPHERE) + expect(cuboid.collider.__COLLIDER__.shape).toBeDefined() + expect(cuboid.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(0) + expect(cuboid.collider.position.y).toEqual(0) + expect(cuboid.collider.position.z).toEqual(0) + expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.scale.x).toEqual(1) + expect(cuboid.collider.scale.y).toEqual(1) + expect(cuboid.collider.scale.z).toEqual(1) + }) + + it('should modify collider transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 0, z: 0 }, + rotation: { x: 0, y: 0.2, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initCollider() + expect(cuboid.collider).toBeDefined() + // Validate transforms + expect(cuboid.collider.position.x).toEqual(1) + expect(cuboid.collider.position.y).toEqual(0) + expect(cuboid.collider.position.z).toEqual(0) + expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.scale.x).toEqual(1) + expect(cuboid.collider.scale.y).toEqual(1) + expect(cuboid.collider.scale.z).toEqual(1) + // Modify transforms with functions + cuboid.collider.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.collider.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.collider.setScale({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(1) + expect(cuboid.collider.position.y).toEqual(1) + expect(cuboid.collider.position.z).toEqual(1) + expect(cuboid.collider.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.collider.scale.x).toEqual(2) + expect(cuboid.collider.scale.y).toEqual(2) + expect(cuboid.collider.scale.z).toEqual(2) + // Modify transforms with setters + cuboid.collider.position = { x: 2, y: 4, z: 6 } + cuboid.collider.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.collider.scale = { x: 3, y: 4, z: 5 } + // Validate transforms + expect(cuboid.collider.position.x).toEqual(2) + expect(cuboid.collider.position.y).toEqual(4) + expect(cuboid.collider.position.z).toEqual(6) + expect(cuboid.collider.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.6, 0.0001) + expect(cuboid.collider.scale.x).toEqual(3) + expect(cuboid.collider.scale.y).toEqual(4) + expect(cuboid.collider.scale.z).toEqual(5) + }) + + it('should modify collider transforms with a sphere shape', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initCollider({ + shape: FShapes.SPHERE, + }) + expect(cuboid.collider).toBeDefined() + // Validate shape + expect(cuboid.collider.shape).toEqual(FShapes.SPHERE) + expect(cuboid.collider.__COLLIDER__.shape).toBeDefined() + expect(cuboid.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(0) + expect(cuboid.collider.position.y).toEqual(0) + expect(cuboid.collider.position.z).toEqual(0) + expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.scale.x).toEqual(1) + expect(cuboid.collider.scale.y).toEqual(1) + expect(cuboid.collider.scale.z).toEqual(1) + // Modify transforms with functions + cuboid.collider.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.collider.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.collider.setScale({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(1) + expect(cuboid.collider.position.y).toEqual(1) + expect(cuboid.collider.position.z).toEqual(1) + expect(cuboid.collider.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.collider.scale.x).toEqual(2) + expect(cuboid.collider.scale.y).toEqual(2) + expect(cuboid.collider.scale.z).toEqual(2) + // Modify transforms with setters + cuboid.collider.position = { x: 2, y: 4, z: 6 } + cuboid.collider.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.collider.scale = { x: 3, y: 5, z: 4 } + // Validate transforms + expect(cuboid.collider.position.x).toEqual(2) + expect(cuboid.collider.position.y).toEqual(4) + expect(cuboid.collider.position.z).toEqual(6) + expect(cuboid.collider.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.6, 0.0001) + // Circle shape has the same scale for x, y and z (the highest value is used) + expect(cuboid.collider.scale.x).toEqual(5) + expect(cuboid.collider.scale.y).toEqual(5) + expect(cuboid.collider.scale.z).toEqual(5) + }) + + it('should update collider transforms with attached component transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 0.5, z: 1 }, + }) + cuboid.initCollider({ + position: { x: -2, y: 3, z: -4 }, + rotation: { x: -0.3, y: 0.2, z: 0.1 }, + scale: { x: 2, y: 4, z: 2 }, + }) + expect(cuboid.collider).toBeDefined() + // Validate transforms + expect(cuboid.collider.position.x).toEqual(-1) + expect(cuboid.collider.position.y).toEqual(4) + expect(cuboid.collider.position.z).toEqual(-3) + expect(cuboid.collider.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.collider.scale.x).toEqual(2) + expect(cuboid.collider.scale.y).toEqual(2) + expect(cuboid.collider.scale.z).toEqual(2) + // Modify component transforms + cuboid.setPosition({ x: 2, y: 2, z: 6 }) + cuboid.setRotation({ x: 0.2, y: 0.4, z: 0.6 }) + cuboid.setScale({ x: 3, y: 4, z: 5 }) + // Validate transforms + expect(cuboid.collider.position.x).toEqual(0) + expect(cuboid.collider.position.y).toEqual(5) + expect(cuboid.collider.position.z).toEqual(2) + expect(cuboid.collider.rotation.x).closeTo(-0.1, 0.0001) + expect(cuboid.collider.rotation.y).closeTo(0.6, 0.0001) + expect(cuboid.collider.rotation.z).closeTo(0.7, 0.0001) + expect(cuboid.collider.scale.x).toEqual(6) + expect(cuboid.collider.scale.y).toEqual(16) + expect(cuboid.collider.scale.z).toEqual(10) + }) +}) diff --git a/packages/3d/test/browser/rigidbody.test.ts b/packages/3d/test/browser/rigidbody.test.ts new file mode 100644 index 00000000..92fbcc84 --- /dev/null +++ b/packages/3d/test/browser/rigidbody.test.ts @@ -0,0 +1,242 @@ +import { beforeEach, describe, expect, it } from 'vitest' +import { FCuboid, FScene, FShapes } from '@fibbojs/3d' +import RAPIER from '@dimforge/rapier3d' + +describe('fCollider', () => { + let scene: FScene + + beforeEach(async () => { + scene = new FScene() + await scene.init() + await scene.initPhysics() + }) + + it('should create a collider with default options', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initRigidBody() + expect(cuboid.rigidBody).toBeDefined() + // Validate offset + expect(cuboid.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(0) + expect(cuboid.rigidBody.position.y).toEqual(0) + expect(cuboid.rigidBody.position.z).toEqual(0) + expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(1) + expect(cuboid.rigidBody.scale.y).toEqual(1) + expect(cuboid.rigidBody.scale.z).toEqual(1) + expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.CUBOID) + // Validate scaleX, scaleY and scaleZ + cuboid.rigidBody.scaleX = 2 + cuboid.rigidBody.scaleY = 3 + cuboid.rigidBody.scaleZ = 4 + expect(cuboid.rigidBody.scaleX).toEqual(2) + expect(cuboid.rigidBody.scaleY).toEqual(3) + expect(cuboid.rigidBody.scaleZ).toEqual(4) + expect(cuboid.rigidBody.scaleX).toEqual(cuboid.rigidBody.scale.x) + expect(cuboid.rigidBody.scaleY).toEqual(cuboid.rigidBody.scale.y) + expect(cuboid.rigidBody.scaleZ).toEqual(cuboid.rigidBody.scale.z) + }) + + it('should create a collider with custom transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 2, z: 3 }, + }) + cuboid.initRigidBody({ + position: { x: -2, y: 3, z: -4 }, + rotation: { x: -0.3, y: 0.2, z: 0.1 }, + scale: { x: 2, y: 2, z: 2 }, + }) + expect(cuboid.rigidBody).toBeDefined() + // Validate offset + expect(cuboid.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: -2, y: 3, z: -4 }) + expect(cuboid.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) + expect(cuboid.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(-1) + expect(cuboid.rigidBody.position.y).toEqual(4) + expect(cuboid.rigidBody.position.z).toEqual(-3) + expect(cuboid.rigidBody.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(2) + expect(cuboid.rigidBody.scale.y).toEqual(4) + expect(cuboid.rigidBody.scale.z).toEqual(6) + }) + + it('should create a collider with a sphere shape', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initRigidBody({ + shape: FShapes.SPHERE, + }) + expect(cuboid.rigidBody).toBeDefined() + // Validate shape + expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.SPHERE) + expect(cuboid.rigidBody.collider.__COLLIDER__.shape).toBeDefined() + expect(cuboid.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(0) + expect(cuboid.rigidBody.position.y).toEqual(0) + expect(cuboid.rigidBody.position.z).toEqual(0) + expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(1) + expect(cuboid.rigidBody.scale.y).toEqual(1) + expect(cuboid.rigidBody.scale.z).toEqual(1) + }) + + it('should modify collider transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 0, z: 0 }, + rotation: { x: 0, y: 0.2, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initRigidBody() + expect(cuboid.rigidBody).toBeDefined() + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(1) + expect(cuboid.rigidBody.position.y).toEqual(0) + expect(cuboid.rigidBody.position.z).toEqual(0) + expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(1) + expect(cuboid.rigidBody.scale.y).toEqual(1) + expect(cuboid.rigidBody.scale.z).toEqual(1) + // Modify transforms with functions + cuboid.rigidBody.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.rigidBody.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.rigidBody.setScale({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(1) + expect(cuboid.rigidBody.position.y).toEqual(1) + expect(cuboid.rigidBody.position.z).toEqual(1) + expect(cuboid.rigidBody.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(2) + expect(cuboid.rigidBody.scale.y).toEqual(2) + expect(cuboid.rigidBody.scale.z).toEqual(2) + // Modify transforms with setters + cuboid.rigidBody.position = { x: 2, y: 4, z: 6 } + cuboid.rigidBody.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.rigidBody.scale = { x: 3, y: 4, z: 5 } + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(2) + expect(cuboid.rigidBody.position.y).toEqual(4) + expect(cuboid.rigidBody.position.z).toEqual(6) + expect(cuboid.rigidBody.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.6, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(3) + expect(cuboid.rigidBody.scale.y).toEqual(4) + expect(cuboid.rigidBody.scale.z).toEqual(5) + }) + + it('should modify collider transforms with a sphere shape', () => { + const cuboid = new FCuboid(scene, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + }) + cuboid.initRigidBody({ + shape: FShapes.SPHERE, + }) + expect(cuboid.rigidBody).toBeDefined() + // Validate shape + expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.SPHERE) + expect(cuboid.rigidBody.collider.__COLLIDER__.shape).toBeDefined() + expect(cuboid.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(0) + expect(cuboid.rigidBody.position.y).toEqual(0) + expect(cuboid.rigidBody.position.z).toEqual(0) + expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(1) + expect(cuboid.rigidBody.scale.y).toEqual(1) + expect(cuboid.rigidBody.scale.z).toEqual(1) + // Modify transforms with functions + cuboid.rigidBody.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.rigidBody.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.rigidBody.setScale({ x: 2, y: 2, z: 2 }) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(1) + expect(cuboid.rigidBody.position.y).toEqual(1) + expect(cuboid.rigidBody.position.z).toEqual(1) + expect(cuboid.rigidBody.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(2) + expect(cuboid.rigidBody.scale.y).toEqual(2) + expect(cuboid.rigidBody.scale.z).toEqual(2) + // Modify transforms with setters + cuboid.rigidBody.position = { x: 2, y: 4, z: 6 } + cuboid.rigidBody.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.rigidBody.scale = { x: 3, y: 5, z: 4 } + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(2) + expect(cuboid.rigidBody.position.y).toEqual(4) + expect(cuboid.rigidBody.position.z).toEqual(6) + expect(cuboid.rigidBody.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.6, 0.0001) + // Circle shape has the same scale for x, y and z (the highest value is used) + expect(cuboid.rigidBody.scale.x).toEqual(5) + expect(cuboid.rigidBody.scale.y).toEqual(5) + expect(cuboid.rigidBody.scale.z).toEqual(5) + }) + + it('should update collider transforms with attached component transforms', () => { + const cuboid = new FCuboid(scene, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 0.5, z: 1 }, + }) + cuboid.initRigidBody({ + position: { x: -2, y: 3, z: -4 }, + rotation: { x: -0.3, y: 0.2, z: 0.1 }, + scale: { x: 2, y: 4, z: 2 }, + }) + expect(cuboid.rigidBody).toBeDefined() + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(-1) + expect(cuboid.rigidBody.position.y).toEqual(4) + expect(cuboid.rigidBody.position.z).toEqual(-3) + expect(cuboid.rigidBody.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(2) + expect(cuboid.rigidBody.scale.y).toEqual(2) + expect(cuboid.rigidBody.scale.z).toEqual(2) + // Modify component transforms + cuboid.setPosition({ x: 2, y: 2, z: 6 }) + cuboid.setRotation({ x: 0.2, y: 0.4, z: 0.6 }) + cuboid.setScale({ x: 3, y: 4, z: 5 }) + // Validate transforms + expect(cuboid.rigidBody.position.x).toEqual(0) + expect(cuboid.rigidBody.position.y).toEqual(5) + expect(cuboid.rigidBody.position.z).toEqual(2) + expect(cuboid.rigidBody.rotation.x).closeTo(-0.1, 0.0001) + expect(cuboid.rigidBody.rotation.y).closeTo(0.6, 0.0001) + expect(cuboid.rigidBody.rotation.z).closeTo(0.7, 0.0001) + expect(cuboid.rigidBody.scale.x).toEqual(6) + expect(cuboid.rigidBody.scale.y).toEqual(16) + expect(cuboid.rigidBody.scale.z).toEqual(10) + }) +}) From c3fef07ef9736a06f32e696f177a366c03588630 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 4 Oct 2024 10:22:01 +0200 Subject: [PATCH 14/36] chore: update docs + lint --- docs/api/2d/classes/FAttachedCamera.md | 16 +- docs/api/2d/classes/FCamera.md | 14 +- docs/api/2d/classes/FCharacterController.md | 10 +- docs/api/2d/classes/FCharacterControllerD.md | 14 +- docs/api/2d/classes/FCharacterControllerK.md | 16 +- docs/api/2d/classes/FCharacterControllerKP.md | 20 +- docs/api/2d/classes/FCharacterControllerKV.md | 20 +- docs/api/2d/classes/FCircle.md | 66 +- docs/api/2d/classes/FCollider.md | 238 ++++++- docs/api/2d/classes/FComponent.md | 66 +- docs/api/2d/classes/FComponentEmpty.md | 66 +- docs/api/2d/classes/FController.md | 4 +- docs/api/2d/classes/FFixedCamera.md | 14 +- docs/api/2d/classes/FFreeCamera.md | 14 +- docs/api/2d/classes/FLight.md | 32 +- docs/api/2d/classes/FPolygon.md | 66 +- docs/api/2d/classes/FRectangle.md | 66 +- docs/api/2d/classes/FRigidBody.md | 269 ++++++- docs/api/2d/classes/FScene.md | 40 +- docs/api/2d/classes/FSprite.md | 80 ++- docs/api/2d/classes/FTransform.md | 8 +- docs/api/2d/enumerations/FShapes.md | 8 +- .../2d/interfaces/FAttachedCameraOptions.md | 4 +- docs/api/2d/interfaces/FCameraOptions.md | 2 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/2d/interfaces/FColliderOptions.md | 16 +- docs/api/2d/interfaces/FComponentOptions.md | 8 +- docs/api/2d/interfaces/FControllerOptions.md | 2 +- docs/api/2d/interfaces/FLightOptions.md | 14 +- docs/api/2d/interfaces/FRigidBodyOptions.md | 20 +- docs/api/2d/interfaces/FSceneOptions.md | 2 +- docs/api/2d/interfaces/FSpriteOptions.md | 10 +- docs/api/2d/interfaces/FTransformOptions.md | 8 +- docs/api/3d/classes/FAmbientLight.md | 28 +- docs/api/3d/classes/FAttachedCamera.md | 32 +- docs/api/3d/classes/FCamera.md | 28 +- docs/api/3d/classes/FCapsule.md | 88 +-- docs/api/3d/classes/FCharacterController.md | 12 +- docs/api/3d/classes/FCharacterControllerD.md | 14 +- docs/api/3d/classes/FCharacterControllerK.md | 18 +- docs/api/3d/classes/FCharacterControllerKP.md | 20 +- docs/api/3d/classes/FCharacterControllerKV.md | 20 +- docs/api/3d/classes/FCollider.md | 660 +++++++++++++++++- docs/api/3d/classes/FComponent.md | 86 +-- docs/api/3d/classes/FComponentEmpty.md | 86 +-- docs/api/3d/classes/FController.md | 4 +- docs/api/3d/classes/FCuboid.md | 88 +-- docs/api/3d/classes/FDirectionalLight.md | 28 +- docs/api/3d/classes/FFBX.md | 104 +-- docs/api/3d/classes/FFixedCamera.md | 28 +- docs/api/3d/classes/FGLB.md | 104 +-- docs/api/3d/classes/FGLTF.md | 104 +-- docs/api/3d/classes/FGameCamera.md | 36 +- docs/api/3d/classes/FHemisphereLight.md | 28 +- docs/api/3d/classes/FLight.md | 28 +- docs/api/3d/classes/FLightProbe.md | 28 +- docs/api/3d/classes/FModel.md | 104 +-- docs/api/3d/classes/FOBJ.md | 104 +-- docs/api/3d/classes/FOrbitCamera.md | 32 +- docs/api/3d/classes/FPointLight.md | 28 +- docs/api/3d/classes/FPointerLockCamera.md | 32 +- docs/api/3d/classes/FPolyhedron.md | 88 +-- docs/api/3d/classes/FRigidBody.md | 658 ++++++++++++++++- docs/api/3d/classes/FScene.md | 40 +- docs/api/3d/classes/FSphere.md | 88 +-- docs/api/3d/classes/FSpotLight.md | 28 +- docs/api/3d/classes/FTransform.md | 8 +- docs/api/3d/enumerations/FShapes.md | 12 +- .../3d/interfaces/FAttachedCameraOptions.md | 10 +- docs/api/3d/interfaces/FCameraOptions.md | 8 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/3d/interfaces/FColliderOptions.md | 16 +- docs/api/3d/interfaces/FComponentOptions.md | 8 +- docs/api/3d/interfaces/FControllerOptions.md | 2 +- .../3d/interfaces/FHemisphereLightOptions.md | 18 +- docs/api/3d/interfaces/FLightOptions.md | 14 +- docs/api/3d/interfaces/FLightProbeOptions.md | 16 +- docs/api/3d/interfaces/FModelOptions.md | 16 +- docs/api/3d/interfaces/FRigidBodyOptions.md | 22 +- docs/api/3d/interfaces/FSceneOptions.md | 4 +- docs/api/3d/interfaces/FSpotLightOptions.md | 22 +- docs/api/3d/interfaces/FTransformOptions.md | 8 +- docs/api/core/classes/FCamera.md | 20 +- docs/api/core/classes/FComponent.md | 18 +- docs/api/core/classes/FController.md | 6 +- docs/api/core/classes/FGroup.md | 10 +- docs/api/core/classes/FLight.md | 18 +- docs/api/core/classes/FScene.md | 52 +- .../api/core/interfaces/FControllerOptions.md | 2 +- docs/api/core/interfaces/FSceneOptions.md | 4 +- .../core/interfaces/OnCollisionWithData.md | 2 +- docs/api/event/classes/FKeyboard.md | 18 +- 92 files changed, 3070 insertions(+), 1379 deletions(-) diff --git a/docs/api/2d/classes/FAttachedCamera.md b/docs/api/2d/classes/FAttachedCamera.md index fa533735..e5ab4676 100644 --- a/docs/api/2d/classes/FAttachedCamera.md +++ b/docs/api/2d/classes/FAttachedCamera.md @@ -30,7 +30,7 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L20) +[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L20) ## Methods @@ -48,7 +48,7 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L33) +[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L33) *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L25) +[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L25) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,7 +330,7 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) *** @@ -342,4 +342,4 @@ The target to follow. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L18) +[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L18) diff --git a/docs/api/2d/classes/FCamera.md b/docs/api/2d/classes/FCamera.md index 627280c0..dcb3ac09 100644 --- a/docs/api/2d/classes/FCamera.md +++ b/docs/api/2d/classes/FCamera.md @@ -42,7 +42,7 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L34) +[2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L34) ## Methods @@ -56,7 +56,7 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L55) +[2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L55) *** @@ -188,7 +188,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L53) +[2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L53) *** @@ -212,7 +212,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -266,7 +266,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -318,7 +318,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FCharacterController.md b/docs/api/2d/classes/FCharacterController.md index a44ba149..6a0b128a 100644 --- a/docs/api/2d/classes/FCharacterController.md +++ b/docs/api/2d/classes/FCharacterController.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller. #### Defined in -[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L38) +[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L38) ## Methods @@ -80,7 +80,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) *** @@ -108,7 +108,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -120,7 +120,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -132,4 +132,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerD.md b/docs/api/2d/classes/FCharacterControllerD.md index ed30d79c..2db1f69f 100644 --- a/docs/api/2d/classes/FCharacterControllerD.md +++ b/docs/api/2d/classes/FCharacterControllerD.md @@ -7,7 +7,7 @@ A pre-defined character controller based on a Dynamic RigidBody. ## Example ```ts -import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/3d' +import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/2d' const scene = new FScene() @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerD.ts#L22) +[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerD.ts#L22) ## Methods @@ -68,7 +68,7 @@ Any rendering process should be done on the component, not here. #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerD.ts#L38) +[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerD.ts#L38) ## Properties @@ -85,7 +85,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) *** @@ -117,7 +117,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -133,7 +133,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -149,4 +149,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerK.md b/docs/api/2d/classes/FCharacterControllerK.md index 6217488d..5a0d323f 100644 --- a/docs/api/2d/classes/FCharacterControllerK.md +++ b/docs/api/2d/classes/FCharacterControllerK.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L22) +[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L22) ## Methods @@ -59,7 +59,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -99,7 +99,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -116,7 +116,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) *** @@ -148,7 +148,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -164,7 +164,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -180,7 +180,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -192,4 +192,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKP.md b/docs/api/2d/classes/FCharacterControllerKP.md index cc3c6345..b5d82952 100644 --- a/docs/api/2d/classes/FCharacterControllerKP.md +++ b/docs/api/2d/classes/FCharacterControllerKP.md @@ -7,7 +7,7 @@ A pre-defined character controller based on a Kinematic Position RigidBody. ## Example ```ts -import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/3d' +import { FCapsule, FCharacterControllerKP, FScene } from '@fibbojs/2d' const scene = new FScene() @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) +[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) ## Methods @@ -70,7 +70,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -98,7 +98,7 @@ The time since the last frame. #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) +[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) ## Properties @@ -114,7 +114,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +131,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +163,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +179,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +195,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +211,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKV.md b/docs/api/2d/classes/FCharacterControllerKV.md index e24fba1c..fbbdb69c 100644 --- a/docs/api/2d/classes/FCharacterControllerKV.md +++ b/docs/api/2d/classes/FCharacterControllerKV.md @@ -7,7 +7,7 @@ A pre-defined character controller based on a Kinematic Velocity RigidBody. ## Example ```ts -import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/3d' +import { FCapsule, FCharacterControllerKV, FScene } from '@fibbojs/2d' const scene = new FScene() @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) +[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) ## Methods @@ -70,7 +70,7 @@ Return the corrected movements for the current frame. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) *** @@ -98,7 +98,7 @@ The time since the last frame. #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) +[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) ## Properties @@ -114,7 +114,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +131,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +163,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +179,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +195,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +211,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCircle.md b/docs/api/2d/classes/FCircle.md index 595c1d47..e3c35492 100644 --- a/docs/api/2d/classes/FCircle.md +++ b/docs/api/2d/classes/FCircle.md @@ -25,8 +25,6 @@ scene.addComponent(circle) > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -55,7 +53,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -79,7 +77,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -103,7 +101,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -139,7 +137,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -163,7 +161,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -187,7 +185,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -211,7 +209,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -235,7 +233,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -259,7 +257,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L21) +[2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L21) ## Methods @@ -365,7 +363,7 @@ component.initCollider({ #### Defined in -[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L51) +[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L51) *** @@ -434,7 +432,7 @@ component.initRigidBody({ #### Defined in -[2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L33) +[2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L33) *** @@ -472,7 +470,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -526,7 +524,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -552,7 +550,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FCircle.ts#L29) +[2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L29) *** @@ -592,7 +590,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -624,7 +622,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -656,7 +654,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -696,7 +694,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) ## Properties @@ -750,7 +748,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -770,9 +768,9 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider @@ -782,7 +780,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -798,7 +796,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -814,13 +812,13 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody @@ -830,7 +828,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -846,13 +844,13 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -862,7 +860,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -878,4 +876,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FCollider.md b/docs/api/2d/classes/FCollider.md index c382c9e1..35f619f8 100644 --- a/docs/api/2d/classes/FCollider.md +++ b/docs/api/2d/classes/FCollider.md @@ -2,7 +2,191 @@ # Class: FCollider -A 3d collider. +A 2d collider that can be attached to a component. + +## Accessors + +### position + +> `get` **position**(): `object` + +> `set` **position**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FCollider.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L223) + +*** + +### rotation + +> `get` **rotation**(): `number` + +> `set` **rotation**(`rotation`): `void` + +#### Parameters + +• **rotation**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:247](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L247) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): `number` + +> `set` **rotationDegree**(`rotation`): `void` + +#### Parameters + +• **rotation**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:255](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L255) + +*** + +### scale + +> `get` **scale**(): `object` + +> `set` **scale**(`scale`): `void` + +#### Parameters + +• **scale** + +• **scale.x**: `number` + +• **scale.y**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FCollider.ts:263](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L263) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +> `set` **scaleX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:285](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L285) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +> `set` **scaleY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:293](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L293) + +*** + +### x + +> `get` **x**(): `number` + +> `set` **x**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L231) + +*** + +### y + +> `get` **y**(): `number` + +> `set` **y**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FCollider.ts:239](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L239) ## Constructors @@ -33,13 +217,13 @@ const collider = new FCollider(component, { position: { x: 0, y: 1 }, scale: { x: 1, y: 1 }, rotation: 0, - shape: FShapes.CUBE + shape: FShapes.RECTANGLE }) ``` #### Defined in -[2d/src/core/FCollider.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L65) +[2d/src/core/FCollider.ts:70](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L70) ## Methods @@ -69,7 +253,7 @@ The new y position of the collider. #### Defined in -[2d/src/core/FCollider.ts:149](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L149) +[2d/src/core/FCollider.ts:154](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L154) *** @@ -91,7 +275,7 @@ The new rotation of the collider. #### Defined in -[2d/src/core/FCollider.ts:157](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L157) +[2d/src/core/FCollider.ts:162](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L162) *** @@ -113,7 +297,7 @@ The new rotation of the collider in degrees. #### Defined in -[2d/src/core/FCollider.ts:165](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L165) +[2d/src/core/FCollider.ts:170](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L170) *** @@ -143,7 +327,7 @@ The new y scale of the collider. #### Defined in -[2d/src/core/FCollider.ts:175](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L175) +[2d/src/core/FCollider.ts:180](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L180) *** @@ -151,7 +335,7 @@ The new y scale of the collider. > **updatePosition**(): `void` -Update the position of the collider according to the component's position. +Update the position of the collider according to its component's position. This takes into account the position offset. #### Returns @@ -160,7 +344,7 @@ This takes into account the position offset. #### Defined in -[2d/src/core/FCollider.ts:193](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L193) +[2d/src/core/FCollider.ts:195](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L195) *** @@ -168,7 +352,7 @@ This takes into account the position offset. > **updateRotation**(): `void` -Update the rotation of the collider according to the component's rotation. +Update the rotation of the collider according to its component's rotation. This takes into account the rotation offset. #### Returns @@ -177,7 +361,7 @@ This takes into account the rotation offset. #### Defined in -[2d/src/core/FCollider.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L204) +[2d/src/core/FCollider.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L206) *** @@ -185,7 +369,7 @@ This takes into account the rotation offset. > **updateScale**(): `void` -Update the scale of the collider according to the component's scale. +Update the scale of the collider according to its component's scale. This takes into account the scale offset. #### Returns @@ -194,7 +378,7 @@ This takes into account the scale offset. #### Defined in -[2d/src/core/FCollider.ts:212](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L212) +[2d/src/core/FCollider.ts:214](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L214) ## Properties @@ -203,7 +387,7 @@ This takes into account the scale offset. > **\_\_COLLIDER\_POSITION\_OFFSET\_\_**: `object` Position Offset for the collider. -This is used to adjust the collider position relative to the mesh. +This is used to adjust the collider position relative to the component. #### x @@ -215,7 +399,7 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[2d/src/core/FCollider.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L28) +[2d/src/core/FCollider.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L29) *** @@ -224,11 +408,11 @@ This is used to adjust the collider position relative to the mesh. > **\_\_COLLIDER\_ROTATION\_OFFSET\_\_**: `number` Rotation Offset for the collider. -This is used to adjust the collider position relative to the mesh. +This is used to adjust the collider position relative to the component. #### Defined in -[2d/src/core/FCollider.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L33) +[2d/src/core/FCollider.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L34) *** @@ -237,7 +421,7 @@ This is used to adjust the collider position relative to the mesh. > **\_\_COLLIDER\_SCALE\_OFFSET\_\_**: `object` Scale Offset for the collider. -This is used to adjust the collider scale relative to the mesh. +This is used to adjust the collider scale relative to the component. #### x @@ -249,7 +433,7 @@ This is used to adjust the collider scale relative to the mesh. #### Defined in -[2d/src/core/FCollider.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L38) +[2d/src/core/FCollider.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L39) *** @@ -261,7 +445,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FCollider.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L23) +[2d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L24) *** @@ -273,4 +457,16 @@ The component the collider is attached to. #### Defined in -[2d/src/core/FCollider.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L42) +[2d/src/core/FCollider.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L43) + +*** + +### shape + +> **shape**: [`FShapes`](../enumerations/FShapes.md) + +The shape of the collider. + +#### Defined in + +[2d/src/core/FCollider.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L47) diff --git a/docs/api/2d/classes/FComponent.md b/docs/api/2d/classes/FComponent.md index caed450c..f31cb2fc 100644 --- a/docs/api/2d/classes/FComponent.md +++ b/docs/api/2d/classes/FComponent.md @@ -20,8 +20,6 @@ The base class for all 2D components in Fibbo. > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -46,7 +44,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -66,7 +64,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -86,7 +84,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -118,7 +116,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -138,7 +136,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -158,7 +156,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -178,7 +176,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -198,7 +196,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -226,7 +224,7 @@ The options for the component. #### Defined in -[2d/src/core/FComponent.ts:71](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L71) +[2d/src/core/FComponent.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L71) ## Methods @@ -312,7 +310,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) *** @@ -345,7 +343,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) *** @@ -379,7 +377,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -433,7 +431,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -459,7 +457,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/core/FComponent.ts:104](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L104) +[2d/src/core/FComponent.ts:104](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L104) *** @@ -495,7 +493,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -523,7 +521,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -551,7 +549,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -587,7 +585,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) ## Properties @@ -641,7 +639,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -661,15 +659,15 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -681,7 +679,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -697,19 +695,19 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -721,19 +719,19 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -745,4 +743,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FComponentEmpty.md b/docs/api/2d/classes/FComponentEmpty.md index a1f90b45..a125ab27 100644 --- a/docs/api/2d/classes/FComponentEmpty.md +++ b/docs/api/2d/classes/FComponentEmpty.md @@ -14,8 +14,6 @@ An empty component. The container is empty. > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -44,7 +42,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -68,7 +66,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -92,7 +90,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -128,7 +126,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -152,7 +150,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -176,7 +174,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -200,7 +198,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -224,7 +222,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -248,7 +246,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponentEmpty.ts#L10) +[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -338,7 +336,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) *** @@ -375,7 +373,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) *** @@ -413,7 +411,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -467,7 +465,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -493,7 +491,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponentEmpty.ts#L14) +[2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponentEmpty.ts#L14) *** @@ -533,7 +531,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -565,7 +563,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -597,7 +595,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -637,7 +635,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) ## Properties @@ -691,7 +689,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -711,9 +709,9 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider @@ -723,7 +721,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -739,7 +737,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -755,13 +753,13 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody @@ -771,7 +769,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -787,13 +785,13 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -803,7 +801,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -819,4 +817,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FController.md b/docs/api/2d/classes/FController.md index a4b80f81..79fff9f8 100644 --- a/docs/api/2d/classes/FController.md +++ b/docs/api/2d/classes/FController.md @@ -34,7 +34,7 @@ The options for the controller. #### Defined in -[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L23) +[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L23) ## Methods @@ -79,4 +79,4 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) diff --git a/docs/api/2d/classes/FFixedCamera.md b/docs/api/2d/classes/FFixedCamera.md index d2374737..91693e12 100644 --- a/docs/api/2d/classes/FFixedCamera.md +++ b/docs/api/2d/classes/FFixedCamera.md @@ -30,7 +30,7 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L10) +[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L10) ## Methods @@ -48,7 +48,7 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L17) +[2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L17) *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFixedCamera.ts#L14) +[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L14) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FFreeCamera.md b/docs/api/2d/classes/FFreeCamera.md index cefae8d3..1fc5801c 100644 --- a/docs/api/2d/classes/FFreeCamera.md +++ b/docs/api/2d/classes/FFreeCamera.md @@ -30,7 +30,7 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L10) +[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L10) ## Methods @@ -48,7 +48,7 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L17) +[2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L17) *** @@ -180,7 +180,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FFreeCamera.ts#L14) +[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L14) *** @@ -204,7 +204,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) ## Properties @@ -258,7 +258,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) *** @@ -314,7 +314,7 @@ Position of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) *** @@ -330,4 +330,4 @@ The scene the camera is in. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) diff --git a/docs/api/2d/classes/FLight.md b/docs/api/2d/classes/FLight.md index 7ea1a3b4..de1876a5 100644 --- a/docs/api/2d/classes/FLight.md +++ b/docs/api/2d/classes/FLight.md @@ -26,7 +26,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L88) +[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L88) *** @@ -46,7 +46,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L96) +[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L96) *** @@ -78,7 +78,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L100) +[2d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L100) ## Constructors @@ -102,7 +102,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L45) +[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L45) ## Methods @@ -116,7 +116,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:75](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L75) +[2d/src/lights/FLight.ts:75](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L75) *** @@ -248,7 +248,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/lights/FLight.ts:73](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L73) +[2d/src/lights/FLight.ts:73](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L73) ## Properties @@ -269,7 +269,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L23) +[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L23) *** @@ -286,13 +286,13 @@ It is generated automatically. #### Defined in -[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L22) +[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L22) *** ### \_\_IS\_2D\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_IS\_2D\_\_**: `boolean` = `true` #### Overrides @@ -300,13 +300,13 @@ It is generated automatically. #### Defined in -[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L21) +[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L21) *** ### \_\_IS\_3D\_\_ -> **\_\_IS\_3D\_\_**: `boolean` = `true` +> **\_\_IS\_3D\_\_**: `boolean` = `false` Internal flags @@ -316,7 +316,7 @@ Internal flags #### Defined in -[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L20) +[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L20) *** @@ -336,7 +336,7 @@ Look at target of the light. #### Defined in -[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L43) +[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L43) *** @@ -364,7 +364,7 @@ The original light object from PIXI.js. #### Defined in -[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L28) +[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L28) *** @@ -376,7 +376,7 @@ Scene the light is in. #### Defined in -[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L33) +[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L33) *** @@ -388,4 +388,4 @@ Transform of the light. #### Defined in -[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L38) +[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L38) diff --git a/docs/api/2d/classes/FPolygon.md b/docs/api/2d/classes/FPolygon.md index 16c8ad47..bb8c0a0b 100644 --- a/docs/api/2d/classes/FPolygon.md +++ b/docs/api/2d/classes/FPolygon.md @@ -19,8 +19,6 @@ A simple polygon in Fibbo. > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -49,7 +47,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -73,7 +71,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -97,7 +95,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -133,7 +131,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -157,7 +155,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -181,7 +179,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -205,7 +203,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -229,7 +227,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -253,7 +251,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FPolygon.ts#L11) +[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FPolygon.ts#L11) ## Methods @@ -343,7 +341,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) *** @@ -380,7 +378,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) *** @@ -418,7 +416,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -472,7 +470,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -498,7 +496,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FPolygon.ts#L21) +[2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FPolygon.ts#L21) *** @@ -538,7 +536,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -570,7 +568,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -602,7 +600,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -642,7 +640,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) ## Properties @@ -696,7 +694,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -716,9 +714,9 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider @@ -728,7 +726,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -744,7 +742,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -760,13 +758,13 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody @@ -776,7 +774,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -792,13 +790,13 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -808,7 +806,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -824,4 +822,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FRectangle.md b/docs/api/2d/classes/FRectangle.md index 18ccd9fd..56d45ee8 100644 --- a/docs/api/2d/classes/FRectangle.md +++ b/docs/api/2d/classes/FRectangle.md @@ -25,8 +25,6 @@ scene.addComponent(square) > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -55,7 +53,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -79,7 +77,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -103,7 +101,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -139,7 +137,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -163,7 +161,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -187,7 +185,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -211,7 +209,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -235,7 +233,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -259,7 +257,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FRectangle.ts#L19) +[2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FRectangle.ts#L19) ## Methods @@ -349,7 +347,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) *** @@ -386,7 +384,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) *** @@ -424,7 +422,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -478,7 +476,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -504,7 +502,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/polygons/FRectangle.ts#L23) +[2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FRectangle.ts#L23) *** @@ -544,7 +542,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -576,7 +574,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -608,7 +606,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -648,7 +646,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) ## Properties @@ -702,7 +700,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -722,9 +720,9 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider @@ -734,7 +732,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -750,7 +748,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -766,13 +764,13 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody @@ -782,7 +780,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -798,13 +796,13 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -814,7 +812,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -830,4 +828,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FRigidBody.md b/docs/api/2d/classes/FRigidBody.md index a3380f45..dbdf911a 100644 --- a/docs/api/2d/classes/FRigidBody.md +++ b/docs/api/2d/classes/FRigidBody.md @@ -2,7 +2,191 @@ # Class: FRigidBody -A 3d RigidBody. +A 2d rigidBody that can be attached to a component. + +## Accessors + +### position + +> `get` **position**(): `object` + +> `set` **position**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L223) + +*** + +### rotation + +> `get` **rotation**(): `number` + +> `set` **rotation**(`rotation`): `void` + +#### Parameters + +• **rotation**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:247](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L247) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): `number` + +> `set` **rotationDegree**(`rotation`): `void` + +#### Parameters + +• **rotation**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:255](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L255) + +*** + +### scale + +> `get` **scale**(): `object` + +> `set` **scale**(`scale`): `void` + +#### Parameters + +• **scale** + +• **scale.x**: `number` + +• **scale.y**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:263](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L263) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +> `set` **scaleX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:271](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L271) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +> `set` **scaleY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:279](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L279) + +*** + +### x + +> `get` **x**(): `number` + +> `set` **x**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L231) + +*** + +### y + +> `get` **y**(): `number` + +> `set` **y**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:239](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L239) ## Constructors @@ -29,17 +213,17 @@ The options for the rigidBody. #### Example ```ts -const rigidBody = new FRigidBody({ +const rigidBody = new FRigidBody(component, { position: { x: 0, y: 0 }, scale: { x: 1, y: 1 }, rotation: 0, - shape: FShapes.CUBE + shape: FShapes.RECTANGLE }) ``` #### Defined in -[2d/src/core/FRigidBody.ts:79](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L79) +[2d/src/core/FRigidBody.ts:79](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L79) ## Methods @@ -69,7 +253,7 @@ The new y position of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:157](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L157) +[2d/src/core/FRigidBody.ts:156](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L156) *** @@ -91,7 +275,59 @@ The new rotation of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:166](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L166) +[2d/src/core/FRigidBody.ts:165](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L165) + +*** + +### setRotationDegree() + +> **setRotationDegree**(`rotation`): `void` + +Set the rotation of the rigidBody in degrees. + +#### Parameters + +• **rotation**: `number` + +The new rotation of the rigidBody in degrees. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:174](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L174) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set the scale of the rigidBody. + +#### Parameters + +• **scale** + +The new scale of the rigidBody. + +• **scale.x**: `number` + +The new x scale of the rigidBody. + +• **scale.y**: `number` + +The new y scale of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FRigidBody.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L186) *** @@ -108,7 +344,7 @@ This takes into account the position offset. #### Defined in -[2d/src/core/FRigidBody.ts:175](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L175) +[2d/src/core/FRigidBody.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L194) *** @@ -125,7 +361,7 @@ This takes into account the rotation offset. #### Defined in -[2d/src/core/FRigidBody.ts:187](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L187) +[2d/src/core/FRigidBody.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L206) *** @@ -135,6 +371,7 @@ This takes into account the rotation offset. Update the scale of the rigidBody's collider according to the component's scale. This takes into account the scale offset. +As a rigidBody does not have a scale, this will only update the attached collider's scale. #### Returns @@ -142,7 +379,7 @@ This takes into account the scale offset. #### Defined in -[2d/src/core/FRigidBody.ts:197](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L197) +[2d/src/core/FRigidBody.ts:217](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L217) ## Properties @@ -151,7 +388,7 @@ This takes into account the scale offset. > **\_\_RIGIDBODY\_POSITION\_OFFSET\_\_**: `object` Position Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the mesh. +This is used to adjust the rigidBody position relative to the component. #### x @@ -163,7 +400,7 @@ This is used to adjust the rigidBody position relative to the mesh. #### Defined in -[2d/src/core/FRigidBody.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L39) +[2d/src/core/FRigidBody.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L39) *** @@ -172,11 +409,11 @@ This is used to adjust the rigidBody position relative to the mesh. > **\_\_RIGIDBODY\_ROTATION\_OFFSET\_\_**: `number` Rotation Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the mesh. +This is used to adjust the rigidBody position relative to the component. #### Defined in -[2d/src/core/FRigidBody.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L44) +[2d/src/core/FRigidBody.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L44) *** @@ -188,7 +425,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FRigidBody.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L30) +[2d/src/core/FRigidBody.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L30) *** @@ -200,7 +437,7 @@ Fibbo Collider #### Defined in -[2d/src/core/FRigidBody.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L34) +[2d/src/core/FRigidBody.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L34) *** @@ -212,4 +449,4 @@ The component the rigidBody is attached to. #### Defined in -[2d/src/core/FRigidBody.ts:48](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L48) +[2d/src/core/FRigidBody.ts:48](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L48) diff --git a/docs/api/2d/classes/FScene.md b/docs/api/2d/classes/FScene.md index 51b9f81d..1a52c145 100644 --- a/docs/api/2d/classes/FScene.md +++ b/docs/api/2d/classes/FScene.md @@ -48,7 +48,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L248) +[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L248) ## Constructors @@ -70,7 +70,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L59) +[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L59) ## Methods @@ -94,7 +94,7 @@ Add a component to the scene. #### Defined in -[2d/src/core/FScene.ts:193](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L193) +[2d/src/core/FScene.ts:193](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L193) *** @@ -118,7 +118,7 @@ Add a light to the scene. #### Defined in -[2d/src/core/FScene.ts:261](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L261) +[2d/src/core/FScene.ts:261](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L261) *** @@ -148,7 +148,7 @@ If the collision has started or ended #### Defined in -[2d/src/core/FScene.ts:169](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L169) +[2d/src/core/FScene.ts:169](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L169) *** @@ -167,7 +167,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:77](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L77) +[2d/src/core/FScene.ts:77](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L77) *** @@ -181,7 +181,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:138](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L138) +[2d/src/core/FScene.ts:138](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L138) *** @@ -350,7 +350,7 @@ Remove a component from the scene. #### Defined in -[2d/src/core/FScene.ts:223](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L223) +[2d/src/core/FScene.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L223) *** @@ -374,7 +374,7 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:265](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L265) +[2d/src/core/FScene.ts:265](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L265) ## Properties @@ -384,7 +384,7 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L49) +[2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L49) *** @@ -495,7 +495,7 @@ core/dist/index.d.ts:240 #### Defined in -[2d/src/core/FScene.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L46) +[2d/src/core/FScene.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L46) *** @@ -527,7 +527,7 @@ Internal flags #### Defined in -[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L38) +[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L38) *** @@ -557,7 +557,7 @@ core/dist/index.d.ts:197 #### Defined in -[2d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L57) +[2d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L57) *** @@ -567,7 +567,7 @@ core/dist/index.d.ts:197 #### Defined in -[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L50) +[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L50) *** @@ -583,7 +583,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L41) +[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L41) *** @@ -597,7 +597,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L56) +[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L56) *** @@ -619,7 +619,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L54) +[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L54) *** @@ -635,7 +635,7 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L43) +[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L43) *** @@ -645,7 +645,7 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L51) +[2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L51) *** @@ -659,4 +659,4 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L55) +[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L55) diff --git a/docs/api/2d/classes/FSprite.md b/docs/api/2d/classes/FSprite.md index 15de2990..25c276eb 100644 --- a/docs/api/2d/classes/FSprite.md +++ b/docs/api/2d/classes/FSprite.md @@ -25,8 +25,6 @@ scene.addComponent(sprite) > `get` **position**(): `object` -Setters & getters for transform properties - > `set` **position**(`p`): `void` #### Parameters @@ -55,7 +53,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:354](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L354) +[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) *** @@ -79,7 +77,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:378](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L378) +[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) *** @@ -103,7 +101,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L386) +[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) *** @@ -139,7 +137,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L394) +[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) *** @@ -163,7 +161,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:402](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L402) +[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) *** @@ -187,7 +185,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:410](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L410) +[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) *** @@ -211,7 +209,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L362) +[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) *** @@ -235,7 +233,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/core/FComponent.ts:370](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L370) +[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) ## Constructors @@ -259,7 +257,7 @@ Setters & getters for transform properties #### Defined in -[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L33) +[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L33) ## Methods @@ -327,7 +325,7 @@ Emit the onLoaded callbacks. #### Defined in -[2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L119) +[2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L119) *** @@ -365,7 +363,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) *** @@ -402,7 +400,7 @@ component.initRigidBody({ #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) *** @@ -440,7 +438,7 @@ component.initSensor({ #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) *** @@ -462,7 +460,7 @@ The path to the texture. #### Defined in -[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L52) +[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L52) *** @@ -516,7 +514,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) *** @@ -542,7 +540,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L104) +[2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L104) *** @@ -564,7 +562,7 @@ The callback function. #### Defined in -[2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L112) +[2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L112) *** @@ -604,7 +602,7 @@ component.setPosition({ x: 0, y: 0 }) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L186) +[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) *** @@ -636,7 +634,7 @@ component.setRotation(Math.PI / 2) #### Defined in -[2d/src/core/FComponent.ts:233](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L233) +[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) *** @@ -668,7 +666,7 @@ component.setRotationDegree(90) #### Defined in -[2d/src/core/FComponent.ts:255](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L255) +[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) *** @@ -708,7 +706,7 @@ component.setScale({ x: 1, y: 1 }) #### Defined in -[2d/src/core/FComponent.ts:210](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L210) +[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) *** @@ -731,7 +729,7 @@ The height of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L100) +[2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L100) *** @@ -754,7 +752,7 @@ The width of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L91) +[2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L91) ## Properties @@ -787,7 +785,7 @@ Callbacks for when the texture is loaded #### Defined in -[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L31) +[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L31) *** @@ -820,7 +818,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) *** @@ -840,9 +838,9 @@ core/dist/index.d.ts:47 *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) RAPIER Collider @@ -852,7 +850,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L57) +[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) *** @@ -868,7 +866,7 @@ PIXI container #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) *** @@ -884,13 +882,13 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RAPIER RigidBody @@ -900,7 +898,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) *** @@ -916,13 +914,13 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -932,7 +930,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) *** @@ -944,7 +942,7 @@ The texture of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L27) +[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L27) *** @@ -960,4 +958,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) diff --git a/docs/api/2d/classes/FTransform.md b/docs/api/2d/classes/FTransform.md index 76c52885..8041381b 100644 --- a/docs/api/2d/classes/FTransform.md +++ b/docs/api/2d/classes/FTransform.md @@ -34,7 +34,7 @@ const collider = new FTransform({ #### Defined in -[2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L42) +[2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L42) ## Properties @@ -54,7 +54,7 @@ Position of the component. #### Defined in -[2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L16) +[2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L16) *** @@ -66,7 +66,7 @@ Rotation of the component. #### Defined in -[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L24) +[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L24) *** @@ -86,4 +86,4 @@ Scale of the component. #### Defined in -[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L20) +[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L20) diff --git a/docs/api/2d/enumerations/FShapes.md b/docs/api/2d/enumerations/FShapes.md index cf5e4473..1be2e777 100644 --- a/docs/api/2d/enumerations/FShapes.md +++ b/docs/api/2d/enumerations/FShapes.md @@ -10,14 +10,14 @@ #### Defined in -[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/types/FShapes.ts#L4) +[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/types/FShapes.ts#L4) *** -### SQUARE +### RECTANGLE -> **SQUARE**: `"Square"` +> **RECTANGLE**: `"Rectangle"` #### Defined in -[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/types/FShapes.ts#L3) +[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/types/FShapes.ts#L3) diff --git a/docs/api/2d/interfaces/FAttachedCameraOptions.md b/docs/api/2d/interfaces/FAttachedCameraOptions.md index e0000ad8..a1102814 100644 --- a/docs/api/2d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/2d/interfaces/FAttachedCameraOptions.md @@ -26,7 +26,7 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L5) *** @@ -36,4 +36,4 @@ #### Defined in -[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FAttachedCamera.ts#L7) +[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/2d/interfaces/FCameraOptions.md b/docs/api/2d/interfaces/FCameraOptions.md index 61952659..b581e85d 100644 --- a/docs/api/2d/interfaces/FCameraOptions.md +++ b/docs/api/2d/interfaces/FCameraOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L5) diff --git a/docs/api/2d/interfaces/FCharacterControllerOptions.md b/docs/api/2d/interfaces/FCharacterControllerOptions.md index f7991c68..f1efe963 100644 --- a/docs/api/2d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/2d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FCharacterController.ts#L10) +[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L10) diff --git a/docs/api/2d/interfaces/FColliderOptions.md b/docs/api/2d/interfaces/FColliderOptions.md index dc8a191a..de44801e 100644 --- a/docs/api/2d/interfaces/FColliderOptions.md +++ b/docs/api/2d/interfaces/FColliderOptions.md @@ -18,17 +18,17 @@ #### Defined in -[2d/src/core/FCollider.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L6) +[2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L7) *** ### rigidBody? -> `optional` **rigidBody**: `RigidBody` +> `optional` **rigidBody**: [`FRigidBody`](../classes/FRigidBody.md) #### Defined in -[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L11) +[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L12) *** @@ -38,7 +38,7 @@ #### Defined in -[2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L8) +[2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L9) *** @@ -48,7 +48,7 @@ #### Defined in -[2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L9) +[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L10) *** @@ -66,7 +66,7 @@ #### Defined in -[2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L7) +[2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L8) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L12) +[2d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L13) *** @@ -86,4 +86,4 @@ #### Defined in -[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FCollider.ts#L10) +[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L11) diff --git a/docs/api/2d/interfaces/FComponentOptions.md b/docs/api/2d/interfaces/FComponentOptions.md index b965246e..bc69f124 100644 --- a/docs/api/2d/interfaces/FComponentOptions.md +++ b/docs/api/2d/interfaces/FComponentOptions.md @@ -22,7 +22,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L14) *** @@ -32,7 +32,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L16) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L17) *** @@ -60,4 +60,4 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L15) diff --git a/docs/api/2d/interfaces/FControllerOptions.md b/docs/api/2d/interfaces/FControllerOptions.md index 102232eb..734648ca 100644 --- a/docs/api/2d/interfaces/FControllerOptions.md +++ b/docs/api/2d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L6) diff --git a/docs/api/2d/interfaces/FLightOptions.md b/docs/api/2d/interfaces/FLightOptions.md index 385c7643..83191949 100644 --- a/docs/api/2d/interfaces/FLightOptions.md +++ b/docs/api/2d/interfaces/FLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L7) +[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L7) *** @@ -24,7 +24,7 @@ #### Defined in -[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L8) +[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L8) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/lights/FLight.ts#L9) +[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L9) *** @@ -64,7 +64,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L2) *** @@ -78,7 +78,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L4) *** @@ -92,7 +92,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L5) *** @@ -114,4 +114,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L3) diff --git a/docs/api/2d/interfaces/FRigidBodyOptions.md b/docs/api/2d/interfaces/FRigidBodyOptions.md index febe44bb..e8b00edf 100644 --- a/docs/api/2d/interfaces/FRigidBodyOptions.md +++ b/docs/api/2d/interfaces/FRigidBodyOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L16) +[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L16) *** @@ -28,7 +28,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L15) +[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L15) *** @@ -38,7 +38,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L14) +[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L14) *** @@ -56,7 +56,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L7) +[2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L7) *** @@ -66,7 +66,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L12) +[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L12) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L9) +[2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L9) *** @@ -86,7 +86,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L10) +[2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L10) *** @@ -104,7 +104,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L8) +[2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L8) *** @@ -114,7 +114,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L13) +[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L13) *** @@ -124,4 +124,4 @@ #### Defined in -[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FRigidBody.ts#L11) +[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L11) diff --git a/docs/api/2d/interfaces/FSceneOptions.md b/docs/api/2d/interfaces/FSceneOptions.md index 90c8b771..9f5fb7ed 100644 --- a/docs/api/2d/interfaces/FSceneOptions.md +++ b/docs/api/2d/interfaces/FSceneOptions.md @@ -40,4 +40,4 @@ core/dist/index.d.ts:186 #### Defined in -[2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FScene.ts#L13) +[2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L13) diff --git a/docs/api/2d/interfaces/FSpriteOptions.md b/docs/api/2d/interfaces/FSpriteOptions.md index fefdc182..e7db02dc 100644 --- a/docs/api/2d/interfaces/FSpriteOptions.md +++ b/docs/api/2d/interfaces/FSpriteOptions.md @@ -26,7 +26,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L14) *** @@ -40,7 +40,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L16) *** @@ -54,7 +54,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L17) *** @@ -76,7 +76,7 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L15) *** @@ -86,4 +86,4 @@ #### Defined in -[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/sprite/FSprite.ts#L7) +[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L7) diff --git a/docs/api/2d/interfaces/FTransformOptions.md b/docs/api/2d/interfaces/FTransformOptions.md index b307e222..b5c0f321 100644 --- a/docs/api/2d/interfaces/FTransformOptions.md +++ b/docs/api/2d/interfaces/FTransformOptions.md @@ -22,7 +22,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L2) *** @@ -32,7 +32,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L4) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L5) *** @@ -60,4 +60,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L3) diff --git a/docs/api/3d/classes/FAmbientLight.md b/docs/api/3d/classes/FAmbientLight.md index cdf095a1..e4197523 100644 --- a/docs/api/3d/classes/FAmbientLight.md +++ b/docs/api/3d/classes/FAmbientLight.md @@ -30,7 +30,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FAmbientLight.ts#L11) +[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FAmbientLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FAmbientLight.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FAmbientLight.ts#L31) +[3d/src/lights/FAmbientLight.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FAmbientLight.ts#L31) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FAttachedCamera.md b/docs/api/3d/classes/FAttachedCamera.md index b754651c..2b94ba82 100644 --- a/docs/api/3d/classes/FAttachedCamera.md +++ b/docs/api/3d/classes/FAttachedCamera.md @@ -43,7 +43,7 @@ Model that the camera is attached to #### Defined in -[3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L34) +[3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L34) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L39) +[3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L39) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L51) +[3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L51) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2254,7 +2254,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L27) +[3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L27) *** @@ -2853,7 +2853,7 @@ The valid range is greater than `0` and less than the current value of the [.far #### Defined in -[3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L29) +[3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L29) *** @@ -3059,7 +3059,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FCamera.md b/docs/api/3d/classes/FCamera.md index 56e89ab4..6fd37a95 100644 --- a/docs/api/3d/classes/FCamera.md +++ b/docs/api/3d/classes/FCamera.md @@ -39,7 +39,7 @@ The base class for 3d cameras in Fibbo. #### Defined in -[3d/src/cameras/FCamera.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L26) +[3d/src/cameras/FCamera.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L26) ## Methods @@ -358,7 +358,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -377,7 +377,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1117,7 +1117,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1143,7 +1143,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L53) +[3d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L53) *** @@ -1490,7 +1490,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1514,7 +1514,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1650,7 +1650,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1755,7 +1755,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2133,7 +2133,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2150,7 +2150,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2164,7 +2164,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2180,7 +2180,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3003,7 +3003,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FCapsule.md b/docs/api/3d/classes/FCapsule.md index 1820c4f9..c58390ac 100644 --- a/docs/api/3d/classes/FCapsule.md +++ b/docs/api/3d/classes/FCapsule.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L23) +[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L23) ## Methods @@ -579,7 +579,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/polyhedrons/FCapsule.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L47) +[3d/src/polyhedrons/FCapsule.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L47) *** @@ -616,7 +616,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/polyhedrons/FCapsule.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L40) +[3d/src/polyhedrons/FCapsule.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L40) *** @@ -654,7 +654,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FCapsule.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCapsule.ts#L36) +[3d/src/polyhedrons/FCapsule.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L36) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1020,13 +1020,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,13 +1069,13 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,13 +1101,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FCharacterController.md b/docs/api/3d/classes/FCharacterController.md index 79c4a027..f9b8d07c 100644 --- a/docs/api/3d/classes/FCharacterController.md +++ b/docs/api/3d/classes/FCharacterController.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller. #### Defined in -[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L41) +[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L41) ## Methods @@ -52,7 +52,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -97,7 +97,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) *** @@ -125,7 +125,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -137,7 +137,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -149,4 +149,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) diff --git a/docs/api/3d/classes/FCharacterControllerD.md b/docs/api/3d/classes/FCharacterControllerD.md index 152a2376..035ba484 100644 --- a/docs/api/3d/classes/FCharacterControllerD.md +++ b/docs/api/3d/classes/FCharacterControllerD.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerD.ts#L23) +[3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerD.ts#L23) ## Methods @@ -63,7 +63,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -89,7 +89,7 @@ Any rendering process should be done on the component, not here. #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerD.ts#L39) +[3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerD.ts#L39) ## Properties @@ -106,7 +106,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) *** @@ -138,7 +138,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -154,7 +154,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -170,4 +170,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) diff --git a/docs/api/3d/classes/FCharacterControllerK.md b/docs/api/3d/classes/FCharacterControllerK.md index b3f5d110..d7a004ce 100644 --- a/docs/api/3d/classes/FCharacterControllerK.md +++ b/docs/api/3d/classes/FCharacterControllerK.md @@ -35,7 +35,7 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L23) +[3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L23) ## Methods @@ -63,7 +63,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -84,7 +84,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -124,7 +124,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -141,7 +141,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) *** @@ -173,7 +173,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -189,7 +189,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -205,7 +205,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -217,4 +217,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKP.md b/docs/api/3d/classes/FCharacterControllerKP.md index c4769a3f..051326fb 100644 --- a/docs/api/3d/classes/FCharacterControllerKP.md +++ b/docs/api/3d/classes/FCharacterControllerKP.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) +[3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) ## Methods @@ -74,7 +74,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -95,7 +95,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -123,7 +123,7 @@ The time since the last frame. #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) +[3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) ## Properties @@ -139,7 +139,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -156,7 +156,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +188,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -204,7 +204,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -220,7 +220,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -236,4 +236,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCharacterControllerKV.md b/docs/api/3d/classes/FCharacterControllerKV.md index aa388e4a..b4c04bba 100644 --- a/docs/api/3d/classes/FCharacterControllerKV.md +++ b/docs/api/3d/classes/FCharacterControllerKV.md @@ -42,7 +42,7 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) +[3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) ## Methods @@ -74,7 +74,7 @@ Return the corrected movements for the current frame. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) *** @@ -95,7 +95,7 @@ Uses the camera so the character nevers faces the camera. #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) *** @@ -123,7 +123,7 @@ The time since the last frame. #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) +[3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) ## Properties @@ -139,7 +139,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) *** @@ -156,7 +156,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +188,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) *** @@ -204,7 +204,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) *** @@ -220,7 +220,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) *** @@ -236,4 +236,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) diff --git a/docs/api/3d/classes/FCollider.md b/docs/api/3d/classes/FCollider.md index cd98da7a..897a106e 100644 --- a/docs/api/3d/classes/FCollider.md +++ b/docs/api/3d/classes/FCollider.md @@ -2,7 +2,399 @@ # Class: FCollider -A 3d collider. +A 3d collider that can be attached to a component. + +## Accessors + +### position + +> `get` **position**(): `object` + +> `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` + +#### Defined in + +[3d/src/core/FCollider.ts:279](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L279) + +*** + +### 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` + +#### Defined in + +[3d/src/core/FCollider.ts:311](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L311) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): `object` + +> `set` **rotationDegree**(`rotation`): `void` + +#### Parameters + +• **rotation** + +• **rotation.x**: `number` + +• **rotation.y**: `number` + +• **rotation.z**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +##### z + +> **z**: `number` + +#### Defined in + +[3d/src/core/FCollider.ts:352](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L352) + +*** + +### rotationDegreeX + +> `get` **rotationDegreeX**(): `number` + +> `set` **rotationDegreeX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L361) + +*** + +### rotationDegreeY + +> `get` **rotationDegreeY**(): `number` + +> `set` **rotationDegreeY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L369) + +*** + +### rotationDegreeZ + +> `get` **rotationDegreeZ**(): `number` + +> `set` **rotationDegreeZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L377) + +*** + +### rotationX + +> `get` **rotationX**(): `number` + +> `set` **rotationX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:328](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L328) + +*** + +### rotationY + +> `get` **rotationY**(): `number` + +> `set` **rotationY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:336](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L336) + +*** + +### rotationZ + +> `get` **rotationZ**(): `number` + +> `set` **rotationZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:344](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L344) + +*** + +### 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` + +#### Defined in + +[3d/src/core/FCollider.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L385) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +> `set` **scaleX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L409) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +> `set` **scaleY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:417](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L417) + +*** + +### scaleZ + +> `get` **scaleZ**(): `number` + +> `set` **scaleZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:425](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L425) + +*** + +### x + +> `get` **x**(): `number` + +> `set` **x**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:287](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L287) + +*** + +### y + +> `get` **y**(): `number` + +> `set` **y**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:295](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L295) + +*** + +### z + +> `get` **z**(): `number` + +> `set` **z**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FCollider.ts:303](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L303) ## Constructors @@ -33,34 +425,209 @@ const collider = new FCollider(component, { position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE + shape: FShapes.CUBOID }) ``` #### Defined in -[3d/src/core/FCollider.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L57) +[3d/src/core/FCollider.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L71) -## Properties +## Methods -### collider +### setPosition() -> **collider**: `Collider` +> **setPosition**(`position`): `void` -RAPIER Collider +Set the position of the collider. + +#### Parameters + +• **position** + +The new position of the collider. + +• **position.x**: `number` + +The new x position of the collider. + +• **position.y**: `number` + +The new y position of the collider. + +• **position.z**: `number` + +The new z position of the collider. + +#### Returns + +`void` #### Defined in -[3d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L24) +[3d/src/core/FCollider.ts:193](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L193) *** -### colliderPositionOffset +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set the rotation of the collider. + +#### Parameters + +• **rotation** + +The new rotation of the collider. + +• **rotation.x**: `number` + +The new x rotation of the collider. + +• **rotation.y**: `number` + +The new y rotation of the collider. + +• **rotation.z**: `number` + +The new z rotation of the collider. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L204) + +*** + +### setRotationDegree() + +> **setRotationDegree**(`rotation`): `void` + +Set the rotation of the collider in degrees. + +#### Parameters + +• **rotation** + +The new rotation of the collider in degrees. + +• **rotation.x**: `number` + +The new x rotation of the collider in degrees. + +• **rotation.y**: `number` + +The new y rotation of the collider in degrees. + +• **rotation.z**: `number` + +The new z rotation of the collider in degrees. + +#### Returns -> **colliderPositionOffset**: `object` +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:215](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L215) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set the scale of the collider. + +#### Parameters + +• **scale** + +The new scale of the collider. + +• **scale.x**: `number` + +The new x scale of the collider. + +• **scale.y**: `number` + +The new y scale of the collider. + +• **scale.z**: `number` + +The new z scale of the collider. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L230) + +*** + +### updatePosition() + +> **updatePosition**(): `void` + +Update the position of the collider according to its component's position. +This takes into account the position offset. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:245](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L245) + +*** + +### updateRotation() + +> **updateRotation**(): `void` + +Update the rotation of the collider according to its component's rotation. +This takes into account the rotation offset. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:257](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L257) + +*** + +### updateScale() + +> **updateScale**(): `void` + +Update the scale of the collider according to its component's scale. +This takes into account the scale offset. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FCollider.ts:269](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L269) + +## Properties + +### \_\_COLLIDER\_POSITION\_OFFSET\_\_ + +> **\_\_COLLIDER\_POSITION\_OFFSET\_\_**: `object` Position Offset for the collider. -This is used to adjust the collider position relative to the mesh. +This is used to adjust the collider position relative to the component. #### x @@ -76,16 +643,16 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[3d/src/core/FCollider.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L29) +[3d/src/core/FCollider.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L30) *** -### colliderRotationOffset +### \_\_COLLIDER\_ROTATION\_OFFSET\_\_ -> **colliderRotationOffset**: `object` +> **\_\_COLLIDER\_ROTATION\_OFFSET\_\_**: `object` Rotation Offset for the collider. -This is used to adjust the collider position relative to the mesh. +This is used to adjust the collider position relative to the component. #### x @@ -101,4 +668,65 @@ This is used to adjust the collider position relative to the mesh. #### Defined in -[3d/src/core/FCollider.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L34) +[3d/src/core/FCollider.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L35) + +*** + +### \_\_COLLIDER\_SCALE\_OFFSET\_\_ + +> **\_\_COLLIDER\_SCALE\_OFFSET\_\_**: `object` + +Scale Offset for the collider. +This is used to adjust the collider scale relative to the component. + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Defined in + +[3d/src/core/FCollider.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L40) + +*** + +### \_\_COLLIDER\_\_ + +> **\_\_COLLIDER\_\_**: `Collider` + +RAPIER Collider + +#### Defined in + +[3d/src/core/FCollider.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L25) + +*** + +### component + +> **component**: [`FComponent`](FComponent.md) + +The component the collider is attached to. + +#### Defined in + +[3d/src/core/FCollider.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L44) + +*** + +### shape + +> **shape**: [`FShapes`](../enumerations/FShapes.md) + +The shape of the collider. + +#### Defined in + +[3d/src/core/FCollider.ts:48](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L48) diff --git a/docs/api/3d/classes/FComponent.md b/docs/api/3d/classes/FComponent.md index 522aeadd..68269b2d 100644 --- a/docs/api/3d/classes/FComponent.md +++ b/docs/api/3d/classes/FComponent.md @@ -52,7 +52,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -90,7 +90,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -128,7 +128,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -148,7 +148,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -168,7 +168,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -188,7 +188,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -208,7 +208,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -228,7 +228,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -248,7 +248,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -286,7 +286,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -306,7 +306,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -326,7 +326,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -346,7 +346,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -366,7 +366,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -386,7 +386,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -406,7 +406,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -434,7 +434,7 @@ The options for the component. #### Defined in -[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L83) +[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L83) ## Methods @@ -514,13 +514,13 @@ 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 + shape: FShapes.CUBOID }) ``` #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -547,13 +547,13 @@ 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 + shape: FShapes.CUBOID }) ``` #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -581,13 +581,13 @@ 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 + shape: FShapes.CUBOID }) ``` #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -641,7 +641,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -667,7 +667,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -707,7 +707,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -747,7 +747,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -787,7 +787,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -827,7 +827,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -895,19 +895,19 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -923,7 +923,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -935,19 +935,19 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -959,19 +959,19 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -983,4 +983,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FComponentEmpty.md b/docs/api/3d/classes/FComponentEmpty.md index e7e97beb..71ac768b 100644 --- a/docs/api/3d/classes/FComponentEmpty.md +++ b/docs/api/3d/classes/FComponentEmpty.md @@ -50,7 +50,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -92,7 +92,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -134,7 +134,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -158,7 +158,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -182,7 +182,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -206,7 +206,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -230,7 +230,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -254,7 +254,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -278,7 +278,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -320,7 +320,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -344,7 +344,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -368,7 +368,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -392,7 +392,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -416,7 +416,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -440,7 +440,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -464,7 +464,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -488,7 +488,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponentEmpty.ts#L10) +[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponentEmpty.ts#L10) ## Methods @@ -568,7 +568,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -578,7 +578,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -605,7 +605,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -615,7 +615,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -643,7 +643,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -653,7 +653,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -707,7 +707,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -733,7 +733,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponentEmpty.ts#L14) +[3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponentEmpty.ts#L14) *** @@ -777,7 +777,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -821,7 +821,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -865,7 +865,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -909,7 +909,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -977,13 +977,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -993,7 +993,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1009,7 +1009,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1025,13 +1025,13 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1041,7 +1041,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1057,13 +1057,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1073,7 +1073,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1089,4 +1089,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FController.md b/docs/api/3d/classes/FController.md index f0c02ecf..a038af3d 100644 --- a/docs/api/3d/classes/FController.md +++ b/docs/api/3d/classes/FController.md @@ -34,7 +34,7 @@ The options for the controller. #### Defined in -[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L23) +[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L23) ## Methods @@ -79,4 +79,4 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) diff --git a/docs/api/3d/classes/FCuboid.md b/docs/api/3d/classes/FCuboid.md index e6685dbf..98f58eac 100644 --- a/docs/api/3d/classes/FCuboid.md +++ b/docs/api/3d/classes/FCuboid.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCuboid.ts#L19) +[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCuboid.ts#L19) ## Methods @@ -579,7 +579,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -616,7 +616,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -654,7 +654,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FCuboid.ts#L23) +[3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCuboid.ts#L23) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1020,13 +1020,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,13 +1069,13 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,13 +1101,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FDirectionalLight.md b/docs/api/3d/classes/FDirectionalLight.md index 7e5997a4..fab19cc5 100644 --- a/docs/api/3d/classes/FDirectionalLight.md +++ b/docs/api/3d/classes/FDirectionalLight.md @@ -30,7 +30,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FDirectionalLight.ts#L11) +[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FDirectionalLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FDirectionalLight.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FDirectionalLight.ts#L46) +[3d/src/lights/FDirectionalLight.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FDirectionalLight.ts#L46) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FFBX.md b/docs/api/3d/classes/FFBX.md index 66863f52..52b1ad1e 100644 --- a/docs/api/3d/classes/FFBX.md +++ b/docs/api/3d/classes/FFBX.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FFBX.ts#L23) +[3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FFBX.ts#L23) ## Methods @@ -521,7 +521,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FFBX.ts#L65) +[3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FFBX.ts#L65) *** @@ -593,7 +593,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) *** @@ -621,7 +621,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -631,7 +631,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -658,7 +658,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -696,7 +696,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -706,7 +706,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -738,7 +738,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -818,7 +818,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -844,7 +844,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) *** @@ -888,7 +888,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -932,7 +932,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -976,7 +976,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -1020,7 +1020,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1057,7 +1057,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) *** @@ -1104,13 +1104,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1120,7 +1120,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1136,7 +1136,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1153,7 +1153,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) *** @@ -1169,7 +1169,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** @@ -1186,7 +1186,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) *** @@ -1205,13 +1205,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1221,7 +1221,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1237,13 +1237,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1253,7 +1253,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1277,7 +1277,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) *** @@ -1293,4 +1293,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FFixedCamera.md b/docs/api/3d/classes/FFixedCamera.md index 0594b56c..76c2e4b1 100644 --- a/docs/api/3d/classes/FFixedCamera.md +++ b/docs/api/3d/classes/FFixedCamera.md @@ -40,7 +40,7 @@ scene.camera.lookAt(0, 0, 0) #### Defined in -[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FFixedCamera.ts#L19) +[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FFixedCamera.ts#L19) ## Methods @@ -359,7 +359,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -382,7 +382,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1122,7 +1122,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1148,7 +1148,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FFixedCamera.ts#L23) +[3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FFixedCamera.ts#L23) *** @@ -1499,7 +1499,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1527,7 +1527,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1667,7 +1667,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1772,7 +1772,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2150,7 +2150,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2167,7 +2167,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2181,7 +2181,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2197,7 +2197,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -3024,7 +3024,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FGLB.md b/docs/api/3d/classes/FGLB.md index 5a53784f..ede5e6d8 100644 --- a/docs/api/3d/classes/FGLB.md +++ b/docs/api/3d/classes/FGLB.md @@ -64,7 +64,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -106,7 +106,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -148,7 +148,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -172,7 +172,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -196,7 +196,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -220,7 +220,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -244,7 +244,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -268,7 +268,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -292,7 +292,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -334,7 +334,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -358,7 +358,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -382,7 +382,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -406,7 +406,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -430,7 +430,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -454,7 +454,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -478,7 +478,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -502,7 +502,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FGLB.ts#L22) +[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FGLB.ts#L22) ## Methods @@ -522,7 +522,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) *** @@ -594,7 +594,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) *** @@ -622,7 +622,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -632,7 +632,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -659,7 +659,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -669,7 +669,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -697,7 +697,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -707,7 +707,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -739,7 +739,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) *** @@ -793,7 +793,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -819,7 +819,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -845,7 +845,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) *** @@ -889,7 +889,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -933,7 +933,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -977,7 +977,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -1021,7 +1021,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1058,7 +1058,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) *** @@ -1105,13 +1105,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1121,7 +1121,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1137,7 +1137,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1154,7 +1154,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) *** @@ -1170,7 +1170,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** @@ -1187,7 +1187,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) *** @@ -1206,13 +1206,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1222,7 +1222,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1238,13 +1238,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1254,7 +1254,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1278,7 +1278,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) *** @@ -1294,4 +1294,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FGLTF.md b/docs/api/3d/classes/FGLTF.md index 83a4b021..c0bee0c3 100644 --- a/docs/api/3d/classes/FGLTF.md +++ b/docs/api/3d/classes/FGLTF.md @@ -67,7 +67,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -109,7 +109,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -151,7 +151,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -175,7 +175,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -199,7 +199,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -223,7 +223,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -247,7 +247,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -271,7 +271,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -295,7 +295,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -337,7 +337,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -361,7 +361,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -385,7 +385,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -409,7 +409,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -433,7 +433,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -457,7 +457,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -481,7 +481,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -505,7 +505,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FGLTF.ts#L37) +[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FGLTF.ts#L37) ## Methods @@ -525,7 +525,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) *** @@ -597,7 +597,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) *** @@ -625,7 +625,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -635,7 +635,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -662,7 +662,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -672,7 +672,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -700,7 +700,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -710,7 +710,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -742,7 +742,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) *** @@ -796,7 +796,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -822,7 +822,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -848,7 +848,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) *** @@ -892,7 +892,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -936,7 +936,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -980,7 +980,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -1024,7 +1024,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1061,7 +1061,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) *** @@ -1108,13 +1108,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1124,7 +1124,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1140,7 +1140,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1157,7 +1157,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) *** @@ -1173,7 +1173,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** @@ -1190,7 +1190,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) *** @@ -1209,13 +1209,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1225,7 +1225,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1241,13 +1241,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1257,7 +1257,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1281,7 +1281,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) *** @@ -1297,4 +1297,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FGameCamera.md b/docs/api/3d/classes/FGameCamera.md index 56895f63..a46a0a05 100644 --- a/docs/api/3d/classes/FGameCamera.md +++ b/docs/api/3d/classes/FGameCamera.md @@ -43,7 +43,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L31) +[3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L31) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L57) +[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L57) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L46) +[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L54) +[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L54) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2258,7 +2258,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L23) +[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2316,7 +2316,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L25) +[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -2621,7 +2621,7 @@ This is a _constant_ value #### Defined in -[3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L24) +[3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L24) *** @@ -2631,7 +2631,7 @@ This is a _constant_ value #### Defined in -[3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FGameCamera.ts#L26) +[3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L26) *** @@ -3075,7 +3075,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FHemisphereLight.md b/docs/api/3d/classes/FHemisphereLight.md index 03bb305e..5bc10c69 100644 --- a/docs/api/3d/classes/FHemisphereLight.md +++ b/docs/api/3d/classes/FHemisphereLight.md @@ -30,7 +30,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L16) +[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L16) ## Methods @@ -138,7 +138,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FHemisphereLight.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L37) +[3d/src/lights/FHemisphereLight.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L37) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FLight.md b/docs/api/3d/classes/FLight.md index a37e6d7a..1efdd114 100644 --- a/docs/api/3d/classes/FLight.md +++ b/docs/api/3d/classes/FLight.md @@ -35,7 +35,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -55,7 +55,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -93,7 +93,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -117,7 +117,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L46) +[3d/src/lights/FLight.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L46) ## Methods @@ -131,7 +131,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -263,7 +263,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FLight.ts:74](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L74) +[3d/src/lights/FLight.ts:74](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L74) ## Properties @@ -284,7 +284,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -301,7 +301,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -315,7 +315,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -331,7 +331,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -355,7 +355,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -383,7 +383,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -395,7 +395,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -407,4 +407,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FLightProbe.md b/docs/api/3d/classes/FLightProbe.md index a7570fa3..57d1f932 100644 --- a/docs/api/3d/classes/FLightProbe.md +++ b/docs/api/3d/classes/FLightProbe.md @@ -33,7 +33,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -57,7 +57,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -99,7 +99,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -123,7 +123,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L18) +[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L18) ## Methods @@ -141,7 +141,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -273,7 +273,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FLightProbe.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L47) +[3d/src/lights/FLightProbe.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L47) ## Properties @@ -294,7 +294,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -311,7 +311,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -325,7 +325,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -341,7 +341,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -369,7 +369,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -401,7 +401,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -417,7 +417,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -433,4 +433,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FModel.md b/docs/api/3d/classes/FModel.md index 0db82995..bd240dfb 100644 --- a/docs/api/3d/classes/FModel.md +++ b/docs/api/3d/classes/FModel.md @@ -56,7 +56,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -98,7 +98,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -140,7 +140,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -164,7 +164,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -188,7 +188,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -212,7 +212,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -236,7 +236,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -260,7 +260,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -284,7 +284,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -326,7 +326,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -350,7 +350,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -374,7 +374,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -398,7 +398,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -422,7 +422,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -446,7 +446,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -470,7 +470,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -498,7 +498,7 @@ The options for the component (inherits from FComponent). #### Defined in -[3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L59) +[3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L59) ## Methods @@ -514,7 +514,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) *** @@ -582,7 +582,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) *** @@ -610,7 +610,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -620,7 +620,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -647,7 +647,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -657,7 +657,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -685,7 +685,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -695,7 +695,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -723,7 +723,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) *** @@ -777,7 +777,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -803,7 +803,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -825,7 +825,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) *** @@ -869,7 +869,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -913,7 +913,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -957,7 +957,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -1001,7 +1001,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1034,7 +1034,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) *** @@ -1081,13 +1081,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1097,7 +1097,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1113,7 +1113,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1126,7 +1126,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) *** @@ -1142,7 +1142,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** @@ -1155,7 +1155,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) *** @@ -1170,13 +1170,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1186,7 +1186,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1202,13 +1202,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1218,7 +1218,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1238,7 +1238,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) *** @@ -1254,4 +1254,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FOBJ.md b/docs/api/3d/classes/FOBJ.md index 079c81eb..9f934946 100644 --- a/docs/api/3d/classes/FOBJ.md +++ b/docs/api/3d/classes/FOBJ.md @@ -63,7 +63,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -105,7 +105,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -147,7 +147,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -171,7 +171,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -195,7 +195,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -219,7 +219,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -243,7 +243,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -267,7 +267,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -291,7 +291,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -333,7 +333,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -357,7 +357,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -381,7 +381,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -405,7 +405,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -429,7 +429,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -453,7 +453,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -477,7 +477,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -501,7 +501,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FOBJ.ts#L23) +[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FOBJ.ts#L23) ## Methods @@ -521,7 +521,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) *** @@ -593,7 +593,7 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) *** @@ -621,7 +621,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -631,7 +631,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -658,7 +658,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -668,7 +668,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -696,7 +696,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -706,7 +706,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -738,7 +738,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) *** @@ -792,7 +792,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -818,7 +818,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L108) +[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) *** @@ -844,7 +844,7 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L109) +[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) *** @@ -888,7 +888,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -932,7 +932,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -976,7 +976,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -1020,7 +1020,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1057,7 +1057,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L21) +[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) *** @@ -1104,13 +1104,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1120,7 +1120,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1136,7 +1136,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1153,7 +1153,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L52) +[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) *** @@ -1169,7 +1169,7 @@ Mesh #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) *** @@ -1186,7 +1186,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) *** @@ -1205,13 +1205,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1221,7 +1221,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1237,13 +1237,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1253,7 +1253,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1277,7 +1277,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) *** @@ -1293,4 +1293,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FOrbitCamera.md b/docs/api/3d/classes/FOrbitCamera.md index bd49b1e1..4c66597a 100644 --- a/docs/api/3d/classes/FOrbitCamera.md +++ b/docs/api/3d/classes/FOrbitCamera.md @@ -47,7 +47,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L30) +[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L30) ## Methods @@ -366,7 +366,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -389,7 +389,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1129,7 +1129,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1155,7 +1155,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L38) +[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L38) *** @@ -1506,7 +1506,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L46) +[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L46) *** @@ -1534,7 +1534,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1674,7 +1674,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1779,7 +1779,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L54) +[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L54) *** @@ -2157,7 +2157,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2174,7 +2174,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2188,7 +2188,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2204,7 +2204,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2258,7 +2258,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L23) +[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L23) *** @@ -2312,7 +2312,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FOrbitCamera.ts#L25) +[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L25) *** @@ -3051,7 +3051,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FPointLight.md b/docs/api/3d/classes/FPointLight.md index 01887f90..17983459 100644 --- a/docs/api/3d/classes/FPointLight.md +++ b/docs/api/3d/classes/FPointLight.md @@ -30,7 +30,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -120,7 +120,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FPointLight.ts#L11) +[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FPointLight.ts#L11) ## Methods @@ -138,7 +138,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -270,7 +270,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FPointLight.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FPointLight.ts#L40) +[3d/src/lights/FPointLight.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FPointLight.ts#L40) ## Properties @@ -291,7 +291,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -308,7 +308,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -322,7 +322,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -338,7 +338,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -366,7 +366,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -398,7 +398,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -414,7 +414,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -430,4 +430,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FPointerLockCamera.md b/docs/api/3d/classes/FPointerLockCamera.md index 3099a3fb..33537024 100644 --- a/docs/api/3d/classes/FPointerLockCamera.md +++ b/docs/api/3d/classes/FPointerLockCamera.md @@ -43,7 +43,7 @@ Options for the camera. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L30) +[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L30) ## Methods @@ -362,7 +362,7 @@ player.emitCollisionWith({ #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L88) +[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) *** @@ -385,7 +385,7 @@ The direction of the camera. It is a normalized vector. #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L97) +[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) *** @@ -1125,7 +1125,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L81) +[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) *** @@ -1151,7 +1151,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L45) +[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L45) *** @@ -1502,7 +1502,7 @@ Set the position of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L58) +[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) *** @@ -1530,7 +1530,7 @@ Set the rotation of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L72) +[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) *** @@ -1670,7 +1670,7 @@ Set the scale of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L65) +[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) *** @@ -1775,7 +1775,7 @@ Set the zoom of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L76) +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) *** @@ -2153,7 +2153,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L19) +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) *** @@ -2170,7 +2170,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L18) +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) *** @@ -2184,7 +2184,7 @@ It is generated automatically. #### Defined in -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L17) +[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) *** @@ -2200,7 +2200,7 @@ Internal flags #### Defined in -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L16) +[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) *** @@ -2254,7 +2254,7 @@ Expects a `Float` #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L23) +[3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L23) *** @@ -2308,7 +2308,7 @@ THREE.Object3DGroup | Group for info on manually grouping objects. #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FPointerLockCamera.ts#L25) +[3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L25) *** @@ -3047,7 +3047,7 @@ Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FCamera.ts#L24) +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) *** diff --git a/docs/api/3d/classes/FPolyhedron.md b/docs/api/3d/classes/FPolyhedron.md index 7c4b5108..fd4eb14b 100644 --- a/docs/api/3d/classes/FPolyhedron.md +++ b/docs/api/3d/classes/FPolyhedron.md @@ -57,7 +57,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -99,7 +99,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -141,7 +141,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -165,7 +165,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -189,7 +189,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -213,7 +213,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -237,7 +237,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -261,7 +261,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -285,7 +285,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -327,7 +327,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -351,7 +351,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -375,7 +375,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -399,7 +399,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -423,7 +423,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -447,7 +447,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -471,7 +471,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -495,7 +495,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) +[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) ## Methods @@ -575,7 +575,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -585,7 +585,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L361) +[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) *** @@ -612,7 +612,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -622,7 +622,7 @@ component.initRigidBody({ #### Defined in -[3d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L332) +[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) *** @@ -650,7 +650,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -660,7 +660,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -714,7 +714,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -740,7 +740,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:35](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L35) +[3d/src/polyhedrons/FPolyhedron.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L35) *** @@ -768,7 +768,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -812,7 +812,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -856,7 +856,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -900,7 +900,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -944,7 +944,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1012,13 +1012,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1028,7 +1028,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1044,7 +1044,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1061,13 +1061,13 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1077,7 +1077,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1093,13 +1093,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1109,7 +1109,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1125,4 +1125,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FRigidBody.md b/docs/api/3d/classes/FRigidBody.md index 08253b97..6958cc32 100644 --- a/docs/api/3d/classes/FRigidBody.md +++ b/docs/api/3d/classes/FRigidBody.md @@ -2,7 +2,399 @@ # Class: FRigidBody -A 3d RigidBody. +A 3d rigidBody that can be attached to a component. + +## Accessors + +### position + +> `get` **position**(): `object` + +> `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` + +#### Defined in + +[3d/src/core/FRigidBody.ts:264](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L264) + +*** + +### 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` + +#### Defined in + +[3d/src/core/FRigidBody.ts:296](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L296) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): `object` + +> `set` **rotationDegree**(`rotation`): `void` + +#### Parameters + +• **rotation** + +• **rotation.x**: `number` + +• **rotation.y**: `number` + +• **rotation.z**: `number` + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +##### z + +> **z**: `number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:337](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L337) + +*** + +### rotationDegreeX + +> `get` **rotationDegreeX**(): `number` + +> `set` **rotationDegreeX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:346](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L346) + +*** + +### rotationDegreeY + +> `get` **rotationDegreeY**(): `number` + +> `set` **rotationDegreeY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:354](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L354) + +*** + +### rotationDegreeZ + +> `get` **rotationDegreeZ**(): `number` + +> `set` **rotationDegreeZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L362) + +*** + +### rotationX + +> `get` **rotationX**(): `number` + +> `set` **rotationX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:313](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L313) + +*** + +### rotationY + +> `get` **rotationY**(): `number` + +> `set` **rotationY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:321](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L321) + +*** + +### rotationZ + +> `get` **rotationZ**(): `number` + +> `set` **rotationZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:329](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L329) + +*** + +### 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` + +#### Defined in + +[3d/src/core/FRigidBody.ts:370](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L370) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +> `set` **scaleX**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:378](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L378) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +> `set` **scaleY**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L386) + +*** + +### scaleZ + +> `get` **scaleZ**(): `number` + +> `set` **scaleZ**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:394](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L394) + +*** + +### x + +> `get` **x**(): `number` + +> `set` **x**(`x`): `void` + +#### Parameters + +• **x**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:272](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L272) + +*** + +### y + +> `get` **y**(): `number` + +> `set` **y**(`y`): `void` + +#### Parameters + +• **y**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L280) + +*** + +### z + +> `get` **z**(): `number` + +> `set` **z**(`z`): `void` + +#### Parameters + +• **z**: `number` + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:288](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L288) ## Constructors @@ -33,16 +425,266 @@ const rigidBody = new FRigidBody({ position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBE + shape: FShapes.CUBOID }) ``` #### Defined in -[3d/src/core/FRigidBody.ts:72](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L72) +[3d/src/core/FRigidBody.ts:86](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L86) + +## Methods + +### setPosition() + +> **setPosition**(`position`): `void` + +Set the position of the rigidBody. + +#### Parameters + +• **position** + +The new position of the rigidBody. + +• **position.x**: `number` + +The new x position of the rigidBody. + +• **position.y**: `number` + +The new y position of the rigidBody. + +• **position.z**: `number` + +The new z position of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:182](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L182) + +*** + +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set the rotation of the rigidBody. + +#### Parameters + +• **rotation** + +The new rotation of the rigidBody. + +• **rotation.x**: `number` + +The new x rotation of the rigidBody. + +• **rotation.y**: `number` + +The new y rotation of the rigidBody. + +• **rotation.z**: `number` + +The new z rotation of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L194) + +*** + +### setRotationDegree() + +> **setRotationDegree**(`rotation`): `void` + +Set the rotation of the rigidBody in degrees. + +#### Parameters + +• **rotation** + +The new rotation of the rigidBody in degrees. + +• **rotation.x**: `number` + +The new x rotation of the rigidBody in degrees. + +• **rotation.y**: `number` + +The new y rotation of the rigidBody in degrees. + +• **rotation.z**: `number` + +The new z rotation of the rigidBody in degrees. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L206) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set the scale of the rigidBody. + +#### Parameters + +• **scale** + +The new scale of the rigidBody. + +• **scale.x**: `number` + +The new x scale of the rigidBody. + +• **scale.y**: `number` + +The new y scale of the rigidBody. + +• **scale.z**: `number` + +The new z scale of the rigidBody. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:221](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L221) + +*** + +### updatePosition() + +> **updatePosition**(): `void` + +Update the position of the rigidBody according to its component's position. +This takes into account the position offset. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:229](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L229) + +*** + +### updateRotation() + +> **updateRotation**(): `void` + +Update the rotation of the rigidBody according to its component's rotation. +This takes into account the rotation offset. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:243](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L243) + +*** + +### updateScale() + +> **updateScale**(): `void` + +Update the scale of the rigidBody according to its component's scale. +This takes into account the scale offset. +As a rigidBody does not have a scale, this will only update the attached collider's scale. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FRigidBody.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L258) ## Properties +### \_\_RIGIDBODY\_POSITION\_OFFSET\_\_ + +> **\_\_RIGIDBODY\_POSITION\_OFFSET\_\_**: `object` + +Position Offset for the rigidBody. +This is used to adjust the rigidBody position relative to the component. + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L46) + +*** + +### \_\_RIGIDBODY\_ROTATION\_OFFSET\_\_ + +> **\_\_RIGIDBODY\_ROTATION\_OFFSET\_\_**: `object` + +Rotation Offset for the rigidBody. +This is used to adjust the rigidBody position relative to the component. + +#### x + +> **x**: `number` + +#### y + +> **y**: `number` + +#### z + +> **z**: `number` + +#### Defined in + +[3d/src/core/FRigidBody.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L51) + +*** + +### \_\_RIGIDBODY\_\_ + +> **\_\_RIGIDBODY\_\_**: `RigidBody` + +RAPIER RigidBody + +#### Defined in + +[3d/src/core/FRigidBody.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L37) + +*** + ### collider > **collider**: [`FCollider`](FCollider.md) @@ -51,16 +693,16 @@ Fibbo Collider #### Defined in -[3d/src/core/FRigidBody.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L41) +[3d/src/core/FRigidBody.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L41) *** -### rigidBody +### component -> **rigidBody**: `RigidBody` +> **component**: [`FComponent`](FComponent.md) -RAPIER RigidBody +The component the rigidBody is attached to. #### Defined in -[3d/src/core/FRigidBody.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L37) +[3d/src/core/FRigidBody.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L55) diff --git a/docs/api/3d/classes/FScene.md b/docs/api/3d/classes/FScene.md index 078a88d4..d2a8e239 100644 --- a/docs/api/3d/classes/FScene.md +++ b/docs/api/3d/classes/FScene.md @@ -57,7 +57,7 @@ import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d' #### Defined in -[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L71) +[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L71) ## Methods @@ -81,7 +81,7 @@ Add a component to the scene. #### Defined in -[3d/src/core/FScene.ts:183](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L183) +[3d/src/core/FScene.ts:183](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L183) *** @@ -105,7 +105,7 @@ Add a light to the scene. #### Defined in -[3d/src/core/FScene.ts:236](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L236) +[3d/src/core/FScene.ts:236](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L236) *** @@ -135,7 +135,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L159) +[3d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L159) *** @@ -149,7 +149,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:95](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L95) +[3d/src/core/FScene.ts:95](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L95) *** @@ -163,7 +163,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:130](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L130) +[3d/src/core/FScene.ts:130](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L130) *** @@ -332,7 +332,7 @@ Remove a component from the scene. #### Defined in -[3d/src/core/FScene.ts:214](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L214) +[3d/src/core/FScene.ts:214](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L214) *** @@ -356,7 +356,7 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L243) +[3d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L243) ## Properties @@ -366,7 +366,7 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L60) +[3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L60) *** @@ -493,7 +493,7 @@ core/dist/index.d.ts:202 #### Defined in -[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L52) +[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L52) *** @@ -523,7 +523,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L51) +[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L51) *** @@ -537,7 +537,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L69) +[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L69) *** @@ -547,7 +547,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L63) +[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L63) *** @@ -563,7 +563,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L55) +[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L55) *** @@ -577,7 +577,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L68) +[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L68) *** @@ -603,7 +603,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L66) +[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L66) *** @@ -619,7 +619,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L57) +[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L57) *** @@ -629,7 +629,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L62) +[3d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L62) *** @@ -639,7 +639,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L61) +[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L61) *** @@ -653,4 +653,4 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L67) +[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L67) diff --git a/docs/api/3d/classes/FSphere.md b/docs/api/3d/classes/FSphere.md index 894725ba..687af127 100644 --- a/docs/api/3d/classes/FSphere.md +++ b/docs/api/3d/classes/FSphere.md @@ -61,7 +61,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:407](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L407) +[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) *** @@ -103,7 +103,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:439](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L439) +[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) *** @@ -145,7 +145,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:471](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L471) +[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) *** @@ -169,7 +169,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:483](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L483) +[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) *** @@ -193,7 +193,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:491](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L491) +[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) *** @@ -217,7 +217,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:499](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L499) +[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) *** @@ -241,7 +241,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:447](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L447) +[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) *** @@ -265,7 +265,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:455](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L455) +[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) *** @@ -289,7 +289,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:463](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L463) +[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) *** @@ -331,7 +331,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:507](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L507) +[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) *** @@ -355,7 +355,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:515](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L515) +[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) *** @@ -379,7 +379,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:523](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L523) +[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) *** @@ -403,7 +403,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:531](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L531) +[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) *** @@ -427,7 +427,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:415](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L415) +[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) *** @@ -451,7 +451,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:423](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L423) +[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) *** @@ -475,7 +475,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/core/FComponent.ts:431](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L431) +[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) ## Constructors @@ -499,7 +499,7 @@ Setters & getters for transform properties #### Defined in -[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L23) +[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L23) ## Methods @@ -579,7 +579,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -589,7 +589,7 @@ component.initCollider({ #### Defined in -[3d/src/polyhedrons/FSphere.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L47) +[3d/src/polyhedrons/FSphere.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L47) *** @@ -616,7 +616,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -626,7 +626,7 @@ component.initRigidBody({ #### Defined in -[3d/src/polyhedrons/FSphere.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L40) +[3d/src/polyhedrons/FSphere.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L40) *** @@ -654,7 +654,7 @@ 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 + shape: FShapes.CUBOID }) ``` @@ -664,7 +664,7 @@ component.initSensor({ #### Defined in -[3d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L385) +[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) *** @@ -718,7 +718,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:394](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L394) +[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) *** @@ -744,7 +744,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/polyhedrons/FSphere.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FSphere.ts#L36) +[3d/src/polyhedrons/FSphere.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L36) *** @@ -776,7 +776,7 @@ cube.setColor(0xFF0000) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) *** @@ -820,7 +820,7 @@ component.setPosition({ x: 0, y: 1, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L204) +[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) *** @@ -864,7 +864,7 @@ component.setRotation({ x: 0, y: 0, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:269](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L269) +[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) *** @@ -908,7 +908,7 @@ component.setRotationDegree({ x: 0, y: 90, z: 0 }) #### Defined in -[3d/src/core/FComponent.ts:293](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L293) +[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) *** @@ -952,7 +952,7 @@ component.setScale({ x: 1, y: 1, z: 1 }) #### Defined in -[3d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L228) +[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) ## Properties @@ -1020,13 +1020,13 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) *** -### collider? +### collider -> `optional` **collider**: [`FCollider`](FCollider.md) +> **collider**: [`FCollider`](FCollider.md) Collider @@ -1036,7 +1036,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) *** @@ -1052,7 +1052,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) *** @@ -1069,13 +1069,13 @@ directly available after the constructor, as a polyhedron is created synchronous #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### rigidBody? +### rigidBody -> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) +> **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +1085,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) *** @@ -1101,13 +1101,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) *** -### sensor? +### sensor -> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) +> **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +1117,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) *** @@ -1133,4 +1133,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) diff --git a/docs/api/3d/classes/FSpotLight.md b/docs/api/3d/classes/FSpotLight.md index 10bad4f2..9348e257 100644 --- a/docs/api/3d/classes/FSpotLight.md +++ b/docs/api/3d/classes/FSpotLight.md @@ -30,7 +30,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) *** @@ -54,7 +54,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) *** @@ -96,7 +96,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) ## Constructors @@ -124,7 +124,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L26) +[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L26) ## Methods @@ -142,7 +142,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) *** @@ -274,7 +274,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/lights/FSpotLight.ts:62](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L62) +[3d/src/lights/FSpotLight.ts:62](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L62) ## Properties @@ -295,7 +295,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) *** @@ -312,7 +312,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L23) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) *** @@ -326,7 +326,7 @@ It is generated automatically. #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) *** @@ -342,7 +342,7 @@ Internal flags #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) *** @@ -370,7 +370,7 @@ Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) *** @@ -402,7 +402,7 @@ The original light object from Three.js. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) *** @@ -418,7 +418,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) *** @@ -434,4 +434,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) diff --git a/docs/api/3d/classes/FTransform.md b/docs/api/3d/classes/FTransform.md index 6c1b2ee0..01dbf384 100644 --- a/docs/api/3d/classes/FTransform.md +++ b/docs/api/3d/classes/FTransform.md @@ -34,7 +34,7 @@ const collider = new FTransform({ #### Defined in -[3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L44) +[3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L44) ## Properties @@ -46,7 +46,7 @@ The position of the component. #### Defined in -[3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L18) +[3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L18) *** @@ -58,7 +58,7 @@ The rotation of the component. #### Defined in -[3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L26) +[3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L26) *** @@ -70,4 +70,4 @@ The scale of the component. #### Defined in -[3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L22) +[3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L22) diff --git a/docs/api/3d/enumerations/FShapes.md b/docs/api/3d/enumerations/FShapes.md index 560bc6f3..2f4944df 100644 --- a/docs/api/3d/enumerations/FShapes.md +++ b/docs/api/3d/enumerations/FShapes.md @@ -10,17 +10,17 @@ #### Defined in -[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L5) +[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L5) *** -### CUBE +### CUBOID -> **CUBE**: `"Cube"` +> **CUBOID**: `"Cuboid"` #### Defined in -[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L3) +[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L3) *** @@ -30,7 +30,7 @@ #### Defined in -[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L6) +[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L6) *** @@ -40,4 +40,4 @@ #### Defined in -[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/types/FShapes.ts#L4) +[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L4) diff --git a/docs/api/3d/interfaces/FAttachedCameraOptions.md b/docs/api/3d/interfaces/FAttachedCameraOptions.md index 5454cfb8..d307280d 100644 --- a/docs/api/3d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/3d/interfaces/FAttachedCameraOptions.md @@ -30,7 +30,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -56,7 +56,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -82,7 +82,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -108,7 +108,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) *** @@ -118,4 +118,4 @@ #### Defined in -[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/cameras/FAttachedCamera.ts#L7) +[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/3d/interfaces/FCameraOptions.md b/docs/api/3d/interfaces/FCameraOptions.md index 4981bfb5..1c32900a 100644 --- a/docs/api/3d/interfaces/FCameraOptions.md +++ b/docs/api/3d/interfaces/FCameraOptions.md @@ -34,7 +34,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -60,7 +60,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -112,4 +112,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FCharacterControllerOptions.md b/docs/api/3d/interfaces/FCharacterControllerOptions.md index 2d2b2a12..f6f4a168 100644 --- a/docs/api/3d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/3d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FCharacterController.ts#L13) +[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L13) diff --git a/docs/api/3d/interfaces/FColliderOptions.md b/docs/api/3d/interfaces/FColliderOptions.md index 6e0b253e..0a4095e7 100644 --- a/docs/api/3d/interfaces/FColliderOptions.md +++ b/docs/api/3d/interfaces/FColliderOptions.md @@ -22,17 +22,17 @@ #### Defined in -[3d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L7) +[3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L8) *** ### rigidBody? -> `optional` **rigidBody**: `RigidBody` +> `optional` **rigidBody**: [`FRigidBody`](../classes/FRigidBody.md) #### Defined in -[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L12) +[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L13) *** @@ -54,7 +54,7 @@ #### Defined in -[3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L9) +[3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L10) *** @@ -76,7 +76,7 @@ #### Defined in -[3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L10) +[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L11) *** @@ -98,7 +98,7 @@ #### Defined in -[3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L8) +[3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L9) *** @@ -108,7 +108,7 @@ #### Defined in -[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L13) +[3d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L14) *** @@ -118,4 +118,4 @@ #### Defined in -[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FCollider.ts#L11) +[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L12) diff --git a/docs/api/3d/interfaces/FComponentOptions.md b/docs/api/3d/interfaces/FComponentOptions.md index 418096f3..93f70ded 100644 --- a/docs/api/3d/interfaces/FComponentOptions.md +++ b/docs/api/3d/interfaces/FComponentOptions.md @@ -26,7 +26,7 @@ #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L14) *** @@ -48,7 +48,7 @@ #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L16) *** @@ -70,7 +70,7 @@ #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L17) *** @@ -92,4 +92,4 @@ #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L15) diff --git a/docs/api/3d/interfaces/FControllerOptions.md b/docs/api/3d/interfaces/FControllerOptions.md index 76465497..1693835b 100644 --- a/docs/api/3d/interfaces/FControllerOptions.md +++ b/docs/api/3d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L6) diff --git a/docs/api/3d/interfaces/FHemisphereLightOptions.md b/docs/api/3d/interfaces/FHemisphereLightOptions.md index fd75b2be..de946d86 100644 --- a/docs/api/3d/interfaces/FHemisphereLightOptions.md +++ b/docs/api/3d/interfaces/FHemisphereLightOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L8) +[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L8) *** @@ -42,7 +42,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) *** @@ -68,7 +68,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) *** @@ -94,7 +94,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -120,7 +120,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -146,7 +146,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -172,7 +172,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) *** @@ -182,4 +182,4 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FHemisphereLight.ts#L7) +[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L7) diff --git a/docs/api/3d/interfaces/FLightOptions.md b/docs/api/3d/interfaces/FLightOptions.md index e1925b46..0ea9e51d 100644 --- a/docs/api/3d/interfaces/FLightOptions.md +++ b/docs/api/3d/interfaces/FLightOptions.md @@ -20,7 +20,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) *** @@ -30,7 +30,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) *** @@ -52,7 +52,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) *** @@ -78,7 +78,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -104,7 +104,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -130,7 +130,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -156,4 +156,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FLightProbeOptions.md b/docs/api/3d/interfaces/FLightProbeOptions.md index 466ebad2..1d1a0f47 100644 --- a/docs/api/3d/interfaces/FLightProbeOptions.md +++ b/docs/api/3d/interfaces/FLightProbeOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) *** @@ -32,7 +32,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) *** @@ -58,7 +58,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) *** @@ -84,7 +84,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -110,7 +110,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -136,7 +136,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -162,7 +162,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) *** @@ -172,4 +172,4 @@ #### Defined in -[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLightProbe.ts#L7) +[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L7) diff --git a/docs/api/3d/interfaces/FModelOptions.md b/docs/api/3d/interfaces/FModelOptions.md index 6df54855..3e608ab9 100644 --- a/docs/api/3d/interfaces/FModelOptions.md +++ b/docs/api/3d/interfaces/FModelOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L10) +[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L10) *** @@ -24,7 +24,7 @@ #### Defined in -[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L7) +[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L7) *** @@ -34,7 +34,7 @@ #### Defined in -[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L8) +[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L8) *** @@ -60,7 +60,7 @@ #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L14) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L16) *** @@ -112,7 +112,7 @@ #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L17) *** @@ -138,7 +138,7 @@ #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L15) *** @@ -148,4 +148,4 @@ #### Defined in -[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/model/FModel.ts#L9) +[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L9) diff --git a/docs/api/3d/interfaces/FRigidBodyOptions.md b/docs/api/3d/interfaces/FRigidBodyOptions.md index 65fa36b9..d97e3634 100644 --- a/docs/api/3d/interfaces/FRigidBodyOptions.md +++ b/docs/api/3d/interfaces/FRigidBodyOptions.md @@ -22,7 +22,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L22) +[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L22) *** @@ -44,7 +44,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L17) +[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L17) *** @@ -54,7 +54,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L16) +[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L16) *** @@ -64,7 +64,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L15) +[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L15) *** @@ -86,7 +86,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L8) +[3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L8) *** @@ -96,7 +96,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L13) +[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L13) *** @@ -118,7 +118,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L10) +[3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L10) *** @@ -140,7 +140,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L11) +[3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L11) *** @@ -162,7 +162,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L9) +[3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L9) *** @@ -172,7 +172,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L14) +[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L14) *** @@ -182,4 +182,4 @@ #### Defined in -[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FRigidBody.ts#L12) +[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L12) diff --git a/docs/api/3d/interfaces/FSceneOptions.md b/docs/api/3d/interfaces/FSceneOptions.md index c02d86b6..9ef4036e 100644 --- a/docs/api/3d/interfaces/FSceneOptions.md +++ b/docs/api/3d/interfaces/FSceneOptions.md @@ -44,7 +44,7 @@ core/dist/index.d.ts:186 #### Defined in -[3d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L12) +[3d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L12) *** @@ -54,4 +54,4 @@ core/dist/index.d.ts:186 #### Defined in -[3d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FScene.ts#L13) +[3d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L13) diff --git a/docs/api/3d/interfaces/FSpotLightOptions.md b/docs/api/3d/interfaces/FSpotLightOptions.md index 3b717437..5fb186d5 100644 --- a/docs/api/3d/interfaces/FSpotLightOptions.md +++ b/docs/api/3d/interfaces/FSpotLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L8) +[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L8) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) *** @@ -38,7 +38,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L10) +[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L10) *** @@ -48,7 +48,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L7) +[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L7) *** @@ -62,7 +62,7 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) *** @@ -88,7 +88,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) *** @@ -98,7 +98,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/lights/FSpotLight.ts#L9) +[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L9) *** @@ -124,7 +124,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -150,7 +150,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -176,7 +176,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -202,4 +202,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/3d/interfaces/FTransformOptions.md b/docs/api/3d/interfaces/FTransformOptions.md index 6462dfe8..874facae 100644 --- a/docs/api/3d/interfaces/FTransformOptions.md +++ b/docs/api/3d/interfaces/FTransformOptions.md @@ -27,7 +27,7 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) *** @@ -49,7 +49,7 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) *** @@ -71,7 +71,7 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) *** @@ -93,4 +93,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) diff --git a/docs/api/core/classes/FCamera.md b/docs/api/core/classes/FCamera.md index 666bf3e9..5587fbe5 100644 --- a/docs/api/core/classes/FCamera.md +++ b/docs/api/core/classes/FCamera.md @@ -24,7 +24,7 @@ The base class for cameras in Fibbo. #### Defined in -[core/src/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FCamera.ts#L8) +[core/src/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FCamera.ts#L8) ## Methods @@ -76,7 +76,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) *** @@ -130,7 +130,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) *** @@ -158,7 +158,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) *** @@ -178,7 +178,7 @@ Set the zoom of the camera. #### Defined in -[core/src/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FCamera.ts#L15) +[core/src/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FCamera.ts#L15) ## Properties @@ -199,7 +199,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) *** @@ -216,7 +216,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) *** @@ -230,7 +230,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) *** @@ -246,7 +246,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) *** @@ -262,4 +262,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FComponent.md b/docs/api/core/classes/FComponent.md index 60fdfcc6..38a9bb64 100644 --- a/docs/api/core/classes/FComponent.md +++ b/docs/api/core/classes/FComponent.md @@ -21,7 +21,7 @@ The base class for all 2D and 3D components in Fibbo. #### Defined in -[core/src/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L46) +[core/src/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L46) ## Methods @@ -69,7 +69,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) *** @@ -119,7 +119,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) *** @@ -143,7 +143,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) ## Properties @@ -160,7 +160,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) *** @@ -173,7 +173,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) *** @@ -183,7 +183,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) *** @@ -195,7 +195,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) *** @@ -207,4 +207,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FController.md b/docs/api/core/classes/FController.md index 13e9ded9..7df64557 100644 --- a/docs/api/core/classes/FController.md +++ b/docs/api/core/classes/FController.md @@ -22,7 +22,7 @@ The options for the controller. #### Defined in -[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L21) +[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L21) ## Methods @@ -46,7 +46,7 @@ The time since the last frame. #### Defined in -[core/src/FController.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L31) +[core/src/FController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L31) ## Properties @@ -58,4 +58,4 @@ The component attached to the controller. #### Defined in -[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L15) +[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L15) diff --git a/docs/api/core/classes/FGroup.md b/docs/api/core/classes/FGroup.md index 30ff52c9..391a9273 100644 --- a/docs/api/core/classes/FGroup.md +++ b/docs/api/core/classes/FGroup.md @@ -29,7 +29,7 @@ The components to add to the group. #### Defined in -[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L19) +[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L19) ## Methods @@ -49,7 +49,7 @@ Add a component to the group. #### Defined in -[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L26) +[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L26) *** @@ -71,7 +71,7 @@ The time since the last frame. #### Defined in -[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L41) +[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L41) *** @@ -91,7 +91,7 @@ Remove a component from the group. #### Defined in -[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L33) +[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L33) ## Properties @@ -103,4 +103,4 @@ The components in the group. #### Defined in -[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FGroup.ts#L11) +[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L11) diff --git a/docs/api/core/classes/FLight.md b/docs/api/core/classes/FLight.md index d50a02c1..c7bf7fa6 100644 --- a/docs/api/core/classes/FLight.md +++ b/docs/api/core/classes/FLight.md @@ -24,7 +24,7 @@ The base class for lights in Fibbo. #### Defined in -[core/src/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FLight.ts#L8) +[core/src/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FLight.ts#L8) ## Methods @@ -76,7 +76,7 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) *** @@ -130,7 +130,7 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) *** @@ -158,7 +158,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) ## Properties @@ -179,7 +179,7 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) *** @@ -196,7 +196,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) *** @@ -210,7 +210,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) *** @@ -226,7 +226,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) *** @@ -242,4 +242,4 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) diff --git a/docs/api/core/classes/FScene.md b/docs/api/core/classes/FScene.md index 5154e5c8..789eb618 100644 --- a/docs/api/core/classes/FScene.md +++ b/docs/api/core/classes/FScene.md @@ -21,7 +21,7 @@ Also contains the Rapier world if physics is enabled. #### Defined in -[core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L75) +[core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L75) ## Methods @@ -41,7 +41,7 @@ Add a component to the scene. #### Defined in -[core/src/FScene.ts:128](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L128) +[core/src/FScene.ts:128](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L128) *** @@ -61,7 +61,7 @@ Add a light to the scene. #### Defined in -[core/src/FScene.ts:147](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L147) +[core/src/FScene.ts:147](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L147) *** @@ -81,7 +81,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -[core/src/FScene.ts:173](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L173) +[core/src/FScene.ts:173](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L173) *** @@ -101,7 +101,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -[core/src/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L180) +[core/src/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L180) *** @@ -121,7 +121,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L166) +[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L166) *** @@ -141,7 +141,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -[core/src/FScene.ts:195](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L195) +[core/src/FScene.ts:195](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L195) *** @@ -161,7 +161,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -[core/src/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L202) +[core/src/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L202) *** @@ -182,7 +182,7 @@ The scene is ready when the `init` method has finished. #### Defined in -[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L188) +[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L188) *** @@ -202,7 +202,7 @@ Remove a component from the scene. #### Defined in -[core/src/FScene.ts:136](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L136) +[core/src/FScene.ts:136](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L136) *** @@ -222,7 +222,7 @@ Remove a light from the scene. #### Defined in -[core/src/FScene.ts:155](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L155) +[core/src/FScene.ts:155](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L155) ## Properties @@ -235,7 +235,7 @@ It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L54) +[core/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L54) *** @@ -248,7 +248,7 @@ It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L59) +[core/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L59) *** @@ -261,7 +261,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L49) +[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L49) *** @@ -274,7 +274,7 @@ It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L68) +[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L68) *** @@ -287,7 +287,7 @@ It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L73) +[core/src/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L73) *** @@ -299,7 +299,7 @@ Callbacks for when the scene is ready. #### Defined in -[core/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L63) +[core/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L63) *** @@ -311,7 +311,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L26) +[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L26) *** @@ -321,7 +321,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L21) +[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L21) *** @@ -333,7 +333,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:20](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L20) +[core/src/FScene.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L20) *** @@ -343,7 +343,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L42) +[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L42) *** @@ -355,7 +355,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:31](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L31) +[core/src/FScene.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L31) *** @@ -365,7 +365,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L41) +[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L41) *** @@ -375,7 +375,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:39](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L39) +[core/src/FScene.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L39) *** @@ -387,7 +387,7 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L36) +[core/src/FScene.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L36) *** @@ -397,4 +397,4 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L40) +[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L40) diff --git a/docs/api/core/interfaces/FControllerOptions.md b/docs/api/core/interfaces/FControllerOptions.md index 6d9e35eb..41c2bae1 100644 --- a/docs/api/core/interfaces/FControllerOptions.md +++ b/docs/api/core/interfaces/FControllerOptions.md @@ -10,4 +10,4 @@ #### Defined in -[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FController.ts#L4) +[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L4) diff --git a/docs/api/core/interfaces/FSceneOptions.md b/docs/api/core/interfaces/FSceneOptions.md index 2d7ca79a..e79a7282 100644 --- a/docs/api/core/interfaces/FSceneOptions.md +++ b/docs/api/core/interfaces/FSceneOptions.md @@ -10,7 +10,7 @@ #### Defined in -[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L8) +[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L8) *** @@ -20,4 +20,4 @@ #### Defined in -[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FScene.ts#L7) +[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L7) diff --git a/docs/api/core/interfaces/OnCollisionWithData.md b/docs/api/core/interfaces/OnCollisionWithData.md index 6d90f6e8..6a2a303d 100644 --- a/docs/api/core/interfaces/OnCollisionWithData.md +++ b/docs/api/core/interfaces/OnCollisionWithData.md @@ -14,4 +14,4 @@ The component that collided with the component. #### Defined in -[core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/core/src/FComponent.ts#L15) +[core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L15) diff --git a/docs/api/event/classes/FKeyboard.md b/docs/api/event/classes/FKeyboard.md index e34d5f75..40650c62 100644 --- a/docs/api/event/classes/FKeyboard.md +++ b/docs/api/event/classes/FKeyboard.md @@ -35,7 +35,7 @@ keyboard.on('ArrowUp', () => { #### Defined in -[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L38) +[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L38) ## Methods @@ -61,7 +61,7 @@ keyboard.clear() #### Defined in -[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L194) +[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L194) *** @@ -112,7 +112,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L102) +[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L102) *** @@ -161,7 +161,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L136) +[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L136) *** @@ -210,7 +210,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L170) +[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L170) ## Properties @@ -222,7 +222,7 @@ An map of all the callbacks for each key being pressed #### Defined in -[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L28) +[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L28) *** @@ -234,7 +234,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L32) +[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L32) *** @@ -246,7 +246,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L36) +[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L36) *** @@ -258,4 +258,4 @@ A map of all the keys being pressed #### Defined in -[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/e3aaabaf7a5c47833ea6611fca008a9ca7b66ba5/packages/event/src/FKeyboard.ts#L24) +[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L24) From b89f858907edb3c881249fb43f83d14247943693 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 4 Oct 2024 10:32:51 +0200 Subject: [PATCH 15/36] fix(3d): fix playground model position --- apps/playground-3d/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/playground-3d/src/main.ts b/apps/playground-3d/src/main.ts index 895fa44a..909313a3 100644 --- a/apps/playground-3d/src/main.ts +++ b/apps/playground-3d/src/main.ts @@ -76,7 +76,7 @@ import Character from './classes/Character' const blockGrassOverhangLargeTall = new FOBJ(scene, { name: 'block-grass-overhang-large-tall', - position: { x: -10, y: -7, z: -4 }, + position: { x: -10, y: -5, z: -4 }, scale: { x: 4, y: 4, z: 4 }, }) blockGrassOverhangLargeTall.initCollider({ @@ -112,7 +112,7 @@ import Character from './classes/Character' const blockGrassLarge = new FFBX(scene, { name: 'block-grass-large', - position: { x: -14, y: -8, z: 0 }, + position: { x: -14, y: -6, z: 0 }, scale: { x: 8, y: 8, z: 8 }, }) blockGrassLarge.initCollider({ From 246ad56a00d7a0666c7c6a63743a8198619e890d Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 11 Oct 2024 08:03:56 +0200 Subject: [PATCH 16/36] docs: add fibbo IPA pronouncation --- docs/getting-started/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index 321412eb..a68ec637 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -1,6 +1,6 @@ # Introduction -Fibbo is a free and [open-source](https://github.com/fibbojs/fibbo) web-based game engine that allows you to create interactive experiences using JavaScript, right in your browser. +Fibbo (pronounced [fˈa͡ɪbo͡ʊ](http://ipa-reader.xyz/?text=f%CB%88a%CD%A1%C9%AAbo%CD%A1%CA%8A)) is a free and [open-source](https://github.com/fibbojs/fibbo) web-based game engine that allows you to create interactive experiences using JavaScript, right in your browser. It is designed to be simple to use, extensible, and flexible. You can use it to create games, simulations, visualizations, and more. From ec6007f5dd19a110d8e61194776e725881ec4291 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Fri, 11 Oct 2024 16:23:20 +0200 Subject: [PATCH 17/36] docs: fix rigid-body to rigidBody --- docs/guide/physics/colliders.md | 6 +++--- docs/guide/physics/rigidbody.md | 26 +++++++++++------------ docs/more/recipes/character-controller.md | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/guide/physics/colliders.md b/docs/guide/physics/colliders.md index 8dab6327..d6b5435c 100644 --- a/docs/guide/physics/colliders.md +++ b/docs/guide/physics/colliders.md @@ -1,10 +1,10 @@ # Colliders -Colliders represent the geometric shapes that generate contacts and collision events when they touch. Attaching one or multiple colliders to a rigid-body allow the rigid-body to be affected by contact forces. +Colliders represent the geometric shapes that generate contacts and collision events when they touch. Attaching one or multiple colliders to a rigidBody allow the rigidBody to be affected by contact forces. -The only use case for a collider without a rigid-body might be to create ground or walls that are not supposed to move and which you do not want to detect contacts against. +The only use case for a collider without a rigidBody might be to create ground or walls that are not supposed to move and which you do not want to detect contacts against. -Any other use case might require attaching the collider to a rigid-body. +Any other use case might require attaching the collider to a rigidBody. ## Adding a collider to a component diff --git a/docs/guide/physics/rigidbody.md b/docs/guide/physics/rigidbody.md index eb6f50dc..03477968 100644 --- a/docs/guide/physics/rigidbody.md +++ b/docs/guide/physics/rigidbody.md @@ -8,12 +8,12 @@ On the other hand, rigid-bodies are not enough to simulate, e.g., cars, ragdolls ## Relation with colliders -A [collider](/guide/physics/colliders) can be attached to a rigid-body to specify its shape and enable collision-detection. +A [collider](/guide/physics/colliders) can be attached to a rigidBody to specify its shape and enable collision-detection. -A rigid-body without collider attached to it will not be affected by contacts (because there is no shape to compute contact against). +A rigidBody without collider attached to it will not be affected by contacts (because there is no shape to compute contact against). ::: tip -By default, Fibbo always create a collider when a rigid-body is created. +By default, Fibbo always create a collider when a rigidBody is created. ::: ## Types of rigid-bodies @@ -26,9 +26,9 @@ There are four types of rigid-bodies, identified by the RigidBodyType enumeratio - Kinematic Position Based (`RAPIER.RigidBodyType.KinematicPositionBased`): Indicates that the body position must not be altered by the physics engine. The user is free to set its next position and the body velocity will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. - Kinematic Velocity Based (`RAPIER.RigidBodyType.KinematicVelocityBased`): Indicates that the body velocity must not be altered by the physics engine. The user is free to set its velocity and the next body position will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. -## Adding a rigid-body to a component +## Adding a rigidBody to a component -Every [`FComponent`](/api/core/classes/FComponent) has a [`initRigidBody`](/api/3d/classes/FComponent#initrigidbody) method that allows you to create a rigid-body and attach it to the component directly. +Every [`FComponent`](/api/core/classes/FComponent) has a [`initRigidBody`](/api/3d/classes/FComponent#initrigidbody) method that allows you to create a rigidBody and attach it to the component directly. ```typescript import { FCuboid, FShape } from '@fibbojs/3d' @@ -45,22 +45,22 @@ cube.initRigidBody({ ``` Apart from the classic [transform](/guide/core/transforms) properties, the `initRigidBody` method accepts the following parameters : -- `shape` : The shape of the collider attached to the rigid-body. This is required to compute contacts. -- `rigidBodyType` : The type of the rigid-body. -- `lockTranslations` : A boolean indicating if the translations of the rigid-body should be locked. -- `enabledTranslations` : An object containing the enabled translations of the rigid-body. +- `shape` : The shape of the collider attached to the rigidBody. This is required to compute contacts. +- `rigidBodyType` : The type of the rigidBody. +- `lockTranslations` : A boolean indicating if the translations of the rigidBody should be locked. +- `enabledTranslations` : An object containing the enabled translations of the rigidBody. - `enableX` : A boolean indicating if the translation along the x-axis is enabled. - `enableY` : A boolean indicating if the translation along the y-axis is enabled. - `enableZ` : A boolean indicating if the translation along the z-axis is enabled. (only exist on 3d rigid-bodies) -- `lockRotations` : A boolean indicating if the rotations of the rigid-body should be locked. -- `enabledRotations` : An object containing the enabled rotations of the rigid-body. (only exist on 3d rigid-bodies) +- `lockRotations` : A boolean indicating if the rotations of the rigidBody should be locked. +- `enabledRotations` : An object containing the enabled rotations of the rigidBody. (only exist on 3d rigid-bodies) - `enableX` : A boolean indicating if the rotation around the x-axis is enabled. - `enableY` : A boolean indicating if the rotation around the y-axis is enabled. - `enableZ` : A boolean indicating if the rotation around the z-axis is enabled. -## Creating a rigid-body by hand +## Creating a rigidBody by hand -You can also directly use the [`FRigidBody`](/api/3d/classes/FRigidBody) class to create a rigid-body and attach it to a component. +You can also directly use the [`FRigidBody`](/api/3d/classes/FRigidBody) class to create a rigidBody and attach it to a component. ```typescript import { FCuboid, FRigidBody, FShape } from '@fibbojs/3d' diff --git a/docs/more/recipes/character-controller.md b/docs/more/recipes/character-controller.md index 91d903aa..c6f06e05 100644 --- a/docs/more/recipes/character-controller.md +++ b/docs/more/recipes/character-controller.md @@ -11,10 +11,10 @@ Here are the available character controllers in Fibbo : | Controller | Description | Common usage | | --------------------- | --------------------------------------------------------------------------------------------------------- | ------------ | -| FCharacterControllerD | The "D" stands for dynamic. It it based on a dynamic rigid-body so it is affected by the scene's gravity. | Not recommended as movements do not feel game-like. | +| FCharacterControllerD | The "D" stands for dynamic. It it based on a dynamic rigidBody so it is affected by the scene's gravity. | Not recommended as movements do not feel game-like. | | FCharacterControllerK | The "K" stands for kinematic. It is an abstract controller used for `FCharacterControllerKP` and `FCharacterControllerKV`. | | -| FCharacterControllerKP | The "KP" stands for kinematic position-based. It is based on a kinematic position-based rigid-body, and has its own gravity. | Recommended for most use cases as position-based behavior generally feel more natural to think about. It is also the only controller including rotation movements by default in 3D. | -| FCharacterControllerKV | The "KV" stands for kinematic velocity-based. It is based on a kinematic velocity-based rigid-body, and has its own gravity. | Less recommended but very similar to `FCharacterControllerKP`. | +| FCharacterControllerKP | The "KP" stands for kinematic position-based. It is based on a kinematic position-based rigidBody, and has its own gravity. | Recommended for most use cases as position-based behavior generally feel more natural to think about. It is also the only controller including rotation movements by default in 3D. | +| FCharacterControllerKV | The "KV" stands for kinematic velocity-based. It is based on a kinematic velocity-based rigidBody, and has its own gravity. | Less recommended but very similar to `FCharacterControllerKP`. | ## Using a character controller From 9b8a33fa393c2a02c2f1eab40f824d7c170b7df4 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Sat, 12 Oct 2024 17:44:27 +0200 Subject: [PATCH 18/36] feat: improve test config, improve FScene, FComponent, FCamera... --- .gitignore | 4 +- .vscode/settings.json | 3 +- docs/vitest.config.ts | 1 + nx.json | 8 + package-lock.json | 1567 ++++++++++++----- package.json | 16 +- packages/2d/package.json | 4 +- packages/2d/src/cameras/FCamera.ts | 2 +- packages/2d/src/core/FCollider.ts | 2 +- packages/2d/src/core/FComponent.ts | 6 +- packages/2d/src/core/FRigidBody.ts | 36 +- packages/2d/src/core/FScene.ts | 32 +- packages/2d/src/lights/FLight.ts | 2 +- packages/2d/src/polygons/FCircle.ts | 2 + packages/2d/src/polygons/FRectangle.ts | 2 + packages/2d/src/sprite/FSprite.ts | 21 - packages/2d/test/browser/collider.test.ts | 8 +- packages/2d/test/browser/rigidbody.test.ts | 65 +- packages/3d/package.json | 4 +- packages/3d/src/cameras/FAttachedCamera.ts | 20 +- packages/3d/src/cameras/FCamera.ts | 212 ++- packages/3d/src/cameras/FFixedCamera.ts | 5 +- packages/3d/src/cameras/FGameCamera.ts | 24 +- packages/3d/src/cameras/FOrbitCamera.ts | 20 +- packages/3d/src/cameras/FPointerLockCamera.ts | 10 +- packages/3d/src/core/FComponent.ts | 21 +- packages/3d/src/core/FScene.ts | 22 +- packages/3d/src/core/FTransform.ts | 34 +- packages/3d/src/lights/FLight.ts | 2 +- packages/3d/src/model/FModel.ts | 14 +- packages/3d/test/browser/collider.test.ts | 6 +- packages/3d/test/browser/rigidbody.test.ts | 6 +- packages/core/package.json | 4 +- packages/core/src/FCamera.ts | 5 +- packages/core/src/FComponent.ts | 52 +- packages/core/src/FLight.ts | 5 +- packages/core/src/FScene.ts | 23 +- packages/devtools/package.json | 4 +- packages/event/package.json | 4 +- vitest.config.global.ts | 14 + vitest.config.ts | 13 + 41 files changed, 1671 insertions(+), 634 deletions(-) create mode 100644 vitest.config.global.ts create mode 100644 vitest.config.ts diff --git a/.gitignore b/.gitignore index a08162e7..d163231d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ html .nx/cache -.nx/workspace-data \ No newline at end of file +.nx/workspace-data + +__screenshots__ diff --git a/.vscode/settings.json b/.vscode/settings.json index 5d401540..29e7e978 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,6 +53,7 @@ "**/tsconfig.json": true, "**/*.d.ts": true, "**/.gitignore": true, - "**/vitest.workspace.ts": true + "**/vitest.workspace.ts": true, + "**/vitest.config.ts": true } } diff --git a/docs/vitest.config.ts b/docs/vitest.config.ts index c99ddb1d..be4f21c5 100644 --- a/docs/vitest.config.ts +++ b/docs/vitest.config.ts @@ -6,6 +6,7 @@ export default defineConfig({ coverage: { enabled: true, include: ['packages'], + exclude: ['packages/**/dist', 'packages/**/coverage', 'packages/**/test'], reporter: [['html', { subdir: 'coverage' }]], reportsDirectory: 'fibbo', }, diff --git a/nx.json b/nx.json index c9bc839d..f68f8191 100644 --- a/nx.json +++ b/nx.json @@ -35,6 +35,14 @@ "dependsOn": ["^build", "build"], "cache": true }, + "test:ui": { + "dependsOn": ["^build", "build"], + "cache": true + }, + "test:run": { + "dependsOn": ["^build", "build"], + "cache": true + }, "docs:build": { "dependsOn": ["^build"], "cache": true diff --git a/package-lock.json b/package-lock.json index f67bd4cb..e28104b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@antfu/utils": "^0.7.7", "@nx/eslint": "19.6.1", "@nx/js": "19.6.1", - "@nx/vite": "19.6.1", + "@nx/vite": "^20.0.0", "@nx/web": "19.6.1", "@swc-node/register": "1.9.2", "@swc/core": "1.5.7", @@ -33,9 +33,10 @@ "@types/node": "^20.12.7", "@types/three": "^0.166.0", "@vitejs/plugin-vue": "^5.1.2", - "@vitest/browser": "^1.6.0", - "@vitest/coverage-v8": "^1.6.0", - "@vitest/ui": "^1.3.1", + "@vitest/browser": "^2.1.2", + "@vitest/coverage-istanbul": "^2.1.2", + "@vitest/coverage-v8": "^2.1.2", + "@vitest/ui": "^2.1.2", "eslint": "^9.7.0", "nx": "19.6.1", "playwright": "^1.47.2", @@ -47,7 +48,7 @@ "unbuild": "^2.0.0", "vite": "^5.2.9", "vitepress": "^1.1.4", - "vitest": "^1.6.0", + "vitest": "^2.1.2", "vue": "^3.4.37", "vue-tsc": "^2.0.29" } @@ -2479,6 +2480,34 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bundled-es-modules/cookie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.0.tgz", + "integrity": "sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==", + "dev": true, + "dependencies": { + "cookie": "^0.5.0" + } + }, + "node_modules/@bundled-es-modules/statuses": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz", + "integrity": "sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==", + "dev": true, + "dependencies": { + "statuses": "^2.0.1" + } + }, + "node_modules/@bundled-es-modules/tough-cookie": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/tough-cookie/-/tough-cookie-0.1.6.tgz", + "integrity": "sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==", + "dev": true, + "dependencies": { + "@types/tough-cookie": "^4.0.5", + "tough-cookie": "^4.1.4" + } + }, "node_modules/@clack/core": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.3.4.tgz", @@ -2506,7 +2535,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -3268,6 +3297,110 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@inquirer/confirm": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.2.0.tgz", + "integrity": "sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==", + "dev": true, + "dependencies": { + "@inquirer/core": "^9.1.0", + "@inquirer/type": "^1.5.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz", + "integrity": "sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==", + "dev": true, + "dependencies": { + "@inquirer/figures": "^1.0.6", + "@inquirer/type": "^2.0.0", + "@types/mute-stream": "^0.0.4", + "@types/node": "^22.5.5", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core/node_modules/@inquirer/type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-2.0.0.tgz", + "integrity": "sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==", + "dev": true, + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@inquirer/core/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@inquirer/core/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.7.tgz", + "integrity": "sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.5.5.tgz", + "integrity": "sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==", + "dev": true, + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -3432,6 +3565,23 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mswjs/interceptors": { + "version": "0.35.9", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.35.9.tgz", + "integrity": "sha512-SSnyl/4ni/2ViHKkiZb8eajA/eN1DNFaHjhGiLUdZvDz6PKF4COSf/17xqSz64nOo2Ia29SA6B2KNCsyCbVmaQ==", + "dev": true, + "dependencies": { + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "strict-event-emitter": "^0.5.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.4.tgz", @@ -3509,15 +3659,6 @@ "tao": "index.js" } }, - "node_modules/@nrwl/vite": { - "version": "19.6.1", - "resolved": "https://registry.npmjs.org/@nrwl/vite/-/vite-19.6.1.tgz", - "integrity": "sha512-niq+bgzc2sbSb6Z3phKaxdP9/UGf4CcHgvJjtopt7lSiDMdqcTQx89NzFdKlQwHYwOMvHuVlXE3zxJvC+e9BVA==", - "dev": true, - "dependencies": { - "@nx/vite": "19.6.1" - } - }, "node_modules/@nrwl/web": { "version": "19.6.1", "resolved": "https://registry.npmjs.org/@nrwl/web/-/web-19.6.1.tgz", @@ -3807,22 +3948,339 @@ } }, "node_modules/@nx/vite": { - "version": "19.6.1", - "resolved": "https://registry.npmjs.org/@nx/vite/-/vite-19.6.1.tgz", - "integrity": "sha512-p8BT7bXxJOjQfUi7oG0y+Lo5t5Ww55y4V4vR3c7oeVteJ0sMqEXBo2EtMaLa73xTmnkHV0AFU0o77NnZV6iafw==", + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/vite/-/vite-20.0.0.tgz", + "integrity": "sha512-1aENKRpSiAV/mKiRELcOrXrxN9xlnxTN7255XPhulZE7JTn7pjpwNkKu1zbiM+kP3bLFRgUhXWzMbmdBZ7phdw==", "dev": true, "dependencies": { - "@nrwl/vite": "19.6.1", - "@nx/devkit": "19.6.1", - "@nx/js": "19.6.1", + "@nx/devkit": "20.0.0", + "@nx/js": "20.0.0", "@phenomnomnominal/tsquery": "~5.0.1", "@swc/helpers": "~0.5.0", "enquirer": "~2.3.6", + "minimatch": "9.0.3", "tsconfig-paths": "^4.1.2" }, "peerDependencies": { "vite": "^5.0.0", - "vitest": "^1.3.1" + "vitest": "^1.3.1 || ^2.0.0" + } + }, + "node_modules/@nx/vite/node_modules/@nx/devkit": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-20.0.0.tgz", + "integrity": "sha512-9hSZBFnJ9pkdJnaNiuBwBGJAIYXEOwcXDhtUrm4jpVTDdYWP2m9fgu0Vf47TADf7vF1f2EVvS7dqqJbMDgULlg==", + "dev": true, + "dependencies": { + "ejs": "^3.1.7", + "enquirer": "~2.3.6", + "ignore": "^5.0.4", + "minimatch": "9.0.3", + "semver": "^7.5.3", + "tmp": "~0.2.1", + "tslib": "^2.3.0", + "yargs-parser": "21.1.1" + }, + "peerDependencies": { + "nx": ">= 19 <= 21" + } + }, + "node_modules/@nx/vite/node_modules/@nx/js": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/js/-/js-20.0.0.tgz", + "integrity": "sha512-CiWl9Np+YL55FZiQXIiOqwxU4Gj9l7pQFE3YV/4v1CTSuT+4uHNAS6hr7nSbVZ0Z4YTk0QnDLsxuvsezIG0LfA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.2", + "@babel/plugin-proposal-decorators": "^7.22.7", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-runtime": "^7.23.2", + "@babel/preset-env": "^7.23.2", + "@babel/preset-typescript": "^7.22.5", + "@babel/runtime": "^7.22.6", + "@nx/devkit": "20.0.0", + "@nx/workspace": "20.0.0", + "@zkochan/js-yaml": "0.0.7", + "babel-plugin-const-enum": "^1.0.1", + "babel-plugin-macros": "^2.8.0", + "babel-plugin-transform-typescript-metadata": "^0.3.1", + "chalk": "^4.1.0", + "columnify": "^1.6.0", + "detect-port": "^1.5.1", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "ignore": "^5.0.4", + "js-tokens": "^4.0.0", + "jsonc-parser": "3.2.0", + "minimatch": "9.0.3", + "npm-package-arg": "11.0.1", + "npm-run-path": "^4.0.1", + "ora": "5.3.0", + "semver": "^7.5.3", + "source-map-support": "0.5.19", + "ts-node": "10.9.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "verdaccio": "^5.0.4" + }, + "peerDependenciesMeta": { + "verdaccio": { + "optional": true + } + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-darwin-arm64": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-20.0.0.tgz", + "integrity": "sha512-sVG2qdQh192eQbsRVs/VpYkgRdbinLEj/6LvHXjU+Qi3ABKAnNDuNquNqpmxVU7YnoIZsyHMlbPsr47PgU2ljw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-darwin-x64": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-20.0.0.tgz", + "integrity": "sha512-Vk1i9PYlzPr7XT9fu2nWKpzPS/kTM8bDCmBfu7lotJpR+gEp52vegy4bkz00C5sDtFZTFOUoDYvMxiS9lNuvbQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-freebsd-x64": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-20.0.0.tgz", + "integrity": "sha512-g9L4KG34U8KLNBpoX5iQnevh/q3mTHBNLaoF+dFfBLDFdqVkLc1cUoWEITP41RfExhU/jqgo66T3Wtjt/FmYPw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-linux-arm-gnueabihf": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-20.0.0.tgz", + "integrity": "sha512-EcWjz4HM0UElppyDjIK9uGn0x+HgNMKloBQWYCQZv9z10joPDFleXNL66ywGi3KbpJp8jZZoBoXUBAuQ30wTkA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-linux-arm64-gnu": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-20.0.0.tgz", + "integrity": "sha512-SNWNlG1IF3m84n//s9EVq4VXbACi4YC+0Zto6mBSWnJ54PQSBaPlYQOjA+zUg5j/TDBcErJwmWBhrsDpfUzASA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-linux-arm64-musl": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-20.0.0.tgz", + "integrity": "sha512-dP8Z2wmouSoGbiNFchf5XuMEzZ9LOxIL9m+YZ+g1aBK1lakqugGmu5AWC4LujLdRYJ2Aq0NiTujFb9X8N65LEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-linux-x64-gnu": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-20.0.0.tgz", + "integrity": "sha512-B9ePhJ6t4Q/T20jjuegmIujEbgQAjVYSbaVqlL1TpSz5JOjYqTMJVOdZfK1iSizanmdAr/tgNk/3U+pN68Qo2w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-linux-x64-musl": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-20.0.0.tgz", + "integrity": "sha512-SIJ42y+paUJ7OeOh1Wgk1BkgFj/oa/U3jsBrusyJMD1omShXJR0DW63yHHP19rhkVfkzDB4hl5AWYAb+IX0n1A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-win32-arm64-msvc": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-20.0.0.tgz", + "integrity": "sha512-NZi88z+xa70L9E5ota3R6+/TjBDQ/XtoWuNDqPRcgBAHtOEH4YpF0pJ+sc+TybotcXFUs99v1TRxPHagsBn8QQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/nx-win32-x64-msvc": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-20.0.0.tgz", + "integrity": "sha512-rtGphY7sXqHGQN1q6M6umR/iAIU0/IcstYW5IAXQ3wivaQJrV7sM+aumrFZfgAWHHDTWDdQncSQTdn49RoRjEA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/vite/node_modules/@nx/workspace": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@nx/workspace/-/workspace-20.0.0.tgz", + "integrity": "sha512-ReTyJrUdCVPa9fnFWOaYhtNPJkfHMsASjGCvijZv+9EyDmggZ9PmpZBN7fdaCQD8+MyRSOPCrPEzXU1NnjjgqQ==", + "dev": true, + "dependencies": { + "@nx/devkit": "20.0.0", + "chalk": "^4.1.0", + "enquirer": "~2.3.6", + "nx": "20.0.0", + "tslib": "^2.3.0", + "yargs-parser": "21.1.1" + } + }, + "node_modules/@nx/vite/node_modules/lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/@nx/vite/node_modules/nx": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/nx/-/nx-20.0.0.tgz", + "integrity": "sha512-xfTCFiSYqxhchIXQvT6cxKcyRmReAvpzEQJbpEZTtmhMucBqvDTkK25WIhY4cW2uPPUXSOgQGbFt2uIVQz5RTw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@napi-rs/wasm-runtime": "0.2.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "3.0.0-rc.46", + "@zkochan/js-yaml": "0.0.7", + "axios": "^1.7.4", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^8.0.1", + "dotenv": "~16.4.5", + "dotenv-expand": "~11.0.6", + "enquirer": "~2.3.6", + "figures": "3.2.0", + "flat": "^5.0.2", + "front-matter": "^4.0.2", + "ignore": "^5.0.4", + "jest-diff": "^29.4.1", + "jsonc-parser": "3.2.0", + "lines-and-columns": "2.0.3", + "minimatch": "9.0.3", + "node-machine-id": "1.1.12", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "ora": "5.3.0", + "semver": "^7.5.3", + "string-width": "^4.2.3", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" + }, + "bin": { + "nx": "bin/nx.js", + "nx-cloud": "bin/nx-cloud.js" + }, + "optionalDependencies": { + "@nx/nx-darwin-arm64": "20.0.0", + "@nx/nx-darwin-x64": "20.0.0", + "@nx/nx-freebsd-x64": "20.0.0", + "@nx/nx-linux-arm-gnueabihf": "20.0.0", + "@nx/nx-linux-arm64-gnu": "20.0.0", + "@nx/nx-linux-arm64-musl": "20.0.0", + "@nx/nx-linux-x64-gnu": "20.0.0", + "@nx/nx-linux-x64-musl": "20.0.0", + "@nx/nx-win32-arm64-msvc": "20.0.0", + "@nx/nx-win32-x64-msvc": "20.0.0" + }, + "peerDependencies": { + "@swc-node/register": "^1.8.0", + "@swc/core": "^1.3.85" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } } }, "node_modules/@nx/web": { @@ -3855,6 +4313,28 @@ "yargs-parser": "21.1.1" } }, + "node_modules/@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true + }, + "node_modules/@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "dependencies": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, + "node_modules/@open-draft/until": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", + "dev": true + }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", @@ -4655,6 +5135,70 @@ "@swc/counter": "^0.1.3" } }, + "node_modules/@testing-library/dom": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/dom/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/@testing-library/user-event": { + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", + "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", + "dev": true, + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -4702,6 +5246,18 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "dev": true + }, "node_modules/@types/css-font-loading-module": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.12.tgz", @@ -4774,6 +5330,15 @@ "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", "dev": true }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "20.16.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", @@ -4806,6 +5371,12 @@ "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.3.tgz", "integrity": "sha512-pXNfAD3KHOdif9EQXZ9deK82HVNaXP5ZIF5RP2QG6OQFNTaY2YIetfrE9t528vEreGQvEPRDDc8muaoYeK0SxQ==" }, + "node_modules/@types/statuses": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", + "integrity": "sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==", + "dev": true + }, "node_modules/@types/three": { "version": "0.166.0", "resolved": "https://registry.npmjs.org/@types/three/-/three-0.166.0.tgz", @@ -4819,6 +5390,12 @@ "meshoptimizer": "~0.18.1" } }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, "node_modules/@types/unist": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", @@ -4836,6 +5413,12 @@ "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.20.tgz", "integrity": "sha512-JGpU6qiIJQKUuVSKx1GtQnHJGxRjtfGIhzO2ilq43VZZS//f1h1Sgexbdk+Lq+7569a6EYhOWrUpIruR/1Enmg==" }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", @@ -5087,21 +5670,27 @@ } }, "node_modules/@vitest/browser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-1.6.0.tgz", - "integrity": "sha512-3Wpp9h1hf++rRVPvoXevkdHybLhJVn7MwIMKMIh08tVaoDMmT6fnNhbP222Z48V9PptpYeA5zvH9Ct/ZcaAzmQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-2.1.2.tgz", + "integrity": "sha512-tqpGfz2sfjFFNuZ2iLZ6EGRVnH8z18O93ZIicbLsxDhiLgRNz84UcjSvX4pbheuddW+BJeNbLGdM3BU8vohbEg==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "magic-string": "^0.30.5", - "sirv": "^2.0.4" + "@testing-library/dom": "^10.4.0", + "@testing-library/user-event": "^14.5.2", + "@vitest/mocker": "2.1.2", + "@vitest/utils": "2.1.2", + "magic-string": "^0.30.11", + "msw": "^2.3.5", + "sirv": "^2.0.4", + "tinyrainbow": "^1.2.0", + "ws": "^8.18.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "playwright": "*", - "vitest": "1.6.0", + "vitest": "2.1.2", "webdriverio": "*" }, "peerDependenciesMeta": { @@ -5116,37 +5705,66 @@ } } }, + "node_modules/@vitest/coverage-istanbul": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/coverage-istanbul/-/coverage-istanbul-2.1.2.tgz", + "integrity": "sha512-dg7ex3GKrTIenAV0oEp78JucTVFsPMzjl1gYWun22O7SBDxcHFC/REZjWLhMTHRHY8ihm4uBCvmu+CvEu5/Adg==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.3", + "debug": "^4.3.6", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-instrument": "^6.0.3", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magicast": "^0.3.4", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "2.1.2" + } + }, "node_modules/@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.2.tgz", + "integrity": "sha512-b7kHrFrs2urS0cOk5N10lttI8UdJ/yP3nB4JYTREvR5o18cR99yPpK4gK8oQgI42BVv0ILWYUSYB7AXkAUDc0g==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.1", + "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", + "debug": "^4.3.6", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.11", + "magicast": "^0.3.4", + "std-env": "^3.7.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.6.0" + "@vitest/browser": "2.1.2", + "vitest": "2.1.2" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } } }, "node_modules/@vitest/eslint-plugin": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.1.0.tgz", - "integrity": "sha512-Ur80Y27Wbw8gFHJ3cv6vypcjXmrx6QHfw+q435h6Q2L+tf+h4Xf5pJTCL4YU/Jps9EVeggQxS85OcUZU7sdXRw==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.1.7.tgz", + "integrity": "sha512-pTWGW3y6lH2ukCuuffpan6kFxG6nIuoesbhMiQxskyQMRcCN5t9SXsKrNHvEw3p8wcCsgJoRqFZVkOTn6TjclA==", "dev": true, "peerDependencies": { "@typescript-eslint/utils": ">= 8.0", @@ -5155,9 +5773,6 @@ "vitest": "*" }, "peerDependenciesMeta": { - "@typescript-eslint/utils": { - "optional": true - }, "typescript": { "optional": true }, @@ -5167,145 +5782,128 @@ } }, "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.2.tgz", + "integrity": "sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==", "dev": true, "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" + "@vitest/spy": "2.1.2", + "@vitest/utils": "2.1.2", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "node_modules/@vitest/mocker": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.2.tgz", + "integrity": "sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "@vitest/spy": "^2.1.0-beta.1", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.11" }, "funding": { "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/spy": "2.1.2", + "msw": "^2.3.5", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/@vitest/runner/node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "node_modules/@vitest/pretty-format": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.2.tgz", + "integrity": "sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==", "dev": true, "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" + "tinyrainbow": "^1.2.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", - "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "node_modules/@vitest/runner": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.2.tgz", + "integrity": "sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==", "dev": true, - "engines": { - "node": ">=12.20" + "dependencies": { + "@vitest/utils": "2.1.2", + "pathe": "^1.1.2" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.2.tgz", + "integrity": "sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==", "dev": true, "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.1.2", + "magic-string": "^0.30.11", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.2.tgz", + "integrity": "sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==", "dev": true, "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/ui": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", - "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.2.tgz", + "integrity": "sha512-92gcNzkDnmxOxyHzQrQYRsoV9Q0Aay0r4QMLnV+B+lbqlUWa8nDg9ivyLV5mMVTtGirHsYUGGh/zbIA55gBZqA==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "fast-glob": "^3.3.2", - "fflate": "^0.8.1", - "flatted": "^3.2.9", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "sirv": "^2.0.4" + "@vitest/utils": "2.1.2", + "fflate": "^0.8.2", + "flatted": "^3.3.1", + "pathe": "^1.1.2", + "sirv": "^2.0.4", + "tinyglobby": "^0.2.6", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.6.0" - } - }, - "node_modules/@vitest/ui/node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/@vitest/ui/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" + "vitest": "2.1.2" } }, "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.2.tgz", + "integrity": "sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==", "dev": true, "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.1.2", + "loupe": "^3.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" @@ -5880,6 +6478,33 @@ "node": ">=6" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -5950,13 +6575,22 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/async": { @@ -6342,21 +6976,19 @@ ] }, "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chalk": { @@ -6406,15 +7038,12 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -6522,6 +7151,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -6657,6 +7295,15 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/copy-anything": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-3.0.5.tgz", @@ -6933,13 +7580,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -7012,6 +7656,15 @@ "node": ">=0.4.0" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/detect-port": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.6.1.tgz", @@ -7071,6 +7724,12 @@ "node": ">=6.0.0" } }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true + }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -8096,95 +8755,6 @@ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/execa/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/execa/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/execa/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/execa/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/execa/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -8240,6 +8810,20 @@ "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.0.tgz", + "integrity": "sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -8549,16 +9133,7 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" + "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { @@ -8580,18 +9155,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-tsconfig": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", @@ -8734,6 +9297,15 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, + "node_modules/graphql": { + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", + "integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -8800,6 +9372,12 @@ "he": "bin/he" } }, + "node_modules/headers-polyfill": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz", + "integrity": "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==", + "dev": true + }, "node_modules/hookable": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz", @@ -8883,15 +9461,6 @@ "node": ">=12" } }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -9142,6 +9711,12 @@ "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, + "node_modules/is-node-process": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", + "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", + "dev": true + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -9169,18 +9744,6 @@ "@types/estree": "*" } }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -9237,6 +9800,22 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", @@ -9636,13 +10215,10 @@ } }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "dev": true }, "node_modules/lru-cache": { "version": "5.1.1", @@ -9659,6 +10235,15 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { "version": "0.30.11", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", @@ -9761,12 +10346,6 @@ "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -10445,12 +11024,76 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/msw": { + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.4.10.tgz", + "integrity": "sha512-bDQh9b25JK4IKMs5hnamwAkcNZ9RwA4mR/4YcgWkzwHOxj7UICbVJfmChJvY1UCAAMraPpvjHdxjoUDpc3F+Qw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@bundled-es-modules/cookie": "^2.0.0", + "@bundled-es-modules/statuses": "^1.0.1", + "@bundled-es-modules/tough-cookie": "^0.1.6", + "@inquirer/confirm": "^3.0.0", + "@mswjs/interceptors": "^0.35.8", + "@open-draft/until": "^2.1.0", + "@types/cookie": "^0.6.0", + "@types/statuses": "^2.0.4", + "chalk": "^4.1.2", + "graphql": "^16.8.1", + "headers-polyfill": "^4.0.2", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.2", + "path-to-regexp": "^6.3.0", + "strict-event-emitter": "^0.5.1", + "type-fest": "^4.9.0", + "yargs": "^17.7.2" + }, + "bin": { + "msw": "cli/index.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/mswjs" + }, + "peerDependencies": { + "typescript": ">= 4.8.x" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/msw/node_modules/type-fest": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/muggle-string": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", "dev": true }, + "node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -10749,6 +11392,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/outvariant": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz", + "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==", + "dev": true + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -10896,15 +11545,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -10942,6 +11582,12 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -10958,12 +11604,12 @@ "dev": true }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/perfect-debounce": { @@ -11674,6 +12320,12 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -11707,6 +12359,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -12432,12 +13090,27 @@ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, + "node_modules/strict-event-emitter": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -12530,18 +13203,6 @@ "node": ">=4" } }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -12566,24 +13227,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/strip-literal/node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, "node_modules/strong-log-transformer": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", @@ -12726,62 +13369,34 @@ } }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^9.0.4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "node": ">=18" } }, - "node_modules/test-exclude/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -12811,19 +13426,41 @@ "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", "dev": true }, + "node_modules/tinyglobby": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.9.tgz", + "integrity": "sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==", + "dev": true, + "dependencies": { + "fdir": "^6.4.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", + "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, "engines": { "node": ">=14.0.0" @@ -12894,6 +13531,30 @@ "node": ">=6" } }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -12981,15 +13642,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -13283,6 +13935,16 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -13397,15 +14059,14 @@ } }, "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.2.tgz", + "integrity": "sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==", "dev": true, "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", + "debug": "^4.3.6", + "pathe": "^1.1.2", "vite": "^5.0.0" }, "bin": { @@ -14120,31 +14781,30 @@ } }, "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.2.tgz", + "integrity": "sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==", + "dev": true, + "dependencies": { + "@vitest/expect": "2.1.2", + "@vitest/mocker": "2.1.2", + "@vitest/pretty-format": "^2.1.2", + "@vitest/runner": "2.1.2", + "@vitest/snapshot": "2.1.2", + "@vitest/spy": "2.1.2", + "@vitest/utils": "2.1.2", + "chai": "^5.1.1", + "debug": "^4.3.6", + "magic-string": "^0.30.11", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.0", + "tinypool": "^1.0.0", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" + "vite-node": "2.1.2", + "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" @@ -14158,8 +14818,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", + "@vitest/browser": "2.1.2", + "@vitest/ui": "2.1.2", "happy-dom": "*", "jsdom": "*" }, @@ -14398,6 +15058,27 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xml-name-validator": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", @@ -14520,6 +15201,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/2d": { "name": "@fibbojs/2d", "version": "0.0.9", diff --git a/package.json b/package.json index a6a09690..1c3132fb 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,9 @@ "lint": "./node_modules/.bin/eslint .", "lint:fix": "./node_modules/.bin/eslint --fix .", "lint:docs": "./node_modules/.bin/eslint --fix ./docs", - "test:ui": "vitest --ui --coverage --coverage.include=packages", - "test:report": "vitest run --config ./docs/vitest.config.ts", + "test": "vitest --config ./vitest.config.global.ts --workspace ./vitest.workspace.ts", + "test:ui": "vitest --ui --config ./vitest.config.global.ts --workspace ./vitest.workspace.ts", + "test:report": "vitest run --config ./docs/vitest.config.global.ts --workspace ./vitest.workspace.ts", "docs:dev": "vitepress dev docs", "docs:dev:host": "vitepress dev docs --host", "docs:build": "vitepress build docs", @@ -47,7 +48,7 @@ "@antfu/utils": "^0.7.7", "@nx/eslint": "19.6.1", "@nx/js": "19.6.1", - "@nx/vite": "19.6.1", + "@nx/vite": "^20.0.0", "@nx/web": "19.6.1", "@swc-node/register": "1.9.2", "@swc/core": "1.5.7", @@ -55,9 +56,10 @@ "@types/node": "^20.12.7", "@types/three": "^0.166.0", "@vitejs/plugin-vue": "^5.1.2", - "@vitest/browser": "^1.6.0", - "@vitest/coverage-v8": "^1.6.0", - "@vitest/ui": "^1.3.1", + "@vitest/browser": "^2.1.2", + "@vitest/coverage-istanbul": "^2.1.2", + "@vitest/coverage-v8": "^2.1.2", + "@vitest/ui": "^2.1.2", "eslint": "^9.7.0", "nx": "19.6.1", "playwright": "^1.47.2", @@ -69,7 +71,7 @@ "unbuild": "^2.0.0", "vite": "^5.2.9", "vitepress": "^1.1.4", - "vitest": "^1.6.0", + "vitest": "^2.1.2", "vue": "^3.4.37", "vue-tsc": "^2.0.29" }, diff --git a/packages/2d/package.json b/packages/2d/package.json index 867792a3..f3bf47b5 100644 --- a/packages/2d/package.json +++ b/packages/2d/package.json @@ -40,7 +40,9 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run --workspace ../../vitest.workspace.ts", + "test": "vitest --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:ui": "vitest --ui --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:run": "vitest run --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/packages/2d/src/cameras/FCamera.ts b/packages/2d/src/cameras/FCamera.ts index 93a93111..84324e8e 100644 --- a/packages/2d/src/cameras/FCamera.ts +++ b/packages/2d/src/cameras/FCamera.ts @@ -32,7 +32,7 @@ export abstract class FCamera extends FCameraCore { * @param options The options for the camera. */ constructor(scene: FScene, options?: FCameraOptions) { - super() + super(scene) // Store scene this.scene = scene diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index a0f2e0a3..c2efa459 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -88,7 +88,7 @@ export class FCollider { throw new Error('FibboError: FScene must have a world to create a collider') // If rotation degree is given, convert it to radians - if (options.rotationDegree) { + if (options.rotationDegree !== undefined) { // Convert the degree to radians options.rotation = (options.rotationDegree * Math.PI) / 180 } diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 2ca8e533..5058b46c 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -1,4 +1,4 @@ -import type { OnCollisionWithData } from '@fibbojs/core' +import type { FComponentOptions as FComponentOptionsCore, OnCollisionWithData } from '@fibbojs/core' import { FComponent as FComponentCore } from '@fibbojs/core' import { Container } from 'pixi.js' import * as RAPIER from '@dimforge/rapier2d' @@ -10,7 +10,7 @@ import type { FRigidBodyOptions } from './FRigidBody' import { FRigidBody } from './FRigidBody' import { FTransform } from './FTransform' -export interface FComponentOptions { +export interface FComponentOptions extends FComponentOptionsCore { position?: { x: number, y: number } scale?: { x: number, y: number } rotation?: number @@ -69,7 +69,7 @@ export abstract class FComponent extends FComponentCore { * @param options.rotationDegree The rotation of the component in degrees. If this is provided, the rotation will be converted to radians. */ constructor(scene: FScene, options?: FComponentOptions) { - super() + super(scene) this.scene = scene // Create a new PIXI container this.container = new Container() diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 2fd53a2d..2e50d947 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -106,7 +106,7 @@ export class FRigidBody { this.component = component // If rotation degree is given, convert it to radians - if (options.rotationDegree) { + if (options.rotationDegree !== undefined) { // Convert the degree to radians options.rotation = (options.rotationDegree * Math.PI) / 180 } @@ -218,6 +218,16 @@ export class FRigidBody { this.collider.updateScale() } + /** + * Set the velocity of the rigidBody. + * @param velocity The new velocity of the rigidBody. + * @param velocity.x The new x velocity of the rigidBody. + * @param velocity.y The new y velocity of the rigidBody. + */ + setVelocity(velocity: { x: number, y: number }) { + this.__RIGIDBODY__.setLinvel(new RAPIER.Vector2(velocity.x, velocity.y), true) + } + // Setters & getters for transform properties get position() { @@ -283,4 +293,28 @@ export class FRigidBody { set scaleY(y: number) { this.setScale({ x: this.scaleX, y }) } + + get velocity() { + return this.__RIGIDBODY__.linvel() + } + + set velocity(velocity: { x: number, y: number }) { + this.setVelocity(velocity) + } + + get velocityX() { + return this.velocity.x + } + + set velocityX(x: number) { + this.setVelocity({ x, y: this.velocity.y }) + } + + get velocityY() { + return this.velocity.y + } + + set velocityY(y: number) { + this.setVelocity({ x: this.velocity.x, y }) + } } diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index 2a797300..013a94a7 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -193,31 +193,17 @@ export class FScene extends FSceneCore { addComponent(component: FComponent) { super.addComponent(component) - // Detect if the FComponent is a FSprite instance - if (component instanceof FSprite) { - // Wait for the sprite to be loaded before adding it to the scene - component.onLoaded(() => { - this.viewport.addChild(component.container) - - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) - }) - } - else { - // The component is not a FSprite instance, it can be added directly + // Wait for the component to be loaded before adding it to the scene + component.onLoaded(() => { this.viewport.addChild(component.container) - } - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + if (component.sensor) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) + // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + else if (component.collider) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + }) } removeComponent(component: FComponent): void { diff --git a/packages/2d/src/lights/FLight.ts b/packages/2d/src/lights/FLight.ts index 538a383b..f34f1b34 100644 --- a/packages/2d/src/lights/FLight.ts +++ b/packages/2d/src/lights/FLight.ts @@ -43,7 +43,7 @@ export abstract class FLight extends FLightCore { __LOOK_AT__: { x: number, y: number } constructor(scene: FScene, options?: FLightOptions) { - super() + super(scene) // Define default options const DEFAULT_OPTIONS = { diff --git a/packages/2d/src/polygons/FCircle.ts b/packages/2d/src/polygons/FCircle.ts index bc72f726..9589ec53 100644 --- a/packages/2d/src/polygons/FCircle.ts +++ b/packages/2d/src/polygons/FCircle.ts @@ -24,6 +24,8 @@ export class FCircle extends FPolygon { this.container = new PIXI.Graphics() .circle(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100 / 2) .fill(new PIXI.FillGradient(0, 0, 10, 10).addColorStop(0, 0x0000FF).addColorStop(1, 0xFFFF00)) + // Emit the onLoaded event + this.emitOnLoaded() } onFrame(delta: number): void { diff --git a/packages/2d/src/polygons/FRectangle.ts b/packages/2d/src/polygons/FRectangle.ts index a2583dd2..89bbbd80 100644 --- a/packages/2d/src/polygons/FRectangle.ts +++ b/packages/2d/src/polygons/FRectangle.ts @@ -18,6 +18,8 @@ import { FPolygon } from './FPolygon' export class FRectangle extends FPolygon { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) + // Emit the onLoaded event + this.emitOnLoaded() } onFrame(delta: number): void { diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index 48a9da83..6cc95866 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -25,10 +25,6 @@ export class FSprite extends FComponent { * The texture of the sprite. */ texture: PIXI.Texture - /** - * Callbacks for when the texture is loaded - */ - public __CALLBACKS_ON_LOADED__: (() => void)[] = [] constructor(scene: FScene, options: FSpriteOptions) { super(scene, options) @@ -104,21 +100,4 @@ export class FSprite extends FComponent { onFrame(delta: number): void { super.onFrame(delta) } - - /** - * Add a callback to be called when the texture is loaded. - * @param callback The callback function. - */ - onLoaded(callback: () => void) { - this.__CALLBACKS_ON_LOADED__.push(callback) - } - - /** - * Emit the onLoaded callbacks. - */ - emitOnLoaded() { - this.__CALLBACKS_ON_LOADED__.forEach((callback) => { - callback() - }) - } } diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 8e683a35..301d312d 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -1,12 +1,14 @@ import { beforeEach, describe, expect, it } from 'vitest' -import { FRectangle, FScene, FShapes } from '@fibbojs/2d' import RAPIER from '@dimforge/rapier2d' +import { FRectangle, FScene, FShapes } from '../../src' describe('fCollider', () => { let scene: FScene beforeEach(async () => { - scene = new FScene() + scene = new FScene({ + autoLoop: false, + }) await scene.init() await scene.initPhysics() }) @@ -14,7 +16,7 @@ describe('fCollider', () => { it('should create a collider with default options', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, - rotation: 0, + rotationDegree: 0, scale: { x: 1, y: 1 }, }) rectangle.initCollider() diff --git a/packages/2d/test/browser/rigidbody.test.ts b/packages/2d/test/browser/rigidbody.test.ts index 8aea9749..8c25fbac 100644 --- a/packages/2d/test/browser/rigidbody.test.ts +++ b/packages/2d/test/browser/rigidbody.test.ts @@ -1,12 +1,14 @@ import { beforeEach, describe, expect, it } from 'vitest' -import { FRectangle, FScene, FShapes } from '@fibbojs/2d' import RAPIER from '@dimforge/rapier2d' +import { FRectangle, FScene, FShapes } from '../../src' describe('fRigidBody', () => { let scene: FScene beforeEach(async () => { - scene = new FScene() + scene = new FScene({ + autoLoop: false, + }) await scene.init() await scene.initPhysics() }) @@ -14,7 +16,7 @@ describe('fRigidBody', () => { it('should create a rigidBody with default options', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, - rotation: 0, + rotationDegree: 0, scale: { x: 1, y: 1 }, }) rectangle.initRigidBody() @@ -193,4 +195,61 @@ describe('fRigidBody', () => { expect(rectangle.rigidBody.scale.x).toEqual(6) expect(rectangle.rigidBody.scale.y).toEqual(8) }) + + it('should move the rigidBody according to its X velocity', async () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + // Lock translations on Y axis + rectangle.initRigidBody({ + enabledTranslations: { + enableX: true, + enableY: false, + }, + }) + expect(rectangle.rigidBody).toBeDefined() + // Set velocity + rectangle.rigidBody.setVelocity({ x: 1, y: 0 }) + // Run 60 frames + for (let i = 0; i < 60; i++) { + scene.frame(1 / 60) + } + // Validate velocity + expect(rectangle.rigidBody.velocity.x).toEqual(1) + expect(rectangle.rigidBody.velocity.y).toEqual(0) + // Validate new position + expect(rectangle.rigidBody.position.x).closeTo(1, 0.1) + expect(rectangle.rigidBody.position.y).toEqual(0) + }) + + it('should move the rigidBody according to its Y velocity', async () => { + const rectangle = new FRectangle(scene, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1 }, + }) + // Lock translations on X axis + rectangle.initRigidBody({ + enabledTranslations: { + enableX: false, + enableY: true, + }, + }) + expect(rectangle.rigidBody).toBeDefined() + // Set velocity + rectangle.rigidBody.velocity = { x: 0, y: 100 } + // Run 60 frames + for (let i = 0; i < 60; i++) { + scene.frame(1 / 60) + } + // Validate velocity + expect(rectangle.rigidBody.velocity.x).toEqual(0) + expect(rectangle.rigidBody.velocity.y).closeTo(90, 1) + // Validate new position + expect(rectangle.rigidBody.position.x).toEqual(0) + expect(rectangle.rigidBody.position.y).toBeGreaterThan(90) + expect(rectangle.rigidBody.position.y).toBeLessThanOrEqual(100) + }) }) diff --git a/packages/3d/package.json b/packages/3d/package.json index 9f706314..4a50edba 100644 --- a/packages/3d/package.json +++ b/packages/3d/package.json @@ -40,7 +40,9 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run --workspace ../../vitest.workspace.ts", + "test": "vitest --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:ui": "vitest --ui --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:run": "vitest run --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/packages/3d/src/cameras/FAttachedCamera.ts b/packages/3d/src/cameras/FAttachedCamera.ts index b41810fb..e9b22b1f 100644 --- a/packages/3d/src/cameras/FAttachedCamera.ts +++ b/packages/3d/src/cameras/FAttachedCamera.ts @@ -1,5 +1,5 @@ -import * as THREE from 'three' import type { FComponent } from '../core/FComponent' +import type { FScene } from '../core/FScene' import type { FCameraOptions } from './FCamera' import { FCamera } from './FCamera' @@ -29,10 +29,11 @@ export class FAttachedCamera extends FCamera { offset: { x: number, y: number, z: number } = { x: 0, y: 5, z: 5 } /** - * @param attachedComponent Model that the camera is attached to + * @param scene Scene that the camera is in + * @param attachedComponent Component that the camera is attached to */ - constructor(attachedComponent: FComponent) { - super() + constructor(scene: FScene, attachedComponent: FComponent) { + super(scene) this.attachedComponent = attachedComponent } @@ -45,11 +46,14 @@ export class FAttachedCamera extends FCamera { this.position.y = this.attachedComponent.mesh.position.y + this.offset.y this.position.z = this.attachedComponent.mesh.position.z + this.offset.z // Make the camera look at the model - this.lookAt(this.attachedComponent.mesh.position.x, this.attachedComponent.mesh.position.y, this.attachedComponent.mesh.position.z) + this.lookAt({ + x: this.attachedComponent.mesh.position.x, + y: this.attachedComponent.mesh.position.y, + z: this.attachedComponent.mesh.position.z, + }) } - setPosition(x: number, y: number, z: number): void { - super.setPosition(x, y, z) - this.offset = new THREE.Vector3(x, y, z) + setPosition(position: { x: number, y: number, z: number }): void { + super.setPosition(position) } } diff --git a/packages/3d/src/cameras/FCamera.ts b/packages/3d/src/cameras/FCamera.ts index 7920b324..f5d17cbf 100644 --- a/packages/3d/src/cameras/FCamera.ts +++ b/packages/3d/src/cameras/FCamera.ts @@ -1,7 +1,8 @@ import * as THREE from 'three' -import type { FCamera as FCameraCore, OnCollisionWithData } from '@fibbojs/core' +import { FCamera as FCameraCore } from '@fibbojs/core' import type { FTransformOptions } from '../core/FTransform' import { FTransform } from '../core/FTransform' +import type { FScene } from '../core/FScene' export interface FCameraOptions extends FTransformOptions {} @@ -9,22 +10,25 @@ export interface FCameraOptions extends FTransformOptions {} * The base class for 3d cameras in Fibbo. * @category Camera */ -export abstract class FCamera extends THREE.PerspectiveCamera implements FCameraCore { +export abstract class FCamera extends FCameraCore { /** * Internal flags */ public __IS_3D__: boolean = true public __IS_2D__: boolean = false - declare public __ID__: number - public __CALLBACKS_ON_COLLISION__: { [key: string]: (() => void)[] } = {} + + /** + * Three.js camera object. + */ + __CAMERA__: THREE.PerspectiveCamera /** * Transform of the camera. */ transform: FTransform - constructor(options?: FCameraOptions) { - super(75, window.innerWidth / window.innerHeight, 0.1, 1000) + constructor(scene: FScene, options?: FCameraOptions) { + super(scene) // Define default options const DEFAULT_OPTIONS = { @@ -37,6 +41,9 @@ export abstract class FCamera extends THREE.PerspectiveCamera implements FCamera if (!options.position || (!options.rotation && !options.rotationDegree)) throw new Error('FibboError: FCamera requires position and rotation options') + // Create the Three.js camera + this.__CAMERA__ = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) + // Store transform this.transform = new FTransform({ position: options.position, @@ -45,48 +52,61 @@ export abstract class FCamera extends THREE.PerspectiveCamera implements FCamera }) // Set the position - this.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) + this.__CAMERA__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) // Set the rotation - this.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) + this.__CAMERA__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) } - abstract onFrame(_delta: number): void - /** * Set the position of the camera. */ - setPosition(x: number, y: number, z: number): void { - this.position.set(x, y, z) + setPosition(position: { x: number, y: number, z: number }): void { + this.__CAMERA__.position.set(position.x, position.y, position.z) + this.transform.position = position } /** * Set the scale of the camera. */ - setScale(x: number, y: number, z: number): void { - this.scale.set(x, y, z) + setScale(scale: { x: number, y: number, z: number }): void { + this.__CAMERA__.scale.set(scale.x, scale.y, scale.z) + this.transform.scale = scale } /** * Set the rotation of the camera. */ - setRotation(x: number, y: number, z: number): void { - this.rotation.set(x, y, z) + setRotation(rotation: { x: number, y: number, z: number }): void { + this.__CAMERA__.rotation.set(rotation.x, rotation.y, rotation.z) + this.transform.rotation = rotation } - setZoom(zoom: number): void { - this.zoom = zoom - this.updateProjectionMatrix() + /** + * Set the rotation of the camera in degrees. + */ + setRotationDegree(rotation: { x: number, y: number, z: number }): void { + const rotationRad = { + x: THREE.MathUtils.degToRad(rotation.x), + y: THREE.MathUtils.degToRad(rotation.y), + z: THREE.MathUtils.degToRad(rotation.z), + } + this.__CAMERA__.rotation.set(rotationRad.x, rotationRad.y, rotationRad.z) + this.transform.rotation = rotationRad } - onCollisionWith( - classOrObject: any, - callback: (data: OnCollisionWithData) => void, - ): () => void { - return FCamera.prototype.onCollisionWith.call(this, classOrObject, callback) + /** + * Set the zoom of the camera. + */ + setZoom(zoom: number): void { + this.__CAMERA__.zoom = zoom + this.__CAMERA__.updateProjectionMatrix() } - emitCollisionWith(classOrObject: any) { - FCamera.prototype.emitCollisionWith.call(this, classOrObject) + /** + * Look at a point in the scene. + */ + lookAt(target: { x: number, y: number, z: number }): void { + this.__CAMERA__.lookAt(target.x, target.y, target.z) } /** @@ -96,8 +116,146 @@ export abstract class FCamera extends THREE.PerspectiveCamera implements FCamera */ getCameraDirection() { const direction = new THREE.Vector3() - this.getWorldDirection(direction) + this.__CAMERA__.getWorldDirection(direction) direction.normalize() return direction } + + // Setters & getters + + get position() { + return this.transform.position + } + + set position(position: { x: number, y: number, z: number }) { + this.setPosition(position) + } + + get x() { + return this.transform.position.x + } + + set x(x: number) { + this.setPosition({ x, y: this.y, z: this.z }) + } + + get y() { + return this.transform.position.y + } + + set y(y: number) { + this.setPosition({ x: this.x, y, z: this.z }) + } + + get z() { + return this.transform.position.z + } + + set z(z: number) { + this.setPosition({ x: this.x, y: this.y, z }) + } + + get rotation() { + return this.transform.rotation + } + + set rotation(rotation: { x: number, y: number, z: number }) { + this.setRotation(rotation) + } + + get rotationX() { + return this.transform.rotation.x + } + + set rotationX(x: number) { + this.setRotation({ x, y: this.rotationY, z: this.rotationZ }) + } + + get rotationY() { + return this.transform.rotation.y + } + + set rotationY(y: number) { + this.setRotation({ x: this.rotationX, y, z: this.rotationZ }) + } + + get rotationZ() { + return this.transform.rotation.z + } + + set rotationZ(z: number) { + this.setRotation({ x: this.rotationX, y: this.rotationY, z }) + } + + get rotationDegree() { + return this.transform.rotationDegree + } + + set rotationDegree(rotation: { x: number, y: number, z: number }) { + this.setRotation(rotation) + } + + get rotationDegreeX() { + return this.transform.rotationDegree.x + } + + set rotationDegreeX(x: number) { + this.setRotationDegree({ x, y: this.rotationDegreeY, z: this.rotationDegreeZ }) + } + + get rotationDegreeY() { + return this.transform.rotationDegree.y + } + + set rotationDegreeY(y: number) { + this.setRotationDegree({ x: this.rotationDegreeX, y, z: this.rotationDegreeZ }) + } + + get rotationDegreeZ() { + return this.transform.rotationDegree.z + } + + set rotationDegreeZ(z: number) { + this.setRotationDegree({ x: this.rotationDegreeX, y: this.rotationDegreeY, z }) + } + + get scale() { + return this.transform.scale + } + + set scale(scale: { x: number, y: number, z: number }) { + this.setScale(scale) + } + + get scaleX() { + return this.transform.scale.x + } + + set scaleX(x: number) { + this.setScale({ x, y: this.scaleY, z: this.scaleZ }) + } + + get scaleY() { + return this.transform.scale.y + } + + set scaleY(y: number) { + this.setScale({ x: this.scaleX, y, z: this.scaleZ }) + } + + get scaleZ() { + return this.transform.scale.z + } + + set scaleZ(z: number) { + this.setScale({ x: this.scaleX, y: this.scaleY, z }) + } + + get zoom() { + return this.__CAMERA__.zoom + } + + set zoom(zoom: number) { + this.setZoom(zoom) + } } diff --git a/packages/3d/src/cameras/FFixedCamera.ts b/packages/3d/src/cameras/FFixedCamera.ts index 2292c64a..4a2b2083 100644 --- a/packages/3d/src/cameras/FFixedCamera.ts +++ b/packages/3d/src/cameras/FFixedCamera.ts @@ -1,3 +1,4 @@ +import type { FScene } from '../core/FScene' import type { FCameraOptions } from './FCamera' import { FCamera } from './FCamera' @@ -16,8 +17,8 @@ import { FCamera } from './FCamera' * ``` */ export class FFixedCamera extends FCamera { - constructor(options?: FCameraOptions) { - super(options) + constructor(scene: FScene, options?: FCameraOptions) { + super(scene, options) } onFrame(_delta: number): void { diff --git a/packages/3d/src/cameras/FGameCamera.ts b/packages/3d/src/cameras/FGameCamera.ts index ee97bde3..455f987d 100644 --- a/packages/3d/src/cameras/FGameCamera.ts +++ b/packages/3d/src/cameras/FGameCamera.ts @@ -1,4 +1,4 @@ -import type * as THREE from 'three' +import type { FScene } from '../core/FScene' import { FOrbitCamera } from './FOrbitCamera' import type { FAttachedCameraOptions } from './FAttachedCamera' @@ -19,19 +19,17 @@ import type { FAttachedCameraOptions } from './FAttachedCamera' */ export class FGameCamera extends FOrbitCamera { // Previous position of the attached component (at each frame) - private previousModelPosition: THREE.Vector3 + private previousModelPosition: { x: number, y: number, z: number } // Flag to track if the pointer is locked isPointerLocked: boolean = false // Last mouse move event lastMouseMoveEvent: MouseEvent | undefined - /** - * @param options Options for the camera. - */ - constructor(options: FAttachedCameraOptions) { - super(options) - this.previousModelPosition = options.target.transform.position.clone() - this.setPosition(0, 20, 20) + constructor(scene: FScene, options: FAttachedCameraOptions) { + super(scene, options) + // Clone the model's position + this.previousModelPosition = options.target.transform.position + this.setPosition({ x: 0, y: 20, z: 20 }) this.controls.enableDamping = true this.controls.maxDistance = 5 @@ -63,7 +61,9 @@ export class FGameCamera extends FOrbitCamera { // Calculate the difference between the previous and current position of the attached model const positionDifference = this.attachedComponent.mesh.position.clone().sub(this.previousModelPosition) // Move the camera by the same amount - this.position.add(positionDifference) + this.position.x += positionDifference.x + this.position.y += positionDifference.y + this.position.z += positionDifference.z // Update the previous position this.previousModelPosition = this.attachedComponent.mesh.position.clone() @@ -78,8 +78,8 @@ export class FGameCamera extends FOrbitCamera { * Let's be honest, I don't know why this works. * But it does. */ - this.translateX(-movementX * 0.01) - this.translateY(movementY * 0.01) + this.__CAMERA__.translateX(-movementX * 0.01) + this.__CAMERA__.translateY(movementY * 0.01) this.lastMouseMoveEvent = undefined } diff --git a/packages/3d/src/cameras/FOrbitCamera.ts b/packages/3d/src/cameras/FOrbitCamera.ts index 4ed3c49e..ee29ecc2 100644 --- a/packages/3d/src/cameras/FOrbitCamera.ts +++ b/packages/3d/src/cameras/FOrbitCamera.ts @@ -1,5 +1,6 @@ import { OrbitControls } from 'three/addons/controls/OrbitControls.js' import type { FComponent } from '../core/FComponent' +import type { FScene } from '../core/FScene' import { FCamera } from './FCamera' import type { FAttachedCameraOptions } from './FAttachedCamera' @@ -24,15 +25,12 @@ export class FOrbitCamera extends FCamera { // Orbit controls controls: OrbitControls - /** - * @param options Options for the camera. - */ - constructor(options: FAttachedCameraOptions) { - super(options) + constructor(scene: FScene, options: FAttachedCameraOptions) { + super(scene, options) this.attachedComponent = options.target // Create orbit controls - this.controls = new OrbitControls(this, this.attachedComponent.scene.renderer.domElement) + this.controls = new OrbitControls(this.__CAMERA__, this.attachedComponent.scene.renderer.domElement) } onFrame(_delta: number): void { @@ -43,10 +41,12 @@ export class FOrbitCamera extends FCamera { this.controls.update() } - setPosition(x: number, y: number, z: number): void { - super.setPosition(x, y, z) - // Set the position of the camera relative to the attached model - this.position.set(this.attachedComponent.transform.position.x + x, this.attachedComponent.transform.position.y + y, this.attachedComponent.transform.position.z + z) + setPosition(position: { x: number, y: number, z: number }): void { + super.setPosition({ + x: this.attachedComponent.transform.position.x + position.x, + y: this.attachedComponent.transform.position.y + position.y, + z: this.attachedComponent.transform.position.z + position.z, + }) // Set the target of the camera to the attached model this.lookAt(this.attachedComponent.transform.position) } diff --git a/packages/3d/src/cameras/FPointerLockCamera.ts b/packages/3d/src/cameras/FPointerLockCamera.ts index 8ca22b23..d912fad2 100644 --- a/packages/3d/src/cameras/FPointerLockCamera.ts +++ b/packages/3d/src/cameras/FPointerLockCamera.ts @@ -1,5 +1,6 @@ import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js' import type { FComponent } from '../core/FComponent' +import type { FScene } from '../core/FScene' import { FCamera } from './FCamera' import type { FAttachedCameraOptions } from './FAttachedCamera' @@ -24,15 +25,12 @@ export class FPointerLockCamera extends FCamera { // Pointer Lock controls controls: PointerLockControls - /** - * @param options Options for the camera. - */ - constructor(options: FAttachedCameraOptions) { - super(options) + constructor(scene: FScene, options: FAttachedCameraOptions) { + super(scene, options) this.attachedComponent = options.target // Create Pointer Lock controls - this.controls = new PointerLockControls(this, this.attachedComponent.scene.renderer.domElement) + this.controls = new PointerLockControls(this.__CAMERA__, this.attachedComponent.scene.renderer.domElement) this.attachedComponent.scene.scene.add(this.controls.getObject()) diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index d07515df..68d54579 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -81,7 +81,7 @@ export abstract class FComponent extends FComponentCore { * @param options.rotationDegree.z The rotation in degrees on the z-axis. */ constructor(scene: FScene, options?: FComponentOptions) { - super() + super(scene) this.scene = scene // Define default values @@ -135,8 +135,8 @@ export abstract class FComponent extends FComponentCore { this.mesh.setRotationFromEuler(newMeshRotation) // Update position and rotation properties of the component according to the rigidBody - this.transform.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.transform.rotation.set(newMeshRotation.x, newMeshRotation.y, newMeshRotation.z) + this.transform.position = newMeshPosition + this.transform.rotation = newMeshRotation // If a sensor exists, update its position and rotation according to the rigidBody if (this.sensor) { // Apply offset to the sensor @@ -174,8 +174,8 @@ export abstract class FComponent extends FComponentCore { this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) this.mesh.setRotationFromEuler(newMeshRotation) // Update position and rotation properties of the component - this.transform.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.transform.rotation.set(newMeshRotation.x, newMeshRotation.y, newMeshRotation.z) + this.transform.position = newMeshPosition + this.transform.rotation = newMeshRotation } // If the rigidBody and collider doesn't exist, update the mesh position and rotation according to the default values else if (this.mesh) { @@ -202,7 +202,7 @@ export abstract class FComponent extends FComponentCore { * ``` */ setPosition(options: { x: number, y: number, z: number }): void { - this.transform.position.set(options.x, options.y, options.z) + this.transform.position = options // If a mesh exists, update its position if (this.mesh) this.mesh.position.set(options.x, options.y, options.z) @@ -229,7 +229,7 @@ export abstract class FComponent extends FComponentCore { * ``` */ setRotation(options: { x: number, y: number, z: number }): void { - this.transform.rotation.set(options.x, options.y, options.z) + this.transform.rotation = options // If a mesh exists, update its rotation if (this.mesh) this.mesh.rotation.set(options.x, options.y, options.z) @@ -278,7 +278,7 @@ export abstract class FComponent extends FComponentCore { * ``` */ setScale(options: { x: number, y: number, z: number }): void { - this.transform.scale.set(options.x, options.y, options.z) + this.transform.scale = options // If a mesh exists if (this.mesh) { // If the mesh is a classic polyhedron @@ -402,9 +402,8 @@ export abstract class FComponent extends FComponentCore { return super.onCollisionWith(classOrObject, callback) } - /** - * Setters & getters for transform properties - */ + // Setters & getters + get position(): { x: number, y: number, z: number } { return this.transform.position } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 4e3349ff..994b3f26 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -85,8 +85,8 @@ export class FScene extends FSceneCore { // Handle window resize window.addEventListener('resize', () => { - this.camera.aspect = window.innerWidth / window.innerHeight - this.camera.updateProjectionMatrix() + this.camera.__CAMERA__.aspect = window.innerWidth / window.innerHeight + this.camera.__CAMERA__.updateProjectionMatrix() this.renderer.setSize(window.innerWidth, window.innerHeight) }) @@ -104,7 +104,7 @@ export class FScene extends FSceneCore { // this.renderer.shadowMap.type = THREE.PCFSoftShadowMap } // Create a default camera - this.camera = new FFixedCamera() + this.camera = new FFixedCamera(this) // Add renderer to DOM this.__DOM_NODE__.appendChild(this.renderer.domElement) @@ -118,7 +118,7 @@ export class FScene extends FSceneCore { this.camera.onFrame(delta) // Render the scene - this.renderer.render(this.scene, this.camera) + this.renderer.render(this.scene, this.camera.__CAMERA__) }) // Call the onReady callbacks @@ -201,14 +201,14 @@ export class FScene extends FSceneCore { else { if (component.mesh) this.scene.add(component.mesh) - } - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + if (component.sensor) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) + // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + else if (component.collider) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + } } removeComponent(component: FComponent): void { diff --git a/packages/3d/src/core/FTransform.ts b/packages/3d/src/core/FTransform.ts index 2aa64a82..41d03bd5 100644 --- a/packages/3d/src/core/FTransform.ts +++ b/packages/3d/src/core/FTransform.ts @@ -15,15 +15,15 @@ export class FTransform { /** * The position of the component. */ - position: THREE.Vector3 + position: { x: number, y: number, z: number } /** * The scale of the component. */ - scale: THREE.Vector3 + scale: { x: number, y: number, z: number } /** * The rotation of the component. */ - rotation: THREE.Vector3 + rotation: { x: number, y: number, z: number } /** * Create a new FTransform. @@ -55,14 +55,26 @@ export class FTransform { throw new Error('FibboError: FTransform requires position, scale, rotation and shape options') // Set the transform values - this.position = new THREE.Vector3(options.position.x, options.position.y, options.position.z) - this.scale = new THREE.Vector3(options.scale.x, options.scale.y, options.scale.z) + this.position = options.position + this.scale = options.scale this.rotation = options.rotationDegree - ? new THREE.Vector3( - THREE.MathUtils.degToRad(options.rotationDegree.x), - THREE.MathUtils.degToRad(options.rotationDegree.y), - THREE.MathUtils.degToRad(options.rotationDegree.z), - ) - : options.rotation ? new THREE.Vector3(options.rotation.x, options.rotation.y, options.rotation.z) : new THREE.Vector3(0, 0, 0) + ? { x: THREE.MathUtils.degToRad(options.rotationDegree.x), y: THREE.MathUtils.degToRad(options.rotationDegree.y), z: THREE.MathUtils.degToRad(options.rotationDegree.z) } + : options.rotation || { x: 0, y: 0, z: 0 } + } + + // Setters and getters for the transform values + + /** + * Get the rotation in degrees. + */ + get rotationDegree() { + return { x: THREE.MathUtils.radToDeg(this.rotation.x), y: THREE.MathUtils.radToDeg(this.rotation.y), z: THREE.MathUtils.radToDeg(this.rotation.z) } + } + + /** + * Set the rotation in degrees. + */ + set rotationDegree(rotation: { x: number, y: number, z: number }) { + this.rotation = { x: THREE.MathUtils.degToRad(rotation.x), y: THREE.MathUtils.degToRad(rotation.y), z: THREE.MathUtils.degToRad(rotation.z) } } } diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index 8705b0e4..739821b3 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -44,7 +44,7 @@ export abstract class FLight extends FLightCore { __LOOK_AT__: { x: number, y: number, z: number } constructor(scene: FScene, options?: FLightOptions) { - super() + super(scene) // Define default options const DEFAULT_OPTIONS = { diff --git a/packages/3d/src/model/FModel.ts b/packages/3d/src/model/FModel.ts index 8001baf9..7e0f3a55 100644 --- a/packages/3d/src/model/FModel.ts +++ b/packages/3d/src/model/FModel.ts @@ -15,11 +15,6 @@ export interface FModelOptions extends FComponentOptions { * @category Model */ export abstract class FModel extends FComponent { - /** - * Callbacks for when the model is loaded - */ - public __CALLBACKS_ON_LOADED__: (() => void)[] = [] - /** * The name of the model. * Shouldn't contain file extensions. @@ -102,16 +97,9 @@ export abstract class FModel extends FComponent { ) } - /** - * Add a callback to be called when the model is loaded. - * @param callback The callback function. - */ - onLoaded(callback: () => void) { - this.__CALLBACKS_ON_LOADED__.push(callback) - } - /** * Emit the onLoaded callbacks. + * It was overridden to add shadow support. */ emitOnLoaded() { if (this.scene.__ENABLE_SHADOWS__ && this.mesh) { diff --git a/packages/3d/test/browser/collider.test.ts b/packages/3d/test/browser/collider.test.ts index 64ee366e..958ec7ad 100644 --- a/packages/3d/test/browser/collider.test.ts +++ b/packages/3d/test/browser/collider.test.ts @@ -1,12 +1,14 @@ import { beforeEach, describe, expect, it } from 'vitest' -import { FCuboid, FScene, FShapes } from '@fibbojs/3d' import RAPIER from '@dimforge/rapier3d' +import { FCuboid, FScene, FShapes } from '../../src' describe('fCollider', () => { let scene: FScene beforeEach(async () => { - scene = new FScene() + scene = new FScene({ + autoLoop: false, + }) await scene.init() await scene.initPhysics() }) diff --git a/packages/3d/test/browser/rigidbody.test.ts b/packages/3d/test/browser/rigidbody.test.ts index 92fbcc84..e26ec750 100644 --- a/packages/3d/test/browser/rigidbody.test.ts +++ b/packages/3d/test/browser/rigidbody.test.ts @@ -1,12 +1,14 @@ import { beforeEach, describe, expect, it } from 'vitest' -import { FCuboid, FScene, FShapes } from '@fibbojs/3d' import RAPIER from '@dimforge/rapier3d' +import { FCuboid, FScene, FShapes } from '../../src' describe('fCollider', () => { let scene: FScene beforeEach(async () => { - scene = new FScene() + scene = new FScene({ + autoLoop: false, + }) await scene.init() await scene.initPhysics() }) diff --git a/packages/core/package.json b/packages/core/package.json index 13777b1d..8200f199 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,7 +40,9 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run", + "test": "vitest --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:ui": "vitest --ui --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:run": "vitest run --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" } } diff --git a/packages/core/src/FCamera.ts b/packages/core/src/FCamera.ts index 86049d0f..3fa7fc6e 100644 --- a/packages/core/src/FCamera.ts +++ b/packages/core/src/FCamera.ts @@ -1,12 +1,13 @@ import { FComponent } from './FComponent' +import type { FScene } from './FScene' /** * The base class for cameras in Fibbo. * @category Core */ export abstract class FCamera extends FComponent { - constructor() { - super() + constructor(scene: FScene) { + super(scene, { addToScene: false }) } /** diff --git a/packages/core/src/FComponent.ts b/packages/core/src/FComponent.ts index fcf1f011..31ba1b48 100644 --- a/packages/core/src/FComponent.ts +++ b/packages/core/src/FComponent.ts @@ -1,10 +1,15 @@ import type { FController } from './FController' +import type { FScene } from './FScene' /** * ID_COUNTER is used to generate unique identifiers for components. */ let ID_COUNTER = 0 +export interface FComponentOptions { + addToScene?: boolean +} + /** * Data being sent to collision callbacks. */ @@ -32,18 +37,46 @@ export abstract class FComponent { */ public __ID__: number + /** + * Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + */ + public __CALLBACKS_ON_LOADED__: (() => void)[] = [] + /** * 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. */ public __CALLBACKS_ON_COLLISION__: { [key: string]: ((data: OnCollisionWithData) => void)[] } = {} + /** + * The scene the component is attached to. + */ + public scene?: FScene + /** * The controller attached to the component. */ public controller?: FController - constructor() { + constructor(scene: FScene, options?: FComponentOptions) { + // Define default options + const DEFAULT_OPTIONS = { + addToScene: true, + } + // Apply default options + options = { ...DEFAULT_OPTIONS, ...options } + // Validate options + if (options.addToScene === undefined) + throw new Error('FibboError: FComponent requires addToScene option') + + // Store the scene + this.scene = scene + + // Add the component to the scene if addToScene is true + if (options.addToScene) + this.scene.addComponent(this) + + // Generate a unique ID this.__ID__ = ID_COUNTER++ } @@ -60,6 +93,23 @@ export abstract class FComponent { } } + /** + * Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + * @param callback The callback function. + */ + onLoaded(callback: () => void) { + this.__CALLBACKS_ON_LOADED__.push(callback) + } + + /** + * Emit the onLoaded callbacks. + */ + emitOnLoaded() { + this.__CALLBACKS_ON_LOADED__.forEach((callback) => { + callback() + }) + } + /** * Add a callback to be called when a collision occurs. * @param classOrObject The class or object to add the callback to. diff --git a/packages/core/src/FLight.ts b/packages/core/src/FLight.ts index ed8fbeb4..56743ed8 100644 --- a/packages/core/src/FLight.ts +++ b/packages/core/src/FLight.ts @@ -1,11 +1,12 @@ import { FComponent } from './FComponent' +import type { FScene } from './FScene' /** * The base class for lights in Fibbo. * @category Core */ export abstract class FLight extends FComponent { - constructor() { - super() + constructor(scene: FScene) { + super(scene) } } diff --git a/packages/core/src/FScene.ts b/packages/core/src/FScene.ts index 05c82781..825c636b 100644 --- a/packages/core/src/FScene.ts +++ b/packages/core/src/FScene.ts @@ -6,6 +6,7 @@ import type { FLight } from './FLight' export interface FSceneOptions { gravity?: { x: number, y: number, z: number } | { x: number, y: number } domNode?: HTMLElement + autoLoop?: boolean } /** @@ -81,6 +82,7 @@ export abstract class FScene { const DEFAULT_OPTIONS = { gravity: { x: 0, y: -9.81, z: 0 }, domNode: document.body, + autoLoop: true, } // Apply default options options = { ...DEFAULT_OPTIONS, ...options } @@ -100,10 +102,10 @@ export abstract class FScene { let delta = 0 /** - * Animation loop + * Auto loop function that calls the frame method every frame. */ - const animate = () => { - requestAnimationFrame(animate) + const autoLoop = () => { + requestAnimationFrame(autoLoop) // Calculate delta time currentTime = (new Date()).getTime() @@ -111,10 +113,11 @@ export abstract class FScene { lastTime = currentTime // Call onFrame callbacks - this.__CALLBACKS_ON_FRAME__.forEach(callback => callback(delta)) + this.frame(delta) } - animate() + if (options.autoLoop) + autoLoop() // Initialize the components array this.components = [] @@ -160,6 +163,16 @@ export abstract class FScene { this.__CALLBACKS_ON_LIGHT_REMOVED__.forEach(callback => callback(light)) } + /** + * Compute a frame with the given delta time. + * By default, it is called every frame, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene. + * @param delta The time in seconds since the last frame. + */ + frame(delta: number): void { + // Call onFrame callbacks + this.__CALLBACKS_ON_FRAME__.forEach(callback => callback(delta)) + } + /** * Add a callback to be called when a frame is rendered. */ diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 5d7794ca..431c00a1 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -40,7 +40,9 @@ "scripts": { "build": "vite build && vue-tsc --emitDeclarationOnly && mv dist/temp/src dist/types && rm -rf dist/temp", "lint": "eslint .", - "test": "vitest run", + "test": "vitest --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:ui": "vitest --ui --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:run": "vitest run --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/packages/event/package.json b/packages/event/package.json index 3d10b10b..88300ece 100644 --- a/packages/event/package.json +++ b/packages/event/package.json @@ -40,7 +40,9 @@ "scripts": { "build": "unbuild", "lint": "eslint .", - "test": "vitest run", + "test": "vitest --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:ui": "vitest --ui --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", + "test:run": "vitest run --config ../../vitest.config.ts --workspace ../../vitest.workspace.ts", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/vitest.config.global.ts b/vitest.config.global.ts new file mode 100644 index 00000000..b165310a --- /dev/null +++ b/vitest.config.global.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vitest/config' + +/** + * This configuration will be used to run tests from the root of the project. + */ +export default defineConfig({ + test: { + coverage: { + enabled: true, + include: ['packages'], + exclude: ['packages/**/dist', 'packages/**/coverage', 'packages/**/test'], + }, + }, +}) diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 00000000..65acb7fa --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config' + +/** + * This configuration will be used to run tests for all packages. + * This means paths are relative to the root of each package. + */ +export default defineConfig({ + test: { + coverage: { + enabled: true, + }, + }, +}) From c0ad9b0d13c4f693258457ad9b4dc475cbae2de3 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Sat, 12 Oct 2024 18:34:28 +0200 Subject: [PATCH 19/36] fix: tests config + devtools typing --- packages/core/test/{ => unit}/index.test.ts | 0 packages/devtools/src/FDebug.ts | 2 +- packages/devtools/test/{ => unit}/index.test.ts | 0 packages/event/test/{ => unit}/index.test.ts | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename packages/core/test/{ => unit}/index.test.ts (100%) rename packages/devtools/test/{ => unit}/index.test.ts (100%) rename packages/event/test/{ => unit}/index.test.ts (100%) diff --git a/packages/core/test/index.test.ts b/packages/core/test/unit/index.test.ts similarity index 100% rename from packages/core/test/index.test.ts rename to packages/core/test/unit/index.test.ts diff --git a/packages/devtools/src/FDebug.ts b/packages/devtools/src/FDebug.ts index 2eb47920..1c788a41 100644 --- a/packages/devtools/src/FDebug.ts +++ b/packages/devtools/src/FDebug.ts @@ -48,7 +48,7 @@ export class FDebug { }) // Make the component array reactive - this.scene.components = reactive(this.scene.components) + this.scene.components = reactive(this.scene.components) as any // 3D specific debug behavior if (scene.__IS_3D__) { diff --git a/packages/devtools/test/index.test.ts b/packages/devtools/test/unit/index.test.ts similarity index 100% rename from packages/devtools/test/index.test.ts rename to packages/devtools/test/unit/index.test.ts diff --git a/packages/event/test/index.test.ts b/packages/event/test/unit/index.test.ts similarity index 100% rename from packages/event/test/index.test.ts rename to packages/event/test/unit/index.test.ts From e66585f3e2396c97b16138f1952ec7718a1891a9 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Sat, 12 Oct 2024 18:40:39 +0200 Subject: [PATCH 20/36] chore: fix ci and test config --- .github/workflows/run-tests.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8b625626..1ff67c65 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -32,4 +32,4 @@ jobs: - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Test all packages - run: npx nx run-many --target=test --all + run: npx nx run-many --target=test:run --all diff --git a/package.json b/package.json index 1c3132fb..8294b74b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "lint:docs": "./node_modules/.bin/eslint --fix ./docs", "test": "vitest --config ./vitest.config.global.ts --workspace ./vitest.workspace.ts", "test:ui": "vitest --ui --config ./vitest.config.global.ts --workspace ./vitest.workspace.ts", - "test:report": "vitest run --config ./docs/vitest.config.global.ts --workspace ./vitest.workspace.ts", + "test:report": "vitest run --config ./docs/vitest.config.ts --workspace ./vitest.workspace.ts", "docs:dev": "vitepress dev docs", "docs:dev:host": "vitepress dev docs --host", "docs:build": "vitepress build docs", From b3ce6406eab27d16ca92c8dfd1b5cb580c845b6f Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Sun, 13 Oct 2024 11:14:21 +0200 Subject: [PATCH 21/36] feat: hide pixi and three objects behind __INTERNALS__ --- apps/playground-2d/src/main.ts | 2 +- apps/playground-3d/pages/rainbowls/main.ts | 30 +++++------ apps/playground-3d/src/main.ts | 2 +- packages/2d/src/core/FComponent.ts | 52 +++++++++---------- packages/2d/src/core/FScene.ts | 4 +- packages/2d/src/polygons/FCircle.ts | 2 +- packages/2d/src/polygons/FPolygon.ts | 4 +- packages/2d/src/sprite/FSprite.ts | 10 ++-- packages/3d/src/cameras/FAttachedCamera.ts | 14 ++--- packages/3d/src/cameras/FGameCamera.ts | 6 +-- packages/3d/src/cameras/FOrbitCamera.ts | 4 +- packages/3d/src/cameras/FPointerLockCamera.ts | 8 +-- packages/3d/src/core/FCollider.ts | 6 +-- packages/3d/src/core/FComponent.ts | 36 ++++++------- packages/3d/src/core/FScene.ts | 12 ++--- packages/3d/src/model/FFBX.ts | 6 +-- packages/3d/src/model/FGLTF.ts | 2 +- packages/3d/src/model/FModel.ts | 12 ++--- packages/3d/src/model/FOBJ.ts | 2 +- packages/3d/src/polyhedrons/FCapsule.ts | 6 +-- packages/3d/src/polyhedrons/FPolyhedron.ts | 10 ++-- packages/3d/src/polyhedrons/FSphere.ts | 6 +-- 22 files changed, 118 insertions(+), 118 deletions(-) diff --git a/apps/playground-2d/src/main.ts b/apps/playground-2d/src/main.ts index ec315ed6..132ee44a 100644 --- a/apps/playground-2d/src/main.ts +++ b/apps/playground-2d/src/main.ts @@ -96,7 +96,7 @@ import Character from './classes/Character' // Cast the component to FRectangle const square = component as FRectangle // Change the color of the square to a random color - square.container.tint = Math.random() * 0xFFFFFF + square.__CONTAINER__.tint = Math.random() * 0xFFFFFF }) character.onCollisionWith(circle, () => { console.log('Sprite collided with the circle!') diff --git a/apps/playground-3d/pages/rainbowls/main.ts b/apps/playground-3d/pages/rainbowls/main.ts index 49177c06..d8e5205c 100644 --- a/apps/playground-3d/pages/rainbowls/main.ts +++ b/apps/playground-3d/pages/rainbowls/main.ts @@ -23,7 +23,7 @@ import * as THREE from 'three' const sphere = new FSphere(scene) sphere.setPosition({ x: i * GRID_GAP - GRID_ROWS * GRID_GAP / 2, y: 1, z: j * GRID_GAP - GRID_COLS * GRID_GAP / 2 }) // @ts-expect-error Disable typing for the mesh property - sphere.mesh.material.color.set(new THREE.Color(0x2C2C2C)) + sphere.__MESH__.material.color.set(new THREE.Color(0x2C2C2C)) // Create a cube for the hitbox const cube = new FCuboid(scene) @@ -31,11 +31,11 @@ import * as THREE from 'three' cube.setScale({ x: GRID_GAP, y: 1, z: GRID_GAP }) // Make the cube invisible // @ts-expect-error Disable typing for the mesh property - cube.mesh.material.transparent = true + cube.__MESH__.material.transparent = true // @ts-expect-error Disable typing for the mesh property - cube.mesh.material.opacity = 0 + cube.__MESH__.material.opacity = 0 // Attach coordinates to the cube - cube.mesh.userData = { x: i, y: j } + cube.__MESH__.userData = { x: i, y: j } // Add the sphere to the scene scene.addComponent(sphere) @@ -51,11 +51,11 @@ 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({ + const camera = new FOrbitCamera(scene, { target: cameraTarget, }) - camera.setPosition(14, 12, 14) - camera.lookAt(0, 0, 0) + camera.setPosition({ x: 14, y: 12, z: 14 }) + camera.lookAt({ x: 0, y: 0, z: 0 }) scene.camera = camera // Create raycaster and pointer @@ -79,11 +79,11 @@ import * as THREE from 'three' // Move the spheres back to their original position for (let i = 0; i < GRID_ROWS; i++) { for (let j = 0; j < GRID_COLS; j++) { - grid[i][j].mesh.position.lerp( + grid[i][j].__MESH__.position.lerp( new THREE.Vector3( - grid[i][j].mesh.position.x, + grid[i][j].__MESH__.position.x, 1, - grid[i][j].mesh.position.z, + grid[i][j].__MESH__.position.z, ) , 0.1, ) @@ -102,19 +102,19 @@ import * as THREE from 'three' if (distance < RADIUS) { // Change the color of the sphere based on the distance // @ts-expect-error Disable typing for the mesh property - sphere.mesh.material.color.set(new THREE.Color(`hsl(${(distance / RADIUS) * 360}, 90%, 70%)`)) + sphere.__MESH__.material.color.set(new THREE.Color(`hsl(${(distance / RADIUS) * 360}, 90%, 70%)`)) // Elevate the sphere based on the distance - sphere.mesh.position.lerp( + sphere.__MESH__.position.lerp( new THREE.Vector3( - sphere.mesh.position.x, + sphere.__MESH__.position.x, 1 + ELEVATION * (1 - distance / RADIUS), - sphere.mesh.position.z, + sphere.__MESH__.position.z, ) , 0.1, ) } // @ts-expect-error Disable typing for the mesh property - else { sphere.mesh.material.color.set(new THREE.Color(0x2C2C2C)) } + else { sphere.__MESH__.material.color.set(new THREE.Color(0x2C2C2C)) } } } } diff --git a/apps/playground-3d/src/main.ts b/apps/playground-3d/src/main.ts index 909313a3..9d7f6726 100644 --- a/apps/playground-3d/src/main.ts +++ b/apps/playground-3d/src/main.ts @@ -146,7 +146,7 @@ import Character from './classes/Character' scene.addComponent(character) // Attach a camera to the character - scene.camera = new FGameCamera({ target: character }) + scene.camera = new FGameCamera(scene, { target: character }) /** * Create other objects diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 5058b46c..72557cc5 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -1,6 +1,6 @@ import type { FComponentOptions as FComponentOptionsCore, OnCollisionWithData } from '@fibbojs/core' import { FComponent as FComponentCore } from '@fibbojs/core' -import { Container } from 'pixi.js' +import * as PIXI from 'pixi.js' import * as RAPIER from '@dimforge/rapier2d' import type { FController } from '../controllers/FController' import type { FScene } from './FScene' @@ -39,7 +39,7 @@ export abstract class FComponent extends FComponentCore { /** * PIXI container */ - container: Container + __CONTAINER__: PIXI.Container /** * Transforms @@ -72,7 +72,7 @@ export abstract class FComponent extends FComponentCore { super(scene) this.scene = scene // Create a new PIXI container - this.container = new Container() + this.__CONTAINER__ = new PIXI.Container() // Define default options const DEFAULT_OPTIONS = { @@ -94,11 +94,11 @@ export abstract class FComponent extends FComponentCore { rotationDegree: options.rotationDegree, }) // Set the container values - this.container.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) - this.container.scale.set(this.transform.scale.x * 100, this.transform.scale.y * 100) - this.container.rotation = this.transform.rotation + this.__CONTAINER__.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) + this.__CONTAINER__.scale.set(this.transform.scale.x * 100, this.transform.scale.y * 100) + this.__CONTAINER__.rotation = this.transform.rotation // Set the pivot of the container to the center - this.container.pivot.set(this.container.width / 2, this.container.height / 2) + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } onFrame(_delta: number): void { @@ -117,15 +117,15 @@ export abstract class FComponent extends FComponentCore { newContainerRotation -= this.rigidBody.__RIGIDBODY_ROTATION_OFFSET__ // Apply the new transforms to the container - this.container.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) - this.container.rotation = -newContainerRotation + this.__CONTAINER__.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) + this.__CONTAINER__.rotation = -newContainerRotation // Update position and rotation properties of the component according to the rigidBody this.transform.position = { - x: this.container.position.x / 100, - y: -this.container.position.y / 100, + x: this.__CONTAINER__.position.x / 100, + y: -this.__CONTAINER__.position.y / 100, } - this.transform.rotation = this.container.rotation + this.transform.rotation = this.__CONTAINER__.rotation } // Else if the collider exist, update the container position and rotation according to the collider else if (this.collider) { @@ -143,26 +143,26 @@ export abstract class FComponent extends FComponentCore { newContainerRotation -= this.collider.__COLLIDER_ROTATION_OFFSET__ // Apply the new transforms to the container - this.container.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) - this.container.rotation = -newContainerRotation + this.__CONTAINER__.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) + this.__CONTAINER__.rotation = -newContainerRotation // Update position and rotation properties of the component according to the collider this.transform.position = { - x: this.container.position.x / 100, - y: -this.container.position.y / 100, + x: this.__CONTAINER__.position.x / 100, + y: -this.__CONTAINER__.position.y / 100, } - this.transform.rotation = this.container.rotation + this.transform.rotation = this.__CONTAINER__.rotation } else { // If the rigidBody and collider doesn't exist, update the container position and rotation according to the default values // The y position is inverted because the y axis is inverted in PIXI.js compared to Rapier - this.container.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) - this.container.rotation = this.transform.rotation + this.__CONTAINER__.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) + this.__CONTAINER__.rotation = this.transform.rotation // Update position and rotation properties of the component according to the default values this.transform.position = { - x: this.container.position.x / 100, - y: -this.container.position.y / 100, + x: this.__CONTAINER__.position.x / 100, + y: -this.__CONTAINER__.position.y / 100, } - this.transform.rotation = this.container.rotation + this.transform.rotation = this.__CONTAINER__.rotation } // If a sensor exists, update its transforms @@ -185,7 +185,7 @@ export abstract class FComponent extends FComponentCore { */ setPosition(options: { x: number, y: number }): void { this.transform.position = { x: options.x, y: options.y } - this.container.position.set(options.x * 100, -options.y * 100) + this.__CONTAINER__.position.set(options.x * 100, -options.y * 100) // If a rigidBody exists, update its position if (this.rigidBody) this.rigidBody.updatePosition() @@ -207,7 +207,7 @@ export abstract class FComponent extends FComponentCore { */ setRotation(r: number): void { this.transform.rotation = r - this.container.rotation = r + this.__CONTAINER__.rotation = r // If a rigidBody exists, update its rotation if (this.rigidBody) this.rigidBody.updateRotation() @@ -243,8 +243,8 @@ export abstract class FComponent extends FComponentCore { */ setScale(options: { x: number, y: number }): void { this.transform.scale = { x: options.x, y: options.y } - this.container.height = options.y * 100 - this.container.width = options.x * 100 + this.__CONTAINER__.height = options.y * 100 + this.__CONTAINER__.width = options.x * 100 // If a rigidBody exists, update its scale if (this.rigidBody) this.rigidBody.updateScale() diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index 013a94a7..0eec4965 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -195,7 +195,7 @@ export class FScene extends FSceneCore { // Wait for the component to be loaded before adding it to the scene component.onLoaded(() => { - this.viewport.addChild(component.container) + this.viewport.addChild(component.__CONTAINER__) // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) @@ -210,7 +210,7 @@ export class FScene extends FSceneCore { super.removeComponent(component) // Remove container from the viewport - this.viewport.removeChild(component.container) + this.viewport.removeChild(component.__CONTAINER__) // Remove colliders and rigidBodies from rapier world if (component.rigidBody) diff --git a/packages/2d/src/polygons/FCircle.ts b/packages/2d/src/polygons/FCircle.ts index 9589ec53..a8c9b659 100644 --- a/packages/2d/src/polygons/FCircle.ts +++ b/packages/2d/src/polygons/FCircle.ts @@ -21,7 +21,7 @@ export class FCircle extends FPolygon { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) // Create a circle - this.container = new PIXI.Graphics() + this.__CONTAINER__ = new PIXI.Graphics() .circle(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100 / 2) .fill(new PIXI.FillGradient(0, 0, 10, 10).addColorStop(0, 0x0000FF).addColorStop(1, 0xFFFF00)) // Emit the onLoaded event diff --git a/packages/2d/src/polygons/FPolygon.ts b/packages/2d/src/polygons/FPolygon.ts index e570875c..abdb2b4f 100644 --- a/packages/2d/src/polygons/FPolygon.ts +++ b/packages/2d/src/polygons/FPolygon.ts @@ -11,11 +11,11 @@ export abstract class FPolygon extends FComponent { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) // Create a square - this.container = new PIXI.Graphics() + this.__CONTAINER__ = new PIXI.Graphics() .rect(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100, this.transform.scale.y * 100) .fill(new PIXI.FillGradient(0, 0, this.transform.scale.x * 100, this.transform.scale.y * 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) // Set the pivot of the container to the center - this.container.pivot.set(this.container.width / 2, this.container.height / 2) + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } onFrame(delta: number): void { diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index 6cc95866..7bd42acc 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -31,11 +31,11 @@ export class FSprite extends FComponent { // Define the texture and container while loading this.texture = PIXI.Texture.EMPTY - this.container = new PIXI.Graphics() + this.__CONTAINER__ = new PIXI.Graphics() .rect(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100, this.transform.scale.y * 100) .fill(new PIXI.FillGradient(0, 0, 100, 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) // Set the pivot of the container to the center - this.container.pivot.set(this.container.width / 2, this.container.height / 2) + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) // Load the texture this.loadTexture(options.texture) @@ -68,10 +68,10 @@ export class FSprite extends FComponent { this.texture = await PIXI.Assets.load(path) this.texture.source.scaleMode = 'nearest' // Create a sprite - this.container = new PIXI.Sprite(this.texture) - this.container.zIndex = 0 + this.__CONTAINER__ = new PIXI.Sprite(this.texture) + this.__CONTAINER__.zIndex = 0 // Set the pivot of the container to the center - this.container.pivot.set(this.container.width / 2, this.container.height / 2) + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) // Set the scale of the component so it fits the texture by its width // Width will be 1 unit, height will be calculated according to the aspect ratio this.setScaleWidth(this.transform.scale.x) diff --git a/packages/3d/src/cameras/FAttachedCamera.ts b/packages/3d/src/cameras/FAttachedCamera.ts index e9b22b1f..262031f9 100644 --- a/packages/3d/src/cameras/FAttachedCamera.ts +++ b/packages/3d/src/cameras/FAttachedCamera.ts @@ -38,18 +38,18 @@ export class FAttachedCamera extends FCamera { } onFrame(_delta: number): void { - if (this.attachedComponent.mesh === undefined) + if (this.attachedComponent.__MESH__ === undefined) return // Position the camera at the model's position + offset - this.position.x = this.attachedComponent.mesh.position.x + this.offset.x - this.position.y = this.attachedComponent.mesh.position.y + this.offset.y - this.position.z = this.attachedComponent.mesh.position.z + this.offset.z + this.position.x = this.attachedComponent.__MESH__.position.x + this.offset.x + this.position.y = this.attachedComponent.__MESH__.position.y + this.offset.y + this.position.z = this.attachedComponent.__MESH__.position.z + this.offset.z // Make the camera look at the model this.lookAt({ - x: this.attachedComponent.mesh.position.x, - y: this.attachedComponent.mesh.position.y, - z: this.attachedComponent.mesh.position.z, + x: this.attachedComponent.__MESH__.position.x, + y: this.attachedComponent.__MESH__.position.y, + z: this.attachedComponent.__MESH__.position.z, }) } diff --git a/packages/3d/src/cameras/FGameCamera.ts b/packages/3d/src/cameras/FGameCamera.ts index 455f987d..33fe3b16 100644 --- a/packages/3d/src/cameras/FGameCamera.ts +++ b/packages/3d/src/cameras/FGameCamera.ts @@ -55,17 +55,17 @@ export class FGameCamera extends FOrbitCamera { onFrame(delta: number): void { super.onFrame(delta) - if (!this.attachedComponent.mesh) + if (!this.attachedComponent.__MESH__) return // Calculate the difference between the previous and current position of the attached model - const positionDifference = this.attachedComponent.mesh.position.clone().sub(this.previousModelPosition) + const positionDifference = this.attachedComponent.__MESH__.position.clone().sub(this.previousModelPosition) // Move the camera by the same amount this.position.x += positionDifference.x this.position.y += positionDifference.y this.position.z += positionDifference.z // Update the previous position - this.previousModelPosition = this.attachedComponent.mesh.position.clone() + this.previousModelPosition = this.attachedComponent.__MESH__.position.clone() // Move the camera based on mouse movement if pointer is locked if (this.isPointerLocked && this.lastMouseMoveEvent) { diff --git a/packages/3d/src/cameras/FOrbitCamera.ts b/packages/3d/src/cameras/FOrbitCamera.ts index ee29ecc2..48c81ef5 100644 --- a/packages/3d/src/cameras/FOrbitCamera.ts +++ b/packages/3d/src/cameras/FOrbitCamera.ts @@ -34,10 +34,10 @@ export class FOrbitCamera extends FCamera { } onFrame(_delta: number): void { - if (this.attachedComponent.mesh === undefined) + if (this.attachedComponent.__MESH__ === undefined) return - this.controls.target = this.attachedComponent.mesh.position + this.controls.target = this.attachedComponent.__MESH__.position this.controls.update() } diff --git a/packages/3d/src/cameras/FPointerLockCamera.ts b/packages/3d/src/cameras/FPointerLockCamera.ts index d912fad2..d58be12e 100644 --- a/packages/3d/src/cameras/FPointerLockCamera.ts +++ b/packages/3d/src/cameras/FPointerLockCamera.ts @@ -41,12 +41,12 @@ export class FPointerLockCamera extends FCamera { } onFrame(_delta: number): void { - if (this.attachedComponent.mesh === undefined) + if (this.attachedComponent.__MESH__ === undefined) return // Position the camera at the model's position + offset - this.position.x = this.attachedComponent.mesh.position.x - this.position.y = this.attachedComponent.mesh.position.y - this.position.z = this.attachedComponent.mesh.position.z + this.position.x = this.attachedComponent.__MESH__.position.x + this.position.y = this.attachedComponent.__MESH__.position.y + this.position.z = this.attachedComponent.__MESH__.position.z } } diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index 1ad03642..3d4d043b 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -125,14 +125,14 @@ export class FCollider { colliderDesc = RAPIER.ColliderDesc.capsule(options.scale.y / 2, options.scale.x / 2) break case FShapes.MESH: - // If component.mesh isn't defined, throw an error + // If component.__MESH__ isn't defined, throw an error { - if (!component.mesh) + if (!component.__MESH__) throw new Error('FibboError: Mesh collider can only be created from a THREE.Mesh') // Flag to check if a THREE.Mesh was found let found = false // Traverse the mesh tree until we find a THREE.Mesh - component.mesh.traverse((child) => { + component.__MESH__.traverse((child) => { if (!found && child instanceof THREE.Mesh) { colliderDesc = RAPIER.ColliderDesc.trimesh( child.geometry.attributes.position.array as Float32Array, diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 68d54579..9bf798fa 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -39,7 +39,7 @@ export abstract class FComponent extends FComponentCore { /** * Mesh */ - mesh?: THREE.Mesh | THREE.Group + __MESH__?: THREE.Mesh | THREE.Group /** * Transforms @@ -108,7 +108,7 @@ export abstract class FComponent extends FComponentCore { onFrame(_delta: number): void { super.onFrame(_delta) // If the rigidBody and mesh exist, update the mesh position and rotation according to the rigidBody - if (this.rigidBody && this.collider && this.mesh) { + if (this.rigidBody && this.collider && this.__MESH__) { // Translation const newMeshPosition = this.rigidBody.__RIGIDBODY__.translation() // Remove offset @@ -131,8 +131,8 @@ export abstract class FComponent extends FComponentCore { newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z // Apply the new transforms to the mesh - this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.mesh.setRotationFromEuler(newMeshRotation) + this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) + this.__MESH__.setRotationFromEuler(newMeshRotation) // Update position and rotation properties of the component according to the rigidBody this.transform.position = newMeshPosition @@ -148,7 +148,7 @@ export abstract class FComponent extends FComponentCore { } } // If the collider and mesh exist, update the mesh position and rotation according to the collider - else if (this.collider && this.mesh) { + else if (this.collider && this.__MESH__) { // Translation const newMeshPosition = this.collider.__COLLIDER__.translation() // Remove offset @@ -171,16 +171,16 @@ export abstract class FComponent extends FComponentCore { newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z // Apply the new transforms to the mesh - this.mesh.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.mesh.setRotationFromEuler(newMeshRotation) + this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) + this.__MESH__.setRotationFromEuler(newMeshRotation) // Update position and rotation properties of the component this.transform.position = newMeshPosition this.transform.rotation = newMeshRotation } // If the rigidBody and collider doesn't exist, update the mesh position and rotation according to the default values - else if (this.mesh) { - this.mesh.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) - this.mesh.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) + else if (this.__MESH__) { + this.__MESH__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) + this.__MESH__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) // If a sensor exists, update its position and rotation according to the default values if (this.sensor) { this.sensor.__RIGIDBODY__.setTranslation({ x: this.transform.position.x, y: this.transform.position.y, z: this.transform.position.z }, true) @@ -204,8 +204,8 @@ export abstract class FComponent extends FComponentCore { setPosition(options: { x: number, y: number, z: number }): void { this.transform.position = options // If a mesh exists, update its position - if (this.mesh) - this.mesh.position.set(options.x, options.y, options.z) + if (this.__MESH__) + this.__MESH__.position.set(options.x, options.y, options.z) // If a rigidBody exists, update its position if (this.rigidBody) this.rigidBody.updatePosition() @@ -231,8 +231,8 @@ export abstract class FComponent extends FComponentCore { setRotation(options: { x: number, y: number, z: number }): void { this.transform.rotation = options // If a mesh exists, update its rotation - if (this.mesh) - this.mesh.rotation.set(options.x, options.y, options.z) + if (this.__MESH__) + this.__MESH__.rotation.set(options.x, options.y, options.z) // If a rigidBody exists, update its rotation if (this.rigidBody) this.rigidBody.updateRotation() @@ -280,15 +280,15 @@ export abstract class FComponent extends FComponentCore { setScale(options: { x: number, y: number, z: number }): void { this.transform.scale = options // If a mesh exists - if (this.mesh) { + if (this.__MESH__) { // If the mesh is a classic polyhedron - if (this.mesh instanceof THREE.Mesh && (this.mesh.geometry instanceof THREE.BoxGeometry || this.mesh.geometry instanceof THREE.SphereGeometry)) { - this.mesh.scale.set(options.x, options.y, options.z) + if (this.__MESH__ instanceof THREE.Mesh && (this.__MESH__.geometry instanceof THREE.BoxGeometry || this.__MESH__.geometry instanceof THREE.SphereGeometry)) { + this.__MESH__.scale.set(options.x, options.y, options.z) } // We don't know the type of the mesh, probably a custom mesh else { // I don't really know why the scale should be devided by 2 for custom meshes, but it works - this.mesh.scale.set(options.x / 2, options.y / 2, options.z / 2) + this.__MESH__.scale.set(options.x / 2, options.y / 2, options.z / 2) } } // If a rigidBody exists, update its scale diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 994b3f26..c0aa70bb 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -187,8 +187,8 @@ export class FScene extends FSceneCore { if (component instanceof FModel) { // Wait for the model to be loaded before adding it to the scene component.onLoaded(() => { - if (component.mesh) - this.scene.add(component.mesh) + if (component.__MESH__) + this.scene.add(component.__MESH__) // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) @@ -199,8 +199,8 @@ export class FScene extends FSceneCore { }) } else { - if (component.mesh) - this.scene.add(component.mesh) + if (component.__MESH__) + this.scene.add(component.__MESH__) // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) @@ -215,8 +215,8 @@ export class FScene extends FSceneCore { super.removeComponent(component) // Remove mesh from scene - if (component.mesh) - this.scene.remove(component.mesh) + if (component.__MESH__) + this.scene.remove(component.__MESH__) // Remove colliders and rigidBodies from rapier world if (component.rigidBody) diff --git a/packages/3d/src/model/FFBX.ts b/packages/3d/src/model/FFBX.ts index 119f1433..2cee2d9d 100644 --- a/packages/3d/src/model/FFBX.ts +++ b/packages/3d/src/model/FFBX.ts @@ -35,7 +35,7 @@ export class FFBX extends FModel { // Called when the resource is loaded (fbx) => { // Get the mesh from the FBX scene - this.mesh = fbx + this.__MESH__ = fbx // Load textures fbx.traverse((child) => { @@ -64,14 +64,14 @@ export class FFBX extends FModel { defineMeshTransforms() { // If the mesh is not defined, return - if (!this.mesh) + if (!this.__MESH__) return super.defineMeshTransforms() // Define the scale differently for FBX models as they are usually larger if (this.transform.scale) { - this.mesh.scale.set(this.transform.scale.x / 200, this.transform.scale.y / 200, this.transform.scale.z / 200) + this.__MESH__.scale.set(this.transform.scale.x / 200, this.transform.scale.y / 200, this.transform.scale.z / 200) } } } diff --git a/packages/3d/src/model/FGLTF.ts b/packages/3d/src/model/FGLTF.ts index 5dead880..95d0671a 100644 --- a/packages/3d/src/model/FGLTF.ts +++ b/packages/3d/src/model/FGLTF.ts @@ -53,7 +53,7 @@ export class FGLTF extends FModel { // Called when the resource is loaded (gltf) => { // Get the mesh from the glTF scene - this.mesh = gltf.scene + this.__MESH__ = gltf.scene // Define mesh transforms this.defineMeshTransforms() diff --git a/packages/3d/src/model/FModel.ts b/packages/3d/src/model/FModel.ts index 7e0f3a55..5f4778f6 100644 --- a/packages/3d/src/model/FModel.ts +++ b/packages/3d/src/model/FModel.ts @@ -102,8 +102,8 @@ export abstract class FModel extends FComponent { * It was overridden to add shadow support. */ emitOnLoaded() { - if (this.scene.__ENABLE_SHADOWS__ && this.mesh) { - this.mesh.traverse((child) => { + if (this.scene.__ENABLE_SHADOWS__ && this.__MESH__) { + this.__MESH__.traverse((child) => { if (child instanceof THREE.Mesh) { child.castShadow = true child.receiveShadow = true @@ -120,20 +120,20 @@ export abstract class FModel extends FComponent { */ defineMeshTransforms() { // If the mesh is not defined, return - if (!this.mesh) + if (!this.__MESH__) return // If a position is defined, apply it if (this.transform.position) - this.mesh.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) + this.__MESH__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) // If a scale is defined, apply it if (this.transform.scale) - this.mesh.scale.set(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2) + this.__MESH__.scale.set(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2) // If a rotation is defined, apply it if (this.transform.rotation) - this.mesh.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) + this.__MESH__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) } /** diff --git a/packages/3d/src/model/FOBJ.ts b/packages/3d/src/model/FOBJ.ts index 1bc97430..7ae73b15 100644 --- a/packages/3d/src/model/FOBJ.ts +++ b/packages/3d/src/model/FOBJ.ts @@ -32,7 +32,7 @@ export class FOBJ extends FModel { // Called when the resource is loaded (obj) => { // Get the mesh from the OBJ object - this.mesh = obj + this.__MESH__ = obj // Load textures obj.traverse((child) => { diff --git a/packages/3d/src/polyhedrons/FCapsule.ts b/packages/3d/src/polyhedrons/FCapsule.ts index 3ccaf435..3809e3b0 100644 --- a/packages/3d/src/polyhedrons/FCapsule.ts +++ b/packages/3d/src/polyhedrons/FCapsule.ts @@ -25,11 +25,11 @@ export class FCapsule extends FPolyhedron { // Create a capsule const geometry = new THREE.CapsuleGeometry(0.5, 1, 32) const material = new THREE.MeshPhongMaterial({ color: 0x666666 }) - this.mesh = new THREE.Mesh(geometry, material) + this.__MESH__ = new THREE.Mesh(geometry, material) // If shadows are enabled, cast and receive shadows if (scene.__ENABLE_SHADOWS__) { - this.mesh.castShadow = true - this.mesh.receiveShadow = true + this.__MESH__.castShadow = true + this.__MESH__.receiveShadow = true } } diff --git a/packages/3d/src/polyhedrons/FPolyhedron.ts b/packages/3d/src/polyhedrons/FPolyhedron.ts index 96199621..07031071 100644 --- a/packages/3d/src/polyhedrons/FPolyhedron.ts +++ b/packages/3d/src/polyhedrons/FPolyhedron.ts @@ -13,7 +13,7 @@ export abstract class FPolyhedron extends FComponent { * mesh is redefined from FComponent without the ? because it is * directly available after the constructor, as a polyhedron is created synchronously. */ - mesh: THREE.Mesh + __MESH__: THREE.Mesh constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) @@ -24,11 +24,11 @@ export abstract class FPolyhedron extends FComponent { // Turn on depthWrite if shadows are enabled depthWrite: this.scene.__ENABLE_SHADOWS__, }) - this.mesh = new THREE.Mesh(geometry, material) + this.__MESH__ = new THREE.Mesh(geometry, material) // If shadows are enabled, cast and receive shadows if (scene.__ENABLE_SHADOWS__) { - this.mesh.castShadow = true - this.mesh.receiveShadow = true + this.__MESH__.castShadow = true + this.__MESH__.receiveShadow = true } } @@ -46,6 +46,6 @@ export abstract class FPolyhedron extends FComponent { */ setColor(color: number): void { const material = new THREE.MeshPhongMaterial({ color }) - this.mesh.material = material + this.__MESH__.material = material } } diff --git a/packages/3d/src/polyhedrons/FSphere.ts b/packages/3d/src/polyhedrons/FSphere.ts index 4ebfafe2..1868648a 100644 --- a/packages/3d/src/polyhedrons/FSphere.ts +++ b/packages/3d/src/polyhedrons/FSphere.ts @@ -25,11 +25,11 @@ export class FSphere extends FPolyhedron { // Create a sphere const geometry = new THREE.SphereGeometry(0.5, 32, 32) const material = new THREE.MeshPhongMaterial({ color: 0x666666 }) - this.mesh = new THREE.Mesh(geometry, material) + this.__MESH__ = new THREE.Mesh(geometry, material) // If shadows are enabled, cast and receive shadows if (scene.__ENABLE_SHADOWS__) { - this.mesh.castShadow = true - this.mesh.receiveShadow = true + this.__MESH__.castShadow = true + this.__MESH__.receiveShadow = true } } From 08aee70405d04ff44155c5629a4f7d3b38de8428 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Mon, 14 Oct 2024 17:57:00 +0200 Subject: [PATCH 22/36] feat: frame / onFrame refactor --- .vscode/settings.json | 3 ++- packages/2d/src/cameras/FAttachedCamera.ts | 2 +- packages/2d/src/cameras/FCamera.ts | 2 -- packages/2d/src/cameras/FFixedCamera.ts | 3 --- packages/2d/src/cameras/FFreeCamera.ts | 3 --- .../src/controllers/FCharacterControllerD.ts | 2 +- .../src/controllers/FCharacterControllerKP.ts | 2 +- .../src/controllers/FCharacterControllerKV.ts | 2 +- packages/2d/src/core/FComponent.ts | 4 ++-- packages/2d/src/core/FComponentEmpty.ts | 6 +---- packages/2d/src/core/FScene.ts | 10 ++++----- packages/2d/src/lights/FLight.ts | 2 -- packages/2d/src/polygons/FCircle.ts | 4 ---- packages/2d/src/polygons/FPolygon.ts | 4 ---- packages/2d/src/polygons/FRectangle.ts | 4 ---- packages/2d/src/sprite/FSprite.ts | 4 ---- packages/3d/src/cameras/FAttachedCamera.ts | 2 +- packages/3d/src/cameras/FFixedCamera.ts | 3 --- packages/3d/src/cameras/FGameCamera.ts | 4 ++-- packages/3d/src/cameras/FOrbitCamera.ts | 2 +- packages/3d/src/cameras/FPointerLockCamera.ts | 2 +- .../src/controllers/FCharacterControllerD.ts | 2 +- .../src/controllers/FCharacterControllerKP.ts | 2 +- .../src/controllers/FCharacterControllerKV.ts | 2 +- packages/3d/src/core/FComponent.ts | 4 ++-- packages/3d/src/core/FComponentEmpty.ts | 4 ---- packages/3d/src/core/FScene.ts | 10 ++++----- packages/3d/src/lights/FAmbientLight.ts | 2 -- packages/3d/src/lights/FDirectionalLight.ts | 2 -- packages/3d/src/lights/FHemisphereLight.ts | 2 -- packages/3d/src/lights/FLight.ts | 2 -- packages/3d/src/lights/FLightProbe.ts | 2 -- packages/3d/src/lights/FPointLight.ts | 2 -- packages/3d/src/lights/FSpotLight.ts | 2 -- packages/3d/src/polyhedrons/FCapsule.ts | 4 ---- packages/3d/src/polyhedrons/FCuboid.ts | 4 ---- packages/3d/src/polyhedrons/FPolyhedron.ts | 4 ---- packages/3d/src/polyhedrons/FSphere.ts | 4 ---- packages/core/src/FComponent.ts | 22 ++++++++++++++----- packages/core/src/FController.ts | 5 ++--- packages/core/src/FGroup.ts | 4 ++-- packages/core/src/FScene.ts | 5 ----- 42 files changed, 50 insertions(+), 110 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 29e7e978..f6e417ff 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -54,6 +54,7 @@ "**/*.d.ts": true, "**/.gitignore": true, "**/vitest.workspace.ts": true, - "**/vitest.config.ts": true + "**/vitest.config.ts": true, + "**/coverage": true } } diff --git a/packages/2d/src/cameras/FAttachedCamera.ts b/packages/2d/src/cameras/FAttachedCamera.ts index 04257fa4..32d905ab 100644 --- a/packages/2d/src/cameras/FAttachedCamera.ts +++ b/packages/2d/src/cameras/FAttachedCamera.ts @@ -22,7 +22,7 @@ export class FAttachedCamera extends FCamera { this.target = options.target } - onFrame(_delta: number): void { + frame(_delta: number): void { // Move the camera to the target this.scene.viewport.moveCenter( this.target.transform.position.x * 100 + this.position.x * 100, diff --git a/packages/2d/src/cameras/FCamera.ts b/packages/2d/src/cameras/FCamera.ts index 84324e8e..8ef67e76 100644 --- a/packages/2d/src/cameras/FCamera.ts +++ b/packages/2d/src/cameras/FCamera.ts @@ -50,8 +50,6 @@ export abstract class FCamera extends FCameraCore { this.position = options.position } - abstract onFrame(_delta: number): void - abstract __ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__(): void setZoom(zoom: number): void { diff --git a/packages/2d/src/cameras/FFixedCamera.ts b/packages/2d/src/cameras/FFixedCamera.ts index aeb3c0dc..81bf3412 100644 --- a/packages/2d/src/cameras/FFixedCamera.ts +++ b/packages/2d/src/cameras/FFixedCamera.ts @@ -11,9 +11,6 @@ export class FFixedCamera extends FCamera { super(scene, options) } - onFrame(_delta: number): void { - } - __ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__(): void { // Disable all plugins on the pixi viewport this.scene.viewport.plugins.pause('drag') diff --git a/packages/2d/src/cameras/FFreeCamera.ts b/packages/2d/src/cameras/FFreeCamera.ts index 0292e602..24a6f82f 100644 --- a/packages/2d/src/cameras/FFreeCamera.ts +++ b/packages/2d/src/cameras/FFreeCamera.ts @@ -11,9 +11,6 @@ export class FFreeCamera extends FCamera { super(scene, options) } - onFrame(_delta: number): void { - } - __ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__(): void { // Enable all plugins on the pixi viewport this.scene.viewport.plugins.resume('drag') diff --git a/packages/2d/src/controllers/FCharacterControllerD.ts b/packages/2d/src/controllers/FCharacterControllerD.ts index 0936c9f2..0039182a 100644 --- a/packages/2d/src/controllers/FCharacterControllerD.ts +++ b/packages/2d/src/controllers/FCharacterControllerD.ts @@ -35,7 +35,7 @@ export class FCharacterControllerD extends FCharacterController { }) } - onFrame(_delta: number): void { + frame(_delta: number): void { // Apply movement on the y axis if (this.inputs.up) { this.component.rigidBody?.__RIGIDBODY__.applyImpulse({ x: 0, y: 0.15 * this.speed }, true) diff --git a/packages/2d/src/controllers/FCharacterControllerKP.ts b/packages/2d/src/controllers/FCharacterControllerKP.ts index 54bbc7cb..e4108178 100644 --- a/packages/2d/src/controllers/FCharacterControllerKP.ts +++ b/packages/2d/src/controllers/FCharacterControllerKP.ts @@ -29,7 +29,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { }) } - onFrame(delta: number): void { + frame(delta: number): void { // Get the corrected movement const correctedMovement = this.getCorrectedMovements() diff --git a/packages/2d/src/controllers/FCharacterControllerKV.ts b/packages/2d/src/controllers/FCharacterControllerKV.ts index 8b6d05d5..407addee 100644 --- a/packages/2d/src/controllers/FCharacterControllerKV.ts +++ b/packages/2d/src/controllers/FCharacterControllerKV.ts @@ -29,7 +29,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { }) } - onFrame(delta: number): void { + frame(delta: number): void { // Get the corrected movement const correctedMovement = this.getCorrectedMovements() diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 72557cc5..11491e0f 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -101,8 +101,8 @@ export abstract class FComponent extends FComponentCore { this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } - onFrame(_delta: number): void { - super.onFrame(_delta) + frame(_delta: number): void { + super.frame(_delta) // If the rigidBody exist, update the container position and rotation according to the rigidBody if (this.rigidBody && this.collider) { // Translation diff --git a/packages/2d/src/core/FComponentEmpty.ts b/packages/2d/src/core/FComponentEmpty.ts index 8083fcc8..ae9754a3 100644 --- a/packages/2d/src/core/FComponentEmpty.ts +++ b/packages/2d/src/core/FComponentEmpty.ts @@ -3,15 +3,11 @@ import { FComponent } from './FComponent' import type { FComponentOptions } from './FComponent' /** - * An empty component. The container is empty. + * An empty component. The PIXI container will be empty. * @category Core */ export class FComponentEmpty extends FComponent { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) } - - onFrame(_delta: number): void { - super.onFrame(_delta) - } } diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index 0eec4965..83180fb4 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -119,14 +119,14 @@ export class FScene extends FSceneCore { // Create a default free camera this.camera = new FFreeCamera(this) - // onFrame + // On each frame this.onFrame((delta) => { - // Call the onFrame method of each component + // Call the frame method of each component this.components.forEach((component) => { - component.onFrame(delta) + component.frame(delta) }) - // Call the onFrame method of the camera - this.camera.onFrame(delta) + // Call the frame method of the camera + this.camera.frame(delta) }) // Call the onReady callbacks diff --git a/packages/2d/src/lights/FLight.ts b/packages/2d/src/lights/FLight.ts index f34f1b34..980a29a3 100644 --- a/packages/2d/src/lights/FLight.ts +++ b/packages/2d/src/lights/FLight.ts @@ -70,8 +70,6 @@ export abstract class FLight extends FLightCore { this.__LOOK_AT__ = options.lookAt } - abstract onFrame(_delta: number): void - applyTransform(): void { // Set the position this.light.position.set(this.transform.position.x, this.transform.position.y) diff --git a/packages/2d/src/polygons/FCircle.ts b/packages/2d/src/polygons/FCircle.ts index a8c9b659..b01c44e9 100644 --- a/packages/2d/src/polygons/FCircle.ts +++ b/packages/2d/src/polygons/FCircle.ts @@ -28,10 +28,6 @@ export class FCircle extends FPolygon { this.emitOnLoaded() } - onFrame(delta: number): void { - super.onFrame(delta) - } - initRigidBody(options?: { position?: PIXI.PointData scale?: PIXI.PointData diff --git a/packages/2d/src/polygons/FPolygon.ts b/packages/2d/src/polygons/FPolygon.ts index abdb2b4f..f7adc6d2 100644 --- a/packages/2d/src/polygons/FPolygon.ts +++ b/packages/2d/src/polygons/FPolygon.ts @@ -17,8 +17,4 @@ export abstract class FPolygon extends FComponent { // Set the pivot of the container to the center this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } - - onFrame(delta: number): void { - super.onFrame(delta) - } } diff --git a/packages/2d/src/polygons/FRectangle.ts b/packages/2d/src/polygons/FRectangle.ts index 89bbbd80..bdcdcf7f 100644 --- a/packages/2d/src/polygons/FRectangle.ts +++ b/packages/2d/src/polygons/FRectangle.ts @@ -21,8 +21,4 @@ export class FRectangle extends FPolygon { // Emit the onLoaded event this.emitOnLoaded() } - - onFrame(delta: number): void { - super.onFrame(delta) - } } diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index 7bd42acc..8b6dba30 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -96,8 +96,4 @@ export class FSprite extends FComponent { setScaleHeight(height: number) { this.setScale({ x: height * this.texture.width / this.texture.height, y: height }) } - - onFrame(delta: number): void { - super.onFrame(delta) - } } diff --git a/packages/3d/src/cameras/FAttachedCamera.ts b/packages/3d/src/cameras/FAttachedCamera.ts index 262031f9..ec92a8e9 100644 --- a/packages/3d/src/cameras/FAttachedCamera.ts +++ b/packages/3d/src/cameras/FAttachedCamera.ts @@ -37,7 +37,7 @@ export class FAttachedCamera extends FCamera { this.attachedComponent = attachedComponent } - onFrame(_delta: number): void { + frame(_delta: number): void { if (this.attachedComponent.__MESH__ === undefined) return diff --git a/packages/3d/src/cameras/FFixedCamera.ts b/packages/3d/src/cameras/FFixedCamera.ts index 4a2b2083..0cff0f83 100644 --- a/packages/3d/src/cameras/FFixedCamera.ts +++ b/packages/3d/src/cameras/FFixedCamera.ts @@ -20,7 +20,4 @@ export class FFixedCamera extends FCamera { constructor(scene: FScene, options?: FCameraOptions) { super(scene, options) } - - onFrame(_delta: number): void { - } } diff --git a/packages/3d/src/cameras/FGameCamera.ts b/packages/3d/src/cameras/FGameCamera.ts index 33fe3b16..45a39c56 100644 --- a/packages/3d/src/cameras/FGameCamera.ts +++ b/packages/3d/src/cameras/FGameCamera.ts @@ -52,8 +52,8 @@ export class FGameCamera extends FOrbitCamera { }) } - onFrame(delta: number): void { - super.onFrame(delta) + frame(delta: number): void { + super.frame(delta) if (!this.attachedComponent.__MESH__) return diff --git a/packages/3d/src/cameras/FOrbitCamera.ts b/packages/3d/src/cameras/FOrbitCamera.ts index 48c81ef5..8fcf6bd8 100644 --- a/packages/3d/src/cameras/FOrbitCamera.ts +++ b/packages/3d/src/cameras/FOrbitCamera.ts @@ -33,7 +33,7 @@ export class FOrbitCamera extends FCamera { this.controls = new OrbitControls(this.__CAMERA__, this.attachedComponent.scene.renderer.domElement) } - onFrame(_delta: number): void { + frame(_delta: number): void { if (this.attachedComponent.__MESH__ === undefined) return diff --git a/packages/3d/src/cameras/FPointerLockCamera.ts b/packages/3d/src/cameras/FPointerLockCamera.ts index d58be12e..bc49a497 100644 --- a/packages/3d/src/cameras/FPointerLockCamera.ts +++ b/packages/3d/src/cameras/FPointerLockCamera.ts @@ -40,7 +40,7 @@ export class FPointerLockCamera extends FCamera { }) } - onFrame(_delta: number): void { + frame(_delta: number): void { if (this.attachedComponent.__MESH__ === undefined) return diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index f65f2216..7727a708 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -36,7 +36,7 @@ export class FCharacterControllerD extends FCharacterController { }) } - onFrame(_delta: number): void { + frame(_delta: number): void { // Get camera direction const cameraDirection = this.scene.camera.getCameraDirection() // Ignore the y axis diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index 3a23fac1..13957b60 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -28,7 +28,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { }) } - onFrame(delta: number): void { + frame(delta: number): void { /** * Get the corrected movements for the current frame */ diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index 19b9f2b3..661cd1e0 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -28,7 +28,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { }) } - onFrame(delta: number): void { + frame(delta: number): void { /** * Get the corrected movements for the current frame */ diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 9bf798fa..1d33845c 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -105,8 +105,8 @@ export abstract class FComponent extends FComponentCore { }) } - onFrame(_delta: number): void { - super.onFrame(_delta) + frame(_delta: number): void { + super.frame(_delta) // If the rigidBody and mesh exist, update the mesh position and rotation according to the rigidBody if (this.rigidBody && this.collider && this.__MESH__) { // Translation diff --git a/packages/3d/src/core/FComponentEmpty.ts b/packages/3d/src/core/FComponentEmpty.ts index da5fb506..67906a4a 100644 --- a/packages/3d/src/core/FComponentEmpty.ts +++ b/packages/3d/src/core/FComponentEmpty.ts @@ -10,8 +10,4 @@ export class FComponentEmpty extends FComponent { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) } - - onFrame(_delta: number): void { - super.onFrame(_delta) - } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index c0aa70bb..01ce7a9a 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -109,13 +109,13 @@ export class FScene extends FSceneCore { // Add renderer to DOM this.__DOM_NODE__.appendChild(this.renderer.domElement) - // onFrame loop + // Each frame this.onFrame((delta) => { - // Call onFrame for each component - this.components.forEach(component => component.onFrame(delta)) + // Call frame for each component + this.components.forEach(component => component.frame(delta)) - // Camera - this.camera.onFrame(delta) + // Call frame for the camera + this.camera.frame(delta) // Render the scene this.renderer.render(this.scene, this.camera.__CAMERA__) diff --git a/packages/3d/src/lights/FAmbientLight.ts b/packages/3d/src/lights/FAmbientLight.ts index 2ce3d448..44c947ca 100644 --- a/packages/3d/src/lights/FAmbientLight.ts +++ b/packages/3d/src/lights/FAmbientLight.ts @@ -27,6 +27,4 @@ export class FAmbientLight extends FLight { // Apply the transform this.applyTransform() } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/lights/FDirectionalLight.ts b/packages/3d/src/lights/FDirectionalLight.ts index 96fb0bae..fd6c384a 100644 --- a/packages/3d/src/lights/FDirectionalLight.ts +++ b/packages/3d/src/lights/FDirectionalLight.ts @@ -42,6 +42,4 @@ export class FDirectionalLight extends FLight { } } } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/lights/FHemisphereLight.ts b/packages/3d/src/lights/FHemisphereLight.ts index 0c845956..f27f1e62 100644 --- a/packages/3d/src/lights/FHemisphereLight.ts +++ b/packages/3d/src/lights/FHemisphereLight.ts @@ -33,6 +33,4 @@ export class FHemisphereLight extends FLight { // Apply the transform this.applyTransform() } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index 739821b3..0e59bd50 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -71,8 +71,6 @@ export abstract class FLight extends FLightCore { this.__LOOK_AT__ = options.lookAt } - abstract onFrame(_delta: number): void - applyTransform(): void { // Set the position this.light.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) diff --git a/packages/3d/src/lights/FLightProbe.ts b/packages/3d/src/lights/FLightProbe.ts index b4ab89d8..9a35d5e4 100644 --- a/packages/3d/src/lights/FLightProbe.ts +++ b/packages/3d/src/lights/FLightProbe.ts @@ -43,6 +43,4 @@ export class FLightProbe extends FLight { } } } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/lights/FPointLight.ts b/packages/3d/src/lights/FPointLight.ts index 92b15f65..09532712 100644 --- a/packages/3d/src/lights/FPointLight.ts +++ b/packages/3d/src/lights/FPointLight.ts @@ -36,6 +36,4 @@ export class FPointLight extends FLight { } } } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/lights/FSpotLight.ts b/packages/3d/src/lights/FSpotLight.ts index 4d812e94..aa74a110 100644 --- a/packages/3d/src/lights/FSpotLight.ts +++ b/packages/3d/src/lights/FSpotLight.ts @@ -58,6 +58,4 @@ export class FSpotLight extends FLight { } } } - - onFrame(_delta: number): void {} } diff --git a/packages/3d/src/polyhedrons/FCapsule.ts b/packages/3d/src/polyhedrons/FCapsule.ts index 3809e3b0..903298e7 100644 --- a/packages/3d/src/polyhedrons/FCapsule.ts +++ b/packages/3d/src/polyhedrons/FCapsule.ts @@ -33,10 +33,6 @@ export class FCapsule extends FPolyhedron { } } - onFrame(_delta: number): void { - super.onFrame(_delta) - } - initRigidBody(options?: FRigidBodyOptions): void { super.initRigidBody({ shape: FShapes.CAPSULE, diff --git a/packages/3d/src/polyhedrons/FCuboid.ts b/packages/3d/src/polyhedrons/FCuboid.ts index 4541237b..516ae452 100644 --- a/packages/3d/src/polyhedrons/FCuboid.ts +++ b/packages/3d/src/polyhedrons/FCuboid.ts @@ -19,8 +19,4 @@ export class FCuboid extends FPolyhedron { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) } - - onFrame(_delta: number): void { - super.onFrame(_delta) - } } diff --git a/packages/3d/src/polyhedrons/FPolyhedron.ts b/packages/3d/src/polyhedrons/FPolyhedron.ts index 07031071..b591d94a 100644 --- a/packages/3d/src/polyhedrons/FPolyhedron.ts +++ b/packages/3d/src/polyhedrons/FPolyhedron.ts @@ -32,10 +32,6 @@ export abstract class FPolyhedron extends FComponent { } } - onFrame(_delta: number): void { - super.onFrame(_delta) - } - /** * Change the color of the polyhedron. * @param color The color of the polyhedron. diff --git a/packages/3d/src/polyhedrons/FSphere.ts b/packages/3d/src/polyhedrons/FSphere.ts index 1868648a..d862136a 100644 --- a/packages/3d/src/polyhedrons/FSphere.ts +++ b/packages/3d/src/polyhedrons/FSphere.ts @@ -33,10 +33,6 @@ export class FSphere extends FPolyhedron { } } - onFrame(_delta: number): void { - super.onFrame(_delta) - } - initRigidBody(options?: FRigidBodyOptions): void { super.initRigidBody({ shape: FShapes.SPHERE, diff --git a/packages/core/src/FComponent.ts b/packages/core/src/FComponent.ts index 31ba1b48..bd2001da 100644 --- a/packages/core/src/FComponent.ts +++ b/packages/core/src/FComponent.ts @@ -37,6 +37,11 @@ export abstract class FComponent { */ public __ID__: number + /** + * Callbacks for when a frame is rendered. + */ + public __CALLBACKS_ON_FRAME__: (() => void)[] = [] + /** * Callbacks for when the component is loaded (could be a texture, a 3D model, etc). */ @@ -82,17 +87,24 @@ export abstract class FComponent { /** * 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. + * The purpose of this method is to render the component, its mesh/sprite, and its properties. * @param delta The time since the last frame. */ - onFrame(delta: number): void { - // If a controller is attached, update it + frame(delta: number): void { + // If a controller is attached, call the frame method if (this.controller) { - this.controller.onFrame(delta) + this.controller.frame(delta) } } + /** + * Add a callback to be called every frame. + * @param callback The callback function. + */ + onFrame(callback: () => void) { + this.__CALLBACKS_ON_FRAME__.push(callback) + } + /** * Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). * @param callback The callback function. diff --git a/packages/core/src/FController.ts b/packages/core/src/FController.ts index 5c00609b..f500da29 100644 --- a/packages/core/src/FController.ts +++ b/packages/core/src/FController.ts @@ -24,9 +24,8 @@ export abstract class FController { /** * 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. + * The purpose of this method is to update the component transform based on the controller logic. * @param delta The time since the last frame. */ - abstract onFrame(delta: number): void + abstract frame(delta: number): void } diff --git a/packages/core/src/FGroup.ts b/packages/core/src/FGroup.ts index 23061fc2..7369f606 100644 --- a/packages/core/src/FGroup.ts +++ b/packages/core/src/FGroup.ts @@ -38,7 +38,7 @@ export abstract class FGroup { * Update all components in the group. * @param delta The time since the last frame. */ - onFrame(delta: number) { - this.components.forEach(c => c.onFrame(delta)) + frame(delta: number) { + this.components.forEach(c => c.frame(delta)) } } diff --git a/packages/core/src/FScene.ts b/packages/core/src/FScene.ts index 825c636b..0b0ecff3 100644 --- a/packages/core/src/FScene.ts +++ b/packages/core/src/FScene.ts @@ -45,17 +45,14 @@ export abstract class FScene { // Callbacks /** * Callbacks for when a frame is rendered. - * It is an array of functions that take the delta time as an argument. */ public __CALLBACKS_ON_FRAME__: ((delta: number) => void)[] = [] /** * Callbacks for when a component is added to the scene. - * It is an array of functions that take the component as an argument. */ public __CALLBACKS_ON_COMPONENT_ADDED__: ((component: FComponent) => void)[] = [] /** * Callbacks for when a component is remove from the scene. - * It is an array of functions that take the component as an argument. */ public __CALLBACKS_ON_COMPONENT_REMOVED__: ((component: FComponent) => void)[] = [] /** @@ -64,12 +61,10 @@ export abstract class FScene { public __CALLBACKS_ON_READY__: (() => void)[] = [] /** * Callbacks for when a light is added to the scene. - * It is an array of functions that take the light as an argument. */ public __CALLBACKS_ON_LIGHT_ADDED__: ((light: FLight) => void)[] = [] /** * Callbacks for when a light is added to the scene. - * It is an array of functions that take the light as an argument. */ public __CALLBACKS_ON_LIGHT_REMOVED__: ((light: FLight) => void)[] = [] From a245113133c3fdc3312bcfcad50c4a77c9d74cc4 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Thu, 17 Oct 2024 22:27:51 +0200 Subject: [PATCH 23/36] fix: game camera + add light getters/setters --- apps/playground-3d/src/classes/Duck.ts | 4 - apps/playground-3d/src/classes/GltfCube.ts | 4 - .../playground-3d/src/classes/MyCustomCube.ts | 4 - packages/3d/src/cameras/FGameCamera.ts | 37 ++-- packages/3d/src/cameras/FOrbitCamera.ts | 10 +- packages/3d/src/lights/FLight.ts | 167 +++++++++++++++++- 6 files changed, 188 insertions(+), 38 deletions(-) diff --git a/apps/playground-3d/src/classes/Duck.ts b/apps/playground-3d/src/classes/Duck.ts index 62a8b82f..6148c47d 100644 --- a/apps/playground-3d/src/classes/Duck.ts +++ b/apps/playground-3d/src/classes/Duck.ts @@ -7,8 +7,4 @@ export default class Duck extends FGLB { name: 'Duck', }) } - - onFrame(delta: number) { - super.onFrame(delta) - } } diff --git a/apps/playground-3d/src/classes/GltfCube.ts b/apps/playground-3d/src/classes/GltfCube.ts index 655f32ff..af36cf92 100644 --- a/apps/playground-3d/src/classes/GltfCube.ts +++ b/apps/playground-3d/src/classes/GltfCube.ts @@ -11,8 +11,4 @@ export default class GltfCube extends FGLTF { this.setRotationDegree({ x: 20, y: 0, z: 0 }) this.initRigidBody() } - - onFrame(delta: number) { - super.onFrame(delta) - } } diff --git a/apps/playground-3d/src/classes/MyCustomCube.ts b/apps/playground-3d/src/classes/MyCustomCube.ts index c8f7665c..4bb7ce55 100644 --- a/apps/playground-3d/src/classes/MyCustomCube.ts +++ b/apps/playground-3d/src/classes/MyCustomCube.ts @@ -8,8 +8,4 @@ export default class MyCustomCube extends FCuboid { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) } - - onFrame(delta: number) { - super.onFrame(delta) - } } diff --git a/packages/3d/src/cameras/FGameCamera.ts b/packages/3d/src/cameras/FGameCamera.ts index 45a39c56..15b38a01 100644 --- a/packages/3d/src/cameras/FGameCamera.ts +++ b/packages/3d/src/cameras/FGameCamera.ts @@ -19,7 +19,7 @@ import type { FAttachedCameraOptions } from './FAttachedCamera' */ export class FGameCamera extends FOrbitCamera { // Previous position of the attached component (at each frame) - private previousModelPosition: { x: number, y: number, z: number } + private previousComponentPosition: { x: number, y: number, z: number } // Flag to track if the pointer is locked isPointerLocked: boolean = false // Last mouse move event @@ -28,11 +28,11 @@ export class FGameCamera extends FOrbitCamera { constructor(scene: FScene, options: FAttachedCameraOptions) { super(scene, options) // Clone the model's position - this.previousModelPosition = options.target.transform.position - this.setPosition({ x: 0, y: 20, z: 20 }) + this.previousComponentPosition = structuredClone(options.target.position) + this.setPosition({ x: 0, y: 8, z: 8 }) this.controls.enableDamping = true - this.controls.maxDistance = 5 + this.controls.maxDistance = 10 /** * Add event listeners @@ -58,14 +58,17 @@ export class FGameCamera extends FOrbitCamera { if (!this.attachedComponent.__MESH__) return - // Calculate the difference between the previous and current position of the attached model - const positionDifference = this.attachedComponent.__MESH__.position.clone().sub(this.previousModelPosition) - // Move the camera by the same amount - this.position.x += positionDifference.x - this.position.y += positionDifference.y - this.position.z += positionDifference.z - // Update the previous position - this.previousModelPosition = this.attachedComponent.__MESH__.position.clone() + // Move the camera by the difference in the attached component's position + const componentPosition = this.attachedComponent.__MESH__.position + const positionDelta = { + x: componentPosition.x - this.previousComponentPosition.x, + y: componentPosition.y - this.previousComponentPosition.y, + z: componentPosition.z - this.previousComponentPosition.z, + } + this.__CAMERA__.position.x += positionDelta.x + this.__CAMERA__.position.y += positionDelta.y + this.__CAMERA__.position.z += positionDelta.z + this.previousComponentPosition = structuredClone(componentPosition) // Move the camera based on mouse movement if pointer is locked if (this.isPointerLocked && this.lastMouseMoveEvent) { @@ -74,12 +77,10 @@ export class FGameCamera extends FOrbitCamera { const movementY = this.lastMouseMoveEvent.movementY || 0 // Rotate the camera based on mouse movement - /** - * Let's be honest, I don't know why this works. - * But it does. - */ - this.__CAMERA__.translateX(-movementX * 0.01) - this.__CAMERA__.translateY(movementY * 0.01) + // Let's be honest, I don't know why this works. + // But it does + this.__CAMERA__.translateX(-movementX * 0.02) + this.__CAMERA__.translateY(movementY * 0.02) this.lastMouseMoveEvent = undefined } diff --git a/packages/3d/src/cameras/FOrbitCamera.ts b/packages/3d/src/cameras/FOrbitCamera.ts index 8fcf6bd8..01ef46d8 100644 --- a/packages/3d/src/cameras/FOrbitCamera.ts +++ b/packages/3d/src/cameras/FOrbitCamera.ts @@ -1,3 +1,4 @@ +import * as THREE from 'three' import { OrbitControls } from 'three/addons/controls/OrbitControls.js' import type { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' @@ -34,10 +35,11 @@ export class FOrbitCamera extends FCamera { } frame(_delta: number): void { - if (this.attachedComponent.__MESH__ === undefined) - return - - this.controls.target = this.attachedComponent.__MESH__.position + this.controls.target = new THREE.Vector3( + this.attachedComponent.transform.position.x, + this.attachedComponent.transform.position.y, + this.attachedComponent.transform.position.z, + ) this.controls.update() } diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index 0e59bd50..de4bc8ea 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -84,22 +84,181 @@ export abstract class FLight extends FLightCore { } } - set color(color: THREE.ColorRepresentation) { - this.light.color.set(color) + setPosition(position: { x: number, y: number, z: number }): void { + this.light.position.set(position.x, position.y, position.z) + this.transform.position = position + } + + setRotation(rotation: { x: number, y: number, z: number }): void { + this.light.rotation.set(rotation.x, rotation.y, rotation.z) + this.transform.rotation = rotation + } + + setRotationDegree(rotationDegree: { x: number, y: number, z: number }): void { + const rotation = { + x: THREE.MathUtils.degToRad(rotationDegree.x), + y: THREE.MathUtils.degToRad(rotationDegree.y), + z: THREE.MathUtils.degToRad(rotationDegree.z), + } + this.light.rotation.set(rotation.x, rotation.y, rotation.z) + this.transform.rotation = rotation + } + + setScale(scale: { x: number, y: number, z: number }): void { + this.light.scale.set(scale.x, scale.y, scale.z) + this.transform.scale = scale + } + + // Setters & Getters + + get position(): { x: number, y: number, z: number } { + return this.transform.position + } + + set position(position: { x: number, y: number, z: number }) { + this.setPosition(position) + } + + get x(): number { + return this.transform.position.x + } + + set x(x: number) { + this.position = { x, y: this.y, z: this.z } + } + + get y(): number { + return this.transform.position.y + } + + set y(y: number) { + this.position = { x: this.x, y, z: this.z } + } + + get z(): number { + return this.transform.position.z + } + + set z(z: number) { + this.position = { x: this.x, y: this.y, z } + } + + get rotation(): { x: number, y: number, z: number } { + return this.transform.rotation + } + + set rotation(rotation: { x: number, y: number, z: number }) { + this.setRotation(rotation) + } + + get rotationX(): number { + return this.transform.rotation.x + } + + set rotationX(x: number) { + this.rotation = { x, y: this.rotationY, z: this.rotationZ } + } + + get rotationY(): number { + return this.transform.rotation.y + } + + set rotationY(y: number) { + this.rotation = { x: this.rotationX, y, z: this.rotationZ } + } + + get rotationZ(): number { + return this.transform.rotation.z + } + + set rotationZ(z: number) { + this.rotation = { x: this.rotationX, y: this.rotationY, z } + } + + get rotationDegree(): { x: number, y: number, z: number } { + return { + x: THREE.MathUtils.radToDeg(this.transform.rotation.x), + y: THREE.MathUtils.radToDeg(this.transform.rotation.y), + z: THREE.MathUtils.radToDeg(this.transform.rotation.z), + } + } + + set rotationDegree(rotationDegree: { x: number, y: number, z: number }) { + this.setRotationDegree(rotationDegree) + } + + get rotationDegreeX(): number { + return THREE.MathUtils.radToDeg(this.transform.rotation.x) + } + + set rotationDegreeX(x: number) { + this.rotationDegree = { x, y: this.rotationDegreeY, z: this.rotationDegreeZ } + } + + get rotationDegreeY(): number { + return THREE.MathUtils.radToDeg(this.transform.rotation.y) + } + + set rotationDegreeY(y: number) { + this.rotationDegree = { x: this.rotationDegreeX, y, z: this.rotationDegreeZ } + } + + get rotationDegreeZ(): number { + return THREE.MathUtils.radToDeg(this.transform.rotation.z) + } + + set rotationDegreeZ(z: number) { + this.rotationDegree = { x: this.rotationDegreeX, y: this.rotationDegreeY, z } + } + + get scale(): { x: number, y: number, z: number } { + return this.transform.scale + } + + set scale(scale: { x: number, y: number, z: number }) { + this.setScale(scale) + } + + get scaleX(): number { + return this.transform.scale.x + } + + set scaleX(x: number) { + this.scale = { x, y: this.scaleY, z: this.scaleZ } + } + + get scaleY(): number { + return this.transform.scale.y + } + + set scaleY(y: number) { + this.scale = { x: this.scaleX, y, z: this.scaleZ } + } + + get scaleZ(): number { + return this.transform.scale.z + } + + set scaleZ(z: number) { + this.scale = { x: this.scaleX, y: this.scaleY, z } } get color(): THREE.Color { return this.light.color } - set intensity(intensity: number) { - this.light.intensity = intensity + set color(color: THREE.ColorRepresentation) { + this.light.color.set(color) } get intensity(): number { return this.light.intensity } + set intensity(intensity: number) { + this.light.intensity = intensity + } + get lookAt(): { x: number, y: number, z: number } { return this.__LOOK_AT__ } From 0632acf838c959b078dcae2173e1056dbd469daa Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Sun, 20 Oct 2024 03:31:16 +0200 Subject: [PATCH 24/36] feat(3d): start refactoring transform reactivity system --- packages/2d/src/cameras/FCamera.ts | 44 +- packages/2d/src/core/FComponent.ts | 28 +- packages/2d/src/core/FTransform.ts | 10 + packages/2d/src/lights/FLight.ts | 74 +++- packages/3d/src/cameras/FAttachedCamera.ts | 13 +- packages/3d/src/cameras/FCamera.ts | 189 ++------ packages/3d/src/cameras/FGameCamera.ts | 5 +- packages/3d/src/cameras/FOrbitCamera.ts | 7 +- packages/3d/src/cameras/FPointerLockCamera.ts | 6 +- .../src/controllers/FCharacterController.ts | 3 +- .../src/controllers/FCharacterControllerD.ts | 3 +- .../src/controllers/FCharacterControllerK.ts | 3 +- .../src/controllers/FCharacterControllerKP.ts | 3 +- .../src/controllers/FCharacterControllerKV.ts | 3 +- packages/3d/src/core/FCollider.ts | 323 ++++---------- packages/3d/src/core/FComponent.ts | 406 +++--------------- packages/3d/src/core/FRigidBody.ts | 297 ++++--------- packages/3d/src/core/FScene.ts | 5 +- packages/3d/src/core/FSensor.ts | 48 +++ packages/3d/src/core/FTransform.ts | 352 ++++++++++++++- packages/3d/src/index.ts | 2 + packages/3d/src/lights/FAmbientLight.ts | 3 +- packages/3d/src/lights/FDirectionalLight.ts | 3 +- packages/3d/src/lights/FHemisphereLight.ts | 3 +- packages/3d/src/lights/FLight.ts | 195 ++------- packages/3d/src/lights/FLightProbe.ts | 3 +- packages/3d/src/lights/FPointLight.ts | 3 +- packages/3d/src/lights/FSpotLight.ts | 3 +- packages/3d/src/polyhedrons/FCapsule.ts | 17 - packages/3d/src/polyhedrons/FSphere.ts | 17 - packages/3d/src/types/FVector3.ts | 17 + packages/core/src/FCamera.ts | 5 - packages/core/src/FComponent.ts | 11 +- 33 files changed, 865 insertions(+), 1239 deletions(-) create mode 100644 packages/3d/src/core/FSensor.ts create mode 100644 packages/3d/src/types/FVector3.ts diff --git a/packages/2d/src/cameras/FCamera.ts b/packages/2d/src/cameras/FCamera.ts index 8ef67e76..6eb964e5 100644 --- a/packages/2d/src/cameras/FCamera.ts +++ b/packages/2d/src/cameras/FCamera.ts @@ -1,5 +1,6 @@ import { FCamera as FCameraCore } from '@fibbojs/core' import type { FScene } from '../core/FScene' +import { FTransform } from '../core/FTransform' export interface FCameraOptions { position?: { x: number, y: number } @@ -20,11 +21,12 @@ export abstract class FCamera extends FCameraCore { */ scene: FScene - // FTransform isn't used as a 2D camera doesn't need scale or rotation /** - * Position of the camera. + * Transform of the camera. + * It is used to store the position of the camera. + * The scale and rotation of the transform are not used. */ - position: { x: number, y: number } + transform: FTransform /** * Create a new 2D camera. @@ -47,7 +49,9 @@ export abstract class FCamera extends FCameraCore { throw new Error('FibboError: FCamera requires position') // Store options - this.position = options.position + this.transform = new FTransform({ + position: options.position, + }) } abstract __ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__(): void @@ -55,4 +59,36 @@ export abstract class FCamera extends FCameraCore { setZoom(zoom: number): void { this.scene.viewport.setZoom(zoom) } + + setPosition(position: { x: number, y: number }): void { + this.transform.position = position + this.scene.viewport.x = position.x + this.scene.viewport.y = position.y + } + + // Setters & Getters + + get position() { + return this.transform.position + } + + set position(position: { x: number, y: number }) { + this.setPosition(position) + } + + get x() { + return this.transform.position.x + } + + set x(x: number) { + this.setPosition({ x, y: this.y }) + } + + get y() { + return this.transform.position.y + } + + set y(y: number) { + this.setPosition({ x: this.x, y }) + } } diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 11491e0f..d307f5d1 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -199,15 +199,15 @@ export abstract class FComponent extends FComponentCore { /** * Set the rotation of the component in radians. - * @param r The rotation in radians. + * @param rotation The rotation in radians. * @example * ```ts * component.setRotation(Math.PI / 2) * ``` */ - setRotation(r: number): void { - this.transform.rotation = r - this.__CONTAINER__.rotation = r + setRotation(rotation: number): void { + this.transform.rotation = rotation + this.__CONTAINER__.rotation = rotation // If a rigidBody exists, update its rotation if (this.rigidBody) this.rigidBody.updateRotation() @@ -221,14 +221,14 @@ export abstract class FComponent extends FComponentCore { /** * Set the rotation of the component in degrees. - * @param r The rotation in degrees. + * @param rotation The rotation in degrees. * @example * ```ts * component.setRotationDegree(90) * ``` */ - setRotationDegree(r: number): void { - this.setRotation(r * (Math.PI / 180)) + setRotationDegree(rotation: number): void { + this.setRotation(rotation * (Math.PI / 180)) } /** @@ -348,14 +348,14 @@ export abstract class FComponent extends FComponentCore { return super.onCollisionWith(classOrObject, callback) } - // Setters & getters for transform properties + // Setters & Getters get position(): { x: number, y: number } { return this.transform.position } - set position(p: { x: number, y: number }) { - this.setPosition(p) + set position(position: { x: number, y: number }) { + this.setPosition(position) } get x(): number { @@ -378,16 +378,16 @@ export abstract class FComponent extends FComponentCore { return this.transform.rotation } - set rotation(r: number) { - this.setRotation(r) + set rotation(rotation: number) { + this.setRotation(rotation) } get rotationDegree(): number { return this.transform.rotation * (180 / Math.PI) } - set rotationDegree(r: number) { - this.setRotationDegree(r) + set rotationDegree(rotation: number) { + this.setRotationDegree(rotation) } get scale(): { x: number, y: number } { diff --git a/packages/2d/src/core/FTransform.ts b/packages/2d/src/core/FTransform.ts index df3da3a8..7d589154 100644 --- a/packages/2d/src/core/FTransform.ts +++ b/packages/2d/src/core/FTransform.ts @@ -57,4 +57,14 @@ export class FTransform { this.scale = options.scale this.rotation = options.rotationDegree ? options.rotationDegree * (Math.PI / 180) : options.rotation ?? 0 } + + // Setters & Getters + + get rotationDegree() { + return this.rotation * (180 / Math.PI) + } + + set rotationDegree(rotation: number) { + this.rotation = rotation * (Math.PI / 180) + } } diff --git a/packages/2d/src/lights/FLight.ts b/packages/2d/src/lights/FLight.ts index 980a29a3..07654174 100644 --- a/packages/2d/src/lights/FLight.ts +++ b/packages/2d/src/lights/FLight.ts @@ -70,13 +70,73 @@ export abstract class FLight extends FLightCore { this.__LOOK_AT__ = options.lookAt } - applyTransform(): void { - // Set the position - this.light.position.set(this.transform.position.x, this.transform.position.y) - // Set the scale - this.light.scale.set(this.transform.scale.x, this.transform.scale.y) - // Set the rotation - this.light.rotation = this.transform.rotation + setPosition(position: { x: number, y: number }): void { + this.transform.position = position + this.light.position.set(position.x, position.y) + } + + setRotation(rotation: number): void { + this.transform.rotation = rotation + this.light.rotation = rotation + } + + setRotationDegree(rotationDegree: number): void { + this.setRotation(rotationDegree * (Math.PI / 180)) + } + + setScale(scale: { x: number, y: number }): void { + this.transform.scale = scale + this.light.scale.set(scale.x, scale.y) + } + + // Setters & Getters + + get position(): { x: number, y: number } { + return this.transform.position + } + + set position(position: { x: number, y: number }) { + this.setPosition(position) + } + + get rotation(): number { + return this.transform.rotation + } + + set rotation(rotation: number) { + this.setRotation(rotation) + } + + get rotationDegree(): number { + return this.transform.rotationDegree + } + + set rotationDegree(rotationDegree: number) { + this.setRotationDegree(rotationDegree) + } + + get scale(): { x: number, y: number } { + return this.transform.scale + } + + set scale(scale: { x: number, y: number }) { + this.setScale(scale) + } + + get scaleX(): number { + return this.transform.scale.x + } + + set scaleX(scaleX: number) { + this.scale = { x: scaleX, y: this.scaleY } + } + + get scaleY(): number { + return this.transform.scale.y + } + + set scaleY(scaleY: number) { + this.setScale({ x: this.scaleX, y: scaleY }) } set color(color: number) { diff --git a/packages/3d/src/cameras/FAttachedCamera.ts b/packages/3d/src/cameras/FAttachedCamera.ts index ec92a8e9..fb07139a 100644 --- a/packages/3d/src/cameras/FAttachedCamera.ts +++ b/packages/3d/src/cameras/FAttachedCamera.ts @@ -1,5 +1,6 @@ import type { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' import type { FCameraOptions } from './FCamera' import { FCamera } from './FCamera' @@ -26,7 +27,7 @@ export class FAttachedCamera extends FCamera { // Component that the camera is attached to attachedComponent: FComponent // Offset from the component's position - offset: { x: number, y: number, z: number } = { x: 0, y: 5, z: 5 } + offset: FVector3 = { x: 0, y: 5, z: 5 } /** * @param scene Scene that the camera is in @@ -42,9 +43,9 @@ export class FAttachedCamera extends FCamera { return // Position the camera at the model's position + offset - this.position.x = this.attachedComponent.__MESH__.position.x + this.offset.x - this.position.y = this.attachedComponent.__MESH__.position.y + this.offset.y - this.position.z = this.attachedComponent.__MESH__.position.z + this.offset.z + this.transform.x = this.attachedComponent.__MESH__.position.x + this.offset.x + this.transform.y = this.attachedComponent.__MESH__.position.y + this.offset.y + this.transform.z = this.attachedComponent.__MESH__.position.z + this.offset.z // Make the camera look at the model this.lookAt({ x: this.attachedComponent.__MESH__.position.x, @@ -52,8 +53,4 @@ export class FAttachedCamera extends FCamera { z: this.attachedComponent.__MESH__.position.z, }) } - - setPosition(position: { x: number, y: number, z: number }): void { - super.setPosition(position) - } } diff --git a/packages/3d/src/cameras/FCamera.ts b/packages/3d/src/cameras/FCamera.ts index f5d17cbf..61422e05 100644 --- a/packages/3d/src/cameras/FCamera.ts +++ b/packages/3d/src/cameras/FCamera.ts @@ -3,6 +3,7 @@ import { FCamera as FCameraCore } from '@fibbojs/core' import type { FTransformOptions } from '../core/FTransform' import { FTransform } from '../core/FTransform' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' export interface FCameraOptions extends FTransformOptions {} @@ -46,6 +47,7 @@ export abstract class FCamera extends FCameraCore { // Store transform this.transform = new FTransform({ + component: this, position: options.position, rotation: options.rotation, rotationDegree: options.rotationDegree, @@ -58,54 +60,38 @@ export abstract class FCamera extends FCameraCore { } /** - * Set the position of the camera. + * Update the position of the camera according to the transform. + * This method should be called after updating the transform properties. */ - setPosition(position: { x: number, y: number, z: number }): void { - this.__CAMERA__.position.set(position.x, position.y, position.z) - this.transform.position = position - } - - /** - * Set the scale of the camera. - */ - setScale(scale: { x: number, y: number, z: number }): void { - this.__CAMERA__.scale.set(scale.x, scale.y, scale.z) - this.transform.scale = scale - } - - /** - * Set the rotation of the camera. - */ - setRotation(rotation: { x: number, y: number, z: number }): void { - this.__CAMERA__.rotation.set(rotation.x, rotation.y, rotation.z) - this.transform.rotation = rotation + __UPDATE_POSITION__(): void { + this.__CAMERA__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) } /** - * Set the rotation of the camera in degrees. + * Update the rotation of the camera according to the transform. + * This method should be called after updating the transform properties. */ - setRotationDegree(rotation: { x: number, y: number, z: number }): void { - const rotationRad = { - x: THREE.MathUtils.degToRad(rotation.x), - y: THREE.MathUtils.degToRad(rotation.y), - z: THREE.MathUtils.degToRad(rotation.z), - } - this.__CAMERA__.rotation.set(rotationRad.x, rotationRad.y, rotationRad.z) - this.transform.rotation = rotationRad + __UPDATE_ROTATION__(): void { + this.__CAMERA__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) } /** - * Set the zoom of the camera. + * Update the scale of the camera according to the transform. + * This method should be called after updating the transform properties. + * This method does not make sense for cameras, but it is implemented for consistency. */ - setZoom(zoom: number): void { - this.__CAMERA__.zoom = zoom - this.__CAMERA__.updateProjectionMatrix() + __UPDATE_SCALE__(): void { + this.__CAMERA__.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) } /** - * Look at a point in the scene. + * Make the camera look at a target. + * @param target The target to look at. + * @param target.x The x coordinate of the target. + * @param target.y The y coordinate of the target. + * @param target.z The z coordinate of the target. */ - lookAt(target: { x: number, y: number, z: number }): void { + lookAt(target: FVector3) { this.__CAMERA__.lookAt(target.x, target.y, target.z) } @@ -121,141 +107,14 @@ export abstract class FCamera extends FCameraCore { return direction } - // Setters & getters - - get position() { - return this.transform.position - } - - set position(position: { x: number, y: number, z: number }) { - this.setPosition(position) - } - - get x() { - return this.transform.position.x - } - - set x(x: number) { - this.setPosition({ x, y: this.y, z: this.z }) - } - - get y() { - return this.transform.position.y - } - - set y(y: number) { - this.setPosition({ x: this.x, y, z: this.z }) - } - - get z() { - return this.transform.position.z - } - - set z(z: number) { - this.setPosition({ x: this.x, y: this.y, z }) - } - - get rotation() { - return this.transform.rotation - } - - set rotation(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationX() { - return this.transform.rotation.x - } - - set rotationX(x: number) { - this.setRotation({ x, y: this.rotationY, z: this.rotationZ }) - } - - get rotationY() { - return this.transform.rotation.y - } - - set rotationY(y: number) { - this.setRotation({ x: this.rotationX, y, z: this.rotationZ }) - } - - get rotationZ() { - return this.transform.rotation.z - } - - set rotationZ(z: number) { - this.setRotation({ x: this.rotationX, y: this.rotationY, z }) - } - - get rotationDegree() { - return this.transform.rotationDegree - } - - set rotationDegree(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationDegreeX() { - return this.transform.rotationDegree.x - } - - set rotationDegreeX(x: number) { - this.setRotationDegree({ x, y: this.rotationDegreeY, z: this.rotationDegreeZ }) - } - - get rotationDegreeY() { - return this.transform.rotationDegree.y - } - - set rotationDegreeY(y: number) { - this.setRotationDegree({ x: this.rotationDegreeX, y, z: this.rotationDegreeZ }) - } - - get rotationDegreeZ() { - return this.transform.rotationDegree.z - } - - set rotationDegreeZ(z: number) { - this.setRotationDegree({ x: this.rotationDegreeX, y: this.rotationDegreeY, z }) - } - - get scale() { - return this.transform.scale - } - - set scale(scale: { x: number, y: number, z: number }) { - this.setScale(scale) - } - - get scaleX() { - return this.transform.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.scaleY, z: this.scaleZ }) - } - - get scaleY() { - return this.transform.scale.y - } - - set scaleY(y: number) { - this.setScale({ x: this.scaleX, y, z: this.scaleZ }) - } - - get scaleZ() { - return this.transform.scale.z - } - - set scaleZ(z: number) { - this.setScale({ x: this.scaleX, y: this.scaleY, z }) - } + // Setters & Getters get zoom() { return this.__CAMERA__.zoom } set zoom(zoom: number) { - this.setZoom(zoom) + this.__CAMERA__.zoom = zoom + this.__CAMERA__.updateProjectionMatrix() } } diff --git a/packages/3d/src/cameras/FGameCamera.ts b/packages/3d/src/cameras/FGameCamera.ts index 15b38a01..5f8c4dff 100644 --- a/packages/3d/src/cameras/FGameCamera.ts +++ b/packages/3d/src/cameras/FGameCamera.ts @@ -1,4 +1,5 @@ import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' import { FOrbitCamera } from './FOrbitCamera' import type { FAttachedCameraOptions } from './FAttachedCamera' @@ -19,7 +20,7 @@ import type { FAttachedCameraOptions } from './FAttachedCamera' */ export class FGameCamera extends FOrbitCamera { // Previous position of the attached component (at each frame) - private previousComponentPosition: { x: number, y: number, z: number } + private previousComponentPosition: FVector3 // Flag to track if the pointer is locked isPointerLocked: boolean = false // Last mouse move event @@ -28,7 +29,7 @@ export class FGameCamera extends FOrbitCamera { constructor(scene: FScene, options: FAttachedCameraOptions) { super(scene, options) // Clone the model's position - this.previousComponentPosition = structuredClone(options.target.position) + this.previousComponentPosition = structuredClone(options.target.transform.position) this.setPosition({ x: 0, y: 8, z: 8 }) this.controls.enableDamping = true diff --git a/packages/3d/src/cameras/FOrbitCamera.ts b/packages/3d/src/cameras/FOrbitCamera.ts index 01ef46d8..f4f8ee0c 100644 --- a/packages/3d/src/cameras/FOrbitCamera.ts +++ b/packages/3d/src/cameras/FOrbitCamera.ts @@ -2,6 +2,7 @@ import * as THREE from 'three' import { OrbitControls } from 'three/addons/controls/OrbitControls.js' import type { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' import { FCamera } from './FCamera' import type { FAttachedCameraOptions } from './FAttachedCamera' @@ -43,12 +44,12 @@ export class FOrbitCamera extends FCamera { this.controls.update() } - setPosition(position: { x: number, y: number, z: number }): void { - super.setPosition({ + setPosition(position: FVector3): void { + this.transform.position = { x: this.attachedComponent.transform.position.x + position.x, y: this.attachedComponent.transform.position.y + position.y, z: this.attachedComponent.transform.position.z + position.z, - }) + } // Set the target of the camera to the attached model this.lookAt(this.attachedComponent.transform.position) } diff --git a/packages/3d/src/cameras/FPointerLockCamera.ts b/packages/3d/src/cameras/FPointerLockCamera.ts index bc49a497..1a3d34a5 100644 --- a/packages/3d/src/cameras/FPointerLockCamera.ts +++ b/packages/3d/src/cameras/FPointerLockCamera.ts @@ -45,8 +45,8 @@ export class FPointerLockCamera extends FCamera { return // Position the camera at the model's position + offset - this.position.x = this.attachedComponent.__MESH__.position.x - this.position.y = this.attachedComponent.__MESH__.position.y - this.position.z = this.attachedComponent.__MESH__.position.z + this.transform.x = this.attachedComponent.__MESH__.position.x + this.transform.y = this.attachedComponent.__MESH__.position.y + this.transform.z = this.attachedComponent.__MESH__.position.z } } diff --git a/packages/3d/src/controllers/FCharacterController.ts b/packages/3d/src/controllers/FCharacterController.ts index b31a54a8..e500e65e 100644 --- a/packages/3d/src/controllers/FCharacterController.ts +++ b/packages/3d/src/controllers/FCharacterController.ts @@ -3,6 +3,7 @@ import RAPIER from '@dimforge/rapier3d' import * as THREE from 'three' import type { FScene } from '../core/FScene' import { FShapes } from '../types/FShapes' +import { FSensor } from '../core/FSensor' import type { FControllerOptions } from './FController' import { FController } from './FController' @@ -109,7 +110,7 @@ export abstract class FCharacterController extends FController { }) // Initialize a sensor - this.component.initSensor({ + this.component.sensor = new FSensor(this.component, { shape: FShapes.CAPSULE, scale: { x: 1.1, y: 1.1, z: 1.1 }, }) diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index 7727a708..deb7a5c8 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -2,6 +2,7 @@ import * as THREE from 'three' import RAPIER from '@dimforge/rapier3d' import { FKeyboard } from '@fibbojs/event' import type { FScene } from '../core/FScene' +import { FRigidBody } from '../core/FRigidBody' import type { FCharacterControllerOptions } from './FCharacterController' import { FCharacterController } from './FCharacterController' @@ -29,7 +30,7 @@ export class FCharacterControllerD extends FCharacterController { }) // Initialize the rigidBody - this.component.initRigidBody({ + this.component.rigidBody = new FRigidBody(this.component, { rigidBodyType: RAPIER.RigidBodyType.Dynamic, lockRotations: true, ...options, diff --git a/packages/3d/src/controllers/FCharacterControllerK.ts b/packages/3d/src/controllers/FCharacterControllerK.ts index 784e604c..c8354403 100644 --- a/packages/3d/src/controllers/FCharacterControllerK.ts +++ b/packages/3d/src/controllers/FCharacterControllerK.ts @@ -2,6 +2,7 @@ import * as THREE from 'three' import RAPIER from '@dimforge/rapier3d' import { FKeyboard } from '@fibbojs/event' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' import type { FCharacterControllerOptions } from './FCharacterController' import { FCharacterController } from './FCharacterController' @@ -44,7 +45,7 @@ export abstract class FCharacterControllerK extends FCharacterController { /** * Return the corrected movements for the current frame. */ - getCorrectedMovements(): { x: number, y: number, z: number } { + getCorrectedMovements(): FVector3 { let worldDirection = new THREE.Vector3(0, 0, 0) // Compute the movement direction worldDirection.x = this.inputs.left ? 1 : this.inputs.right ? -1 : 0 diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index 13957b60..0c125bd0 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -1,5 +1,6 @@ import RAPIER from '@dimforge/rapier3d' import type { FScene } from '../core/FScene' +import { FRigidBody } from '../core/FRigidBody' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -22,7 +23,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { super(scene, options) // Initialize the rigidBody - this.component.initRigidBody({ + this.component.rigidBody = new FRigidBody(this.component, { rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, ...options, }) diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index 661cd1e0..78d974ac 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -1,5 +1,6 @@ import RAPIER from '@dimforge/rapier3d' import type { FScene } from '../core/FScene' +import { FRigidBody } from '../core/FRigidBody' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -22,7 +23,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { super(scene, options) // Initialize the rigidBody - this.component.initRigidBody({ + this.component.rigidBody = new FRigidBody(this.component, { rigidBodyType: RAPIER.RigidBodyType.KinematicVelocityBased, ...options, }) diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index 3d4d043b..d6c4f599 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -1,14 +1,16 @@ import * as THREE from 'three' import * as RAPIER from '@dimforge/rapier3d' import { FShapes } from '../types/FShapes' +import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' import type { FRigidBody } from './FRigidBody' +import { FTransform } from './FTransform' export interface FColliderOptions { - position?: { x: number, y: number, z: number } - scale?: { x: number, y: number, z: number } - rotation?: { x: number, y: number, z: number } - rotationDegree?: { x: number, y: number, z: number } + position?: FVector3 + scale?: FVector3 + rotation?: FVector3 + rotationDegree?: FVector3 shape?: FShapes rigidBody?: FRigidBody sensor?: boolean @@ -27,21 +29,25 @@ export class FCollider { * Position Offset for the collider. * This is used to adjust the collider position relative to the component. */ - __COLLIDER_POSITION_OFFSET__: { x: number, y: number, z: number } + __POSITION_OFFSET__: FVector3 /** * Rotation Offset for the collider. * This is used to adjust the collider position relative to the component. */ - __COLLIDER_ROTATION_OFFSET__: { x: number, y: number, z: number } + __ROTATION_OFFSET__: FVector3 /** * Scale Offset for the collider. * This is used to adjust the collider scale relative to the component. */ - __COLLIDER_SCALE_OFFSET__: { x: number, y: number, z: number } + __SCALE_OFFSET__: FVector3 /** * The component the collider is attached to. */ component: FComponent + /** + * The transform of the rigidBody. + */ + transform: FTransform /** * The shape of the collider. */ @@ -98,9 +104,9 @@ export class FCollider { } // Store the options - this.__COLLIDER_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } - this.__COLLIDER_ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } - this.__COLLIDER_SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y, z: options.scale.z } + this.__POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } + this.__ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } + this.__SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y, z: options.scale.z } this.component = component this.shape = options.shape @@ -179,254 +185,93 @@ export class FCollider { colliderDesc.setActiveCollisionTypes(RAPIER.ActiveCollisionTypes.ALL) } + // Create the transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + scale: options.scale, + }) + // Create the collider this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) } /** - * Set the position of the collider. - * @param position The new position of the collider. - * @param position.x The new x position of the collider. - * @param position.y The new y position of the collider. - * @param position.z The new z position of the collider. - */ - setPosition(position: { x: number, y: number, z: number }) { - this.__COLLIDER__.setTranslation(position) - } - - /** - * Set the rotation of the collider. - * @param rotation The new rotation of the collider. - * @param rotation.x The new x rotation of the collider. - * @param rotation.y The new y rotation of the collider. - * @param rotation.z The new z rotation of the collider. + * Update the position of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the position update. + * This means the offset will be added to the position. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - setRotation(rotation: { x: number, y: number, z: number }) { - this.__COLLIDER__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z))) - } - - /** - * Set the rotation of the collider in degrees. - * @param rotation The new rotation of the collider in degrees. - * @param rotation.x The new x rotation of the collider in degrees. - * @param rotation.y The new y rotation of the collider in degrees. - * @param rotation.z The new z rotation of the collider in degrees. - */ - setRotationDegree(rotation: { x: number, y: number, z: number }) { - this.setRotation({ - x: THREE.MathUtils.degToRad(rotation.x), - y: THREE.MathUtils.degToRad(rotation.y), - z: THREE.MathUtils.degToRad(rotation.z), - }) - } - - /** - * Set the scale of the collider. - * @param scale The new scale of the collider. - * @param scale.x The new x scale of the collider. - * @param scale.y The new y scale of the collider. - * @param scale.z The new z scale of the collider. - */ - setScale(scale: { x: number, y: number, z: number }) { - // If the collider is a cuboid, update its half extents - if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2, scale.z / 2)) + __UPDATE_POSITION__(initiator: boolean = false): void { + const newPosition = { + x: this.component.transform.position.x, + y: this.component.transform.position.y, + z: this.component.transform.position.z, } - // If the collider is a ball, update its radius - else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(scale.x, scale.y, scale.z) / 2)) + // If the collider is the initiator, propagate the position update + if (initiator) { + this.component.__UPDATE_POSITION__() + this.component.sensor?.__UPDATE_POSITION__() } + // Else, it was propagated to the collider, so add the offset + else { + newPosition.x += this.__POSITION_OFFSET__.x + newPosition.y += this.__POSITION_OFFSET__.y + newPosition.z += this.__POSITION_OFFSET__.z + } + // Update the collider position + this.__COLLIDER__.setTranslation(newPosition) } /** - * Update the position of the collider according to its component's position. - * This takes into account the position offset. - */ - updatePosition() { - this.setPosition({ - x: this.component.transform.position.x + this.__COLLIDER_POSITION_OFFSET__.x, - y: this.component.transform.position.y + this.__COLLIDER_POSITION_OFFSET__.y, - z: this.component.transform.position.z + this.__COLLIDER_POSITION_OFFSET__.z, - }) - } - - /** - * Update the rotation of the collider according to its component's rotation. - * This takes into account the rotation offset. + * Update the rotation of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the rotation update. + * This means the offset will be added to the rotation. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - updateRotation() { - this.setRotation({ - x: this.component.transform.rotation.x + this.__COLLIDER_ROTATION_OFFSET__.x, - y: this.component.transform.rotation.y + this.__COLLIDER_ROTATION_OFFSET__.y, - z: this.component.transform.rotation.z + this.__COLLIDER_ROTATION_OFFSET__.z, - }) + __UPDATE_ROTATION__(initiator: boolean = false): void { + const newRotation = new THREE.Euler( + this.component.transform.rotation.x, + this.component.transform.rotation.y, + this.component.transform.rotation.z, + ) + // If the collider is the initiator, propagate the rotation update + if (initiator) { + this.component.__UPDATE_ROTATION__() + this.component.sensor?.__UPDATE_ROTATION__() + } + // Else, it was propagated to the collider, so add the offset + else { + newRotation.x += this.__ROTATION_OFFSET__.x + newRotation.y += this.__ROTATION_OFFSET__.y + newRotation.z += this.__ROTATION_OFFSET__.z + } + // Update the collider rotation + this.__COLLIDER__.setRotation(new THREE.Quaternion().setFromEuler(newRotation)) } /** - * Update the scale of the collider according to its component's scale. - * This takes into account the scale offset. + * Update the scale of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the scale update. + * This means the offset will be added to the scale. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - updateScale() { - this.setScale({ - x: this.component.transform.scale.x * this.__COLLIDER_SCALE_OFFSET__.x, - y: this.component.transform.scale.y * this.__COLLIDER_SCALE_OFFSET__.y, - z: this.component.transform.scale.z * this.__COLLIDER_SCALE_OFFSET__.z, - }) - } - - // Setters & getters for transform properties - - get position() { - return this.__COLLIDER__.translation() - } - - set position(position: { x: number, y: number, z: number }) { - this.setPosition(position) - } - - get x() { - return this.__COLLIDER__.translation().x - } - - set x(x: number) { - this.setPosition({ x, y: this.y, z: this.z }) - } - - get y() { - return this.__COLLIDER__.translation().y - } - - set y(y: number) { - this.setPosition({ x: this.x, y, z: this.z }) - } - - get z() { - return this.__COLLIDER__.translation().z - } - - set z(z: number) { - this.setPosition({ x: this.x, y: this.y, z }) - } - - get rotation() { - const quaternion = this.__COLLIDER__.rotation() - const euler = new THREE.Euler().setFromQuaternion( - new THREE.Quaternion( - quaternion.x, - quaternion.y, - quaternion.z, - quaternion.w, - ), - ) - return { x: euler.x, y: euler.y, z: euler.z } - } - - set rotation(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationX() { - return this.rotation.x - } - - set rotationX(x: number) { - this.setRotation({ x, y: this.rotation.y, z: this.rotation.z }) - } - - get rotationY() { - return this.rotation.y - } - - set rotationY(y: number) { - this.setRotation({ x: this.rotation.x, y, z: this.rotation.z }) - } - - get rotationZ() { - return this.rotation.z - } - - set rotationZ(z: number) { - this.setRotation({ x: this.rotation.x, y: this.rotation.y, z }) - } - - get rotationDegree() { - const euler = this.rotation - return { x: THREE.MathUtils.radToDeg(euler.x), y: THREE.MathUtils.radToDeg(euler.y), z: THREE.MathUtils.radToDeg(euler.z) } - } - - set rotationDegree(rotation: { x: number, y: number, z: number }) { - this.setRotationDegree(rotation) - } - - get rotationDegreeX() { - return this.rotationDegree.x - } - - set rotationDegreeX(x: number) { - this.setRotationDegree({ x, y: this.rotationDegree.y, z: this.rotationDegree.z }) - } - - get rotationDegreeY() { - return this.rotationDegree.y - } - - set rotationDegreeY(y: number) { - this.setRotationDegree({ x: this.rotationDegree.x, y, z: this.rotationDegree.z }) - } - - get rotationDegreeZ() { - return this.rotationDegree.z - } - - set rotationDegreeZ(z: number) { - this.setRotationDegree({ x: this.rotationDegree.x, y: this.rotationDegree.y, z }) - } - - get scale() { + __UPDATE_SCALE__(initiator: boolean = false): void { + // If the collider is the initiator, propagate the scale update + if (initiator) { + this.component.__UPDATE_SCALE__() + this.component.sensor?.__UPDATE_SCALE__() + } + // If the collider is a cuboid, update its half extents if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - return { - x: this.__COLLIDER__.shape.halfExtents.x * 2, - y: this.__COLLIDER__.shape.halfExtents.y * 2, - z: this.__COLLIDER__.shape.halfExtents.z * 2, - } + this.__COLLIDER__.setShape(new RAPIER.Cuboid(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2)) } + // If the collider is a ball, update its radius else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - return { - x: this.__COLLIDER__.shape.radius * 2, - y: this.__COLLIDER__.shape.radius * 2, - z: this.__COLLIDER__.shape.radius * 2, - } + this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) / 2)) } - else { - return { x: 0, y: 0, z: 0 } - } - } - - set scale(scale: { x: number, y: number, z: number }) { - this.setScale(scale) - } - - get scaleX() { - return this.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.scale.y, z: this.scale.z }) - } - - get scaleY() { - return this.scale.y - } - - set scaleY(y: number) { - this.setScale({ x: this.scale.x, y, z: this.scale.z }) - } - - get scaleZ() { - return this.scale.z - } - - set scaleZ(z: number) { - this.setScale({ x: this.scale.x, y: this.scale.y, z }) } } diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 1d33845c..743f64c9 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -3,18 +3,17 @@ import * as RAPIER from '@dimforge/rapier3d' import type { OnCollisionWithData } from '@fibbojs/core' import { FComponent as FComponentCore } from '@fibbojs/core' import type { FController } from '../controllers/FController' +import type { FVector3 } from '../types/FVector3' import type { FScene } from './FScene' -import type { FColliderOptions } from './FCollider' -import { FCollider } from './FCollider' -import type { FRigidBodyOptions } from './FRigidBody' -import { FRigidBody } from './FRigidBody' +import type { FCollider } from './FCollider' +import type { FRigidBody } from './FRigidBody' import { FTransform } from './FTransform' export interface FComponentOptions { - position?: { x: number, y: number, z: number } - scale?: { x: number, y: number, z: number } - rotation?: { x: number, y: number, z: number } - rotationDegree?: { x: number, y: number, z: number } + position?: FVector3 + scale?: FVector3 + rotation?: FVector3 + rotationDegree?: FVector3 } /** @@ -50,15 +49,15 @@ export abstract class FComponent extends FComponentCore { /** * RigidBody */ - declare rigidBody: FRigidBody + rigidBody?: FRigidBody /** * Collider */ - declare collider: FCollider + collider?: FCollider /** * Sensor (a collider that doesn't collide with other colliders, but still triggers events) */ - declare sensor: FRigidBody + sensor?: FRigidBody /** * @param scene The 3D scene where the component will be added. @@ -98,6 +97,7 @@ export abstract class FComponent extends FComponentCore { // Create the transform this.transform = new FTransform({ + component: this, position: options.position, scale: options.scale, rotation: options.rotation, @@ -112,9 +112,9 @@ export abstract class FComponent extends FComponentCore { // Translation const newMeshPosition = this.rigidBody.__RIGIDBODY__.translation() // Remove offset - newMeshPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x - newMeshPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y - newMeshPosition.z -= this.collider.__COLLIDER_POSITION_OFFSET__.z + newMeshPosition.x -= this.collider.__POSITION_OFFSET__.x + newMeshPosition.y -= this.collider.__POSITION_OFFSET__.y + newMeshPosition.z -= this.collider.__POSITION_OFFSET__.z // Rotation const newMeshRotation = new THREE.Euler().setFromQuaternion( @@ -126,9 +126,9 @@ export abstract class FComponent extends FComponentCore { ), ) // Remove offset - newMeshRotation.x -= this.collider.__COLLIDER_ROTATION_OFFSET__.x - newMeshRotation.y -= this.collider.__COLLIDER_ROTATION_OFFSET__.y - newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z + newMeshRotation.x -= this.collider.__ROTATION_OFFSET__.x + newMeshRotation.y -= this.collider.__ROTATION_OFFSET__.y + newMeshRotation.z -= this.collider.__ROTATION_OFFSET__.z // Apply the new transforms to the mesh this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) @@ -140,9 +140,9 @@ export abstract class FComponent extends FComponentCore { // If a sensor exists, update its position and rotation according to the rigidBody if (this.sensor) { // Apply offset to the sensor - newMeshPosition.x += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.x - newMeshPosition.y += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.y - newMeshPosition.z += this.sensor.collider.__COLLIDER_POSITION_OFFSET__.z + newMeshPosition.x += this.sensor.collider.__POSITION_OFFSET__.x + newMeshPosition.y += this.sensor.collider.__POSITION_OFFSET__.y + newMeshPosition.z += this.sensor.collider.__POSITION_OFFSET__.z this.sensor.__RIGIDBODY__.setTranslation(newMeshPosition, true) this.sensor.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(newMeshRotation), true) } @@ -152,9 +152,9 @@ export abstract class FComponent extends FComponentCore { // Translation const newMeshPosition = this.collider.__COLLIDER__.translation() // Remove offset - newMeshPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x - newMeshPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y - newMeshPosition.z -= this.collider.__COLLIDER_POSITION_OFFSET__.z + newMeshPosition.x -= this.collider.__POSITION_OFFSET__.x + newMeshPosition.y -= this.collider.__POSITION_OFFSET__.y + newMeshPosition.z -= this.collider.__POSITION_OFFSET__.z // Rotation const newMeshRotation = new THREE.Euler().setFromQuaternion( @@ -166,9 +166,9 @@ export abstract class FComponent extends FComponentCore { ), ) // Remove offset - newMeshRotation.x -= this.collider.__COLLIDER_ROTATION_OFFSET__.x - newMeshRotation.y -= this.collider.__COLLIDER_ROTATION_OFFSET__.y - newMeshRotation.z -= this.collider.__COLLIDER_ROTATION_OFFSET__.z + newMeshRotation.x -= this.collider.__ROTATION_OFFSET__.x + newMeshRotation.y -= this.collider.__ROTATION_OFFSET__.y + newMeshRotation.z -= this.collider.__ROTATION_OFFSET__.z // Apply the new transforms to the mesh this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) @@ -191,205 +191,75 @@ export abstract class FComponent extends FComponentCore { } /** - * Set the position of the component. - * @param options The options for the position. - * @param options.x The position on the x-axis. - * @param options.y The position on the y-axis. - * @param options.z The position on the z-axis. - * @example - * ```ts - * component.setPosition({ x: 0, y: 1, z: 0 }) - * ``` + * Update the position of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the position update. + * Set this to true to propagate the position update to the rigidBody, collider and sensor. */ - setPosition(options: { x: number, y: number, z: number }): void { - this.transform.position = options + __UPDATE_POSITION__(initiator: boolean = false): void { // If a mesh exists, update its position if (this.__MESH__) - this.__MESH__.position.set(options.x, options.y, options.z) - // If a rigidBody exists, update its position - if (this.rigidBody) - this.rigidBody.updatePosition() - // Else if a collider exists, update its position - else if (this.collider) - this.collider.updatePosition() - // If a sensor exists, update its position - if (this.sensor) - this.sensor.updatePosition() + this.__MESH__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) + // If the component is the initiator, propagate the position update to the rigidBody, collider and sensor + if (initiator) { + if (this.rigidBody) + this.rigidBody.__UPDATE_POSITION__() + else if (this.collider) + this.collider.__UPDATE_POSITION__() + if (this.sensor) + this.sensor.__UPDATE_POSITION__() + } } /** - * Set the rotation of the component from radians. - * @param options The options for the rotation. - * @param options.x The rotation on the x-axis. - * @param options.y The rotation on the y-axis. - * @param options.z The rotation on the z-axis. - * @example - * ```ts - * component.setRotation({ x: 0, y: 0, z: 0 }) - * ``` + * Update the rotation of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the rotation update. + * Set this to true to propagate the rotation update to the rigidBody, collider and sensor. */ - setRotation(options: { x: number, y: number, z: number }): void { - this.transform.rotation = options + __UPDATE_ROTATION__(initiator: boolean = false): void { // If a mesh exists, update its rotation if (this.__MESH__) - this.__MESH__.rotation.set(options.x, options.y, options.z) - // If a rigidBody exists, update its rotation - if (this.rigidBody) - this.rigidBody.updateRotation() - // Else if a collider exists, update its rotation - else if (this.collider) - this.collider.updateRotation() - // If a sensor exists, update its rotation - if (this.sensor) - this.sensor.updateRotation() - } - - /** - * Set the rotation of the component from degrees. - * @param options The options for the rotation. - * @param options.x The rotation in degrees on the x-axis. - * @param options.y The rotation in degrees on the y-axis. - * @param options.z The rotation in degrees on the z-axis. - * @example - * ```ts - * component.setRotationDegree({ x: 0, y: 90, z: 0 }) - * ``` - */ - setRotationDegree(options: { x: number, y: number, z: number }): void { - // Convert degrees to radians - const radRotation = { - x: THREE.MathUtils.degToRad(options.x), - y: THREE.MathUtils.degToRad(options.y), - z: THREE.MathUtils.degToRad(options.z), + this.__MESH__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) + // If the component is the initiator, propagate the rotation update to the rigidBody, collider and sensor + if (initiator) { + if (this.rigidBody) + this.rigidBody.__UPDATE_ROTATION__() + else if (this.collider) + this.collider.__UPDATE_ROTATION__() + if (this.sensor) + this.sensor.__UPDATE_ROTATION__() } - - this.setRotation(radRotation) } /** - * Set the scale of the component. - * @param options The options for the scale. - * @param options.x The scale on the x-axis. - * @param options.y The scale on the y-axis. - * @param options.z The scale on the z-axis. - * @example - * ```ts - * component.setScale({ x: 1, y: 1, z: 1 }) - * ``` + * Update the scale of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the scale update. + * Set this to true to propagate the scale update to the rigidBody, collider and sensor. */ - setScale(options: { x: number, y: number, z: number }): void { - this.transform.scale = options + __UPDATE_SCALE__(initiator: boolean = false): void { // If a mesh exists if (this.__MESH__) { // If the mesh is a classic polyhedron if (this.__MESH__ instanceof THREE.Mesh && (this.__MESH__.geometry instanceof THREE.BoxGeometry || this.__MESH__.geometry instanceof THREE.SphereGeometry)) { - this.__MESH__.scale.set(options.x, options.y, options.z) + this.__MESH__.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) } // We don't know the type of the mesh, probably a custom mesh else { // I don't really know why the scale should be devided by 2 for custom meshes, but it works - this.__MESH__.scale.set(options.x / 2, options.y / 2, options.z / 2) + this.__MESH__.scale.set(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2) } } - // If a rigidBody exists, update its scale - if (this.rigidBody) - this.rigidBody.updateScale() - // Else if a collider exists, update its scale - else if (this.collider) - this.collider.updateScale() - // If a sensor exists, update its scale - if (this.sensor) - this.sensor.updateScale() - } - - /** - * Init a rigidBody for the component. - * @param options The options for the rigidBody. - * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. - * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. - * @param options.lockTranslations If true, the rigidBody will not be able to move. - * @param options.lockRotations If true, the rigidBody will not be able to rotate. - * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. - * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. - * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. - * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. - * @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.CUBOID - * }) - * ``` - */ - initRigidBody(options?: FRigidBodyOptions): void { - // Initialize the rigidBody - this.rigidBody = new FRigidBody(this, options) - - // Set the collider - this.collider = this.rigidBody?.collider - } - - /** - * Only init a collider for the component, without a rigidBody. - * This is useful for static objects. - * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. - * @param options.rigidBody The rigidBody to attach the collider to. (optional) - * @param options.sensor If true, the collider will be a sensor. - * @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.CUBOID - * }) - * ``` - */ - initCollider(options?: FColliderOptions): void { - // Initialize the collider - this.collider = new FCollider(this, options) - } - - /** - * Init a sensor for the component. - * This is useful for triggerings events when the component collides with other components. - * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. - * @param options.sensor If true, the collider will be a sensor. - * @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.CUBOID - * }) - * ``` - */ - initSensor(options?: FColliderOptions): void { - // Initialize the sensor - this.sensor = new FRigidBody(this, { - sensor: true, - rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, - ...options, - }) + // If the component is the initiator, propagate the scale update to the rigidBody, collider and sensor + if (initiator) { + if (this.rigidBody) + this.rigidBody.__UPDATE_SCALE__() + else if (this.collider) + this.collider.__UPDATE_SCALE__() + if (this.sensor) + this.sensor.__UPDATE_SCALE__() + } } onCollisionWith(classOrObject: any, callback: (data: OnCollisionWithData) => void): () => void { @@ -401,138 +271,4 @@ export abstract class FComponent extends FComponentCore { // Call the core onCollisionWith method return super.onCollisionWith(classOrObject, callback) } - - // Setters & getters - - get position(): { x: number, y: number, z: number } { - return this.transform.position - } - - set position(position: { x: number, y: number, z: number }) { - this.setPosition(position) - } - - get x(): number { - return this.transform.position.x - } - - set x(x: number) { - this.setPosition({ x, y: this.transform.position.y, z: this.transform.position.z }) - } - - get y(): number { - return this.transform.position.y - } - - set y(y: number) { - this.setPosition({ x: this.transform.position.x, y, z: this.transform.position.z }) - } - - get z(): number { - return this.transform.position.z - } - - set z(z: number) { - this.setPosition({ x: this.transform.position.x, y: this.transform.position.y, z }) - } - - get rotation(): { x: number, y: number, z: number } { - return this.transform.rotation - } - - set rotation(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationX(): number { - return this.transform.rotation.x - } - - set rotationX(x: number) { - this.setRotation({ x, y: this.transform.rotation.y, z: this.transform.rotation.z }) - } - - get rotationY(): number { - return this.transform.rotation.y - } - - set rotationY(y: number) { - this.setRotation({ x: this.transform.rotation.x, y, z: this.transform.rotation.z }) - } - - get rotationZ(): number { - return this.transform.rotation.z - } - - set rotationZ(z: number) { - this.setRotation({ x: this.transform.rotation.x, y: this.transform.rotation.y, z }) - } - - get rotationDegree(): { x: number, y: number, z: number } { - return { - x: this.rotationDegreeX, - y: this.rotationDegreeY, - z: this.rotationDegreeZ, - } - } - - set rotationDegree(rotationDegree: { x: number, y: number, z: number }) { - this.setRotationDegree(rotationDegree) - } - - get rotationDegreeX(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.x) - } - - set rotationDegreeX(x: number) { - this.setRotationDegree({ x, y: this.rotationDegreeY, z: this.rotationDegreeZ }) - } - - get rotationDegreeY(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.y) - } - - set rotationDegreeY(y: number) { - this.setRotationDegree({ x: this.rotationDegreeX, y, z: this.rotationDegreeZ }) - } - - get rotationDegreeZ(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.z) - } - - set rotationDegreeZ(z: number) { - this.setRotationDegree({ x: this.rotationDegreeX, y: this.rotationDegreeY, z }) - } - - get scale(): { x: number, y: number, z: number } { - return this.transform.scale - } - - set scale(scale: { x: number, y: number, z: number }) { - this.setScale(scale) - } - - get scaleX(): number { - return this.transform.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.transform.scale.y, z: this.transform.scale.z }) - } - - get scaleY(): number { - return this.transform.scale.y - } - - set scaleY(y: number) { - this.setScale({ x: this.transform.scale.x, y, z: this.transform.scale.z }) - } - - get scaleZ(): number { - return this.transform.scale.z - } - - set scaleZ(z: number) { - this.setScale({ x: this.transform.scale.x, y: this.transform.scale.y, z }) - } } diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index a76af184..836c7fbe 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -1,14 +1,16 @@ import * as THREE from 'three' import * as RAPIER from '@dimforge/rapier3d' import { FShapes } from '../types/FShapes' +import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' import { FCollider } from './FCollider' +import { FTransform } from './FTransform' export interface FRigidBodyOptions { - position?: { x: number, y: number, z: number } - scale?: { x: number, y: number, z: number } - rotation?: { x: number, y: number, z: number } - rotationDegree?: { x: number, y: number, z: number } + position?: FVector3 + scale?: FVector3 + rotation?: FVector3 + rotationDegree?: FVector3 shape?: FShapes rigidBodyType?: RAPIER.RigidBodyType sensor?: boolean @@ -43,16 +45,20 @@ export class FRigidBody { * Position Offset for the rigidBody. * This is used to adjust the rigidBody position relative to the component. */ - __RIGIDBODY_POSITION_OFFSET__: { x: number, y: number, z: number } + __POSITION_OFFSET__: FVector3 /** * Rotation Offset for the rigidBody. * This is used to adjust the rigidBody position relative to the component. */ - __RIGIDBODY_ROTATION_OFFSET__: { x: number, y: number, z: number } + __ROTATION_OFFSET__: FVector3 /** * The component the rigidBody is attached to. */ component: FComponent + /** + * The transform of the rigidBody. + */ + transform: FTransform /** * Creates a rigidBody for the given component. @@ -108,8 +114,8 @@ export class FRigidBody { throw new Error('FibboError: FScene must have a world to create a rigidBody') // Store the options - this.__RIGIDBODY_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } - this.__RIGIDBODY_ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } + this.__POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } + this.__ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } this.component = component // If rotation degree is given, convert it to radians @@ -165,6 +171,13 @@ export class FRigidBody { ) } + // Create the transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + scale: options.scale, + }) + // Create the collider this.collider = new FCollider(component, { ...options, @@ -173,229 +186,73 @@ export class FRigidBody { } /** - * Set the position of the rigidBody. - * @param position The new position of the rigidBody. - * @param position.x The new x position of the rigidBody. - * @param position.y The new y position of the rigidBody. - * @param position.z The new z position of the rigidBody. - */ - setPosition(position: { x: number, y: number, z: number }) { - this.__RIGIDBODY__.setTranslation(position, true) - this.collider.setPosition(position) - } - - /** - * Set the rotation of the rigidBody. - * @param rotation The new rotation of the rigidBody. - * @param rotation.x The new x rotation of the rigidBody. - * @param rotation.y The new y rotation of the rigidBody. - * @param rotation.z The new z rotation of the rigidBody. - */ - setRotation(rotation: { x: number, y: number, z: number }) { - this.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z)), true) - this.collider.setRotation(rotation) - } - - /** - * Set the rotation of the rigidBody in degrees. - * @param rotation The new rotation of the rigidBody in degrees. - * @param rotation.x The new x rotation of the rigidBody in degrees. - * @param rotation.y The new y rotation of the rigidBody in degrees. - * @param rotation.z The new z rotation of the rigidBody in degrees. - */ - setRotationDegree(rotation: { x: number, y: number, z: number }) { - this.setRotation({ - x: THREE.MathUtils.degToRad(rotation.x), - y: THREE.MathUtils.degToRad(rotation.y), - z: THREE.MathUtils.degToRad(rotation.z), - }) - } - - /** - * Set the scale of the rigidBody. - * @param scale The new scale of the rigidBody. - * @param scale.x The new x scale of the rigidBody. - * @param scale.y The new y scale of the rigidBody. - * @param scale.z The new z scale of the rigidBody. - */ - setScale(scale: { x: number, y: number, z: number }) { - this.collider.setScale(scale) - } - - /** - * Update the position of the rigidBody according to its component's position. - * This takes into account the position offset. + * Update the position of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the rotation update. + * This means the offset will be added to the rotation. + * Setting this to true will propagate the event to other objects (component, collider, sensor,...). */ - updatePosition() { + __UPDATE_POSITION__(initiator: boolean = false): void { const newPosition = { - x: this.component.transform.position.x + this.__RIGIDBODY_POSITION_OFFSET__.x, - y: this.component.transform.position.y + this.__RIGIDBODY_POSITION_OFFSET__.y, - z: this.component.transform.position.z + this.__RIGIDBODY_POSITION_OFFSET__.z, + x: this.component.transform.position.x, + y: this.component.transform.position.y, + z: this.component.transform.position.z, } - this.setPosition(newPosition) - this.collider.setPosition(newPosition) + // If the rigidBody is the initiator, propagate the position update + if (initiator) { + this.component.__UPDATE_POSITION__() + this.collider.__UPDATE_POSITION__() + } + // Else, it was propagated to the rigidBody, so add the offset + else { + newPosition.x += this.__POSITION_OFFSET__.x + newPosition.y += this.__POSITION_OFFSET__.y + newPosition.z += this.__POSITION_OFFSET__.z + } + // Update the rigidBody position + this.__RIGIDBODY__.setTranslation(newPosition, true) } /** - * Update the rotation of the rigidBody according to its component's rotation. - * This takes into account the rotation offset. + * Update the rotation of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the rotation update. + * This means the offset will be added to the rotation. + * Setting this to true will propagate the event to other objects (component, collider, sensor,...). */ - updateRotation() { - const newRotation = { - x: this.component.transform.rotation.x + this.__RIGIDBODY_ROTATION_OFFSET__.x, - y: this.component.transform.rotation.y + this.__RIGIDBODY_ROTATION_OFFSET__.y, - z: this.component.transform.rotation.z + this.__RIGIDBODY_ROTATION_OFFSET__.z, + __UPDATE_ROTATION__(initiator: boolean = false): void { + const newRotation = new THREE.Euler( + this.component.transform.rotation.x, + this.component.transform.rotation.y, + this.component.transform.rotation.z, + ) + // If the rigidBody is the initiator, propagate the rotation update + if (initiator) { + this.component.__UPDATE_ROTATION__() + this.collider.__UPDATE_ROTATION__() } - this.setRotation(newRotation) - this.collider.setRotation(newRotation) + // Else, it was propagated to the rigidBody, so add the offset + else { + newRotation.x += this.__ROTATION_OFFSET__.x + newRotation.y += this.__ROTATION_OFFSET__.y + newRotation.z += this.__ROTATION_OFFSET__.z + } + // Update the rigidBody rotation + this.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(newRotation), true) } /** - * Update the scale of the rigidBody according to its component's scale. - * This takes into account the scale offset. - * As a rigidBody does not have a scale, this will only update the attached collider's scale. + * Update the scale of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the scale update. + * This means the offset will be added to the scale. + * Setting this to true will propagate the event to other objects (component, collider, sensor,...). */ - updateScale() { - this.collider.updateScale() - } - - // Setters & getters for transform properties - - get position() { - return this.__RIGIDBODY__.translation() - } - - set position(position: { x: number, y: number, z: number }) { - this.setPosition(position) - } - - get x() { - return this.__RIGIDBODY__.translation().x - } - - set x(x: number) { - this.setPosition({ x, y: this.y, z: this.z }) - } - - get y() { - return this.__RIGIDBODY__.translation().y - } - - set y(y: number) { - this.setPosition({ x: this.x, y, z: this.z }) - } - - get z() { - return this.__RIGIDBODY__.translation().z - } - - set z(z: number) { - this.setPosition({ x: this.x, y: this.y, z }) - } - - get rotation() { - const quaternion = this.__RIGIDBODY__.rotation() - const euler = new THREE.Euler().setFromQuaternion( - new THREE.Quaternion( - quaternion.x, - quaternion.y, - quaternion.z, - quaternion.w, - ), - ) - return { x: euler.x, y: euler.y, z: euler.z } - } - - set rotation(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationX() { - return this.rotation.x - } - - set rotationX(x: number) { - this.setRotation({ x, y: this.rotation.y, z: this.rotation.z }) - } - - get rotationY() { - return this.rotation.y - } - - set rotationY(y: number) { - this.setRotation({ x: this.rotation.x, y, z: this.rotation.z }) - } - - get rotationZ() { - return this.rotation.z - } - - set rotationZ(z: number) { - this.setRotation({ x: this.rotation.x, y: this.rotation.y, z }) - } - - get rotationDegree() { - const euler = this.rotation - return { x: THREE.MathUtils.radToDeg(euler.x), y: THREE.MathUtils.radToDeg(euler.y), z: THREE.MathUtils.radToDeg(euler.z) } - } - - set rotationDegree(rotation: { x: number, y: number, z: number }) { - this.setRotationDegree(rotation) - } - - get rotationDegreeX() { - return this.rotationDegree.x - } - - set rotationDegreeX(x: number) { - this.setRotationDegree({ x, y: this.rotationDegree.y, z: this.rotationDegree.z }) - } - - get rotationDegreeY() { - return this.rotationDegree.y - } - - set rotationDegreeY(y: number) { - this.setRotationDegree({ x: this.rotationDegree.x, y, z: this.rotationDegree.z }) - } - - get rotationDegreeZ() { - return this.rotationDegree.z - } - - set rotationDegreeZ(z: number) { - this.setRotationDegree({ x: this.rotationDegree.x, y: this.rotationDegree.y, z }) - } - - get scale() { - return this.collider.scale - } - - set scale(scale: { x: number, y: number, z: number }) { - this.setScale(scale) - } - - get scaleX() { - return this.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.scale.y, z: this.scale.z }) - } - - get scaleY() { - return this.scale.y - } - - set scaleY(y: number) { - this.setScale({ x: this.scale.x, y, z: this.scale.z }) - } - - get scaleZ() { - return this.scale.z - } - - set scaleZ(z: number) { - this.setScale({ x: this.scale.x, y: this.scale.y, z }) + __UPDATE_SCALE__(initiator: boolean = false): void { + // If the rigidBody is the initiator, propagate the scale update + if (initiator) { + this.component.__UPDATE_SCALE__() + this.collider.__UPDATE_SCALE__() + } } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 01ce7a9a..42689a47 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -6,10 +6,11 @@ import type { FCamera } from '../cameras/FCamera' import { FFixedCamera } from '../cameras/FFixedCamera' import { FModel } from '../model/FModel' import type { FLight } from '../lights/FLight' +import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' export interface FSceneOptions extends FSceneOptionsCore { - gravity?: { x: number, y: number, z: number } + gravity?: FVector3 shadows?: boolean } @@ -63,7 +64,7 @@ export class FScene extends FSceneCore { declare camera: FCamera // Rapier - declare gravity: { x: number, y: number, z: number } + declare gravity: FVector3 declare world: RAPIER.World declare eventQueue: RAPIER.EventQueue __RAPIER_TO_COMPONENT__: Map = new Map() diff --git a/packages/3d/src/core/FSensor.ts b/packages/3d/src/core/FSensor.ts new file mode 100644 index 00000000..adb41068 --- /dev/null +++ b/packages/3d/src/core/FSensor.ts @@ -0,0 +1,48 @@ +import * as RAPIER from '@dimforge/rapier3d' +import type { FComponent } from './FComponent' +import type { FRigidBodyOptions } from './FRigidBody' +import { FRigidBody } from './FRigidBody' + +/** + * A 3d sensor that can be attached to a component. + * @category Core + */ +export class FSensor extends FRigidBody { + /** + * Creates a sensor for the given component. + * It is basically a rigidBody that defaults to a kinematic position based type aswell as the sensor flag. + * @param component The component which the collider will be attached to. + * @param options The options for the sensor. + * @param options.position The position of the sensor. If not defined, it will use the default position of the FComponent. + * @param options.scale The scale of the sensor. If not defined, it will use the default scale of the FComponent. + * @param options.rotation The rotation of the sensor. If not defined, it will use the default rotation of the FComponent. + * @param options.shape The shape of the sensor. If not defined, it will default to FShapes.CUBOID. + * @param options.rigidBodyType The type of the sensor. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.lockTranslations If true, the sensor will not be able to move. + * @param options.lockRotations If true, the sensor will not be able to rotate. + * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. + * @param options.enabledTranslations.enableX If true, the sensor will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the sensor will be able to move on the y-axis. + * @param options.enabledTranslations.enableZ If true, the sensor will be able to move on the z-axis. + * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. + * @param options.enabledRotations.enableX If true, the sensor will be able to rotate on the x-axis. + * @param options.enabledRotations.enableY If true, the sensor will be able to rotate on the y-axis. + * @param options.enabledRotations.enableZ If true, the sensor will be able to rotate on the z-axis. + * @example + * ```ts + * const sensor = new FSensor({ + * position: { x: 0, y: 0, z: 0 }, + * scale: { x: 1, y: 1, z: 1 }, + * rotation: { x: 0, y: 0, z: 0 }, + * shape: FShapes.CUBOID + * }) + * ``` + */ + constructor(component: FComponent, options?: FRigidBodyOptions) { + super(component, { + sensor: true, + rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, + ...options, + }) + } +} diff --git a/packages/3d/src/core/FTransform.ts b/packages/3d/src/core/FTransform.ts index 41d03bd5..600ffb1a 100644 --- a/packages/3d/src/core/FTransform.ts +++ b/packages/3d/src/core/FTransform.ts @@ -1,40 +1,53 @@ import * as THREE from 'three' +import type { FCamera } from '../cameras/FCamera' +import type { FLight } from '../lights/FLight' +import type { FVector3 } from '../types/FVector3' +import type { FComponent } from './FComponent' +import type { FCollider } from './FCollider' +import type { FRigidBody } from './FRigidBody' export interface FTransformOptions { - position?: { x: number, y: number, z: number } - scale?: { x: number, y: number, z: number } - rotation?: { x: number, y: number, z: number } - rotationDegree?: { x: number, y: number, z: number } + component?: FComponent | FCamera | FLight + position?: FVector3 + scale?: FVector3 + rotation?: FVector3 + rotationDegree?: FVector3 } /** - * 3D Transforms for a component. + * 3D Transform for a component. * @category Core */ export class FTransform { + /** + * The component that the transform is attached to. + */ + __COMPONENT__?: FComponent | FCamera | FLight | FCollider | FRigidBody + /** * The position of the component. */ - position: { x: number, y: number, z: number } + __POSITION__: FVector3 /** * The scale of the component. */ - scale: { x: number, y: number, z: number } + __SCALE__: FVector3 /** * The rotation of the component. */ - rotation: { x: number, y: number, z: number } + __ROTATION__: FVector3 /** * Create a new FTransform. - * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. - * @param options.scale The scale of the collider. If not defined, it will default to `{ x: 1, y: 1, z: 1 }`. - * @param options.rotation The rotation of the collider. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. - * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to undefined. + * @param options The options for the transform. + * @param options.component The component that the transform is attached to. If provided, the transform will automatically update the component's position, rotation and scale when changed. + * @param options.position The position of the transform. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. + * @param options.scale The scale of the transform. If not defined, it will default to `{ x: 1, y: 1, z: 1 }`. + * @param options.rotation The rotation of the transform. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. + * @param options.rotationDegree The rotation of the transform in degrees. If not defined, it will default to undefined. * @example * ```ts - * const collider = new FTransform({ + * const transform = new FTransform({ * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, @@ -44,6 +57,7 @@ export class FTransform { constructor(options?: FTransformOptions) { // Apply default options const DEFAULT_OPTIONS = { + component: undefined, position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, @@ -55,26 +69,322 @@ export class FTransform { throw new Error('FibboError: FTransform requires position, scale, rotation and shape options') // Set the transform values - this.position = options.position - this.scale = options.scale - this.rotation = options.rotationDegree + this.__POSITION__ = options.position + this.__SCALE__ = options.scale + this.__ROTATION__ = options.rotationDegree ? { x: THREE.MathUtils.degToRad(options.rotationDegree.x), y: THREE.MathUtils.degToRad(options.rotationDegree.y), z: THREE.MathUtils.degToRad(options.rotationDegree.z) } : options.rotation || { x: 0, y: 0, z: 0 } + // Store the component + this.__COMPONENT__ = options.component + } + + /** + * Set a new position. + * @param position The new position. + * @param position.x The new position on the x axis. + * @param position.y The new position on the y axis. + * @param position.z The new position on the z axis. + */ + setPosition(position: FVector3) { + this.__POSITION__ = position + this.__COMPONENT__?.__UPDATE_POSITION__(true) + } + + /** + * Set a new rotation. + * @param rotation The new rotation. + * @param rotation.x The new rotation on the x axis. + * @param rotation.y The new rotation on the y axis. + * @param rotation.z The new rotation on the z axis. + */ + setRotation(rotation: FVector3) { + this.__ROTATION__ = rotation + this.__COMPONENT__?.__UPDATE_ROTATION__(true) + } + + /** + * Set a new rotation in degrees. + * @param rotationDegree The new rotation in degrees. + * @param rotationDegree.x The new rotation on the x axis in degrees. + * @param rotationDegree.y The new rotation on the y axis in degrees. + * @param rotationDegree.z The new rotation on the z axis in degrees. + */ + setRotationDegree(rotationDegree: FVector3) { + this.__ROTATION__ = { + x: THREE.MathUtils.degToRad(rotationDegree.x), + y: THREE.MathUtils.degToRad(rotationDegree.y), + z: THREE.MathUtils.degToRad(rotationDegree.z), + } + this.__COMPONENT__?.__UPDATE_ROTATION__(true) + } + + /** + * Set a new scale. + * @param scale The new scale. + * @param scale.x The new scale on the x axis. + * @param scale.y The new scale on the y axis. + * @param scale.z The new scale on the z axis. + */ + setScale(scale: FVector3) { + this.__SCALE__ = scale + this.__COMPONENT__?.__UPDATE_SCALE__(true) + } + + // Setters & Getters + + /** + * Get the position. + */ + get position() { + return this.__POSITION__ + } + + /** + * Set the position. + * @param position The new position. + * @param position.x The new position on the x axis. + * @param position.y The new position on the y axis. + * @param position.z The new position on the z axis. + */ + set position(position: FVector3) { + this.setPosition(position) } - // Setters and getters for the transform values + /** + * Get the position on the x axis. + */ + get x() { + return this.__POSITION__.x + } + + /** + * Set the x position. + * @param x The new position on the x axis. + */ + set x(x: number) { + this.setPosition({ x, y: this.__POSITION__.y, z: this.__POSITION__.z }) + } + + /** + * Get the position on the y axis. + */ + get y() { + return this.__POSITION__.y + } + + /** + * Set the y position. + * @param y The new position on the y axis. + */ + set y(y: number) { + this.setPosition({ x: this.__POSITION__.x, y, z: this.__POSITION__.z }) + } + + /** + * Get the position on the z axis. + */ + get z() { + return this.__POSITION__.z + } + + /** + * Set the z position. + * @param z The new position on the z axis. + */ + set z(z: number) { + this.setPosition({ x: this.__POSITION__.x, y: this.__POSITION__.y, z }) + } + + /** + * Get the rotation. + */ + get rotation() { + return this.__ROTATION__ + } + + /** + * Set the rotation. + * @param rotation The new rotation. + * @param rotation.x The new rotation on the x axis. + * @param rotation.y The new rotation on the y axis. + * @param rotation.z The new rotation on the z axis. + */ + set rotation(rotation: FVector3) { + this.setRotation(rotation) + } + + /** + * Get the rotation on the x axis. + */ + get rotationX() { + return this.__ROTATION__.x + } + + /** + * Set the x rotation. + * @param x The new rotation on the x axis. + */ + set rotationX(x: number) { + this.setRotation({ x, y: this.__ROTATION__.y, z: this.__ROTATION__.z }) + } + + /** + * Get the rotation on the y axis. + */ + get rotationY() { + return this.__ROTATION__.y + } + + /** + * Set the y rotation. + * @param y The new rotation on the y axis. + */ + set rotationY(y: number) { + this.setRotation({ x: this.__ROTATION__.x, y, z: this.__ROTATION__.z }) + } + + /** + * Get the rotation on the z axis. + */ + get rotationZ() { + return this.__ROTATION__.z + } + + /** + * Set the z rotation. + * @param z The new rotation on the z axis. + */ + set rotationZ(z: number) { + this.setRotation({ x: this.__ROTATION__.x, y: this.__ROTATION__.y, z }) + } /** * Get the rotation in degrees. */ get rotationDegree() { - return { x: THREE.MathUtils.radToDeg(this.rotation.x), y: THREE.MathUtils.radToDeg(this.rotation.y), z: THREE.MathUtils.radToDeg(this.rotation.z) } + return { + x: THREE.MathUtils.radToDeg(this.__ROTATION__.x), + y: THREE.MathUtils.radToDeg(this.__ROTATION__.y), + z: THREE.MathUtils.radToDeg(this.__ROTATION__.z), + } } /** * Set the rotation in degrees. + * @param rotationDegree The new rotation in degrees. + * @param rotationDegree.x The new rotation on the x axis in degrees. + * @param rotationDegree.y The new rotation on the y axis in degrees. + * @param rotationDegree.z The new rotation on the z axis in degrees. + */ + set rotationDegree(rotationDegree: FVector3) { + this.setRotationDegree(rotationDegree) + } + + /** + * Get the rotation in degrees on the x axis. + */ + get rotationDegreeX() { + return THREE.MathUtils.radToDeg(this.__ROTATION__.x) + } + + /** + * Set the x rotation in degrees. + * @param x The new rotation on the x axis in degrees. + */ + set rotationDegreeX(x: number) { + this.setRotationDegree({ x, y: THREE.MathUtils.radToDeg(this.__ROTATION__.y), z: THREE.MathUtils.radToDeg(this.__ROTATION__.z) }) + } + + /** + * Get the rotation in degrees on the y axis. + */ + get rotationDegreeY() { + return THREE.MathUtils.radToDeg(this.__ROTATION__.y) + } + + /** + * Set the y rotation in degrees. + * @param y The new rotation on the y axis in degrees. + */ + set rotationDegreeY(y: number) { + this.setRotationDegree({ x: THREE.MathUtils.radToDeg(this.__ROTATION__.x), y, z: THREE.MathUtils.radToDeg(this.__ROTATION__.z) }) + } + + /** + * Get the rotation in degrees on the z axis. + */ + get rotationDegreeZ() { + return THREE.MathUtils.radToDeg(this.__ROTATION__.z) + } + + /** + * Set the z rotation in degrees. + * @param z The new rotation on the z axis in degrees. + */ + set rotationDegreeZ(z: number) { + this.setRotationDegree({ x: THREE.MathUtils.radToDeg(this.__ROTATION__.x), y: THREE.MathUtils.radToDeg(this.__ROTATION__.y), z }) + } + + /** + * Get the scale. + */ + get scale() { + return this.__SCALE__ + } + + /** + * Set the scale. + * @param scale The new scale. + * @param scale.x The new scale on the x axis. + * @param scale.y The new scale on the y axis. + * @param scale.z The new scale on the z axis. + */ + set scale(scale: FVector3) { + this.setScale(scale) + } + + /** + * Get the scale on the x axis. + */ + get scaleX() { + return this.__SCALE__.x + } + + /** + * Set the x scale. + * @param x The new scale on the x axis. + */ + set scaleX(x: number) { + this.setScale({ x, y: this.__SCALE__.y, z: this.__SCALE__.z }) + } + + /** + * Get the scale on the y axis. + */ + get scaleY() { + return this.__SCALE__.y + } + + /** + * Set the y scale. + * @param y The new scale on the y axis. + */ + set scaleY(y: number) { + this.setScale({ x: this.__SCALE__.x, y, z: this.__SCALE__.z }) + } + + /** + * Get the scale on the z axis. + */ + get scaleZ() { + return this.__SCALE__.z + } + + /** + * Set the z scale. + * @param z The new scale on the z axis. */ - set rotationDegree(rotation: { x: number, y: number, z: number }) { - this.rotation = { x: THREE.MathUtils.degToRad(rotation.x), y: THREE.MathUtils.degToRad(rotation.y), z: THREE.MathUtils.degToRad(rotation.z) } + set scaleZ(z: number) { + this.setScale({ x: this.__SCALE__.x, y: this.__SCALE__.y, z }) } } diff --git a/packages/3d/src/index.ts b/packages/3d/src/index.ts index a6238994..08fd94fb 100644 --- a/packages/3d/src/index.ts +++ b/packages/3d/src/index.ts @@ -24,6 +24,7 @@ export * from './core/FComponent' export * from './core/FComponentEmpty' export * from './core/FRigidBody' export * from './core/FScene' +export * from './core/FSensor' export * from './core/FTransform' // Lights @@ -50,3 +51,4 @@ export * from './polyhedrons/FSphere' // Types export * from './types/FShapes' +export * from './types/FVector3' diff --git a/packages/3d/src/lights/FAmbientLight.ts b/packages/3d/src/lights/FAmbientLight.ts index 44c947ca..0b892e10 100644 --- a/packages/3d/src/lights/FAmbientLight.ts +++ b/packages/3d/src/lights/FAmbientLight.ts @@ -25,6 +25,7 @@ export class FAmbientLight extends FLight { // Create the ambient light this.light = new THREE.AmbientLight(options.color, options.intensity) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() } } diff --git a/packages/3d/src/lights/FDirectionalLight.ts b/packages/3d/src/lights/FDirectionalLight.ts index fd6c384a..a74cd031 100644 --- a/packages/3d/src/lights/FDirectionalLight.ts +++ b/packages/3d/src/lights/FDirectionalLight.ts @@ -25,7 +25,8 @@ export class FDirectionalLight extends FLight { // Create the directional light this.light = new THREE.DirectionalLight(options.color, options.intensity) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { diff --git a/packages/3d/src/lights/FHemisphereLight.ts b/packages/3d/src/lights/FHemisphereLight.ts index f27f1e62..c1a79a1b 100644 --- a/packages/3d/src/lights/FHemisphereLight.ts +++ b/packages/3d/src/lights/FHemisphereLight.ts @@ -31,6 +31,7 @@ export class FHemisphereLight extends FLight { // Create the hemisphere light this.light = new THREE.HemisphereLight(options.color, options.intensity) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() } } diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index de4bc8ea..abacd40c 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -3,11 +3,12 @@ import { FLight as FLightCore } from '@fibbojs/core' import type { FTransformOptions } from '../core/FTransform' import { FTransform } from '../core/FTransform' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' export interface FLightOptions extends FTransformOptions { color?: THREE.ColorRepresentation intensity?: number - lookAt?: { x: number, y: number, z: number } + lookAt?: FVector3 } /** @@ -41,7 +42,7 @@ export abstract class FLight extends FLightCore { /** * Look at target of the light. */ - __LOOK_AT__: { x: number, y: number, z: number } + __LOOK_AT__: FVector3 constructor(scene: FScene, options?: FLightOptions) { super(scene) @@ -64,6 +65,7 @@ export abstract class FLight extends FLightCore { // Store options this.transform = new FTransform({ + component: this, position: options.position, rotation: options.rotation, rotationDegree: options.rotationDegree, @@ -71,178 +73,43 @@ export abstract class FLight extends FLightCore { this.__LOOK_AT__ = options.lookAt } - applyTransform(): void { - // Set the position + /** + * Update the position of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_POSITION__(): void { this.light.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) - // Set the scale - this.light.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) - // Set the rotation - this.light.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) - // Set the look at - if (this.light instanceof THREE.SpotLight || this.light instanceof THREE.DirectionalLight) { - this.light.target.position.set(this.__LOOK_AT__.x, this.__LOOK_AT__.y, this.__LOOK_AT__.z) - } + this.__UPDATE_LOOK_AT__() } - setPosition(position: { x: number, y: number, z: number }): void { - this.light.position.set(position.x, position.y, position.z) - this.transform.position = position + /** + * Update the rotation of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_ROTATION__(): void { + this.light.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) } - setRotation(rotation: { x: number, y: number, z: number }): void { - this.light.rotation.set(rotation.x, rotation.y, rotation.z) - this.transform.rotation = rotation + /** + * Update the scale of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_SCALE__(): void { + this.light.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) } - setRotationDegree(rotationDegree: { x: number, y: number, z: number }): void { - const rotation = { - x: THREE.MathUtils.degToRad(rotationDegree.x), - y: THREE.MathUtils.degToRad(rotationDegree.y), - z: THREE.MathUtils.degToRad(rotationDegree.z), + /** + * Update the look at target of the light. + * This method should be called after updating the position, so the light can look at the target. + */ + __UPDATE_LOOK_AT__(): void { + if (this.light instanceof THREE.SpotLight || this.light instanceof THREE.DirectionalLight) { + this.light.target.position.set(this.__LOOK_AT__.x, this.__LOOK_AT__.y, this.__LOOK_AT__.z) } - this.light.rotation.set(rotation.x, rotation.y, rotation.z) - this.transform.rotation = rotation - } - - setScale(scale: { x: number, y: number, z: number }): void { - this.light.scale.set(scale.x, scale.y, scale.z) - this.transform.scale = scale } // Setters & Getters - get position(): { x: number, y: number, z: number } { - return this.transform.position - } - - set position(position: { x: number, y: number, z: number }) { - this.setPosition(position) - } - - get x(): number { - return this.transform.position.x - } - - set x(x: number) { - this.position = { x, y: this.y, z: this.z } - } - - get y(): number { - return this.transform.position.y - } - - set y(y: number) { - this.position = { x: this.x, y, z: this.z } - } - - get z(): number { - return this.transform.position.z - } - - set z(z: number) { - this.position = { x: this.x, y: this.y, z } - } - - get rotation(): { x: number, y: number, z: number } { - return this.transform.rotation - } - - set rotation(rotation: { x: number, y: number, z: number }) { - this.setRotation(rotation) - } - - get rotationX(): number { - return this.transform.rotation.x - } - - set rotationX(x: number) { - this.rotation = { x, y: this.rotationY, z: this.rotationZ } - } - - get rotationY(): number { - return this.transform.rotation.y - } - - set rotationY(y: number) { - this.rotation = { x: this.rotationX, y, z: this.rotationZ } - } - - get rotationZ(): number { - return this.transform.rotation.z - } - - set rotationZ(z: number) { - this.rotation = { x: this.rotationX, y: this.rotationY, z } - } - - get rotationDegree(): { x: number, y: number, z: number } { - return { - x: THREE.MathUtils.radToDeg(this.transform.rotation.x), - y: THREE.MathUtils.radToDeg(this.transform.rotation.y), - z: THREE.MathUtils.radToDeg(this.transform.rotation.z), - } - } - - set rotationDegree(rotationDegree: { x: number, y: number, z: number }) { - this.setRotationDegree(rotationDegree) - } - - get rotationDegreeX(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.x) - } - - set rotationDegreeX(x: number) { - this.rotationDegree = { x, y: this.rotationDegreeY, z: this.rotationDegreeZ } - } - - get rotationDegreeY(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.y) - } - - set rotationDegreeY(y: number) { - this.rotationDegree = { x: this.rotationDegreeX, y, z: this.rotationDegreeZ } - } - - get rotationDegreeZ(): number { - return THREE.MathUtils.radToDeg(this.transform.rotation.z) - } - - set rotationDegreeZ(z: number) { - this.rotationDegree = { x: this.rotationDegreeX, y: this.rotationDegreeY, z } - } - - get scale(): { x: number, y: number, z: number } { - return this.transform.scale - } - - set scale(scale: { x: number, y: number, z: number }) { - this.setScale(scale) - } - - get scaleX(): number { - return this.transform.scale.x - } - - set scaleX(x: number) { - this.scale = { x, y: this.scaleY, z: this.scaleZ } - } - - get scaleY(): number { - return this.transform.scale.y - } - - set scaleY(y: number) { - this.scale = { x: this.scaleX, y, z: this.scaleZ } - } - - get scaleZ(): number { - return this.transform.scale.z - } - - set scaleZ(z: number) { - this.scale = { x: this.scaleX, y: this.scaleY, z } - } - get color(): THREE.Color { return this.light.color } @@ -259,11 +126,11 @@ export abstract class FLight extends FLightCore { this.light.intensity = intensity } - get lookAt(): { x: number, y: number, z: number } { + get lookAt(): FVector3 { return this.__LOOK_AT__ } - set lookAt(lookAt: { x: number, y: number, z: number }) { + set lookAt(lookAt: FVector3) { this.__LOOK_AT__ = lookAt if (this.light instanceof THREE.SpotLight) { this.light.lookAt(lookAt.x, lookAt.y, lookAt.z) diff --git a/packages/3d/src/lights/FLightProbe.ts b/packages/3d/src/lights/FLightProbe.ts index 9a35d5e4..56f50735 100644 --- a/packages/3d/src/lights/FLightProbe.ts +++ b/packages/3d/src/lights/FLightProbe.ts @@ -32,7 +32,8 @@ export class FLightProbe extends FLight { // Create the light probe this.light = new THREE.LightProbe(options.sh, options.intensity) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { diff --git a/packages/3d/src/lights/FPointLight.ts b/packages/3d/src/lights/FPointLight.ts index 09532712..5877ab50 100644 --- a/packages/3d/src/lights/FPointLight.ts +++ b/packages/3d/src/lights/FPointLight.ts @@ -25,7 +25,8 @@ export class FPointLight extends FLight { // Create the point light this.light = new THREE.PointLight(options.color, options.intensity) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { diff --git a/packages/3d/src/lights/FSpotLight.ts b/packages/3d/src/lights/FSpotLight.ts index aa74a110..b48b4bd0 100644 --- a/packages/3d/src/lights/FSpotLight.ts +++ b/packages/3d/src/lights/FSpotLight.ts @@ -47,7 +47,8 @@ export class FSpotLight extends FLight { options.decay, ) // Apply the transform - this.applyTransform() + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { diff --git a/packages/3d/src/polyhedrons/FCapsule.ts b/packages/3d/src/polyhedrons/FCapsule.ts index 903298e7..09625022 100644 --- a/packages/3d/src/polyhedrons/FCapsule.ts +++ b/packages/3d/src/polyhedrons/FCapsule.ts @@ -1,9 +1,6 @@ import * as THREE from 'three' import type { FScene } from '../core/FScene' -import { FShapes } from '../types/FShapes' import type { FComponentOptions } from '../core/FComponent' -import type { FColliderOptions } from '../core/FCollider' -import type { FRigidBodyOptions } from '../core/FRigidBody' import { FPolyhedron } from './FPolyhedron' /** @@ -32,18 +29,4 @@ export class FCapsule extends FPolyhedron { this.__MESH__.receiveShadow = true } } - - initRigidBody(options?: FRigidBodyOptions): void { - super.initRigidBody({ - shape: FShapes.CAPSULE, - ...options, - }) - } - - initCollider(options?: FColliderOptions): void { - super.initCollider({ - shape: FShapes.CAPSULE, - ...options, - }) - } } diff --git a/packages/3d/src/polyhedrons/FSphere.ts b/packages/3d/src/polyhedrons/FSphere.ts index d862136a..f829c0f7 100644 --- a/packages/3d/src/polyhedrons/FSphere.ts +++ b/packages/3d/src/polyhedrons/FSphere.ts @@ -1,9 +1,6 @@ import * as THREE from 'three' import type { FScene } from '../core/FScene' -import { FShapes } from '../types/FShapes' import type { FComponentOptions } from '../core/FComponent' -import type { FRigidBodyOptions } from '../core/FRigidBody' -import type { FColliderOptions } from '../core/FCollider' import { FPolyhedron } from './FPolyhedron' /** @@ -32,18 +29,4 @@ export class FSphere extends FPolyhedron { this.__MESH__.receiveShadow = true } } - - initRigidBody(options?: FRigidBodyOptions): void { - super.initRigidBody({ - shape: FShapes.SPHERE, - ...options, - }) - } - - initCollider(options?: FColliderOptions): void { - super.initCollider({ - shape: FShapes.SPHERE, - ...options, - }) - } } diff --git a/packages/3d/src/types/FVector3.ts b/packages/3d/src/types/FVector3.ts new file mode 100644 index 00000000..1559392f --- /dev/null +++ b/packages/3d/src/types/FVector3.ts @@ -0,0 +1,17 @@ +/** + * A 3d vector with x, y and z coordinates. + */ +export interface FVector3 { + /** + * The x coordinate of the vector. + */ + x: number + /** + * The y coordinate of the vector. + */ + y: number + /** + * The z coordinate of the vector. + */ + z: number +} diff --git a/packages/core/src/FCamera.ts b/packages/core/src/FCamera.ts index 3fa7fc6e..e292b62e 100644 --- a/packages/core/src/FCamera.ts +++ b/packages/core/src/FCamera.ts @@ -9,9 +9,4 @@ export abstract class FCamera extends FComponent { constructor(scene: FScene) { super(scene, { addToScene: false }) } - - /** - * Set the zoom of the camera. - */ - abstract setZoom(zoom: number): void } diff --git a/packages/core/src/FComponent.ts b/packages/core/src/FComponent.ts index bd2001da..1ed242db 100644 --- a/packages/core/src/FComponent.ts +++ b/packages/core/src/FComponent.ts @@ -1,4 +1,5 @@ import type { FController } from './FController' +import { FLight } from './FLight' import type { FScene } from './FScene' /** @@ -78,8 +79,14 @@ export abstract class FComponent { this.scene = scene // Add the component to the scene if addToScene is true - if (options.addToScene) - this.scene.addComponent(this) + if (options.addToScene) { + if (this instanceof FLight) { + this.scene.addLight(this) + } + else { + this.scene.addComponent(this) + } + } // Generate a unique ID this.__ID__ = ID_COUNTER++ From be6da530050a2d25f0ef17dc5ba0be0f8d0afc48 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:13:45 +0200 Subject: [PATCH 25/36] feat(3d): refactor transform system --- apps/playground-3d/src/classes/Character.ts | 8 +- apps/playground-3d/src/classes/GltfCube.ts | 6 +- apps/playground-3d/src/main.ts | 66 ++- packages/3d/src/cameras/FCamera.ts | 6 +- .../src/controllers/FCharacterController.ts | 3 +- .../src/controllers/FCharacterControllerD.ts | 6 +- .../src/controllers/FCharacterControllerK.ts | 3 +- .../src/controllers/FCharacterControllerKP.ts | 6 +- .../src/controllers/FCharacterControllerKV.ts | 6 +- packages/3d/src/core/FCollider.ts | 346 +++++++++------- packages/3d/src/core/FComponent.ts | 238 ++++++----- packages/3d/src/core/FRigidBody.ts | 273 ++++++++----- packages/3d/src/core/FScene.ts | 86 ++-- packages/3d/src/core/FSensor.ts | 45 +-- packages/3d/src/core/FTransform.ts | 60 ++- packages/3d/src/index.ts | 1 + packages/3d/src/lights/FAmbientLight.ts | 4 +- packages/3d/src/lights/FDirectionalLight.ts | 25 +- packages/3d/src/lights/FHemisphereLight.ts | 4 +- packages/3d/src/lights/FLight.ts | 39 +- packages/3d/src/lights/FLightProbe.ts | 13 +- packages/3d/src/lights/FPointLight.ts | 13 +- packages/3d/src/lights/FSpotLight.ts | 13 +- packages/3d/src/model/FFBX.ts | 9 + packages/3d/src/polyhedrons/FCapsule.ts | 2 + packages/3d/src/polyhedrons/FCuboid.ts | 2 + packages/3d/src/polyhedrons/FSphere.ts | 2 + packages/3d/src/types/FRigidBodyType.ts | 7 + packages/3d/test/browser/collider.test.ts | 378 +++++++++++------- packages/3d/test/browser/rigidbody.test.ts | 321 ++++++++------- packages/3d/test/index.test.ts | 7 - packages/core/src/FComponent.ts | 9 +- packages/core/src/FLight.ts | 56 ++- .../src/components/3d/FComponent3d.vue | 18 +- 34 files changed, 1257 insertions(+), 824 deletions(-) create mode 100644 packages/3d/src/types/FRigidBodyType.ts delete mode 100644 packages/3d/test/index.test.ts diff --git a/apps/playground-3d/src/classes/Character.ts b/apps/playground-3d/src/classes/Character.ts index 9fec7d94..7b263ff3 100644 --- a/apps/playground-3d/src/classes/Character.ts +++ b/apps/playground-3d/src/classes/Character.ts @@ -17,8 +17,8 @@ export default class Character extends FFBX { initRigidBody(options?: FRigidBodyOptions) { super.initRigidBody({ - position: { x: 0, y: 0.25, z: 0 }, - scale: { x: 0.25, y: 0.25, z: 0.25 }, + positionOffset: { x: 0, y: 0.25, z: 0 }, + scaleOffset: { x: -1.5, y: -1.5, z: -1.5 }, ...options, }) } @@ -26,8 +26,8 @@ export default class Character extends FFBX { initSensor(options?: FRigidBodyOptions) { super.initSensor({ ...options, - position: { x: 0, y: 0.25, z: 0 }, - scale: { x: 0.6, y: 0.4, z: 0.6 }, + positionOffset: { x: 0, y: 0.25, z: 0 }, + scaleOffset: { x: -1.5, y: -1.5, z: -1.5 }, }) } } diff --git a/apps/playground-3d/src/classes/GltfCube.ts b/apps/playground-3d/src/classes/GltfCube.ts index af36cf92..2aec31b7 100644 --- a/apps/playground-3d/src/classes/GltfCube.ts +++ b/apps/playground-3d/src/classes/GltfCube.ts @@ -6,9 +6,9 @@ export default class GltfCube extends FGLTF { super(scene, { name: 'Cube', }) - this.setPosition({ x: -4, y: 5, z: 2 }) - this.setScale({ x: 2, y: 0.25, z: 2 }) - this.setRotationDegree({ x: 20, y: 0, z: 0 }) + this.transform.position = { x: -4, y: 5, z: 2 } + this.transform.rotationDegree = { x: 20, y: 0, z: 0 } + this.transform.scale = { x: 2, y: 0.25, z: 2 } this.initRigidBody() } } diff --git a/apps/playground-3d/src/main.ts b/apps/playground-3d/src/main.ts index 9d7f6726..497a41af 100644 --- a/apps/playground-3d/src/main.ts +++ b/apps/playground-3d/src/main.ts @@ -1,7 +1,7 @@ -import { FAmbientLight, FCapsule, FComponentEmpty, FCuboid, FDirectionalLight, FFBX, FGLB, FGameCamera, FOBJ, FScene, FShapes, FSphere, FSpotLight } from '@fibbojs/3d' +/* eslint-disable no-new */ +import { FAmbientLight, FCapsule, FComponentEmpty, FCuboid, FDirectionalLight, FFBX, FGLB, FGameCamera, FOBJ, FRigidBodyType, FScene, FShapes, FSphere, FSpotLight } from '@fibbojs/3d' import { fDebug } from '@fibbojs/devtools' import { FKeyboard } from '@fibbojs/event' -import RAPIER from '@dimforge/rapier3d' import Duck from './classes/Duck' import GltfCube from './classes/GltfCube' import './style.css' @@ -20,25 +20,25 @@ import Character from './classes/Character' fDebug(scene) // Add directional light to represent the sun - scene.addLight(new FDirectionalLight(scene, { + new FDirectionalLight(scene, { position: { x: 20, y: 20, z: 0 }, color: 0xFFFFFF, intensity: 2, - })) + }) // Add spot light - scene.addLight(new FSpotLight(scene, { + new FSpotLight(scene, { position: { x: 4, y: 4, z: 4 }, angle: 1, distance: 8, color: 0xFFFFFF, intensity: 20, lookAt: { x: 8, y: 0, z: 8 }, - })) + }) // Add ambient light - scene.addLight(new FAmbientLight(scene, { + new FAmbientLight(scene, { color: 0x404040, intensity: 20, - })) + }) // Create a death zone const deathZone = new FComponentEmpty(scene, { @@ -46,7 +46,6 @@ import Character from './classes/Character' scale: { x: 100, y: 1, z: 100 }, }) deathZone.initCollider() - scene.addComponent(deathZone) // Create a ground const ground = new FCuboid(scene, { @@ -54,11 +53,10 @@ import Character from './classes/Character' scale: { x: 15, y: 0.1, z: 15 }, }) ground.initRigidBody({ - rigidBodyType: RAPIER.RigidBodyType.Fixed, + rigidBodyType: FRigidBodyType.FIXED, }) // Green ground ground.setColor(0x60D641) - scene.addComponent(ground) // Import 3d models const blockGrassCorner = new FOBJ(scene, { @@ -68,11 +66,10 @@ import Character from './classes/Character' rotationDegree: { x: 0, y: -45, z: 0 }, }) blockGrassCorner.initCollider({ - position: { x: 0, y: 1, z: 0 }, - scale: { x: 0.5, y: 0.5, z: 0.5 }, - rotationDegree: { x: 0, y: 45, z: 0 }, + positionOffset: { x: 0, y: 1, z: 0 }, + rotationDegreeOffset: { x: 0, y: 45, z: 0 }, + scaleOffset: { x: 0.5, y: 0.5, z: 0.5 }, }) - scene.addComponent(blockGrassCorner) const blockGrassOverhangLargeTall = new FOBJ(scene, { name: 'block-grass-overhang-large-tall', @@ -80,35 +77,32 @@ import Character from './classes/Character' scale: { x: 4, y: 4, z: 4 }, }) blockGrassOverhangLargeTall.initCollider({ - position: { x: 0, y: 2, z: 0 }, + positionOffset: { x: 0, y: 2, z: 0 }, }) - scene.addComponent(blockGrassOverhangLargeTall) const blockGrassLargeSlope = new FGLB(scene, { name: 'block-grass-large-slope', position: { x: -8.5, y: -1, z: -4 }, - scale: { x: 2, y: 2, z: 2 }, rotationDegree: { x: 0, y: -90, z: 0 }, + scale: { x: 2, y: 2, z: 2 }, }) blockGrassLargeSlope.onLoaded(() => { blockGrassLargeSlope.initCollider({ - shape: FShapes.MESH, + shape: FShapes.CUBOID, }) }) - scene.addComponent(blockGrassLargeSlope) const blockGrassLargeSlope2 = new FGLB(scene, { name: 'block-grass-large-slope', position: { x: -13, y: -2, z: -3 }, - scale: { x: 2, y: 2, z: 2 }, rotationDegree: { x: 0, y: -90, z: 0 }, + scale: { x: 2, y: 2, z: 2 }, }) blockGrassLargeSlope2.onLoaded(() => { blockGrassLargeSlope2.initCollider({ - shape: FShapes.MESH, + shape: FShapes.CUBOID, }) }) - scene.addComponent(blockGrassLargeSlope2) const blockGrassLarge = new FFBX(scene, { name: 'block-grass-large', @@ -119,7 +113,6 @@ import Character from './classes/Character' position: { x: 0, y: 2, z: 0 }, scale: { x: 1, y: 0.5, z: 1 }, }) - scene.addComponent(blockGrassLarge) // Add "stairs" for (let i = 0; i < 10; i++) { @@ -129,7 +122,6 @@ import Character from './classes/Character' }) cube.initCollider() cube.setColor(0x60D641) - scene.addComponent(cube) } // Create a second ground @@ -139,11 +131,9 @@ import Character from './classes/Character' }) ground2.initCollider() ground2.setColor(0x60D641) - scene.addComponent(ground2) // Create a character const character = new Character(scene) - scene.addComponent(character) // Attach a camera to the character scene.camera = new FGameCamera(scene, { target: character }) @@ -155,26 +145,21 @@ import Character from './classes/Character' position: { x: 2, y: 5, z: -2 }, }) sphere.initRigidBody() - scene.addComponent(sphere) const capsule = new FCapsule(scene, { position: { x: -5, y: 5, z: 5 }, rotationDegree: { x: 0, y: 45, z: 0 }, }) capsule.initRigidBody() - scene.addComponent(capsule) const duck = new Duck(scene) - duck.setPosition({ x: -5, y: 5, z: -5 }) + duck.transform.position = { x: -5, y: 5, z: -5 } duck.initRigidBody() - scene.addComponent(duck) - const gltfCube = new GltfCube(scene) - scene.addComponent(gltfCube) + new GltfCube(scene) const gltfCube2 = new GltfCube(scene) - gltfCube2.setPosition({ x: 2, y: 5, z: 2 }) - scene.addComponent(gltfCube2) + gltfCube2.transform.position = { x: 2, y: 5, z: 2 } // Create 8 cubes dynamically in circle from 0 to 2PI on the second ground for (let i = 0; i < 8; i++) { @@ -199,7 +184,6 @@ import Character from './classes/Character' }) cube.initRigidBody() } - scene.addComponent(cube) } // Create a rotating cube @@ -209,12 +193,11 @@ import Character from './classes/Character' rotatingCube.setColor(0x00FF00) rotatingCube.initSensor() let totalDelta = 0 - scene.addComponent(rotatingCube) scene.onFrame((delta) => { // Each frame, move the cube on a circle of radius 3 const x = Math.cos(totalDelta) * 3 const y = Math.sin(totalDelta) * 3 - rotatingCube.setPosition({ x, y, z: -5 }) + rotatingCube.transform.position = { x, y, z: -5 } totalDelta += delta }) @@ -233,19 +216,18 @@ import Character from './classes/Character' }) character.onCollisionWith(deathZone, () => { console.log('Character fell into the death zone!') - character.setPosition({ x: 0, y: 10, z: 0 }) + character.transform.position = { x: 0, y: 10, z: 0 } }) // Create keyboard const keyboard = new FKeyboard(scene) keyboard.onKeyDown('p', () => { - character.setPosition({ x: 0, y: 5, z: 0 }) + character.transform.position = { x: 0, y: 5, z: 0 } }) // After 3 seconds, add a third gltfCube setTimeout(() => { const gltfCube3 = new GltfCube(scene) - gltfCube3.setPosition({ x: -2, y: 5, z: -2 }) - scene.addComponent(gltfCube3) + gltfCube3.transform.position = { x: -2, y: 5, z: -2 } }, 3000) })() diff --git a/packages/3d/src/cameras/FCamera.ts b/packages/3d/src/cameras/FCamera.ts index 61422e05..bcd89481 100644 --- a/packages/3d/src/cameras/FCamera.ts +++ b/packages/3d/src/cameras/FCamera.ts @@ -45,13 +45,15 @@ export abstract class FCamera extends FCameraCore { // Create the Three.js camera this.__CAMERA__ = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) - // Store transform + // Configure transform this.transform = new FTransform({ - component: this, position: options.position, rotation: options.rotation, rotationDegree: options.rotationDegree, }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__()) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__()) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__()) // Set the position this.__CAMERA__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) diff --git a/packages/3d/src/controllers/FCharacterController.ts b/packages/3d/src/controllers/FCharacterController.ts index e500e65e..a6d9d1b0 100644 --- a/packages/3d/src/controllers/FCharacterController.ts +++ b/packages/3d/src/controllers/FCharacterController.ts @@ -110,9 +110,8 @@ export abstract class FCharacterController extends FController { }) // Initialize a sensor - this.component.sensor = new FSensor(this.component, { + this.component.initSensor({ shape: FShapes.CAPSULE, - scale: { x: 1.1, y: 1.1, z: 1.1 }, }) } diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index deb7a5c8..7a038518 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -1,8 +1,8 @@ import * as THREE from 'three' -import RAPIER from '@dimforge/rapier3d' import { FKeyboard } from '@fibbojs/event' import type { FScene } from '../core/FScene' import { FRigidBody } from '../core/FRigidBody' +import { FRigidBodyType } from '../types/FRigidBodyType' import type { FCharacterControllerOptions } from './FCharacterController' import { FCharacterController } from './FCharacterController' @@ -30,8 +30,8 @@ export class FCharacterControllerD extends FCharacterController { }) // Initialize the rigidBody - this.component.rigidBody = new FRigidBody(this.component, { - rigidBodyType: RAPIER.RigidBodyType.Dynamic, + this.component.initRigidBody({ + rigidBodyType: FRigidBodyType.DYNAMIC, lockRotations: true, ...options, }) diff --git a/packages/3d/src/controllers/FCharacterControllerK.ts b/packages/3d/src/controllers/FCharacterControllerK.ts index c8354403..3387b0b8 100644 --- a/packages/3d/src/controllers/FCharacterControllerK.ts +++ b/packages/3d/src/controllers/FCharacterControllerK.ts @@ -62,9 +62,8 @@ export abstract class FCharacterControllerK extends FCharacterController { y: this.yVelocity * 0.01, z: worldDirection.z * 8 * 0.01, } - // Compute the desired movement this.characterController.computeColliderMovement( - this.component.collider?.__COLLIDER__ as RAPIER.Collider, + this.component.rigidBody ? this.component.rigidBody.collider.__COLLIDER__ : this.component.collider?.__COLLIDER__ as RAPIER.Collider, desiredMovement, RAPIER.QueryFilterFlags.EXCLUDE_SENSORS, ) diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index 0c125bd0..f14752b6 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -1,6 +1,6 @@ -import RAPIER from '@dimforge/rapier3d' import type { FScene } from '../core/FScene' import { FRigidBody } from '../core/FRigidBody' +import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -23,8 +23,8 @@ export class FCharacterControllerKP extends FCharacterControllerK { super(scene, options) // Initialize the rigidBody - this.component.rigidBody = new FRigidBody(this.component, { - rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, + this.component.initRigidBody({ + rigidBodyType: FRigidBodyType.KINEMATIC_POSITION_BASED, ...options, }) } diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index 78d974ac..4430ae03 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -1,6 +1,6 @@ -import RAPIER from '@dimforge/rapier3d' import type { FScene } from '../core/FScene' import { FRigidBody } from '../core/FRigidBody' +import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -23,8 +23,8 @@ export class FCharacterControllerKV extends FCharacterControllerK { super(scene, options) // Initialize the rigidBody - this.component.rigidBody = new FRigidBody(this.component, { - rigidBodyType: RAPIER.RigidBodyType.KinematicVelocityBased, + this.component.initRigidBody({ + rigidBodyType: FRigidBodyType.KINEMATIC_VELOCITY_BASED, ...options, }) } diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index d6c4f599..8f58cbf5 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -5,12 +5,17 @@ import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' import type { FRigidBody } from './FRigidBody' import { FTransform } from './FTransform' +import type { FScene } from './FScene' export interface FColliderOptions { position?: FVector3 - scale?: FVector3 rotation?: FVector3 rotationDegree?: FVector3 + scale?: FVector3 + positionOffset?: FVector3 + rotationOffset?: FVector3 + rotationDegreeOffset?: FVector3 + scaleOffset?: FVector3 shape?: FShapes rigidBody?: FRigidBody sensor?: boolean @@ -25,29 +30,18 @@ export class FCollider { * RAPIER Collider */ __COLLIDER__: RAPIER.Collider - /** - * Position Offset for the collider. - * This is used to adjust the collider position relative to the component. - */ - __POSITION_OFFSET__: FVector3 - /** - * Rotation Offset for the collider. - * This is used to adjust the collider position relative to the component. - */ - __ROTATION_OFFSET__: FVector3 - /** - * Scale Offset for the collider. - * This is used to adjust the collider scale relative to the component. - */ - __SCALE_OFFSET__: FVector3 /** * The component the collider is attached to. */ - component: FComponent + __COMPONENT__?: FComponent /** - * The transform of the rigidBody. + * The transform of the collider. */ transform: FTransform + /** + * The transform offset of the collider. + */ + offset: FTransform /** * The shape of the collider. */ @@ -55,18 +49,22 @@ export class FCollider { /** * Creates a collider for a given component. - * @param component The component which the collider will be attached to. + * @param scene The scene the collider belongs to. * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. + * @param options.position The position of the collider. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotation The rotation of the collider. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationDegree The rotation of the collider in degrees. + * @param options.scale The scale of the collider. Default is { x: 1, y: 1, z: 1 }. + * @param options.positionOffset The position offset of the collider. Only used if the collider is attached to a component. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationOffset The rotation offset of the collider. Only used if the collider is attached to a component. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationDegreeOffset The rotation offset of the collider in degrees. Only used if the collider is attached to a component. + * @param options.scaleOffset The scale offset of the collider. Only used if the collider is attached to a component. Default is { x: 0, y: 0, z: 0 }. * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example * ```ts - * const collider = new FCollider(component, { + * const collider = new FCollider(scene, { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, @@ -74,204 +72,266 @@ export class FCollider { * }) * ``` */ - constructor(component: FComponent, options?: FColliderOptions) { + constructor(scene: FScene, options?: FColliderOptions) { // Apply default options const DEFAULT_OPTIONS = { position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, - rotationDegree: undefined, shape: FShapes.CUBOID, - rigidBody: undefined, sensor: false, } options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || !options.rotation || !options.shape || options.sensor === undefined) - throw new Error('FibboError: initCollider requires transforms options') + throw new Error('FibboError: options missing in FCollider constructor') // Check if the world exists - if (!component.scene.world) + if (!scene.world) throw new Error('FibboError: FScene must have a world to create a collider') - // If rotation degree is given, convert it to radians - if (options.rotationDegree) { - options.rotation = { - x: THREE.MathUtils.degToRad(options.rotationDegree.x), - y: THREE.MathUtils.degToRad(options.rotationDegree.y), - z: THREE.MathUtils.degToRad(options.rotationDegree.z), - } - } - // Store the options - this.__POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } - this.__ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } - this.__SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y, z: options.scale.z } - this.component = component this.shape = options.shape - // Devide the scale by 2 for the collider (RAPIER uses half-extents) - // Also interpete the scale as relative to the component's scale - options.scale = { - x: component.transform.scale.x / 2 * options.scale.x, - y: component.transform.scale.y / 2 * options.scale.y, - z: component.transform.scale.z / 2 * options.scale.z, - } + // Configure transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + rotationDegree: options.rotationDegree, + scale: options.scale, + }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) + this.offset = new FTransform({ + position: options.positionOffset || { x: 0, y: 0, z: 0 }, + rotation: options.rotationOffset ? options.rotationOffset : (options.rotationDegreeOffset ? undefined : { x: 0, y: 0, z: 0 }), + rotationDegree: options.rotationDegreeOffset ? options.rotationDegreeOffset : (options.rotationOffset ? undefined : { x: 0, y: 0, z: 0 }), + scale: options.scaleOffset || { x: 0, y: 0, z: 0 }, + }) // Create a collider description according to the shape given let colliderDesc switch (options.shape) { case FShapes.CUBOID: - colliderDesc = RAPIER.ColliderDesc.cuboid(options.scale.x, options.scale.y, options.scale.z) + colliderDesc = RAPIER.ColliderDesc.cuboid(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) break case FShapes.SPHERE: - colliderDesc = RAPIER.ColliderDesc.ball(options.scale.x) + colliderDesc = RAPIER.ColliderDesc.ball(this.transform.scale.x) break case FShapes.CAPSULE: - colliderDesc = RAPIER.ColliderDesc.capsule(options.scale.y / 2, options.scale.x / 2) - break - case FShapes.MESH: - // If component.__MESH__ isn't defined, throw an error - { - if (!component.__MESH__) - throw new Error('FibboError: Mesh collider can only be created from a THREE.Mesh') - // Flag to check if a THREE.Mesh was found - let found = false - // Traverse the mesh tree until we find a THREE.Mesh - component.__MESH__.traverse((child) => { - if (!found && child instanceof THREE.Mesh) { - colliderDesc = RAPIER.ColliderDesc.trimesh( - child.geometry.attributes.position.array as Float32Array, - child.geometry.index?.array as Uint32Array, - ) - found = true - } - }) - // If no THREE.Mesh was found, throw an error - if (!found) - throw new Error('FibboError: Mesh collider can only be created if a THREE.Mesh is found in the component') + colliderDesc = RAPIER.ColliderDesc.capsule(this.transform.scale.y / 2, this.transform.scale.x / 2) break - } default: throw new Error(`FibboError: shape not supported : ${options.shape}`) } - // Verify the collider description was created - if (!colliderDesc) - throw new Error('FibboError: Collider description could not be created') - - // If no rigidbody given, the collider is free : set translation and rotation for the collider - if (options.rigidBody === undefined) { - // Interprete the given position as relative to the component's position - const finalPosition = new THREE.Vector3( - component.transform.position.x + options.position.x, - component.transform.position.y + options.position.y, - component.transform.position.z + options.position.z, - ) - colliderDesc.setTranslation(finalPosition.x, finalPosition.y, finalPosition.z) + // Move the collider to the position + colliderDesc.setTranslation(this.transform.position.x, this.transform.position.y, this.transform.position.z) + // Rotate the collider + colliderDesc.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z))) - // Interprete the given rotation as relative to the component's rotation - const finalRotation = new THREE.Quaternion().setFromEuler( - new THREE.Euler( - component.transform.rotation.x + options.rotation.x, - component.transform.rotation.y + options.rotation.y, - component.transform.rotation.z + options.rotation.z, - ), - ) - colliderDesc.setRotation(finalRotation) - } // Set the sensor flag if (options.sensor) { colliderDesc.setSensor(true) colliderDesc.setActiveCollisionTypes(RAPIER.ActiveCollisionTypes.ALL) } - // Create the transform - this.transform = new FTransform({ - position: options.position, - rotation: options.rotation, - scale: options.scale, - }) - // Create the collider - this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) + this.__COLLIDER__ = scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) + + // Add the collider to the scene + scene.addCollider(this) + } + + frame(_delta: number): void { + // As the collider should have moved, update the transform to sync with the collider + this.transform.position = this.__COLLIDER__.translation() + this.transform.rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion().copy(this.__COLLIDER__.rotation())) } /** * Update the position of the collider according to the transform. * This method should be called after updating the transform properties. * @param initiator By default (false), the collider won't be considered as the initiator of the position update. - * This means the offset will be added to the position. + * This means the new position will be the position of the attached component, plus the offset. * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_POSITION__(initiator: boolean = false): void { - const newPosition = { - x: this.component.transform.position.x, - y: this.component.transform.position.y, - z: this.component.transform.position.z, - } - // If the collider is the initiator, propagate the position update + // If the collider is the initiator if (initiator) { - this.component.__UPDATE_POSITION__() - this.component.sensor?.__UPDATE_POSITION__() + if (this.component) { + // Update the collider position + this.__SET_POSITION__(this.transform.position) + // Propagate the position update + this.component.__UPDATE_POSITION__() + this.component.sensor?.__UPDATE_POSITION__() + } } - // Else, it was propagated to the collider, so add the offset - else { - newPosition.x += this.__POSITION_OFFSET__.x - newPosition.y += this.__POSITION_OFFSET__.y - newPosition.z += this.__POSITION_OFFSET__.z + // Else, it was propagated to the collider, so move the collider to the new position with the offset + else if (this.component) { + const newPosition = { + x: this.component.transform.position.x + this.offset.position.x, + y: this.component.transform.position.y + this.offset.position.y, + z: this.component.transform.position.z + this.offset.position.z, + } + // Update the collider position + this.__SET_POSITION__(newPosition) } - // Update the collider position - this.__COLLIDER__.setTranslation(newPosition) } /** * Update the rotation of the collider according to the transform. * This method should be called after updating the transform properties. * @param initiator By default (false), the collider won't be considered as the initiator of the rotation update. - * This means the offset will be added to the rotation. + * This means the new rotation will be the rotation of the attached component, plus the offset. * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_ROTATION__(initiator: boolean = false): void { - const newRotation = new THREE.Euler( - this.component.transform.rotation.x, - this.component.transform.rotation.y, - this.component.transform.rotation.z, - ) - // If the collider is the initiator, propagate the rotation update + // If the collider is the initiator if (initiator) { - this.component.__UPDATE_ROTATION__() - this.component.sensor?.__UPDATE_ROTATION__() + if (this.component) { + // Update the collider rotation + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update + this.component.__UPDATE_ROTATION__() + this.component.sensor?.__UPDATE_ROTATION__() + } } - // Else, it was propagated to the collider, so add the offset - else { - newRotation.x += this.__ROTATION_OFFSET__.x - newRotation.y += this.__ROTATION_OFFSET__.y - newRotation.z += this.__ROTATION_OFFSET__.z + // Else, it was propagated to the collider, so rotate the collider to the new rotation with the offset + else if (this.component) { + const newRotation = { + x: this.component.transform.rotation.x + this.offset.rotation.x, + y: this.component.transform.rotation.y + this.offset.rotation.y, + z: this.component.transform.rotation.z + this.offset.rotation.z, + } + // Update the collider rotation + this.__SET_ROTATION__(newRotation) } - // Update the collider rotation - this.__COLLIDER__.setRotation(new THREE.Quaternion().setFromEuler(newRotation)) } /** * Update the scale of the collider according to the transform. * This method should be called after updating the transform properties. * @param initiator By default (false), the collider won't be considered as the initiator of the scale update. - * This means the offset will be added to the scale. + * This means the new scale will be the scale of the attached component, plus the offset. * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_SCALE__(initiator: boolean = false): void { - // If the collider is the initiator, propagate the scale update + // If the collider is the initiator if (initiator) { - this.component.__UPDATE_SCALE__() - this.component.sensor?.__UPDATE_SCALE__() + if (this.component) { + // Update the collider scale + this.__SET_SCALE__(this.transform.scale) + // Propagate the scale update + this.component.__UPDATE_SCALE__() + this.component.sensor?.__UPDATE_SCALE__() + } + } + // Else, it was propagated to the collider, so scale the collider to the new scale with the offset + else if (this.component) { + const newScale = { + x: this.component.transform.scale.x + this.offset.scale.x, + y: this.component.transform.scale.y + this.offset.scale.y, + z: this.component.transform.scale.z + this.offset.scale.z, + } + // Update the collider scale + this.__SET_SCALE__(newScale) + } + } + + /** + * Set the position of the collider. + * @param position The new position of the collider. + */ + __SET_POSITION__(position: FVector3): void { + this.__COLLIDER__.setTranslation(position) + this.transform.__POSITION__ = position + } + + /** + * Set the rotation of the collider. + * @param rotation The new rotation of the collider. + */ + __SET_ROTATION__(rotation: FVector3): void { + this.__COLLIDER__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z))) + this.transform.__ROTATION__ = rotation + } + + /** + * Set the scale of the collider. + * @param scale The new scale of the collider. + */ + __SET_SCALE__(scale: FVector3): void { + // If the shape is a sphere, the scale should be the same on all axis + if (this.shape === FShapes.SPHERE) { + scale.x = Math.max(scale.x, scale.y, scale.z) + scale.y = scale.x + scale.z = scale.x + } + // If the shape is a capsule, the scale should be the same on the x and z axis + else if (this.shape === FShapes.CAPSULE) { + scale.x = Math.max(scale.x, scale.z) + scale.z = scale.x } // If the collider is a cuboid, update its half extents if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - this.__COLLIDER__.setShape(new RAPIER.Cuboid(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2)) + this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2, scale.z / 2)) } // If the collider is a ball, update its radius else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) / 2)) + this.__COLLIDER__.setShape(new RAPIER.Ball(scale.x / 2)) } + // If the collider is a capsule, update its half extents + else if (this.__COLLIDER__.shape instanceof RAPIER.Capsule) { + this.__COLLIDER__.setShape(new RAPIER.Capsule(scale.y / 2, scale.x / 2)) + } + this.transform.__SCALE__ = scale + } + + /** + * Generate a mesh collider from a component. + * @param component The component to generate the mesh collider from. + */ + generateShapeFromComponent(component: FComponent): void { + if (!component.__MESH__) + throw new Error('FibboError: Mesh collider can only be created from a THREE.Mesh') + let colliderDesc + // Flag to check if a THREE.Mesh was found + let found = false + // Traverse the mesh tree until we find a THREE.Mesh + component.__MESH__.traverse((child) => { + if (!found && child instanceof THREE.Mesh) { + colliderDesc = RAPIER.ColliderDesc.trimesh( + child.geometry.attributes.position.array as Float32Array, + child.geometry.index?.array as Uint32Array, + ) + found = true + } + }) + // If no THREE.Mesh was found, throw an error + if (!found || !colliderDesc) + throw new Error('FibboError: Mesh collider can only be created if a THREE.Mesh is found in the component') + // Create the collider + this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, component.rigidBody?.__RIGIDBODY__) + // Move the collider to the position + this.__SET_POSITION__(this.transform.position) + // Rotate the collider + this.__SET_ROTATION__(this.transform.rotation) + // Define the shape as a mesh + this.shape = FShapes.MESH + } + + // Setters & Getters + + get component(): FComponent | undefined { + return this.__COMPONENT__ + } + + set component(component: FComponent | undefined) { + this.__COMPONENT__ = component + // Update the position, rotation and scale of the collider + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() + this.__UPDATE_SCALE__() } } diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 743f64c9..4d43d733 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -5,9 +5,12 @@ import { FComponent as FComponentCore } from '@fibbojs/core' import type { FController } from '../controllers/FController' import type { FVector3 } from '../types/FVector3' import type { FScene } from './FScene' -import type { FCollider } from './FCollider' -import type { FRigidBody } from './FRigidBody' +import type { FColliderOptions } from './FCollider' +import { FCollider } from './FCollider' +import type { FRigidBodyOptions } from './FRigidBody' +import { FRigidBody } from './FRigidBody' import { FTransform } from './FTransform' +import { FSensor } from './FSensor' export interface FComponentOptions { position?: FVector3 @@ -95,99 +98,20 @@ export abstract class FComponent extends FComponentCore { if (!options.position || !options.scale || (!options.rotation && !options.rotationDegree)) throw new Error('FibboError: FComponent requires position, scale and rotation options') - // Create the transform + // Configure transform this.transform = new FTransform({ - component: this, position: options.position, - scale: options.scale, rotation: options.rotation, rotationDegree: options.rotationDegree, + scale: options.scale, }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) } frame(_delta: number): void { super.frame(_delta) - // If the rigidBody and mesh exist, update the mesh position and rotation according to the rigidBody - if (this.rigidBody && this.collider && this.__MESH__) { - // Translation - const newMeshPosition = this.rigidBody.__RIGIDBODY__.translation() - // Remove offset - newMeshPosition.x -= this.collider.__POSITION_OFFSET__.x - newMeshPosition.y -= this.collider.__POSITION_OFFSET__.y - newMeshPosition.z -= this.collider.__POSITION_OFFSET__.z - - // Rotation - const newMeshRotation = new THREE.Euler().setFromQuaternion( - new THREE.Quaternion( - this.rigidBody.__RIGIDBODY__.rotation().x, - this.rigidBody.__RIGIDBODY__.rotation().y, - this.rigidBody.__RIGIDBODY__.rotation().z, - this.rigidBody.__RIGIDBODY__.rotation().w, - ), - ) - // Remove offset - newMeshRotation.x -= this.collider.__ROTATION_OFFSET__.x - newMeshRotation.y -= this.collider.__ROTATION_OFFSET__.y - newMeshRotation.z -= this.collider.__ROTATION_OFFSET__.z - - // Apply the new transforms to the mesh - this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.__MESH__.setRotationFromEuler(newMeshRotation) - - // Update position and rotation properties of the component according to the rigidBody - this.transform.position = newMeshPosition - this.transform.rotation = newMeshRotation - // If a sensor exists, update its position and rotation according to the rigidBody - if (this.sensor) { - // Apply offset to the sensor - newMeshPosition.x += this.sensor.collider.__POSITION_OFFSET__.x - newMeshPosition.y += this.sensor.collider.__POSITION_OFFSET__.y - newMeshPosition.z += this.sensor.collider.__POSITION_OFFSET__.z - this.sensor.__RIGIDBODY__.setTranslation(newMeshPosition, true) - this.sensor.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(newMeshRotation), true) - } - } - // If the collider and mesh exist, update the mesh position and rotation according to the collider - else if (this.collider && this.__MESH__) { - // Translation - const newMeshPosition = this.collider.__COLLIDER__.translation() - // Remove offset - newMeshPosition.x -= this.collider.__POSITION_OFFSET__.x - newMeshPosition.y -= this.collider.__POSITION_OFFSET__.y - newMeshPosition.z -= this.collider.__POSITION_OFFSET__.z - - // Rotation - const newMeshRotation = new THREE.Euler().setFromQuaternion( - new THREE.Quaternion( - this.collider.__COLLIDER__.rotation().x, - this.collider.__COLLIDER__.rotation().y, - this.collider.__COLLIDER__.rotation().z, - this.collider.__COLLIDER__.rotation().w, - ), - ) - // Remove offset - newMeshRotation.x -= this.collider.__ROTATION_OFFSET__.x - newMeshRotation.y -= this.collider.__ROTATION_OFFSET__.y - newMeshRotation.z -= this.collider.__ROTATION_OFFSET__.z - - // Apply the new transforms to the mesh - this.__MESH__.position.set(newMeshPosition.x, newMeshPosition.y, newMeshPosition.z) - this.__MESH__.setRotationFromEuler(newMeshRotation) - // Update position and rotation properties of the component - this.transform.position = newMeshPosition - this.transform.rotation = newMeshRotation - } - // If the rigidBody and collider doesn't exist, update the mesh position and rotation according to the default values - else if (this.__MESH__) { - this.__MESH__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) - this.__MESH__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) - // If a sensor exists, update its position and rotation according to the default values - if (this.sensor) { - this.sensor.__RIGIDBODY__.setTranslation({ x: this.transform.position.x, y: this.transform.position.y, z: this.transform.position.z }, true) - this.sensor.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z)), true) - } - } - // If the mesh still doesn't exist, do nothing } /** @@ -197,11 +121,11 @@ export abstract class FComponent extends FComponentCore { * Set this to true to propagate the position update to the rigidBody, collider and sensor. */ __UPDATE_POSITION__(initiator: boolean = false): void { - // If a mesh exists, update its position - if (this.__MESH__) - this.__MESH__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) - // If the component is the initiator, propagate the position update to the rigidBody, collider and sensor + // If the component is the initiator if (initiator) { + // Move the component + this.__SET_POSITION__(this.transform.position) + // Propagate the position update to the rigidBody, collider and sensor if (this.rigidBody) this.rigidBody.__UPDATE_POSITION__() else if (this.collider) @@ -209,6 +133,27 @@ export abstract class FComponent extends FComponentCore { if (this.sensor) this.sensor.__UPDATE_POSITION__() } + else { + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Move the component + this.__SET_POSITION__({ + x: this.rigidBody.transform.position.x - this.rigidBody.offset.position.x, + y: this.rigidBody.transform.position.y - this.rigidBody.offset.position.y, + z: this.rigidBody.transform.position.z - this.rigidBody.offset.position.z, + }) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Move the component + this.__SET_POSITION__({ + x: this.collider.transform.position.x - this.collider.offset.x, + y: this.collider.transform.position.y - this.collider.offset.y, + z: this.collider.transform.position.z - this.collider.offset.z, + }) + } + } } /** @@ -218,11 +163,11 @@ export abstract class FComponent extends FComponentCore { * Set this to true to propagate the rotation update to the rigidBody, collider and sensor. */ __UPDATE_ROTATION__(initiator: boolean = false): void { - // If a mesh exists, update its rotation - if (this.__MESH__) - this.__MESH__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) - // If the component is the initiator, propagate the rotation update to the rigidBody, collider and sensor + // If the component is the initiator if (initiator) { + // Rotate the component + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update to the rigidBody, collider and sensor if (this.rigidBody) this.rigidBody.__UPDATE_ROTATION__() else if (this.collider) @@ -230,6 +175,27 @@ export abstract class FComponent extends FComponentCore { if (this.sensor) this.sensor.__UPDATE_ROTATION__() } + else { + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Rotate the component + this.__SET_ROTATION__({ + x: this.rigidBody.transform.rotation.x - this.rigidBody.offset.rotationX, + y: this.rigidBody.transform.rotation.y - this.rigidBody.offset.rotationY, + z: this.rigidBody.transform.rotation.z - this.rigidBody.offset.rotationZ, + }) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Rotate the component + this.__SET_ROTATION__({ + x: this.collider.transform.rotation.x - this.collider.offset.rotationX, + y: this.collider.transform.rotation.y - this.collider.offset.rotationY, + z: this.collider.transform.rotation.z - this.collider.offset.rotationZ, + }) + } + } } /** @@ -239,27 +205,72 @@ export abstract class FComponent extends FComponentCore { * Set this to true to propagate the scale update to the rigidBody, collider and sensor. */ __UPDATE_SCALE__(initiator: boolean = false): void { - // If a mesh exists + // If the component is the initiator + if (initiator) { + // Scale the component + this.__SET_SCALE__(this.transform.scale) + // Propagate the scale update to the rigidBody, collider and sensor + if (this.rigidBody) + this.rigidBody.__UPDATE_SCALE__() + else if (this.collider) + this.collider.__UPDATE_SCALE__() + if (this.sensor) + this.sensor.__UPDATE_SCALE__() + } + else { + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Scale the component + this.__SET_SCALE__({ + x: this.rigidBody.transform.scale.x - this.rigidBody.offset.scaleX, + y: this.rigidBody.transform.scale.y - this.rigidBody.offset.scaleY, + z: this.rigidBody.transform.scale.z - this.rigidBody.offset.scaleZ, + }) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Scale the component + this.__SET_SCALE__({ + x: this.collider.transform.scale.x - this.collider.offset.scaleX, + y: this.collider.transform.scale.y - this.collider.offset.scaleY, + z: this.collider.transform.scale.z - this.collider.offset.scaleZ, + }) + } + } + } + + __SET_POSITION__(position: FVector3): void { + // Move the mesh + if (this.__MESH__) + this.__MESH__.position.set(position.x, position.y, position.z) + // Update the transform + this.transform.__POSITION__ = position + } + + __SET_ROTATION__(rotation: FVector3): void { + // Rotate the mesh + if (this.__MESH__) + this.__MESH__.rotation.set(rotation.x, rotation.y, rotation.z) + // Update the transform + this.transform.__ROTATION__ = rotation + } + + __SET_SCALE__(scale: FVector3): void { + // Scale the mesh if (this.__MESH__) { // If the mesh is a classic polyhedron if (this.__MESH__ instanceof THREE.Mesh && (this.__MESH__.geometry instanceof THREE.BoxGeometry || this.__MESH__.geometry instanceof THREE.SphereGeometry)) { - this.__MESH__.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) + this.__MESH__.scale.set(scale.x, scale.y, scale.z) } // We don't know the type of the mesh, probably a custom mesh else { // I don't really know why the scale should be devided by 2 for custom meshes, but it works - this.__MESH__.scale.set(this.transform.scale.x / 2, this.transform.scale.y / 2, this.transform.scale.z / 2) + this.__MESH__.scale.set(scale.x / 2, scale.y / 2, scale.z / 2) } } - // If the component is the initiator, propagate the scale update to the rigidBody, collider and sensor - if (initiator) { - if (this.rigidBody) - this.rigidBody.__UPDATE_SCALE__() - else if (this.collider) - this.collider.__UPDATE_SCALE__() - if (this.sensor) - this.sensor.__UPDATE_SCALE__() - } + // Update the transform + this.transform.__SCALE__ = scale } onCollisionWith(classOrObject: any, callback: (data: OnCollisionWithData) => void): () => void { @@ -271,4 +282,19 @@ export abstract class FComponent extends FComponentCore { // Call the core onCollisionWith method return super.onCollisionWith(classOrObject, callback) } + + initCollider(options?: FColliderOptions) { + this.collider = new FCollider(this.scene, options) + this.collider.component = this + } + + initRigidBody(options?: FRigidBodyOptions) { + this.rigidBody = new FRigidBody(this.scene, options) + this.rigidBody.component = this + } + + initSensor(options?: FRigidBodyOptions) { + this.sensor = new FSensor(this.scene, options) + this.sensor.component = this + } } diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index 836c7fbe..8d6f04dd 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -2,17 +2,23 @@ import * as THREE from 'three' import * as RAPIER from '@dimforge/rapier3d' import { FShapes } from '../types/FShapes' import type { FVector3 } from '../types/FVector3' +import { FRigidBodyType } from '../types/FRigidBodyType' import type { FComponent } from './FComponent' import { FCollider } from './FCollider' import { FTransform } from './FTransform' +import type { FScene } from './FScene' export interface FRigidBodyOptions { position?: FVector3 - scale?: FVector3 rotation?: FVector3 rotationDegree?: FVector3 + scale?: FVector3 + positionOffset?: FVector3 + rotationOffset?: FVector3 + rotationDegreeOffset?: FVector3 + scaleOffset?: FVector3 shape?: FShapes - rigidBodyType?: RAPIER.RigidBodyType + rigidBodyType?: FRigidBodyType sensor?: boolean lockTranslations?: boolean lockRotations?: boolean @@ -41,34 +47,33 @@ export class FRigidBody { * Fibbo Collider */ collider: FCollider - /** - * Position Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the component. - */ - __POSITION_OFFSET__: FVector3 - /** - * Rotation Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the component. - */ - __ROTATION_OFFSET__: FVector3 /** * The component the rigidBody is attached to. */ - component: FComponent + __COMPONENT__?: FComponent /** * The transform of the rigidBody. */ transform: FTransform + /** + * The transform offset of the rigidBody. + */ + offset: FTransform /** * Creates a rigidBody for the given component. - * @param component The component which the collider will be attached to. + * @param scene The scene the rigidBody belongs to. * @param options The options for the rigidBody. - * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. - * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.position The position of the rigidBody. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotation The rotation of the rigidBody. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationDegree The rotation of the rigidBody in degrees. + * @param options.scale The scale of the rigidBody. Default is { x: 1, y: 1, z: 1 }. + * @param options.positionOffset The position offset of the rigidBody. Only used if the rigidBody is attached to a component. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationOffset The rotation offset of the rigidBody. Only used if the rigidBody is attached to a component. Default is { x: 0, y: 0, z: 0 }. + * @param options.rotationDegreeOffset The rotation offset of the rigidBody in degrees. Only used if the rigidBody is attached to a component. + * @param options.scaleOffset The scale offset of the rigidBody. Only used if the rigidBody is attached to a component. Default is { x: 0, y: 0, z: 0 }. + * @param options.shape The shape of the collider that will be generated from the rigidBody. If not defined, it will default to FShapes.CUBOID. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to FRigidBodyType.Dynamic. * @param options.lockTranslations If true, the rigidBody will not be able to move. * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. @@ -81,7 +86,7 @@ export class FRigidBody { * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts - * const rigidBody = new FRigidBody({ + * const rigidBody = new FRigidBody(scene, { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, @@ -89,7 +94,7 @@ export class FRigidBody { * }) * ``` */ - constructor(component: FComponent, options?: FRigidBodyOptions) { + constructor(scene: FScene, options?: FRigidBodyOptions) { // Apply default options const DEFAULT_OPTIONS = { position: { x: 0, y: 0, z: 0 }, @@ -97,7 +102,7 @@ export class FRigidBody { rotation: { x: 0, y: 0, z: 0 }, rotationDegree: undefined, shape: FShapes.CUBOID, - rigidBodyType: RAPIER.RigidBodyType.Dynamic, + rigidBodyType: FRigidBodyType.DYNAMIC, sensor: false, lockTranslations: false, lockRotations: false, @@ -110,41 +115,54 @@ export class FRigidBody { throw new Error('FibboError: initRigidBody requires transforms options') // Check if the world exists - if (!component.scene.world) + if (!scene.world) throw new Error('FibboError: FScene must have a world to create a rigidBody') - // Store the options - this.__POSITION_OFFSET__ = { x: options.position.x, y: options.position.y, z: options.position.z } - this.__ROTATION_OFFSET__ = { x: options.rotation.x, y: options.rotation.y, z: options.rotation.z } - this.component = component - - // If rotation degree is given, convert it to radians - if (options.rotationDegree) { - options.rotation.x = THREE.MathUtils.degToRad(options.rotationDegree.x) - options.rotation.y = THREE.MathUtils.degToRad(options.rotationDegree.y) - options.rotation.z = THREE.MathUtils.degToRad(options.rotationDegree.z) - } + // Configure transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + rotationDegree: options.rotationDegree, + scale: options.scale, + }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) + this.offset = new FTransform({ + position: options.positionOffset || { x: 0, y: 0, z: 0 }, + rotation: options.rotationOffset ? options.rotationOffset : (options.rotationDegreeOffset ? undefined : { x: 0, y: 0, z: 0 }), + rotationDegree: options.rotationDegreeOffset ? options.rotationDegreeOffset : (options.rotationOffset ? undefined : { x: 0, y: 0, z: 0 }), + scale: options.scaleOffset || { x: 0, y: 0, z: 0 }, + }) // Create a rigidBody description according to the type - const rigidBodyDesc = new RAPIER.RigidBodyDesc(options.rigidBodyType as RAPIER.RigidBodyType) + const rigidBodyDesc = new RAPIER.RigidBodyDesc( + options.rigidBodyType === FRigidBodyType.DYNAMIC + ? RAPIER.RigidBodyType.Dynamic + : options.rigidBodyType === FRigidBodyType.KINEMATIC_POSITION_BASED + ? RAPIER.RigidBodyType.KinematicPositionBased + : options.rigidBodyType === FRigidBodyType.KINEMATIC_VELOCITY_BASED + ? RAPIER.RigidBodyType.KinematicVelocityBased + : RAPIER.RigidBodyType.Fixed, + ) // Interprete the given position as relative to the component's position rigidBodyDesc.setTranslation( - component.transform.position.x + options.position.x, - component.transform.position.y + options.position.y, - component.transform.position.z + options.position.z, + this.transform.position.x, + this.transform.position.y, + this.transform.position.z, ) // Interprete the given rotation as relative to the component's rotation rigidBodyDesc.setRotation(new THREE.Quaternion().setFromEuler( new THREE.Euler( - component.transform.rotation.x + options.rotation.x, - component.transform.rotation.y + options.rotation.y, - component.transform.rotation.z + options.rotation.z, + this.transform.rotation.x, + this.transform.rotation.y, + this.transform.rotation.z, ), )) // Create the rigidBody - this.__RIGIDBODY__ = component.scene.world.createRigidBody(rigidBodyDesc) + this.__RIGIDBODY__ = scene.world.createRigidBody(rigidBodyDesc) // Lock the translation if needed if (options.lockTranslations) @@ -171,88 +189,163 @@ export class FRigidBody { ) } - // Create the transform - this.transform = new FTransform({ - position: options.position, - rotation: options.rotation, - scale: options.scale, - }) - // Create the collider - this.collider = new FCollider(component, { + this.collider = new FCollider(scene, { ...options, rigidBody: this, }) + + // Add the rigidBody to the scene + scene.addRigidBody(this) + } + + frame(_delta: number): void { + // As the rigidBody should have moved, update the transform to sync with the rigidBody + this.transform.position = this.__RIGIDBODY__.translation() + this.transform.rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion().copy(this.__RIGIDBODY__.rotation())) } /** * Update the position of the rigidBody according to the transform. * This method should be called after updating the transform properties. - * @param initiator By default (false), the rigidBody won't be considered as the initiator of the rotation update. - * This means the offset will be added to the rotation. - * Setting this to true will propagate the event to other objects (component, collider, sensor,...). + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the position update. + * This means the new position will be the position of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_POSITION__(initiator: boolean = false): void { - const newPosition = { - x: this.component.transform.position.x, - y: this.component.transform.position.y, - z: this.component.transform.position.z, - } - // If the rigidBody is the initiator, propagate the position update + // If the rigidBody is the initiator if (initiator) { - this.component.__UPDATE_POSITION__() - this.collider.__UPDATE_POSITION__() + if (this.component) { + // Update the rigidBody position + this.__SET_POSITION__(this.transform.position) + // Propagate the position update + this.component.__UPDATE_POSITION__() + this.component.sensor?.__UPDATE_POSITION__() + } } - // Else, it was propagated to the rigidBody, so add the offset - else { - newPosition.x += this.__POSITION_OFFSET__.x - newPosition.y += this.__POSITION_OFFSET__.y - newPosition.z += this.__POSITION_OFFSET__.z + // Else, it was propagated to the rigidBody, so move the rigidBody to the new position with the offset + else if (this.component) { + const newPosition = { + x: this.component.transform.position.x + this.offset.position.x, + y: this.component.transform.position.y + this.offset.position.y, + z: this.component.transform.position.z + this.offset.position.z, + } + // Update the rigidBody position + this.__SET_POSITION__(newPosition) } - // Update the rigidBody position - this.__RIGIDBODY__.setTranslation(newPosition, true) } /** * Update the rotation of the rigidBody according to the transform. * This method should be called after updating the transform properties. * @param initiator By default (false), the rigidBody won't be considered as the initiator of the rotation update. - * This means the offset will be added to the rotation. - * Setting this to true will propagate the event to other objects (component, collider, sensor,...). + * This means the new rotation will be the rotation of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_ROTATION__(initiator: boolean = false): void { - const newRotation = new THREE.Euler( - this.component.transform.rotation.x, - this.component.transform.rotation.y, - this.component.transform.rotation.z, - ) - // If the rigidBody is the initiator, propagate the rotation update + // If the rigidBody is the initiator if (initiator) { - this.component.__UPDATE_ROTATION__() - this.collider.__UPDATE_ROTATION__() + if (this.component) { + // Update the rigidBody rotation + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update + this.component.__UPDATE_ROTATION__() + this.component.sensor?.__UPDATE_ROTATION__() + } } - // Else, it was propagated to the rigidBody, so add the offset - else { - newRotation.x += this.__ROTATION_OFFSET__.x - newRotation.y += this.__ROTATION_OFFSET__.y - newRotation.z += this.__ROTATION_OFFSET__.z + // Else, it was propagated to the rigidBody, so rotate the rigidBody to the new rotation with the offset + else if (this.component) { + const newRotation = { + x: this.component.transform.rotation.x + this.offset.rotation.x, + y: this.component.transform.rotation.y + this.offset.rotation.y, + z: this.component.transform.rotation.z + this.offset.rotation.z, + } + // Update the rigidBody rotation + this.__SET_ROTATION__(newRotation) } - // Update the rigidBody rotation - this.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(newRotation), true) } /** * Update the scale of the rigidBody according to the transform. * This method should be called after updating the transform properties. * @param initiator By default (false), the rigidBody won't be considered as the initiator of the scale update. - * This means the offset will be added to the scale. - * Setting this to true will propagate the event to other objects (component, collider, sensor,...). + * This means the new scale will be the scale of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ __UPDATE_SCALE__(initiator: boolean = false): void { - // If the rigidBody is the initiator, propagate the scale update + // If the rigidBody is the initiator if (initiator) { - this.component.__UPDATE_SCALE__() - this.collider.__UPDATE_SCALE__() + // Update the rigidBody scale + this.__SET_SCALE__(this.transform.scale) + if (this.component) { + // Propagate the scale update + this.component.__UPDATE_SCALE__() + this.component.sensor?.__UPDATE_SCALE__() + } + } + // Else, it was propagated to the rigidBody, so scale the rigidBody to the new scale with the offset + else if (this.component) { + const newScale = { + x: this.component.transform.scale.x + this.offset.scale.x, + y: this.component.transform.scale.y + this.offset.scale.y, + z: this.component.transform.scale.z + this.offset.scale.z, + } + // Update the rigidBody scale + this.__SET_SCALE__(newScale) + } + } + + /** + * Set the position of the rigidBody. + * @param position The new position of the rigidBody. + */ + __SET_POSITION__(position: FVector3): void { + this.__RIGIDBODY__.setTranslation(position, true) + this.transform.__POSITION__ = position + this.collider.__SET_POSITION__(position) + } + + /** + * Set the rotation of the rigidBody. + * @param rotation The new rotation of the rigidBody. + */ + __SET_ROTATION__(rotation: FVector3): void { + this.__RIGIDBODY__.setRotation(new THREE.Quaternion().setFromEuler(new THREE.Euler(rotation.x, rotation.y, rotation.z)), true) + this.transform.__ROTATION__ = rotation + this.collider.__SET_ROTATION__(rotation) + } + + /** + * Set the scale of the rigidBody. + * @param scale The new scale of the rigidBody. + */ + __SET_SCALE__(scale: FVector3): void { + // If the shape is a sphere, the scale should be the same on all axis + if (this.collider.shape === FShapes.SPHERE) { + scale.x = Math.max(scale.x, scale.y, scale.z) + scale.y = scale.x + scale.z = scale.x } + // If the shape is a capsule, the scale should be the same on the x and z axis + else if (this.collider.shape === FShapes.CAPSULE) { + scale.x = Math.max(scale.x, scale.z) + scale.z = scale.x + } + this.transform.__SCALE__ = scale + this.collider.__SET_SCALE__(scale) + } + + // Setters & Getters + + get component(): FComponent | undefined { + return this.__COMPONENT__ + } + + set component(component: FComponent | undefined) { + this.__COMPONENT__ = component + // Update the position, rotation and scale of the rigidBody + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() + this.__UPDATE_SCALE__() } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 42689a47..a4045a91 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -8,6 +8,8 @@ import { FModel } from '../model/FModel' import type { FLight } from '../lights/FLight' import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' +import type { FRigidBody } from './FRigidBody' +import type { FCollider } from './FCollider' export interface FSceneOptions extends FSceneOptionsCore { gravity?: FVector3 @@ -56,7 +58,10 @@ export class FScene extends FSceneCore { declare components: FComponent[] // Lights can be declared as it will be initialized by the parent class declare lights: FLight[] - + // The colliders of the scene + declare colliders: FCollider[] + // The rigidBodies of the scene + declare rigidBodies: FRigidBody[] // Three.js THREE: typeof THREE = THREE declare scene: THREE.Scene @@ -91,6 +96,10 @@ export class FScene extends FSceneCore { this.renderer.setSize(window.innerWidth, window.innerHeight) }) + + // Initialize collider and rigidBody arrays + this.colliders = [] + this.rigidBodies = [] } init() { @@ -112,6 +121,9 @@ export class FScene extends FSceneCore { // Each frame this.onFrame((delta) => { + // Call frame for each collider and rigidBody + this.colliders.forEach(collider => collider.frame(delta)) + this.rigidBodies.forEach(rigidBody => rigidBody.frame(delta)) // Call frame for each component this.components.forEach(component => component.frame(delta)) @@ -184,32 +196,15 @@ export class FScene extends FSceneCore { addComponent(component: FComponent) { super.addComponent(component) - // Detect if the FComponent is a FGLTF instance - if (component instanceof FModel) { - // Wait for the model to be loaded before adding it to the scene - component.onLoaded(() => { - if (component.__MESH__) - this.scene.add(component.__MESH__) - - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) - }) - } - else { - if (component.__MESH__) - this.scene.add(component.__MESH__) - - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) - } + if (component.__MESH__) + this.scene.add(component.__MESH__) + + // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + if (component.sensor) + this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) + // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + else if (component.collider) + this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) } removeComponent(component: FComponent): void { @@ -219,13 +214,13 @@ export class FScene extends FSceneCore { if (component.__MESH__) this.scene.remove(component.__MESH__) - // Remove colliders and rigidBodies from rapier world + // Remove colliders and rigidBodies from the scene if (component.rigidBody) - this.world.removeRigidBody(component.rigidBody.__RIGIDBODY__) + this.removeRigidBody(component.rigidBody) if (component.collider) - this.world.removeCollider(component.collider.__COLLIDER__, false) + this.removeCollider(component.collider) if (component.sensor) - this.world.removeCollider(component.sensor.collider.__COLLIDER__, false) + this.removeRigidBody(component.sensor) // Remove handle from rapier map if (component.sensor) @@ -236,15 +231,36 @@ export class FScene extends FSceneCore { addLight(light: FLight): void { super.addLight(light) - // Add the light to the THREE scene - this.scene.add(light.light) + this.scene.add(light.__LIGHT__) } removeLight(light: FLight): void { super.removeLight(light) - // Remove the light from the THREE scene - this.scene.remove(light.light) + this.scene.remove(light.__LIGHT__) + } + + addCollider(collider: FCollider): void { + this.colliders.push(collider) + } + + removeCollider(collider: FCollider): void { + const index = this.colliders.indexOf(collider) + if (index !== -1) + this.colliders.splice(index, 1) + this.world.removeCollider(collider.__COLLIDER__, false) + } + + addRigidBody(rigidBody: FRigidBody): void { + this.rigidBodies.push(rigidBody) + } + + removeRigidBody(rigidBody: FRigidBody): void { + this.removeCollider(rigidBody.collider) + const index = this.rigidBodies.indexOf(rigidBody) + if (index !== -1) + this.rigidBodies.splice(index, 1) + this.world.removeRigidBody(rigidBody.__RIGIDBODY__) } } diff --git a/packages/3d/src/core/FSensor.ts b/packages/3d/src/core/FSensor.ts index adb41068..c953750e 100644 --- a/packages/3d/src/core/FSensor.ts +++ b/packages/3d/src/core/FSensor.ts @@ -1,7 +1,7 @@ -import * as RAPIER from '@dimforge/rapier3d' -import type { FComponent } from './FComponent' +import { FRigidBodyType } from '../types/FRigidBodyType' import type { FRigidBodyOptions } from './FRigidBody' import { FRigidBody } from './FRigidBody' +import type { FScene } from './FScene' /** * A 3d sensor that can be attached to a component. @@ -9,28 +9,27 @@ import { FRigidBody } from './FRigidBody' */ export class FSensor extends FRigidBody { /** - * Creates a sensor for the given component. - * It is basically a rigidBody that defaults to a kinematic position based type aswell as the sensor flag. - * @param component The component which the collider will be attached to. - * @param options The options for the sensor. - * @param options.position The position of the sensor. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the sensor. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the sensor. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the sensor. If not defined, it will default to FShapes.CUBOID. - * @param options.rigidBodyType The type of the sensor. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. - * @param options.lockTranslations If true, the sensor will not be able to move. - * @param options.lockRotations If true, the sensor will not be able to rotate. + * Creates a rigidBody for the given component. + * @param scene The scene the rigidBody belongs to. + * @param options The options for the rigidBody. + * @param options.position The position of the rigidBody. + * @param options.scale The scale of the rigidBody. + * @param options.rotation The rotation of the rigidBody. + * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to FRigidBodyType.Dynamic. + * @param options.lockTranslations If true, the rigidBody will not be able to move. + * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. - * @param options.enabledTranslations.enableX If true, the sensor will be able to move on the x-axis. - * @param options.enabledTranslations.enableY If true, the sensor will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the sensor will be able to move on the z-axis. + * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. + * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the sensor will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the sensor will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the sensor will be able to rotate on the z-axis. + * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. + * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. + * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts - * const sensor = new FSensor({ + * const sensor = new FSensor(scene, { * position: { x: 0, y: 0, z: 0 }, * scale: { x: 1, y: 1, z: 1 }, * rotation: { x: 0, y: 0, z: 0 }, @@ -38,10 +37,10 @@ export class FSensor extends FRigidBody { * }) * ``` */ - constructor(component: FComponent, options?: FRigidBodyOptions) { - super(component, { + constructor(scene: FScene, options?: FRigidBodyOptions) { + super(scene, { sensor: true, - rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, + rigidBodyType: FRigidBodyType.KINEMATIC_POSITION_BASED, ...options, }) } diff --git a/packages/3d/src/core/FTransform.ts b/packages/3d/src/core/FTransform.ts index 600ffb1a..d373821c 100644 --- a/packages/3d/src/core/FTransform.ts +++ b/packages/3d/src/core/FTransform.ts @@ -1,13 +1,7 @@ import * as THREE from 'three' -import type { FCamera } from '../cameras/FCamera' -import type { FLight } from '../lights/FLight' import type { FVector3 } from '../types/FVector3' -import type { FComponent } from './FComponent' -import type { FCollider } from './FCollider' -import type { FRigidBody } from './FRigidBody' export interface FTransformOptions { - component?: FComponent | FCamera | FLight position?: FVector3 scale?: FVector3 rotation?: FVector3 @@ -19,10 +13,19 @@ export interface FTransformOptions { * @category Core */ export class FTransform { + // Callback /** - * The component that the transform is attached to. + * Callback for when the position is updated. */ - __COMPONENT__?: FComponent | FCamera | FLight | FCollider | FRigidBody + __CALLBACKS_ON_POSITION_UPDATED__: (() => void)[] = [] + /** + * Callback for when the rotation is updated. + */ + __CALLBACKS_ON_ROTATION_UPDATED__: (() => void)[] = [] + /** + * Callback for when the scale is updated. + */ + __CALLBACKS_ON_SCALE_UPDATED__: (() => void)[] = [] /** * The position of the component. @@ -59,13 +62,13 @@ export class FTransform { const DEFAULT_OPTIONS = { component: undefined, position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, rotationDegree: undefined, + scale: { x: 1, y: 1, z: 1 }, } options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || !options.rotation) + if (!options.position || !options.scale || (!options.rotation && !options.rotationDegree)) throw new Error('FibboError: FTransform requires position, scale, rotation and shape options') // Set the transform values @@ -74,8 +77,30 @@ export class FTransform { this.__ROTATION__ = options.rotationDegree ? { x: THREE.MathUtils.degToRad(options.rotationDegree.x), y: THREE.MathUtils.degToRad(options.rotationDegree.y), z: THREE.MathUtils.degToRad(options.rotationDegree.z) } : options.rotation || { x: 0, y: 0, z: 0 } - // Store the component - this.__COMPONENT__ = options.component + } + + /** + * Add a callback for when the position is updated. + * @param callback The callback to add. + */ + onPositionUpdated(callback: () => void) { + this.__CALLBACKS_ON_POSITION_UPDATED__.push(callback) + } + + /** + * Add a callback for when the rotation is updated. + * @param callback The callback to add. + */ + onRotationUpdated(callback: () => void) { + this.__CALLBACKS_ON_ROTATION_UPDATED__.push(callback) + } + + /** + * Add a callback for when the scale is updated. + * @param callback The callback to add. + */ + onScaleUpdated(callback: () => void) { + this.__CALLBACKS_ON_SCALE_UPDATED__.push(callback) } /** @@ -87,7 +112,7 @@ export class FTransform { */ setPosition(position: FVector3) { this.__POSITION__ = position - this.__COMPONENT__?.__UPDATE_POSITION__(true) + this.__CALLBACKS_ON_POSITION_UPDATED__.forEach(callback => callback()) } /** @@ -99,7 +124,7 @@ export class FTransform { */ setRotation(rotation: FVector3) { this.__ROTATION__ = rotation - this.__COMPONENT__?.__UPDATE_ROTATION__(true) + this.__CALLBACKS_ON_ROTATION_UPDATED__.forEach(callback => callback()) } /** @@ -110,12 +135,11 @@ export class FTransform { * @param rotationDegree.z The new rotation on the z axis in degrees. */ setRotationDegree(rotationDegree: FVector3) { - this.__ROTATION__ = { + this.setRotation({ x: THREE.MathUtils.degToRad(rotationDegree.x), y: THREE.MathUtils.degToRad(rotationDegree.y), z: THREE.MathUtils.degToRad(rotationDegree.z), - } - this.__COMPONENT__?.__UPDATE_ROTATION__(true) + }) } /** @@ -127,7 +151,7 @@ export class FTransform { */ setScale(scale: FVector3) { this.__SCALE__ = scale - this.__COMPONENT__?.__UPDATE_SCALE__(true) + this.__CALLBACKS_ON_SCALE_UPDATED__.forEach(callback => callback()) } // Setters & Getters diff --git a/packages/3d/src/index.ts b/packages/3d/src/index.ts index 08fd94fb..1ab9e570 100644 --- a/packages/3d/src/index.ts +++ b/packages/3d/src/index.ts @@ -50,5 +50,6 @@ export * from './polyhedrons/FPolyhedron' export * from './polyhedrons/FSphere' // Types +export * from './types/FRigidBodyType' export * from './types/FShapes' export * from './types/FVector3' diff --git a/packages/3d/src/lights/FAmbientLight.ts b/packages/3d/src/lights/FAmbientLight.ts index 0b892e10..dd369480 100644 --- a/packages/3d/src/lights/FAmbientLight.ts +++ b/packages/3d/src/lights/FAmbientLight.ts @@ -23,9 +23,11 @@ export class FAmbientLight extends FLight { throw new Error('FibboError: FAmbientLight requires color and intensity') // Create the ambient light - this.light = new THREE.AmbientLight(options.color, options.intensity) + this.__LIGHT__ = new THREE.AmbientLight(options.color, options.intensity) // Apply the transform this.__UPDATE_POSITION__() this.__UPDATE_ROTATION__() + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/lights/FDirectionalLight.ts b/packages/3d/src/lights/FDirectionalLight.ts index a74cd031..33ca16da 100644 --- a/packages/3d/src/lights/FDirectionalLight.ts +++ b/packages/3d/src/lights/FDirectionalLight.ts @@ -23,24 +23,27 @@ export class FDirectionalLight extends FLight { throw new Error('FibboError: FDirectionalLight requires color and intensity') // Create the directional light - this.light = new THREE.DirectionalLight(options.color, options.intensity) + this.__LIGHT__ = new THREE.DirectionalLight(options.color, options.intensity) // Apply the transform this.__UPDATE_POSITION__() this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { - this.light.castShadow = true - if (this.light.shadow && this.light.shadow.camera && this.light.shadow.camera instanceof THREE.OrthographicCamera) { - this.light.shadow.camera.near = 0.5 - this.light.shadow.camera.far = 500 - this.light.shadow.camera.left = -100 - this.light.shadow.camera.right = 100 - this.light.shadow.camera.top = 100 - this.light.shadow.camera.bottom = -100 - this.light.shadow.mapSize.width = 16384 - this.light.shadow.mapSize.height = 16384 + this.__LIGHT__.castShadow = true + if (this.__LIGHT__.shadow && this.__LIGHT__.shadow.camera && this.__LIGHT__.shadow.camera instanceof THREE.OrthographicCamera) { + this.__LIGHT__.shadow.camera.near = 0.5 + this.__LIGHT__.shadow.camera.far = 500 + this.__LIGHT__.shadow.camera.left = -100 + this.__LIGHT__.shadow.camera.right = 100 + this.__LIGHT__.shadow.camera.top = 100 + this.__LIGHT__.shadow.camera.bottom = -100 + this.__LIGHT__.shadow.mapSize.width = 16384 + this.__LIGHT__.shadow.mapSize.height = 16384 } } + + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/lights/FHemisphereLight.ts b/packages/3d/src/lights/FHemisphereLight.ts index c1a79a1b..b6ae6eff 100644 --- a/packages/3d/src/lights/FHemisphereLight.ts +++ b/packages/3d/src/lights/FHemisphereLight.ts @@ -29,9 +29,11 @@ export class FHemisphereLight extends FLight { throw new Error('FibboError: FHemisphereLight requires color and intensity') // Create the hemisphere light - this.light = new THREE.HemisphereLight(options.color, options.intensity) + this.__LIGHT__ = new THREE.HemisphereLight(options.color, options.intensity) // Apply the transform this.__UPDATE_POSITION__() this.__UPDATE_ROTATION__() + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index abacd40c..ab794336 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -27,7 +27,7 @@ export abstract class FLight extends FLightCore { /** * The original light object from Three.js. */ - declare light: THREE.Light + declare __LIGHT__: THREE.Light /** * Scene the light is in. @@ -42,7 +42,7 @@ export abstract class FLight extends FLightCore { /** * Look at target of the light. */ - __LOOK_AT__: FVector3 + __LOOK_AT__: FVector3 | undefined constructor(scene: FScene, options?: FLightOptions) { super(scene) @@ -50,26 +50,27 @@ export abstract class FLight extends FLightCore { // Define default options const DEFAULT_OPTIONS = { position: { x: 5, y: 5, z: 5 }, - scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, - lookAt: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, } // Apply default options options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.lookAt) + if (!options.position) throw new Error('FibboError: FLight requires position and lookAt options.') // Store scene this.scene = scene - // Store options + // Configure transform this.transform = new FTransform({ - component: this, position: options.position, rotation: options.rotation, rotationDegree: options.rotationDegree, }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__()) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__()) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__()) this.__LOOK_AT__ = options.lookAt } @@ -78,7 +79,7 @@ export abstract class FLight extends FLightCore { * This method should be called after updating the transform properties. */ __UPDATE_POSITION__(): void { - this.light.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) + this.__LIGHT__.position.set(this.transform.position.x, this.transform.position.y, this.transform.position.z) this.__UPDATE_LOOK_AT__() } @@ -87,7 +88,7 @@ export abstract class FLight extends FLightCore { * This method should be called after updating the transform properties. */ __UPDATE_ROTATION__(): void { - this.light.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) + this.__LIGHT__.rotation.set(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z) } /** @@ -95,7 +96,7 @@ export abstract class FLight extends FLightCore { * This method should be called after updating the transform properties. */ __UPDATE_SCALE__(): void { - this.light.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) + this.__LIGHT__.scale.set(this.transform.scale.x, this.transform.scale.y, this.transform.scale.z) } /** @@ -103,37 +104,37 @@ export abstract class FLight extends FLightCore { * This method should be called after updating the position, so the light can look at the target. */ __UPDATE_LOOK_AT__(): void { - if (this.light instanceof THREE.SpotLight || this.light instanceof THREE.DirectionalLight) { - this.light.target.position.set(this.__LOOK_AT__.x, this.__LOOK_AT__.y, this.__LOOK_AT__.z) + if (this.__LOOK_AT__ && (this.__LIGHT__ instanceof THREE.SpotLight || this.__LIGHT__ instanceof THREE.DirectionalLight)) { + this.__LIGHT__.target.position.set(this.__LOOK_AT__.x, this.__LOOK_AT__.y, this.__LOOK_AT__.z) } } // Setters & Getters get color(): THREE.Color { - return this.light.color + return this.__LIGHT__.color } set color(color: THREE.ColorRepresentation) { - this.light.color.set(color) + this.__LIGHT__.color.set(color) } get intensity(): number { - return this.light.intensity + return this.__LIGHT__.intensity } set intensity(intensity: number) { - this.light.intensity = intensity + this.__LIGHT__.intensity = intensity } - get lookAt(): FVector3 { + get lookAt(): FVector3 | undefined { return this.__LOOK_AT__ } set lookAt(lookAt: FVector3) { this.__LOOK_AT__ = lookAt - if (this.light instanceof THREE.SpotLight) { - this.light.lookAt(lookAt.x, lookAt.y, lookAt.z) + if (this.__LIGHT__ instanceof THREE.SpotLight) { + this.__LIGHT__.lookAt(lookAt.x, lookAt.y, lookAt.z) } } } diff --git a/packages/3d/src/lights/FLightProbe.ts b/packages/3d/src/lights/FLightProbe.ts index 56f50735..6c7d70e4 100644 --- a/packages/3d/src/lights/FLightProbe.ts +++ b/packages/3d/src/lights/FLightProbe.ts @@ -30,18 +30,21 @@ export class FLightProbe extends FLight { throw new Error('FibboError: FLightProbe requires sh and intensity') // Create the light probe - this.light = new THREE.LightProbe(options.sh, options.intensity) + this.__LIGHT__ = new THREE.LightProbe(options.sh, options.intensity) // Apply the transform this.__UPDATE_POSITION__() this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { - this.light.castShadow = true - if (this.light.shadow) { - this.light.shadow.mapSize.width = 65536 - this.light.shadow.mapSize.height = 65536 + this.__LIGHT__.castShadow = true + if (this.__LIGHT__.shadow) { + this.__LIGHT__.shadow.mapSize.width = 65536 + this.__LIGHT__.shadow.mapSize.height = 65536 } } + + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/lights/FPointLight.ts b/packages/3d/src/lights/FPointLight.ts index 5877ab50..42c57657 100644 --- a/packages/3d/src/lights/FPointLight.ts +++ b/packages/3d/src/lights/FPointLight.ts @@ -23,18 +23,21 @@ export class FPointLight extends FLight { throw new Error('FibboError: FPointLight requires color and intensity') // Create the point light - this.light = new THREE.PointLight(options.color, options.intensity) + this.__LIGHT__ = new THREE.PointLight(options.color, options.intensity) // Apply the transform this.__UPDATE_POSITION__() this.__UPDATE_ROTATION__() // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { - this.light.castShadow = true - if (this.light.shadow) { - this.light.shadow.mapSize.width = 65536 - this.light.shadow.mapSize.height = 65536 + this.__LIGHT__.castShadow = true + if (this.__LIGHT__.shadow) { + this.__LIGHT__.shadow.mapSize.width = 65536 + this.__LIGHT__.shadow.mapSize.height = 65536 } } + + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/lights/FSpotLight.ts b/packages/3d/src/lights/FSpotLight.ts index b48b4bd0..67167493 100644 --- a/packages/3d/src/lights/FSpotLight.ts +++ b/packages/3d/src/lights/FSpotLight.ts @@ -38,7 +38,7 @@ export class FSpotLight extends FLight { throw new Error('FibboError: FSpotLight requires color and intensity') // Create the spot light - this.light = new THREE.SpotLight( + this.__LIGHT__ = new THREE.SpotLight( options.color, options.intensity, options.distance, @@ -52,11 +52,14 @@ export class FSpotLight extends FLight { // If shadows are enabled, set the light to cast shadows if (this.scene.__ENABLE_SHADOWS__) { - this.light.castShadow = true - if (this.light.shadow) { - this.light.shadow.mapSize.width = 16384 - this.light.shadow.mapSize.height = 16384 + this.__LIGHT__.castShadow = true + if (this.__LIGHT__.shadow) { + this.__LIGHT__.shadow.mapSize.width = 16384 + this.__LIGHT__.shadow.mapSize.height = 16384 } } + + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/model/FFBX.ts b/packages/3d/src/model/FFBX.ts index 2cee2d9d..bf3aac02 100644 --- a/packages/3d/src/model/FFBX.ts +++ b/packages/3d/src/model/FFBX.ts @@ -1,6 +1,7 @@ import * as THREE from 'three' import { FBXLoader } from 'three/addons/loaders/FBXLoader.js' import type { FScene } from '../core/FScene' +import type { FVector3 } from '../types/FVector3' import { FModel } from './FModel' import type { FModelOptions } from './FModel' @@ -74,4 +75,12 @@ export class FFBX extends FModel { this.__MESH__.scale.set(this.transform.scale.x / 200, this.transform.scale.y / 200, this.transform.scale.z / 200) } } + + __SET_SCALE__(scale: FVector3): void { + super.__SET_SCALE__({ + x: scale.x / 200, + y: scale.y / 200, + z: scale.z / 200, + }) + } } diff --git a/packages/3d/src/polyhedrons/FCapsule.ts b/packages/3d/src/polyhedrons/FCapsule.ts index 09625022..f9decf02 100644 --- a/packages/3d/src/polyhedrons/FCapsule.ts +++ b/packages/3d/src/polyhedrons/FCapsule.ts @@ -28,5 +28,7 @@ export class FCapsule extends FPolyhedron { this.__MESH__.castShadow = true this.__MESH__.receiveShadow = true } + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/polyhedrons/FCuboid.ts b/packages/3d/src/polyhedrons/FCuboid.ts index 516ae452..6ef541b7 100644 --- a/packages/3d/src/polyhedrons/FCuboid.ts +++ b/packages/3d/src/polyhedrons/FCuboid.ts @@ -18,5 +18,7 @@ import { FPolyhedron } from './FPolyhedron' export class FCuboid extends FPolyhedron { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/polyhedrons/FSphere.ts b/packages/3d/src/polyhedrons/FSphere.ts index f829c0f7..18b3ed72 100644 --- a/packages/3d/src/polyhedrons/FSphere.ts +++ b/packages/3d/src/polyhedrons/FSphere.ts @@ -28,5 +28,7 @@ export class FSphere extends FPolyhedron { this.__MESH__.castShadow = true this.__MESH__.receiveShadow = true } + // Emit the onLoaded event + this.emitOnLoaded() } } diff --git a/packages/3d/src/types/FRigidBodyType.ts b/packages/3d/src/types/FRigidBodyType.ts new file mode 100644 index 00000000..25b51399 --- /dev/null +++ b/packages/3d/src/types/FRigidBodyType.ts @@ -0,0 +1,7 @@ +// FRigidBodyType enum +export enum FRigidBodyType { + DYNAMIC = 'Dynamic', + KINEMATIC_POSITION_BASED = 'KinematicPositionBased', + KINEMATIC_VELOCITY_BASED = 'KinematicVelocityBased', + FIXED = 'Fixed', +} diff --git a/packages/3d/test/browser/collider.test.ts b/packages/3d/test/browser/collider.test.ts index 958ec7ad..46a7206b 100644 --- a/packages/3d/test/browser/collider.test.ts +++ b/packages/3d/test/browser/collider.test.ts @@ -1,7 +1,38 @@ import { beforeEach, describe, expect, it } from 'vitest' +import * as THREE from 'three' import RAPIER from '@dimforge/rapier3d' import { FCuboid, FScene, FShapes } from '../../src' +function validateRapierCollider(collider: RAPIER.Collider, transform: { + position: { x: number, y: number, z: number } + rotation: { x: number, y: number, z: number } + scale: { x: number, y: number, z: number } + shape: RAPIER.ShapeType +}) { + // Validate RAPIER collider + expect(collider).toBeDefined() + expect(collider.translation().x).toEqual(transform.position.x) + expect(collider.translation().y).toEqual(transform.position.y) + expect(collider.translation().z).toEqual(transform.position.z) + const quaternion = collider.rotation() + const rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w)) + expect(rotation.x).closeTo(transform.rotation.x, 0.0001) + expect(rotation.y).closeTo(transform.rotation.y, 0.0001) + expect(rotation.z).closeTo(transform.rotation.z, 0.0001) + expect(collider.shape).toBeDefined() + expect(collider.shape.type).toEqual(transform.shape) + if (transform.shape === RAPIER.ShapeType.Cuboid) { + const colliderShape = collider.shape as RAPIER.Cuboid + expect(colliderShape.halfExtents.x).toEqual(transform.scale.x) + expect(colliderShape.halfExtents.y).toEqual(transform.scale.y) + expect(colliderShape.halfExtents.z).toEqual(transform.scale.z) + } + else if (transform.shape === RAPIER.ShapeType.Ball) { + const colliderShape = collider.shape as RAPIER.Ball + expect(colliderShape.radius).toEqual(transform.scale.x) + } +} + describe('fCollider', () => { let scene: FScene @@ -21,31 +52,40 @@ describe('fCollider', () => { }) cuboid.initCollider() expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate offset - expect(cuboid.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) - expect(cuboid.collider.__COLLIDER_ROTATION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) - expect(cuboid.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1, z: 1 }) + expect(cuboid.collider.offset.position).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.collider.offset.rotation).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.collider.offset.scale).toEqual({ x: 0, y: 0, z: 0 }) // Validate transforms - expect(cuboid.collider.position.x).toEqual(0) - expect(cuboid.collider.position.y).toEqual(0) - expect(cuboid.collider.position.z).toEqual(0) - expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) - expect(cuboid.collider.scale.x).toEqual(1) - expect(cuboid.collider.scale.y).toEqual(1) - expect(cuboid.collider.scale.z).toEqual(1) + expect(cuboid.collider.transform.position.x).toEqual(0) + expect(cuboid.collider.transform.position.y).toEqual(0) + expect(cuboid.collider.transform.position.z).toEqual(0) + expect(cuboid.collider.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(1) + expect(cuboid.collider.transform.scale.y).toEqual(1) + expect(cuboid.collider.transform.scale.z).toEqual(1) expect(cuboid.collider.shape).toEqual(FShapes.CUBOID) // Validate scaleX, scaleY and scaleZ - cuboid.collider.scaleX = 2 - cuboid.collider.scaleY = 3 - cuboid.collider.scaleZ = 4 - expect(cuboid.collider.scaleX).toEqual(2) - expect(cuboid.collider.scaleY).toEqual(3) - expect(cuboid.collider.scaleZ).toEqual(4) - expect(cuboid.collider.scaleX).toEqual(cuboid.collider.scale.x) - expect(cuboid.collider.scaleY).toEqual(cuboid.collider.scale.y) - expect(cuboid.collider.scaleZ).toEqual(cuboid.collider.scale.z) + cuboid.collider.transform.scaleX = 2 + cuboid.collider.transform.scaleY = 3 + cuboid.collider.transform.scaleZ = 4 + expect(cuboid.collider.transform.scaleX).toEqual(2) + expect(cuboid.collider.transform.scaleY).toEqual(3) + expect(cuboid.collider.transform.scaleZ).toEqual(4) + expect(cuboid.collider.transform.scaleX).toEqual(cuboid.collider.transform.scale.x) + expect(cuboid.collider.transform.scaleY).toEqual(cuboid.collider.transform.scale.y) + expect(cuboid.collider.transform.scaleZ).toEqual(cuboid.collider.transform.scale.z) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1.5, z: 2 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should create a collider with custom transforms', () => { @@ -55,25 +95,34 @@ describe('fCollider', () => { scale: { x: 1, y: 2, z: 3 }, }) cuboid.initCollider({ - position: { x: -2, y: 3, z: -4 }, - rotation: { x: -0.3, y: 0.2, z: 0.1 }, - scale: { x: 2, y: 2, z: 2 }, + positionOffset: { x: -2, y: 3, z: -4 }, + rotationOffset: { x: -0.3, y: 0.2, z: 0.1 }, + scaleOffset: { x: 2, y: 2, z: 2 }, }) expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate offset - expect(cuboid.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: -2, y: 3, z: -4 }) - expect(cuboid.collider.__COLLIDER_ROTATION_OFFSET__).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) - expect(cuboid.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2, z: 2 }) + expect(cuboid.collider.offset.position).toEqual({ x: -2, y: 3, z: -4 }) + expect(cuboid.collider.offset.rotation).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) + expect(cuboid.collider.offset.scale).toEqual({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.collider.position.x).toEqual(-1) - expect(cuboid.collider.position.y).toEqual(4) - expect(cuboid.collider.position.z).toEqual(-3) - expect(cuboid.collider.rotation.x).closeTo(-0.2, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.4, 0.0001) - expect(cuboid.collider.scale.x).toEqual(2) - expect(cuboid.collider.scale.y).toEqual(4) - expect(cuboid.collider.scale.z).toEqual(6) + expect(cuboid.collider.transform.position.x).toEqual(-1) + expect(cuboid.collider.transform.position.y).toEqual(4) + expect(cuboid.collider.transform.position.z).toEqual(-3) + expect(cuboid.collider.transform.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(3) + expect(cuboid.collider.transform.scale.y).toEqual(4) + expect(cuboid.collider.transform.scale.z).toEqual(5) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: -1, y: 4, z: -3 }, + rotation: { x: -0.2, y: 0.4, z: 0.4 }, + scale: { x: 1.5, y: 2, z: 2.5 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should create a collider with a sphere shape', () => { @@ -86,20 +135,29 @@ describe('fCollider', () => { shape: FShapes.SPHERE, }) expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate shape expect(cuboid.collider.shape).toEqual(FShapes.SPHERE) expect(cuboid.collider.__COLLIDER__.shape).toBeDefined() expect(cuboid.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(cuboid.collider.position.x).toEqual(0) - expect(cuboid.collider.position.y).toEqual(0) - expect(cuboid.collider.position.z).toEqual(0) - expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) - expect(cuboid.collider.scale.x).toEqual(1) - expect(cuboid.collider.scale.y).toEqual(1) - expect(cuboid.collider.scale.z).toEqual(1) + expect(cuboid.collider.transform.position.x).toEqual(0) + expect(cuboid.collider.transform.position.y).toEqual(0) + expect(cuboid.collider.transform.position.z).toEqual(0) + expect(cuboid.collider.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(1) + expect(cuboid.collider.transform.scale.y).toEqual(1) + expect(cuboid.collider.transform.scale.z).toEqual(1) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 0, y: 0, z: 0 }, + rotation: { x: 0, y: 0, z: 0 }, + scale: { x: 0.5, y: 0.5, z: 0.5 }, + shape: RAPIER.ShapeType.Ball, + }) }) it('should modify collider transforms', () => { @@ -110,44 +168,60 @@ describe('fCollider', () => { }) cuboid.initCollider() expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate transforms - expect(cuboid.collider.position.x).toEqual(1) - expect(cuboid.collider.position.y).toEqual(0) - expect(cuboid.collider.position.z).toEqual(0) - expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) - expect(cuboid.collider.scale.x).toEqual(1) - expect(cuboid.collider.scale.y).toEqual(1) - expect(cuboid.collider.scale.z).toEqual(1) + expect(cuboid.collider.transform.position.x).toEqual(1) + expect(cuboid.collider.transform.position.y).toEqual(0) + expect(cuboid.collider.transform.position.z).toEqual(0) + expect(cuboid.collider.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(1) + expect(cuboid.collider.transform.scale.y).toEqual(1) + expect(cuboid.collider.transform.scale.z).toEqual(1) // Modify transforms with functions - cuboid.collider.setPosition({ x: 1, y: 1, z: 1 }) - cuboid.collider.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) - cuboid.collider.setScale({ x: 2, y: 2, z: 2 }) + cuboid.collider.transform.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.collider.transform.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.collider.transform.setScale({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.collider.position.x).toEqual(1) - expect(cuboid.collider.position.y).toEqual(1) - expect(cuboid.collider.position.z).toEqual(1) - expect(cuboid.collider.rotation.x).closeTo(0.1, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.3, 0.0001) - expect(cuboid.collider.scale.x).toEqual(2) - expect(cuboid.collider.scale.y).toEqual(2) - expect(cuboid.collider.scale.z).toEqual(2) + expect(cuboid.collider.transform.position.x).toEqual(1) + expect(cuboid.collider.transform.position.y).toEqual(1) + expect(cuboid.collider.transform.position.z).toEqual(1) + expect(cuboid.collider.transform.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(2) + expect(cuboid.collider.transform.scale.y).toEqual(2) + expect(cuboid.collider.transform.scale.z).toEqual(2) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 1, z: 1 }, + shape: RAPIER.ShapeType.Cuboid, + }) // Modify transforms with setters - cuboid.collider.position = { x: 2, y: 4, z: 6 } - cuboid.collider.rotation = { x: 0.2, y: 0.4, z: 0.6 } - cuboid.collider.scale = { x: 3, y: 4, z: 5 } + cuboid.collider.transform.position = { x: 2, y: 4, z: 6 } + cuboid.collider.transform.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.collider.transform.scale = { x: 3, y: 4, z: 5 } // Validate transforms - expect(cuboid.collider.position.x).toEqual(2) - expect(cuboid.collider.position.y).toEqual(4) - expect(cuboid.collider.position.z).toEqual(6) - expect(cuboid.collider.rotation.x).closeTo(0.2, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.6, 0.0001) - expect(cuboid.collider.scale.x).toEqual(3) - expect(cuboid.collider.scale.y).toEqual(4) - expect(cuboid.collider.scale.z).toEqual(5) + expect(cuboid.collider.transform.position.x).toEqual(2) + expect(cuboid.collider.transform.position.y).toEqual(4) + expect(cuboid.collider.transform.position.z).toEqual(6) + expect(cuboid.collider.transform.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.6, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(3) + expect(cuboid.collider.transform.scale.y).toEqual(4) + expect(cuboid.collider.transform.scale.z).toEqual(5) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 2, y: 4, z: 6 }, + rotation: { x: 0.2, y: 0.4, z: 0.6 }, + scale: { x: 1.5, y: 2, z: 2.5 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should modify collider transforms with a sphere shape', () => { @@ -160,49 +234,65 @@ describe('fCollider', () => { shape: FShapes.SPHERE, }) expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate shape expect(cuboid.collider.shape).toEqual(FShapes.SPHERE) expect(cuboid.collider.__COLLIDER__.shape).toBeDefined() expect(cuboid.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(cuboid.collider.position.x).toEqual(0) - expect(cuboid.collider.position.y).toEqual(0) - expect(cuboid.collider.position.z).toEqual(0) - expect(cuboid.collider.rotation.x).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0, 0.0001) - expect(cuboid.collider.scale.x).toEqual(1) - expect(cuboid.collider.scale.y).toEqual(1) - expect(cuboid.collider.scale.z).toEqual(1) + expect(cuboid.collider.transform.position.x).toEqual(0) + expect(cuboid.collider.transform.position.y).toEqual(0) + expect(cuboid.collider.transform.position.z).toEqual(0) + expect(cuboid.collider.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(1) + expect(cuboid.collider.transform.scale.y).toEqual(1) + expect(cuboid.collider.transform.scale.z).toEqual(1) // Modify transforms with functions - cuboid.collider.setPosition({ x: 1, y: 1, z: 1 }) - cuboid.collider.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) - cuboid.collider.setScale({ x: 2, y: 2, z: 2 }) + cuboid.collider.transform.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.collider.transform.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.collider.transform.setScale({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.collider.position.x).toEqual(1) - expect(cuboid.collider.position.y).toEqual(1) - expect(cuboid.collider.position.z).toEqual(1) - expect(cuboid.collider.rotation.x).closeTo(0.1, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.3, 0.0001) - expect(cuboid.collider.scale.x).toEqual(2) - expect(cuboid.collider.scale.y).toEqual(2) - expect(cuboid.collider.scale.z).toEqual(2) + expect(cuboid.collider.transform.position.x).toEqual(1) + expect(cuboid.collider.transform.position.y).toEqual(1) + expect(cuboid.collider.transform.position.z).toEqual(1) + expect(cuboid.collider.transform.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(2) + expect(cuboid.collider.transform.scale.y).toEqual(2) + expect(cuboid.collider.transform.scale.z).toEqual(2) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 1, y: 1, z: 1 }, + rotation: { x: 0.1, y: 0.2, z: 0.3 }, + scale: { x: 1, y: 1, z: 1 }, + shape: RAPIER.ShapeType.Ball, + }) // Modify transforms with setters - cuboid.collider.position = { x: 2, y: 4, z: 6 } - cuboid.collider.rotation = { x: 0.2, y: 0.4, z: 0.6 } - cuboid.collider.scale = { x: 3, y: 5, z: 4 } + cuboid.collider.transform.position = { x: 2, y: 4, z: 6 } + cuboid.collider.transform.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.collider.transform.scale = { x: 3, y: 5, z: 4 } // Validate transforms - expect(cuboid.collider.position.x).toEqual(2) - expect(cuboid.collider.position.y).toEqual(4) - expect(cuboid.collider.position.z).toEqual(6) - expect(cuboid.collider.rotation.x).closeTo(0.2, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.6, 0.0001) - // Circle shape has the same scale for x, y and z (the highest value is used) - expect(cuboid.collider.scale.x).toEqual(5) - expect(cuboid.collider.scale.y).toEqual(5) - expect(cuboid.collider.scale.z).toEqual(5) + expect(cuboid.collider.transform.position.x).toEqual(2) + expect(cuboid.collider.transform.position.y).toEqual(4) + expect(cuboid.collider.transform.position.z).toEqual(6) + expect(cuboid.collider.transform.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.6, 0.0001) + // Sphere shape has the same scale for x, y and z (the highest value is used) + expect(cuboid.collider.transform.scale.x).toEqual(5) + expect(cuboid.collider.transform.scale.y).toEqual(5) + expect(cuboid.collider.transform.scale.z).toEqual(5) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 2, y: 4, z: 6 }, + rotation: { x: 0.2, y: 0.4, z: 0.6 }, + scale: { x: 2.5, y: 2.5, z: 2.5 }, + shape: RAPIER.ShapeType.Ball, + }) }) it('should update collider transforms with attached component transforms', () => { @@ -212,34 +302,50 @@ describe('fCollider', () => { scale: { x: 1, y: 0.5, z: 1 }, }) cuboid.initCollider({ - position: { x: -2, y: 3, z: -4 }, - rotation: { x: -0.3, y: 0.2, z: 0.1 }, - scale: { x: 2, y: 4, z: 2 }, + positionOffset: { x: -2, y: 3, z: -4 }, + rotationOffset: { x: -0.3, y: 0.2, z: 0.1 }, + scaleOffset: { x: 2, y: 4, z: 2 }, }) expect(cuboid.collider).toBeDefined() + if (!cuboid.collider) + return // Validate transforms - expect(cuboid.collider.position.x).toEqual(-1) - expect(cuboid.collider.position.y).toEqual(4) - expect(cuboid.collider.position.z).toEqual(-3) - expect(cuboid.collider.rotation.x).closeTo(-0.2, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.4, 0.0001) - expect(cuboid.collider.scale.x).toEqual(2) - expect(cuboid.collider.scale.y).toEqual(2) - expect(cuboid.collider.scale.z).toEqual(2) + expect(cuboid.collider.transform.position.x).toEqual(-1) + expect(cuboid.collider.transform.position.y).toEqual(4) + expect(cuboid.collider.transform.position.z).toEqual(-3) + expect(cuboid.collider.transform.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(3) + expect(cuboid.collider.transform.scale.y).toEqual(4.5) + expect(cuboid.collider.transform.scale.z).toEqual(3) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: -1, y: 4, z: -3 }, + rotation: { x: -0.2, y: 0.4, z: 0.4 }, + scale: { x: 1.5, y: 2.25, z: 1.5 }, + shape: RAPIER.ShapeType.Cuboid, + }) // Modify component transforms - cuboid.setPosition({ x: 2, y: 2, z: 6 }) - cuboid.setRotation({ x: 0.2, y: 0.4, z: 0.6 }) - cuboid.setScale({ x: 3, y: 4, z: 5 }) + cuboid.transform.setPosition({ x: 2, y: 2, z: 6 }) + cuboid.transform.setRotation({ x: 0.2, y: 0.4, z: 0.6 }) + cuboid.transform.setScale({ x: 3, y: 4, z: 5 }) // Validate transforms - expect(cuboid.collider.position.x).toEqual(0) - expect(cuboid.collider.position.y).toEqual(5) - expect(cuboid.collider.position.z).toEqual(2) - expect(cuboid.collider.rotation.x).closeTo(-0.1, 0.0001) - expect(cuboid.collider.rotation.y).closeTo(0.6, 0.0001) - expect(cuboid.collider.rotation.z).closeTo(0.7, 0.0001) - expect(cuboid.collider.scale.x).toEqual(6) - expect(cuboid.collider.scale.y).toEqual(16) - expect(cuboid.collider.scale.z).toEqual(10) + expect(cuboid.collider.transform.position.x).toEqual(0) + expect(cuboid.collider.transform.position.y).toEqual(5) + expect(cuboid.collider.transform.position.z).toEqual(2) + expect(cuboid.collider.transform.rotation.x).closeTo(-0.1, 0.0001) + expect(cuboid.collider.transform.rotation.y).closeTo(0.6, 0.0001) + expect(cuboid.collider.transform.rotation.z).closeTo(0.7, 0.0001) + expect(cuboid.collider.transform.scale.x).toEqual(5) + expect(cuboid.collider.transform.scale.y).toEqual(8) + expect(cuboid.collider.transform.scale.z).toEqual(7) + // Validate RAPIER collider + validateRapierCollider(cuboid.collider.__COLLIDER__, { + position: { x: 0, y: 5, z: 2 }, + rotation: { x: -0.1, y: 0.6, z: 0.7 }, + scale: { x: 2.5, y: 4, z: 3.5 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) }) diff --git a/packages/3d/test/browser/rigidbody.test.ts b/packages/3d/test/browser/rigidbody.test.ts index e26ec750..7ea50fe3 100644 --- a/packages/3d/test/browser/rigidbody.test.ts +++ b/packages/3d/test/browser/rigidbody.test.ts @@ -1,8 +1,25 @@ import { beforeEach, describe, expect, it } from 'vitest' +import * as THREE from 'three' import RAPIER from '@dimforge/rapier3d' import { FCuboid, FScene, FShapes } from '../../src' -describe('fCollider', () => { +function validateRapierRigidBody(rigidBody: RAPIER.RigidBody, transform: { + position: { x: number, y: number, z: number } + rotation: { x: number, y: number, z: number } +}) { + // Validate RAPIER collider + expect(rigidBody).toBeDefined() + expect(rigidBody.translation().x).toEqual(transform.position.x) + expect(rigidBody.translation().y).toEqual(transform.position.y) + expect(rigidBody.translation().z).toEqual(transform.position.z) + const quaternion = rigidBody.rotation() + const rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w)) + expect(rotation.x).closeTo(transform.rotation.x, 0.0001) + expect(rotation.y).closeTo(transform.rotation.y, 0.0001) + expect(rotation.z).closeTo(transform.rotation.z, 0.0001) +} + +describe('fRigidBody', () => { let scene: FScene beforeEach(async () => { @@ -21,30 +38,34 @@ describe('fCollider', () => { }) cuboid.initRigidBody() expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate offset - expect(cuboid.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) - expect(cuboid.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.rigidBody.offset.position).toEqual({ x: 0, y: 0, z: 0 }) + expect(cuboid.rigidBody.offset.rotation).toEqual({ x: 0, y: 0, z: 0 }) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(0) - expect(cuboid.rigidBody.position.y).toEqual(0) - expect(cuboid.rigidBody.position.z).toEqual(0) - expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(1) - expect(cuboid.rigidBody.scale.y).toEqual(1) - expect(cuboid.rigidBody.scale.z).toEqual(1) + expect(cuboid.rigidBody.transform.position.x).toEqual(0) + expect(cuboid.rigidBody.transform.position.y).toEqual(0) + expect(cuboid.rigidBody.transform.position.z).toEqual(0) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(1) + expect(cuboid.rigidBody.transform.scale.y).toEqual(1) + expect(cuboid.rigidBody.transform.scale.z).toEqual(1) expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.CUBOID) // Validate scaleX, scaleY and scaleZ - cuboid.rigidBody.scaleX = 2 - cuboid.rigidBody.scaleY = 3 - cuboid.rigidBody.scaleZ = 4 - expect(cuboid.rigidBody.scaleX).toEqual(2) - expect(cuboid.rigidBody.scaleY).toEqual(3) - expect(cuboid.rigidBody.scaleZ).toEqual(4) - expect(cuboid.rigidBody.scaleX).toEqual(cuboid.rigidBody.scale.x) - expect(cuboid.rigidBody.scaleY).toEqual(cuboid.rigidBody.scale.y) - expect(cuboid.rigidBody.scaleZ).toEqual(cuboid.rigidBody.scale.z) + cuboid.rigidBody.transform.scaleX = 2 + cuboid.rigidBody.transform.scaleY = 3 + cuboid.rigidBody.transform.scaleZ = 4 + expect(cuboid.rigidBody.transform.scaleX).toEqual(2) + expect(cuboid.rigidBody.transform.scaleY).toEqual(3) + expect(cuboid.rigidBody.transform.scaleZ).toEqual(4) + expect(cuboid.rigidBody.transform.scaleX).toEqual(cuboid.rigidBody.transform.scale.x) + expect(cuboid.rigidBody.transform.scaleY).toEqual(cuboid.rigidBody.transform.scale.y) + expect(cuboid.rigidBody.transform.scaleZ).toEqual(cuboid.rigidBody.transform.scale.z) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) it('should create a collider with custom transforms', () => { @@ -54,25 +75,29 @@ describe('fCollider', () => { scale: { x: 1, y: 2, z: 3 }, }) cuboid.initRigidBody({ - position: { x: -2, y: 3, z: -4 }, - rotation: { x: -0.3, y: 0.2, z: 0.1 }, - scale: { x: 2, y: 2, z: 2 }, + positionOffset: { x: -2, y: 3, z: -4 }, + rotationOffset: { x: -0.3, y: 0.2, z: 0.1 }, + scaleOffset: { x: 2, y: 2, z: 2 }, }) expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate offset - expect(cuboid.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: -2, y: 3, z: -4 }) - expect(cuboid.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) - expect(cuboid.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2, z: 2 }) + expect(cuboid.rigidBody.offset.position).toEqual({ x: -2, y: 3, z: -4 }) + expect(cuboid.rigidBody.offset.rotation).toEqual({ x: -0.3, y: 0.2, z: 0.1 }) + expect(cuboid.rigidBody.collider.offset.scale).toEqual({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(-1) - expect(cuboid.rigidBody.position.y).toEqual(4) - expect(cuboid.rigidBody.position.z).toEqual(-3) - expect(cuboid.rigidBody.rotation.x).closeTo(-0.2, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(2) - expect(cuboid.rigidBody.scale.y).toEqual(4) - expect(cuboid.rigidBody.scale.z).toEqual(6) + expect(cuboid.rigidBody.transform.position.x).toEqual(-1) + expect(cuboid.rigidBody.transform.position.y).toEqual(4) + expect(cuboid.rigidBody.transform.position.z).toEqual(-3) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(3) + expect(cuboid.rigidBody.transform.scale.y).toEqual(4) + expect(cuboid.rigidBody.transform.scale.z).toEqual(5) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) it('should create a collider with a sphere shape', () => { @@ -85,20 +110,24 @@ describe('fCollider', () => { shape: FShapes.SPHERE, }) expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate shape expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.SPHERE) expect(cuboid.rigidBody.collider.__COLLIDER__.shape).toBeDefined() expect(cuboid.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(0) - expect(cuboid.rigidBody.position.y).toEqual(0) - expect(cuboid.rigidBody.position.z).toEqual(0) - expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(1) - expect(cuboid.rigidBody.scale.y).toEqual(1) - expect(cuboid.rigidBody.scale.z).toEqual(1) + expect(cuboid.rigidBody.transform.position.x).toEqual(0) + expect(cuboid.rigidBody.transform.position.y).toEqual(0) + expect(cuboid.rigidBody.transform.position.z).toEqual(0) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(1) + expect(cuboid.rigidBody.transform.scale.y).toEqual(1) + expect(cuboid.rigidBody.transform.scale.z).toEqual(1) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) it('should modify collider transforms', () => { @@ -109,44 +138,50 @@ describe('fCollider', () => { }) cuboid.initRigidBody() expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(1) - expect(cuboid.rigidBody.position.y).toEqual(0) - expect(cuboid.rigidBody.position.z).toEqual(0) - expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(1) - expect(cuboid.rigidBody.scale.y).toEqual(1) - expect(cuboid.rigidBody.scale.z).toEqual(1) + expect(cuboid.rigidBody.transform.position.x).toEqual(1) + expect(cuboid.rigidBody.transform.position.y).toEqual(0) + expect(cuboid.rigidBody.transform.position.z).toEqual(0) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(1) + expect(cuboid.rigidBody.transform.scale.y).toEqual(1) + expect(cuboid.rigidBody.transform.scale.z).toEqual(1) // Modify transforms with functions - cuboid.rigidBody.setPosition({ x: 1, y: 1, z: 1 }) - cuboid.rigidBody.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) - cuboid.rigidBody.setScale({ x: 2, y: 2, z: 2 }) + cuboid.rigidBody.transform.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.rigidBody.transform.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.rigidBody.transform.setScale({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(1) - expect(cuboid.rigidBody.position.y).toEqual(1) - expect(cuboid.rigidBody.position.z).toEqual(1) - expect(cuboid.rigidBody.rotation.x).closeTo(0.1, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.3, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(2) - expect(cuboid.rigidBody.scale.y).toEqual(2) - expect(cuboid.rigidBody.scale.z).toEqual(2) + expect(cuboid.rigidBody.transform.position.x).toEqual(1) + expect(cuboid.rigidBody.transform.position.y).toEqual(1) + expect(cuboid.rigidBody.transform.position.z).toEqual(1) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(2) + expect(cuboid.rigidBody.transform.scale.y).toEqual(2) + expect(cuboid.rigidBody.transform.scale.z).toEqual(2) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) // Modify transforms with setters - cuboid.rigidBody.position = { x: 2, y: 4, z: 6 } - cuboid.rigidBody.rotation = { x: 0.2, y: 0.4, z: 0.6 } - cuboid.rigidBody.scale = { x: 3, y: 4, z: 5 } + cuboid.rigidBody.transform.position = { x: 2, y: 4, z: 6 } + cuboid.rigidBody.transform.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.rigidBody.transform.scale = { x: 3, y: 4, z: 5 } // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(2) - expect(cuboid.rigidBody.position.y).toEqual(4) - expect(cuboid.rigidBody.position.z).toEqual(6) - expect(cuboid.rigidBody.rotation.x).closeTo(0.2, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.6, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(3) - expect(cuboid.rigidBody.scale.y).toEqual(4) - expect(cuboid.rigidBody.scale.z).toEqual(5) + expect(cuboid.rigidBody.transform.position.x).toEqual(2) + expect(cuboid.rigidBody.transform.position.y).toEqual(4) + expect(cuboid.rigidBody.transform.position.z).toEqual(6) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.6, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(3) + expect(cuboid.rigidBody.transform.scale.y).toEqual(4) + expect(cuboid.rigidBody.transform.scale.z).toEqual(5) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) it('should modify collider transforms with a sphere shape', () => { @@ -159,49 +194,57 @@ describe('fCollider', () => { shape: FShapes.SPHERE, }) expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate shape expect(cuboid.rigidBody.collider.shape).toEqual(FShapes.SPHERE) expect(cuboid.rigidBody.collider.__COLLIDER__.shape).toBeDefined() expect(cuboid.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(0) - expect(cuboid.rigidBody.position.y).toEqual(0) - expect(cuboid.rigidBody.position.z).toEqual(0) - expect(cuboid.rigidBody.rotation.x).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(1) - expect(cuboid.rigidBody.scale.y).toEqual(1) - expect(cuboid.rigidBody.scale.z).toEqual(1) + expect(cuboid.rigidBody.transform.position.x).toEqual(0) + expect(cuboid.rigidBody.transform.position.y).toEqual(0) + expect(cuboid.rigidBody.transform.position.z).toEqual(0) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(1) + expect(cuboid.rigidBody.transform.scale.y).toEqual(1) + expect(cuboid.rigidBody.transform.scale.z).toEqual(1) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) // Modify transforms with functions - cuboid.rigidBody.setPosition({ x: 1, y: 1, z: 1 }) - cuboid.rigidBody.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) - cuboid.rigidBody.setScale({ x: 2, y: 2, z: 2 }) + cuboid.rigidBody.transform.setPosition({ x: 1, y: 1, z: 1 }) + cuboid.rigidBody.transform.setRotation({ x: 0.1, y: 0.2, z: 0.3 }) + cuboid.rigidBody.transform.setScale({ x: 2, y: 2, z: 2 }) // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(1) - expect(cuboid.rigidBody.position.y).toEqual(1) - expect(cuboid.rigidBody.position.z).toEqual(1) - expect(cuboid.rigidBody.rotation.x).closeTo(0.1, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.2, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.3, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(2) - expect(cuboid.rigidBody.scale.y).toEqual(2) - expect(cuboid.rigidBody.scale.z).toEqual(2) + expect(cuboid.rigidBody.transform.position.x).toEqual(1) + expect(cuboid.rigidBody.transform.position.y).toEqual(1) + expect(cuboid.rigidBody.transform.position.z).toEqual(1) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0.1, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.3, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(2) + expect(cuboid.rigidBody.transform.scale.y).toEqual(2) + expect(cuboid.rigidBody.transform.scale.z).toEqual(2) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) // Modify transforms with setters - cuboid.rigidBody.position = { x: 2, y: 4, z: 6 } - cuboid.rigidBody.rotation = { x: 0.2, y: 0.4, z: 0.6 } - cuboid.rigidBody.scale = { x: 3, y: 5, z: 4 } + cuboid.rigidBody.transform.position = { x: 2, y: 4, z: 6 } + cuboid.rigidBody.transform.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.rigidBody.transform.scale = { x: 3, y: 5, z: 4 } // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(2) - expect(cuboid.rigidBody.position.y).toEqual(4) - expect(cuboid.rigidBody.position.z).toEqual(6) - expect(cuboid.rigidBody.rotation.x).closeTo(0.2, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.6, 0.0001) - // Circle shape has the same scale for x, y and z (the highest value is used) - expect(cuboid.rigidBody.scale.x).toEqual(5) - expect(cuboid.rigidBody.scale.y).toEqual(5) - expect(cuboid.rigidBody.scale.z).toEqual(5) + expect(cuboid.rigidBody.transform.position.x).toEqual(2) + expect(cuboid.rigidBody.transform.position.y).toEqual(4) + expect(cuboid.rigidBody.transform.position.z).toEqual(6) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.6, 0.0001) + // Sphere shape has the same scale for x, y and z (the highest value is used) + expect(cuboid.rigidBody.transform.scale.x).toEqual(5) + expect(cuboid.rigidBody.transform.scale.y).toEqual(5) + expect(cuboid.rigidBody.transform.scale.z).toEqual(5) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) it('should update collider transforms with attached component transforms', () => { @@ -211,34 +254,40 @@ describe('fCollider', () => { scale: { x: 1, y: 0.5, z: 1 }, }) cuboid.initRigidBody({ - position: { x: -2, y: 3, z: -4 }, - rotation: { x: -0.3, y: 0.2, z: 0.1 }, - scale: { x: 2, y: 4, z: 2 }, + positionOffset: { x: -2, y: 3, z: -4 }, + rotationOffset: { x: -0.3, y: 0.2, z: 0.1 }, + scaleOffset: { x: 2, y: 4, z: 2 }, }) expect(cuboid.rigidBody).toBeDefined() + if (!cuboid.rigidBody) + return // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(-1) - expect(cuboid.rigidBody.position.y).toEqual(4) - expect(cuboid.rigidBody.position.z).toEqual(-3) - expect(cuboid.rigidBody.rotation.x).closeTo(-0.2, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.4, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(2) - expect(cuboid.rigidBody.scale.y).toEqual(2) - expect(cuboid.rigidBody.scale.z).toEqual(2) + expect(cuboid.rigidBody.transform.position.x).toEqual(-1) + expect(cuboid.rigidBody.transform.position.y).toEqual(4) + expect(cuboid.rigidBody.transform.position.z).toEqual(-3) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(-0.2, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.4, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(3) + expect(cuboid.rigidBody.transform.scale.y).toEqual(4.5) + expect(cuboid.rigidBody.transform.scale.z).toEqual(3) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) // Modify component transforms - cuboid.setPosition({ x: 2, y: 2, z: 6 }) - cuboid.setRotation({ x: 0.2, y: 0.4, z: 0.6 }) - cuboid.setScale({ x: 3, y: 4, z: 5 }) + cuboid.transform.position = { x: 2, y: 2, z: 6 } + cuboid.transform.rotation = { x: 0.2, y: 0.4, z: 0.6 } + cuboid.transform.scale = { x: 3, y: 4, z: 5 } // Validate transforms - expect(cuboid.rigidBody.position.x).toEqual(0) - expect(cuboid.rigidBody.position.y).toEqual(5) - expect(cuboid.rigidBody.position.z).toEqual(2) - expect(cuboid.rigidBody.rotation.x).closeTo(-0.1, 0.0001) - expect(cuboid.rigidBody.rotation.y).closeTo(0.6, 0.0001) - expect(cuboid.rigidBody.rotation.z).closeTo(0.7, 0.0001) - expect(cuboid.rigidBody.scale.x).toEqual(6) - expect(cuboid.rigidBody.scale.y).toEqual(16) - expect(cuboid.rigidBody.scale.z).toEqual(10) + expect(cuboid.rigidBody.transform.position.x).toEqual(0) + expect(cuboid.rigidBody.transform.position.y).toEqual(5) + expect(cuboid.rigidBody.transform.position.z).toEqual(2) + expect(cuboid.rigidBody.transform.rotation.x).closeTo(-0.1, 0.0001) + expect(cuboid.rigidBody.transform.rotation.y).closeTo(0.6, 0.0001) + expect(cuboid.rigidBody.transform.rotation.z).closeTo(0.7, 0.0001) + expect(cuboid.rigidBody.transform.scale.x).toEqual(5) + expect(cuboid.rigidBody.transform.scale.y).toEqual(8) + expect(cuboid.rigidBody.transform.scale.z).toEqual(7) + // Validate RAPIER rigidBody + validateRapierRigidBody(cuboid.rigidBody.__RIGIDBODY__, cuboid.rigidBody.transform) }) }) diff --git a/packages/3d/test/index.test.ts b/packages/3d/test/index.test.ts deleted file mode 100644 index 401553c6..00000000 --- a/packages/3d/test/index.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { describe, expect, it } from 'vitest' - -describe('should', () => { - it('exported', () => { - expect(1).toEqual(1) - }) -}) diff --git a/packages/core/src/FComponent.ts b/packages/core/src/FComponent.ts index 1ed242db..df3fa062 100644 --- a/packages/core/src/FComponent.ts +++ b/packages/core/src/FComponent.ts @@ -57,7 +57,7 @@ export abstract class FComponent { /** * The scene the component is attached to. */ - public scene?: FScene + public scene: FScene /** * The controller attached to the component. @@ -80,12 +80,9 @@ export abstract class FComponent { // Add the component to the scene if addToScene is true if (options.addToScene) { - if (this instanceof FLight) { - this.scene.addLight(this) - } - else { + this.onLoaded(() => { this.scene.addComponent(this) - } + }) } // Generate a unique ID diff --git a/packages/core/src/FLight.ts b/packages/core/src/FLight.ts index 56743ed8..8f2f5b73 100644 --- a/packages/core/src/FLight.ts +++ b/packages/core/src/FLight.ts @@ -1,12 +1,60 @@ -import { FComponent } from './FComponent' import type { FScene } from './FScene' +export interface FLightOptions { + addToScene?: boolean +} + /** * The base class for lights in Fibbo. * @category Core */ -export abstract class FLight extends FComponent { - constructor(scene: FScene) { - super(scene) +export abstract class FLight { + /** + * Callbacks for when the light is loaded. + */ + public __CALLBACKS_ON_LOADED__: (() => void)[] = [] + + /** + * The scene the light is attached to. + */ + public scene: FScene + + constructor(scene: FScene, options: FLightOptions = {}) { + // Define default options + const DEFAULT_OPTIONS = { + addToScene: true, + } + // Apply default options + options = { ...DEFAULT_OPTIONS, ...options } + // Validate options + if (options.addToScene === undefined) + throw new Error('FibboError: FComponent requires addToScene option') + + // Store the scene + this.scene = scene + + // If addToScene is true, wait for the light to be loaded and add it to the scene + if (options.addToScene) { + this.onLoaded(() => { + this.scene.addLight(this) + }) + } + } + + /** + * Add a callback to be called when the light is loaded. + * @param callback The callback function. + */ + onLoaded(callback: () => void) { + this.__CALLBACKS_ON_LOADED__.push(callback) + } + + /** + * Emit the onLoaded callbacks. + */ + emitOnLoaded() { + this.__CALLBACKS_ON_LOADED__.forEach((callback) => { + callback() + }) } } diff --git a/packages/devtools/src/components/3d/FComponent3d.vue b/packages/devtools/src/components/3d/FComponent3d.vue index d02ae594..651b965d 100644 --- a/packages/devtools/src/components/3d/FComponent3d.vue +++ b/packages/devtools/src/components/3d/FComponent3d.vue @@ -11,33 +11,33 @@

Position

x :

- +

y :

- +

z :

- +

Scale

x :

- +

y :

- +

z :

- +

Rotation (Degree)

x :

- +

y :

- +

z :

- +
From d34f1f6dddfbb75a59f058f570b20b0fda0ec91a Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:16:40 +0200 Subject: [PATCH 26/36] fix: devtools --- packages/devtools/src/FDebug3d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/devtools/src/FDebug3d.ts b/packages/devtools/src/FDebug3d.ts index dfebae8c..399620e1 100644 --- a/packages/devtools/src/FDebug3d.ts +++ b/packages/devtools/src/FDebug3d.ts @@ -28,14 +28,14 @@ export class FDebug3d { const light = lightParam as FLight // Create a helper depending on the light type let helper - if (light.light instanceof scene.THREE.DirectionalLight) - helper = new scene.THREE.DirectionalLightHelper(light.light) - else if (light.light instanceof scene.THREE.HemisphereLight) - helper = new scene.THREE.HemisphereLightHelper(light.light, 1) - else if (light.light instanceof scene.THREE.PointLight) - helper = new scene.THREE.PointLightHelper(light.light) - else if (light.light instanceof scene.THREE.SpotLight) - helper = new scene.THREE.SpotLightHelper(light.light) + if (light.__LIGHT__ instanceof scene.THREE.DirectionalLight) + helper = new scene.THREE.DirectionalLightHelper(light.__LIGHT__) + else if (light.__LIGHT__ instanceof scene.THREE.HemisphereLight) + helper = new scene.THREE.HemisphereLightHelper(light.__LIGHT__, 1) + else if (light.__LIGHT__ instanceof scene.THREE.PointLight) + helper = new scene.THREE.PointLightHelper(light.__LIGHT__) + else if (light.__LIGHT__ instanceof scene.THREE.SpotLight) + helper = new scene.THREE.SpotLightHelper(light.__LIGHT__) else return // Add the helper to the scene From 5b93a7b96d8fa4a11f84c7863ef06643e198d5e0 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:33:11 +0200 Subject: [PATCH 27/36] fix(3d): custom meshes are back --- apps/playground-3d/src/main.ts | 6 ++-- packages/3d/src/core/FCollider.ts | 54 ++++++++++++------------------ packages/3d/src/core/FComponent.ts | 15 +++++++-- packages/3d/src/core/FRigidBody.ts | 1 + 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/apps/playground-3d/src/main.ts b/apps/playground-3d/src/main.ts index 497a41af..fbef06eb 100644 --- a/apps/playground-3d/src/main.ts +++ b/apps/playground-3d/src/main.ts @@ -68,7 +68,7 @@ import Character from './classes/Character' blockGrassCorner.initCollider({ positionOffset: { x: 0, y: 1, z: 0 }, rotationDegreeOffset: { x: 0, y: 45, z: 0 }, - scaleOffset: { x: 0.5, y: 0.5, z: 0.5 }, + scaleOffset: { x: -2, y: -2, z: -2 }, }) const blockGrassOverhangLargeTall = new FOBJ(scene, { @@ -88,7 +88,7 @@ import Character from './classes/Character' }) blockGrassLargeSlope.onLoaded(() => { blockGrassLargeSlope.initCollider({ - shape: FShapes.CUBOID, + shape: FShapes.MESH, }) }) @@ -100,7 +100,7 @@ import Character from './classes/Character' }) blockGrassLargeSlope2.onLoaded(() => { blockGrassLargeSlope2.initCollider({ - shape: FShapes.CUBOID, + shape: FShapes.MESH, }) }) diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index 8f58cbf5..cb228bf9 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -17,6 +17,7 @@ export interface FColliderOptions { rotationDegreeOffset?: FVector3 scaleOffset?: FVector3 shape?: FShapes + mesh?: THREE.Mesh | THREE.Group rigidBody?: FRigidBody sensor?: boolean } @@ -122,6 +123,26 @@ export class FCollider { case FShapes.CAPSULE: colliderDesc = RAPIER.ColliderDesc.capsule(this.transform.scale.y / 2, this.transform.scale.x / 2) break + case FShapes.MESH: { + if (!options.mesh) + throw new Error(`FibboError: A mesh must be provided to create a mesh collider`) + // Flag to check if a THREE.Mesh was found + let found = false + // Traverse the mesh tree until we find a THREE.Mesh + options.mesh.traverse((child) => { + if (!found && child instanceof THREE.Mesh) { + colliderDesc = RAPIER.ColliderDesc.trimesh( + child.geometry.attributes.position.array as Float32Array, + child.geometry.index?.array as Uint32Array, + ) + found = true + } + }) + // If no THREE.Mesh was found, throw an error + if (!found || !colliderDesc) + throw new Error('FibboError: Mesh collider can only be created if a THREE.Mesh is found in the mesh tree') + break + } default: throw new Error(`FibboError: shape not supported : ${options.shape}`) } @@ -288,39 +309,6 @@ export class FCollider { this.transform.__SCALE__ = scale } - /** - * Generate a mesh collider from a component. - * @param component The component to generate the mesh collider from. - */ - generateShapeFromComponent(component: FComponent): void { - if (!component.__MESH__) - throw new Error('FibboError: Mesh collider can only be created from a THREE.Mesh') - let colliderDesc - // Flag to check if a THREE.Mesh was found - let found = false - // Traverse the mesh tree until we find a THREE.Mesh - component.__MESH__.traverse((child) => { - if (!found && child instanceof THREE.Mesh) { - colliderDesc = RAPIER.ColliderDesc.trimesh( - child.geometry.attributes.position.array as Float32Array, - child.geometry.index?.array as Uint32Array, - ) - found = true - } - }) - // If no THREE.Mesh was found, throw an error - if (!found || !colliderDesc) - throw new Error('FibboError: Mesh collider can only be created if a THREE.Mesh is found in the component') - // Create the collider - this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, component.rigidBody?.__RIGIDBODY__) - // Move the collider to the position - this.__SET_POSITION__(this.transform.position) - // Rotate the collider - this.__SET_ROTATION__(this.transform.rotation) - // Define the shape as a mesh - this.shape = FShapes.MESH - } - // Setters & Getters get component(): FComponent | undefined { diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 4d43d733..bc0032da 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -284,17 +284,26 @@ export abstract class FComponent extends FComponentCore { } initCollider(options?: FColliderOptions) { - this.collider = new FCollider(this.scene, options) + this.collider = new FCollider(this.scene, { + mesh: this.__MESH__, + ...options, + }) this.collider.component = this } initRigidBody(options?: FRigidBodyOptions) { - this.rigidBody = new FRigidBody(this.scene, options) + this.rigidBody = new FRigidBody(this.scene, { + mesh: this.__MESH__, + ...options, + }) this.rigidBody.component = this } initSensor(options?: FRigidBodyOptions) { - this.sensor = new FSensor(this.scene, options) + this.sensor = new FSensor(this.scene, { + mesh: this.__MESH__, + ...options, + }) this.sensor.component = this } } diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index 8d6f04dd..9ea90093 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -18,6 +18,7 @@ export interface FRigidBodyOptions { rotationDegreeOffset?: FVector3 scaleOffset?: FVector3 shape?: FShapes + mesh?: THREE.Mesh | THREE.Group rigidBodyType?: FRigidBodyType sensor?: boolean lockTranslations?: boolean From 09a6190b8cfc10df8236fb1d16f016f3f8278318 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:39:10 +0200 Subject: [PATCH 28/36] fix: default capsule and sphere collider shapes --- packages/3d/src/polyhedrons/FCapsule.ts | 24 ++++++++++++++++++++++++ packages/3d/src/polyhedrons/FSphere.ts | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/packages/3d/src/polyhedrons/FCapsule.ts b/packages/3d/src/polyhedrons/FCapsule.ts index f9decf02..b433f614 100644 --- a/packages/3d/src/polyhedrons/FCapsule.ts +++ b/packages/3d/src/polyhedrons/FCapsule.ts @@ -1,6 +1,9 @@ import * as THREE from 'three' import type { FScene } from '../core/FScene' import type { FComponentOptions } from '../core/FComponent' +import { FShapes } from '../types/FShapes' +import type { FRigidBodyOptions } from '../core/FRigidBody' +import type { FColliderOptions } from '../core/FCollider' import { FPolyhedron } from './FPolyhedron' /** @@ -31,4 +34,25 @@ export class FCapsule extends FPolyhedron { // Emit the onLoaded event this.emitOnLoaded() } + + initCollider(options?: FColliderOptions): void { + super.initCollider({ + shape: FShapes.CAPSULE, + ...options, + }) + } + + initRigidBody(options?: FRigidBodyOptions): void { + super.initRigidBody({ + shape: FShapes.CAPSULE, + ...options, + }) + } + + initSensor(options?: FRigidBodyOptions): void { + super.initSensor({ + shape: FShapes.CAPSULE, + ...options, + }) + } } diff --git a/packages/3d/src/polyhedrons/FSphere.ts b/packages/3d/src/polyhedrons/FSphere.ts index 18b3ed72..0dfc247c 100644 --- a/packages/3d/src/polyhedrons/FSphere.ts +++ b/packages/3d/src/polyhedrons/FSphere.ts @@ -1,6 +1,9 @@ import * as THREE from 'three' import type { FScene } from '../core/FScene' import type { FComponentOptions } from '../core/FComponent' +import type { FColliderOptions } from '../core/FCollider' +import { FShapes } from '../types/FShapes' +import type { FRigidBodyOptions } from '../core/FRigidBody' import { FPolyhedron } from './FPolyhedron' /** @@ -31,4 +34,25 @@ export class FSphere extends FPolyhedron { // Emit the onLoaded event this.emitOnLoaded() } + + initCollider(options?: FColliderOptions): void { + super.initCollider({ + shape: FShapes.SPHERE, + ...options, + }) + } + + initRigidBody(options?: FRigidBodyOptions): void { + super.initRigidBody({ + shape: FShapes.SPHERE, + ...options, + }) + } + + initSensor(options?: FRigidBodyOptions): void { + super.initSensor({ + shape: FShapes.SPHERE, + ...options, + }) + } } From 845301c2c2d06f91b2c5558809ba0066774b27f3 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:49:44 +0200 Subject: [PATCH 29/36] fix(3d): collision management --- apps/playground-3d/src/classes/Character.ts | 2 +- packages/3d/src/core/FComponent.ts | 9 +++++++++ packages/3d/src/core/FScene.ts | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/playground-3d/src/classes/Character.ts b/apps/playground-3d/src/classes/Character.ts index 7b263ff3..a26063da 100644 --- a/apps/playground-3d/src/classes/Character.ts +++ b/apps/playground-3d/src/classes/Character.ts @@ -27,7 +27,7 @@ export default class Character extends FFBX { super.initSensor({ ...options, positionOffset: { x: 0, y: 0.25, z: 0 }, - scaleOffset: { x: -1.5, y: -1.5, z: -1.5 }, + scaleOffset: { x: -1.3, y: -1.8, z: -1.3 }, }) } } diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index bc0032da..9296a33b 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -289,6 +289,7 @@ export abstract class FComponent extends FComponentCore { ...options, }) this.collider.component = this + this.scene.addHandle(this.collider.__COLLIDER__.handle, this) } initRigidBody(options?: FRigidBodyOptions) { @@ -297,6 +298,7 @@ export abstract class FComponent extends FComponentCore { ...options, }) this.rigidBody.component = this + this.scene.addHandle(this.rigidBody.collider.__COLLIDER__.handle, this) } initSensor(options?: FRigidBodyOptions) { @@ -305,5 +307,12 @@ export abstract class FComponent extends FComponentCore { ...options, }) this.sensor.component = this + // If a rigidBody or collider is already defined, remove its handle from being used to detect collisions + if (this.rigidBody) + this.scene.removeHandle(this.rigidBody.__RIGIDBODY__.handle) + else if (this.collider) + this.scene.removeHandle(this.collider.__COLLIDER__.handle) + // Add the sensor's handle to the scene's handle map + this.scene.addHandle(this.sensor.collider.__COLLIDER__.handle, this) } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index a4045a91..fc1e9413 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -193,6 +193,14 @@ export class FScene extends FSceneCore { } } + addHandle(handle: number, component: FComponent) { + this.__RAPIER_TO_COMPONENT__.set(handle, component) + } + + removeHandle(handle: number) { + this.__RAPIER_TO_COMPONENT__.delete(handle) + } + addComponent(component: FComponent) { super.addComponent(component) @@ -201,10 +209,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) + this.addHandle(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + this.addHandle(component.collider.__COLLIDER__.handle, component) } removeComponent(component: FComponent): void { @@ -224,9 +232,9 @@ export class FScene extends FSceneCore { // Remove handle from rapier map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.__COLLIDER__.handle) + this.removeHandle(component.sensor.collider.__COLLIDER__.handle) if (component.collider) - this.__RAPIER_TO_COMPONENT__.delete(component.collider.__COLLIDER__.handle) + this.removeHandle(component.collider.__COLLIDER__.handle) } addLight(light: FLight): void { From 744044a5c6f1e1ff56433541fbefaba2fc5ca615 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 02:57:52 +0200 Subject: [PATCH 30/36] fix(3d): make FCharacterControllerKV rotatable --- packages/3d/src/controllers/FCharacterControllerKV.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index 4430ae03..ebfe00cb 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -41,5 +41,6 @@ export class FCharacterControllerKV extends FCharacterControllerK { y: correctedMovement.y / delta, z: correctedMovement.z / delta, }, true) + this.component.rigidBody?.__RIGIDBODY__.setRotation(this.getCorrectedRotation(), true) } } From 075380e268aec7722acc9048cac8e22de41e9129 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 03:06:47 +0200 Subject: [PATCH 31/36] feat(3d): add setLinvel and setAngvel for convenience --- packages/3d/src/core/FRigidBody.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index 9ea90093..80b21a4c 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -206,6 +206,22 @@ export class FRigidBody { this.transform.rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion().copy(this.__RIGIDBODY__.rotation())) } + /** + * Set the linear velocity of the rigidBody. + * @param velocity The new linear velocity of the rigidBody. + */ + setLinvel(velocity: FVector3): void { + this.__RIGIDBODY__.setLinvel(new RAPIER.Vector3(velocity.x, velocity.y, velocity.z), true) + } + + /** + * Set the angular velocity of the rigidBody. + * @param velocity The new angular velocity of the rigidBody. + */ + setAngvel(velocity: FVector3): void { + this.__RIGIDBODY__.setAngvel(new RAPIER.Vector3(velocity.x, velocity.y, velocity.z), true) + } + /** * Update the position of the rigidBody according to the transform. * This method should be called after updating the transform properties. From 6e84547bd62e36e7ed4177b91d54e7e02e2f8cc9 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 04:08:53 +0200 Subject: [PATCH 32/36] feat(2d): start refactoring 2d transform system --- packages/2d/src/cameras/FAttachedCamera.ts | 4 +- packages/2d/src/cameras/FCamera.ts | 47 +- packages/2d/src/cameras/FFixedCamera.ts | 2 +- packages/2d/src/cameras/FFreeCamera.ts | 2 +- .../src/controllers/FCharacterControllerD.ts | 4 +- .../src/controllers/FCharacterControllerKP.ts | 4 +- .../src/controllers/FCharacterControllerKV.ts | 4 +- packages/2d/src/core/FCollider.ts | 349 +++++++------- packages/2d/src/core/FComponent.ts | 430 ++++++------------ packages/2d/src/core/FRigidBody.ts | 365 ++++++++------- packages/2d/src/core/FScene.ts | 77 +++- packages/2d/src/core/FSensor.ts | 45 ++ packages/2d/src/core/FTransform.ts | 241 ++++++++-- packages/2d/src/index.ts | 2 + packages/2d/src/lights/FLight.ts | 95 ++-- packages/2d/src/sprite/FSprite.ts | 4 +- packages/2d/src/types/FRigidBodyType.ts | 7 + packages/2d/src/types/FVector2.ts | 13 + packages/3d/src/core/FCollider.ts | 4 +- packages/3d/src/core/FComponent.ts | 14 +- packages/3d/src/core/FRigidBody.ts | 6 +- packages/3d/src/core/FScene.ts | 11 +- packages/3d/src/core/FTransform.ts | 20 +- packages/3d/src/lights/FLight.ts | 1 + 24 files changed, 928 insertions(+), 823 deletions(-) create mode 100644 packages/2d/src/core/FSensor.ts create mode 100644 packages/2d/src/types/FRigidBodyType.ts create mode 100644 packages/2d/src/types/FVector2.ts diff --git a/packages/2d/src/cameras/FAttachedCamera.ts b/packages/2d/src/cameras/FAttachedCamera.ts index 32d905ab..3a6e682f 100644 --- a/packages/2d/src/cameras/FAttachedCamera.ts +++ b/packages/2d/src/cameras/FAttachedCamera.ts @@ -25,8 +25,8 @@ export class FAttachedCamera extends FCamera { frame(_delta: number): void { // Move the camera to the target this.scene.viewport.moveCenter( - this.target.transform.position.x * 100 + this.position.x * 100, - -this.target.transform.position.y * 100 - this.position.y * 100, + this.target.transform.position.x * 100 + this.transform.position.x * 100, + -this.target.transform.position.y * 100 - this.transform.position.y * 100, ) } diff --git a/packages/2d/src/cameras/FCamera.ts b/packages/2d/src/cameras/FCamera.ts index 6eb964e5..74b189fa 100644 --- a/packages/2d/src/cameras/FCamera.ts +++ b/packages/2d/src/cameras/FCamera.ts @@ -60,35 +60,34 @@ export abstract class FCamera extends FCameraCore { this.scene.viewport.setZoom(zoom) } - setPosition(position: { x: number, y: number }): void { - this.transform.position = position - this.scene.viewport.x = position.x - this.scene.viewport.y = position.y - } - - // Setters & Getters - - get position() { - return this.transform.position - } - - set position(position: { x: number, y: number }) { - this.setPosition(position) - } - - get x() { - return this.transform.position.x + /** + * Update the position of the camera according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_POSITION__(): void { + this.__SET_POSITION__(this.transform.position) } - set x(x: number) { - this.setPosition({ x, y: this.y }) + /** + * Update the rotation of the camera according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_ROTATION__(): void { + console.warn('FCamera does not support rotation.') } - get y() { - return this.transform.position.y + /** + * Update the scale of the camera according to the transform. + * This method should be called after updating the transform properties. + * This method does not make sense for cameras, but it is implemented for consistency. + */ + __UPDATE_SCALE__(): void { + console.warn('FCamera does not support scale.') } - set y(y: number) { - this.setPosition({ x: this.x, y }) + __SET_POSITION__(position: { x: number, y: number }): void { + this.transform.position = position + this.scene.viewport.x = position.x + this.scene.viewport.y = position.y } } diff --git a/packages/2d/src/cameras/FFixedCamera.ts b/packages/2d/src/cameras/FFixedCamera.ts index 81bf3412..3b406d69 100644 --- a/packages/2d/src/cameras/FFixedCamera.ts +++ b/packages/2d/src/cameras/FFixedCamera.ts @@ -18,6 +18,6 @@ export class FFixedCamera extends FCamera { this.scene.viewport.plugins.pause('wheel') this.scene.viewport.plugins.pause('decelerate') // Move the camera to the target - this.scene.viewport.moveCenter(this.position.x * 100, -this.position.y * 100) + this.scene.viewport.moveCenter(this.transform.position.x * 100, -this.transform.position.y * 100) } } diff --git a/packages/2d/src/cameras/FFreeCamera.ts b/packages/2d/src/cameras/FFreeCamera.ts index 24a6f82f..fd70678a 100644 --- a/packages/2d/src/cameras/FFreeCamera.ts +++ b/packages/2d/src/cameras/FFreeCamera.ts @@ -18,6 +18,6 @@ export class FFreeCamera extends FCamera { this.scene.viewport.plugins.resume('wheel') this.scene.viewport.plugins.resume('decelerate') // Move the camera to the target - this.scene.viewport.moveCenter(this.position.x * 100, -this.position.y * 100) + this.scene.viewport.moveCenter(this.transform.position.x * 100, -this.transform.position.y * 100) } } diff --git a/packages/2d/src/controllers/FCharacterControllerD.ts b/packages/2d/src/controllers/FCharacterControllerD.ts index 0039182a..91d58825 100644 --- a/packages/2d/src/controllers/FCharacterControllerD.ts +++ b/packages/2d/src/controllers/FCharacterControllerD.ts @@ -1,6 +1,6 @@ -import RAPIER from '@dimforge/rapier2d' import { FKeyboard } from '@fibbojs/event' import type { FScene } from '../core/FScene' +import { FRigidBodyType } from '../types/FRigidBodyType' import type { FCharacterControllerOptions } from './FCharacterController' import { FCharacterController } from './FCharacterController' @@ -29,7 +29,7 @@ export class FCharacterControllerD extends FCharacterController { // Initialize the rigidBody this.component.initRigidBody({ - rigidBodyType: RAPIER.RigidBodyType.Dynamic, + rigidBodyType: FRigidBodyType.DYNAMIC, lockRotations: true, ...options, }) diff --git a/packages/2d/src/controllers/FCharacterControllerKP.ts b/packages/2d/src/controllers/FCharacterControllerKP.ts index e4108178..1a1f4f50 100644 --- a/packages/2d/src/controllers/FCharacterControllerKP.ts +++ b/packages/2d/src/controllers/FCharacterControllerKP.ts @@ -1,5 +1,5 @@ -import RAPIER from '@dimforge/rapier2d' import type { FScene } from '../core/FScene' +import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -23,7 +23,7 @@ export class FCharacterControllerKP extends FCharacterControllerK { // Initialize the rigidBody this.component.initRigidBody({ - rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, + rigidBodyType: FRigidBodyType.KINEMATIC_POSITION_BASED, lockRotations: true, ...options, }) diff --git a/packages/2d/src/controllers/FCharacterControllerKV.ts b/packages/2d/src/controllers/FCharacterControllerKV.ts index 407addee..874966a2 100644 --- a/packages/2d/src/controllers/FCharacterControllerKV.ts +++ b/packages/2d/src/controllers/FCharacterControllerKV.ts @@ -1,5 +1,5 @@ -import RAPIER from '@dimforge/rapier2d' import type { FScene } from '../core/FScene' +import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' @@ -23,7 +23,7 @@ export class FCharacterControllerKV extends FCharacterControllerK { // Initialize the rigidBody this.component.initRigidBody({ - rigidBodyType: RAPIER.RigidBodyType.KinematicVelocityBased, + rigidBodyType: FRigidBodyType.KINEMATIC_VELOCITY_BASED, lockRotations: true, ...options, }) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index c2efa459..ce4642a2 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -1,13 +1,18 @@ import * as RAPIER from '@dimforge/rapier2d' +import type { FVector2 } from '../types/FVector2' import { FShapes } from '../types/FShapes' import type { FComponent } from './FComponent' import type { FRigidBody } from './FRigidBody' +import { FTransform } from './FTransform' +import type { FScene } from './FScene' export interface FColliderOptions { - position?: { x: number, y: number } - scale?: { x: number, y: number } + position?: FVector2 rotation?: number - rotationDegree?: number + scale?: FVector2 + positionOffset?: FVector2 + rotationOffset?: number + scaleOffset?: FVector2 shape?: FShapes rigidBody?: FRigidBody sensor?: boolean @@ -23,24 +28,17 @@ export class FCollider { */ __COLLIDER__: RAPIER.Collider /** - * Position Offset for the collider. - * This is used to adjust the collider position relative to the component. + * The component the collider is attached to. */ - __COLLIDER_POSITION_OFFSET__: { x: number, y: number } + __COMPONENT__?: FComponent /** - * Rotation Offset for the collider. - * This is used to adjust the collider position relative to the component. + * The transform of the collider. */ - __COLLIDER_ROTATION_OFFSET__: number + transform: FTransform /** - * Scale Offset for the collider. - * This is used to adjust the collider scale relative to the component. + * The transform offset of the collider. */ - __COLLIDER_SCALE_OFFSET__: { x: number, y: number } - /** - * The component the collider is attached to. - */ - component: FComponent + offset: FTransform /** * The shape of the collider. */ @@ -48,93 +46,79 @@ export class FCollider { /** * Creates a collider for a given component. - * @param component The component which the collider will be attached to. + * @param scene The scene the collider belongs to. * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to 0. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. + * @param options.position The position of the collider. Default is { x: 0, y: 0 }. + * @param options.rotation The rotation of the collider in degrees. Default is 0. + * @param options.scale The scale of the collider. Default is { x: 1, y: 1 }. + * @param options.positionOffset The position offset of the collider. Only used if the collider is attached to a component. Default is { x: 0, y: 0 }. + * @param options.rotationOffset The rotation offset of the collider in degrees. Only used if the collider is attached to a component. Default is 0. + * @param options.scaleOffset The scale offset of the collider. Only used if the collider is attached to a component. Default is { x: 0, y: 0 }. + * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CIRCLE. * @param options.rigidBody The rigidBody to attach the collider to. (optional) * @param options.sensor If true, the collider will be a sensor. * @example * ```ts - * const collider = new FCollider(component, { - * position: { x: 0, y: 1 }, + * const collider = new FCollider(scene, { + * position: { x: 0, y: 0 }, * scale: { x: 1, y: 1 }, - * rotation: 0, - * shape: FShapes.RECTANGLE + * shape: FShapes.CIRCLE * }) * ``` */ - constructor(component: FComponent, options?: FColliderOptions) { + constructor(scene: FScene, options?: FColliderOptions) { // Apply default options const DEFAULT_OPTIONS = { position: { x: 0, y: 0 }, scale: { x: 1, y: 1 }, rotation: 0, - rotationDegree: undefined, - shape: FShapes.RECTANGLE, - rigidBody: undefined, + shape: FShapes.CIRCLE, sensor: false, } options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || options.rotation === undefined || !options.shape || options.sensor === undefined) - throw new Error('FibboError: initCollider requires transforms options') + if (!options.position || !options.scale || !options.shape || options.sensor === undefined) + throw new Error('FibboError: options missing in FCollider constructor') // Check if the world exists - if (!component.scene.world) + if (!scene.world) throw new Error('FibboError: FScene must have a world to create a collider') - // If rotation degree is given, convert it to radians - if (options.rotationDegree !== undefined) { - // Convert the degree to radians - options.rotation = (options.rotationDegree * Math.PI) / 180 - } - // Store the options - this.__COLLIDER_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } - this.__COLLIDER_ROTATION_OFFSET__ = options.rotation - this.__COLLIDER_SCALE_OFFSET__ = { x: options.scale.x, y: options.scale.y } - this.component = component this.shape = options.shape - // Devide the scale by 2 for the collider (RAPIER uses half-extents) - // Also interpete the scale as relative to its component's scale - options.scale = { - x: component.transform.scale.x / 2 * options.scale.x, - y: component.transform.scale.y / 2 * options.scale.y, - } + // Configure transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + scale: options.scale, + }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) + this.offset = new FTransform({ + position: options.positionOffset || { x: 0, y: 0 }, + rotation: options.rotationOffset || 0, + scale: options.scaleOffset || { x: 0, y: 0 }, + }) // Create a collider description according to the shape given let colliderDesc switch (options.shape) { - case FShapes.RECTANGLE: - colliderDesc = RAPIER.ColliderDesc.cuboid(options.scale.x, options.scale.y) - break case FShapes.CIRCLE: - colliderDesc = RAPIER.ColliderDesc.ball(options.scale.x) + colliderDesc = RAPIER.ColliderDesc.ball(this.transform.scale.x / 2) + break + case FShapes.RECTANGLE: + colliderDesc = RAPIER.ColliderDesc.cuboid(this.transform.scale.x / 2, this.transform.scale.y / 2) break default: throw new Error(`FibboError: shape not supported : ${options.shape}`) } - // Verify the collider description was created - if (!colliderDesc) - throw new Error('FibboError: Collider description could not be created') + // Move the collider to the position + colliderDesc.setTranslation(this.transform.position.x, this.transform.position.y) + // Rotate the collider + colliderDesc.setRotation(this.transform.rotation) - // If no rigidbody given, the collider is free : set translation and rotation for the collider - if (options.rigidBody === undefined) { - // Interprete the given position as relative to its component's position - const newPosition = component.transform.position - newPosition.x += options.position.x - newPosition.y += options.position.y - colliderDesc.setTranslation(newPosition.x, newPosition.y) - - // Interprete the given rotation as relative to its component's rotation - const finalRotation = component.transform.rotation + options.rotation - colliderDesc.setRotation(finalRotation) - } // Set the sensor flag if (options.sensor) { colliderDesc.setSensor(true) @@ -142,159 +126,152 @@ export class FCollider { } // Create the collider - this.__COLLIDER__ = component.scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) + this.__COLLIDER__ = scene.world.createCollider(colliderDesc, options.rigidBody?.__RIGIDBODY__) + + // Add the collider to the scene + scene.addCollider(this) } - /** - * Set the position of the collider. - * @param position The new position of the collider. - * @param position.x The new x position of the collider. - * @param position.y The new y position of the collider. - */ - setPosition(position: { x: number, y: number }) { - this.__COLLIDER__.setTranslation(position) + frame(_delta: number): void { + // As the collider should have moved, update the transform to sync with the collider + this.transform.position = this.__COLLIDER__.translation() + this.transform.rotation = this.__COLLIDER__.rotation() * (180 / Math.PI) } /** - * Set the rotation of the collider. - * @param rotation The new rotation of the collider. + * Update the position of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the position update. + * This means the new position will be the position of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - setRotation(rotation: number) { - this.__COLLIDER__.setRotation(rotation) + __UPDATE_POSITION__(initiator: boolean = false): void { + // If the collider is the initiator + if (initiator) { + if (this.component) { + // Update the collider position + this.__SET_POSITION__(this.transform.position) + // Propagate the position update + this.component.__UPDATE_POSITION__() + this.component.sensor?.__UPDATE_POSITION__() + } + } + // Else, it was propagated to the collider, so move the collider to the new position with the offset + else if (this.component) { + const newPosition = { + x: this.component.transform.position.x + this.offset.position.x, + y: this.component.transform.position.y + this.offset.position.y, + } + // Update the collider position + this.__SET_POSITION__(newPosition) + } } /** - * Set the rotation of the collider in degrees. - * @param rotation The new rotation of the collider in degrees. + * Update the rotation of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the rotation update. + * This means the new rotation will be the rotation of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - setRotationDegree(rotation: number) { - this.__COLLIDER__.setRotation((rotation * Math.PI) / 180) + __UPDATE_ROTATION__(initiator: boolean = false): void { + // If the collider is the initiator + if (initiator) { + if (this.component) { + // Update the collider rotation + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update + this.component.__UPDATE_ROTATION__() + this.component.sensor?.__UPDATE_ROTATION__() + } + } + // Else, it was propagated to the collider, so rotate the collider to the new rotation with the offset + else if (this.component) { + const newRotation = this.component.transform.rotation + this.offset.rotation + // Update the collider rotation + this.__SET_ROTATION__(newRotation) + } } /** - * Set the scale of the collider. - * @param scale The new scale of the collider. - * @param scale.x The new x scale of the collider. - * @param scale.y The new y scale of the collider. + * Update the scale of the collider according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the collider won't be considered as the initiator of the scale update. + * This means the new scale will be the scale of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - setScale(scale: { x: number, y: number }) { - // If the collider is a cuboid, update its half extents - if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2)) + __UPDATE_SCALE__(initiator: boolean = false): void { + // If the collider is the initiator + if (initiator) { + if (this.component) { + // Update the collider scale + this.__SET_SCALE__(this.transform.scale) + // Propagate the scale update + this.component.__UPDATE_SCALE__() + this.component.sensor?.__UPDATE_SCALE__() + } } - // If the collider is a ball, update its radius - else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - this.__COLLIDER__.setShape(new RAPIER.Ball(Math.max(scale.x, scale.y) / 2)) + // Else, it was propagated to the collider, so scale the collider to the new scale with the offset + else if (this.component) { + const newScale = { + x: this.component.transform.scale.x + this.offset.scale.x, + y: this.component.transform.scale.y + this.offset.scale.y, + } + // Update the collider scale + this.__SET_SCALE__(newScale) } } /** - * Update the position of the collider according to its component's position. - * This takes into account the position offset. + * Set the position of the collider. + * @param position The new position of the collider. */ - updatePosition() { - this.setPosition({ - x: this.component.transform.position.x + this.__COLLIDER_POSITION_OFFSET__.x, - y: this.component.transform.position.y + this.__COLLIDER_POSITION_OFFSET__.y, - }) + __SET_POSITION__(position: FVector2): void { + this.__COLLIDER__.setTranslation(position) + this.transform.__POSITION__ = position } /** - * Update the rotation of the collider according to its component's rotation. - * This takes into account the rotation offset. + * Set the rotation of the collider. + * @param rotation The new rotation of the collider in degrees. */ - updateRotation() { - this.setRotation(this.component.transform.rotation + this.__COLLIDER_ROTATION_OFFSET__) + __SET_ROTATION__(rotation: number): void { + this.__COLLIDER__.setRotation(rotation * (Math.PI / 180)) + this.transform.__ROTATION__ = rotation } /** - * Update the scale of the collider according to its component's scale. - * This takes into account the scale offset. + * Set the scale of the collider. + * @param scale The new scale of the collider. */ - updateScale() { - this.setScale({ - x: this.component.transform.scale.x * this.__COLLIDER_SCALE_OFFSET__.x, - y: this.component.transform.scale.y * this.__COLLIDER_SCALE_OFFSET__.y, - }) - } - - // Setters & getters for transform properties - - get position() { - return this.__COLLIDER__.translation() - } - - set position(position: { x: number, y: number }) { - this.setPosition(position) - } - - get x() { - return this.__COLLIDER__.translation().x - } - - set x(x: number) { - this.setPosition({ x, y: this.y }) - } - - get y() { - return this.__COLLIDER__.translation().y - } - - set y(y: number) { - this.setPosition({ x: this.x, y }) - } - - get rotation() { - return this.__COLLIDER__.rotation() - } - - set rotation(rotation: number) { - this.setRotation(rotation) - } - - get rotationDegree() { - return (this.__COLLIDER__.rotation() * 180) / Math.PI - } - - set rotationDegree(rotation: number) { - this.setRotationDegree(rotation) - } - - get scale() { - if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { - return { - x: this.__COLLIDER__.shape.halfExtents.x * 2, - y: this.__COLLIDER__.shape.halfExtents.y * 2, - } + __SET_SCALE__(scale: FVector2): void { + // If the shape is a circle, the scale should be the same on both axis + if (this.shape === FShapes.CIRCLE) { + scale.x = Math.max(scale.x, scale.y) + scale.y = scale.x } - else if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { - return { - x: this.__COLLIDER__.shape.radius * 2, - y: this.__COLLIDER__.shape.radius * 2, - } + // If the collider is a circle, update its radius + if (this.__COLLIDER__.shape instanceof RAPIER.Ball) { + this.__COLLIDER__.setShape(new RAPIER.Ball(scale.x / 2)) } - else { - return { x: 0, y: 0 } + // If the collider is a rectangle, update its half extents + else if (this.__COLLIDER__.shape instanceof RAPIER.Cuboid) { + this.__COLLIDER__.setShape(new RAPIER.Cuboid(scale.x / 2, scale.y / 2)) } + this.transform.__SCALE__ = scale } - set scale(scale: { x: number, y: number }) { - this.setScale(scale) - } - - get scaleX() { - return this.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.scale.y }) - } + // Setters & Getters - get scaleY() { - return this.scale.y + get component(): FComponent | undefined { + return this.__COMPONENT__ } - set scaleY(y: number) { - this.setScale({ x: this.scale.x, y }) + set component(component: FComponent | undefined) { + this.__COMPONENT__ = component + // Update the position, rotation and scale of the collider + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() + this.__UPDATE_SCALE__() } } diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index d307f5d1..6f925220 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -3,18 +3,20 @@ import { FComponent as FComponentCore } from '@fibbojs/core' import * as PIXI from 'pixi.js' import * as RAPIER from '@dimforge/rapier2d' import type { FController } from '../controllers/FController' +import type { FVector2 } from '../types/FVector2' import type { FScene } from './FScene' import type { FColliderOptions } from './FCollider' import { FCollider } from './FCollider' import type { FRigidBodyOptions } from './FRigidBody' import { FRigidBody } from './FRigidBody' import { FTransform } from './FTransform' +import { FSensor } from './FSensor' export interface FComponentOptions extends FComponentOptionsCore { position?: { x: number, y: number } - scale?: { x: number, y: number } rotation?: number rotationDegree?: number + scale?: { x: number, y: number } } /** @@ -64,9 +66,9 @@ export abstract class FComponent extends FComponentCore { * @param scene The 2D scene where the component will be added. * @param options The options for the component. * @param options.position The position of the component. - * @param options.scale The scale of the component. * @param options.rotation The rotation of the component. * @param options.rotationDegree The rotation of the component in degrees. If this is provided, the rotation will be converted to radians. + * @param options.scale The scale of the component. */ constructor(scene: FScene, options?: FComponentOptions) { super(scene) @@ -77,265 +79,173 @@ export abstract class FComponent extends FComponentCore { // Define default options const DEFAULT_OPTIONS = { position: { x: 0, y: 5 }, - scale: { x: 1, y: 1 }, rotation: 0, + scale: { x: 1, y: 1 }, } // Apply default options options = { ...DEFAULT_OPTIONS, ...options } // Validate options if (!options.position || !options.scale || (options.rotation === undefined && options.rotationDegree === undefined)) - throw new Error('FibboError: FComponent requires position, scale and rotation options') + throw new Error('FibboError: FComponent requires transform properties.') - // Create the transform + // Configure transform this.transform = new FTransform({ position: options.position, - scale: options.scale, rotation: options.rotation, rotationDegree: options.rotationDegree, + scale: options.scale, }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) + // Set the container values this.__CONTAINER__.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) - this.__CONTAINER__.scale.set(this.transform.scale.x * 100, this.transform.scale.y * 100) this.__CONTAINER__.rotation = this.transform.rotation + this.__CONTAINER__.scale.set(this.transform.scale.x * 100, this.transform.scale.y * 100) // Set the pivot of the container to the center this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } frame(_delta: number): void { super.frame(_delta) - // If the rigidBody exist, update the container position and rotation according to the rigidBody - if (this.rigidBody && this.collider) { - // Translation - const newContainerPosition = this.rigidBody.__RIGIDBODY__.translation() - // Remove offset - newContainerPosition.x -= this.rigidBody.__RIGIDBODY_POSITION_OFFSET__.x - newContainerPosition.y -= this.rigidBody.__RIGIDBODY_POSITION_OFFSET__.y - - // Rotation - let newContainerRotation = this.rigidBody.__RIGIDBODY__.rotation() - // Remove offset - newContainerRotation -= this.rigidBody.__RIGIDBODY_ROTATION_OFFSET__ - - // Apply the new transforms to the container - this.__CONTAINER__.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) - this.__CONTAINER__.rotation = -newContainerRotation - - // Update position and rotation properties of the component according to the rigidBody - this.transform.position = { - x: this.__CONTAINER__.position.x / 100, - y: -this.__CONTAINER__.position.y / 100, - } - this.transform.rotation = this.__CONTAINER__.rotation - } - // Else if the collider exist, update the container position and rotation according to the collider - else if (this.collider) { - // Get the new transforms from the collider - - // Transforms - const newContainerPosition = this.collider.__COLLIDER__.translation() - // Remove offset - newContainerPosition.x -= this.collider.__COLLIDER_POSITION_OFFSET__.x - newContainerPosition.y -= this.collider.__COLLIDER_POSITION_OFFSET__.y - - // Rotation - let newContainerRotation = this.collider.__COLLIDER__.rotation() - // Remove offset - newContainerRotation -= this.collider.__COLLIDER_ROTATION_OFFSET__ + } - // Apply the new transforms to the container - this.__CONTAINER__.position.set(newContainerPosition.x * 100, -newContainerPosition.y * 100) - this.__CONTAINER__.rotation = -newContainerRotation - // Update position and rotation properties of the component according to the collider - this.transform.position = { - x: this.__CONTAINER__.position.x / 100, - y: -this.__CONTAINER__.position.y / 100, - } - this.transform.rotation = this.__CONTAINER__.rotation + /** + * Update the position of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the position update. + * Set this to true to propagate the position update to the rigidBody, collider and sensor. + */ + __UPDATE_POSITION__(initiator: boolean = false): void { + // If the component is the initiator + if (initiator) { + // Move the component + this.__SET_POSITION__(this.transform.position) + // Propagate the position update to the rigidBody, collider and sensor + if (this.rigidBody) + this.rigidBody.__UPDATE_POSITION__() + else if (this.collider) + this.collider.__UPDATE_POSITION__() + if (this.sensor) + this.sensor.__UPDATE_POSITION__() } else { - // If the rigidBody and collider doesn't exist, update the container position and rotation according to the default values - // The y position is inverted because the y axis is inverted in PIXI.js compared to Rapier - this.__CONTAINER__.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) - this.__CONTAINER__.rotation = this.transform.rotation - // Update position and rotation properties of the component according to the default values - this.transform.position = { - x: this.__CONTAINER__.position.x / 100, - y: -this.__CONTAINER__.position.y / 100, + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Move the component + this.__SET_POSITION__({ + x: this.rigidBody.transform.position.x - this.rigidBody.offset.position.x, + y: this.rigidBody.transform.position.y - this.rigidBody.offset.position.y, + }) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Move the component + this.__SET_POSITION__({ + x: this.collider.transform.position.x - this.collider.offset.x, + y: this.collider.transform.position.y - this.collider.offset.y, + }) } - this.transform.rotation = this.__CONTAINER__.rotation - } - - // If a sensor exists, update its transforms - if (this.sensor) { - this.sensor.updatePosition() - this.sensor.updateRotation() - this.sensor.updateScale() } } /** - * Set the position of the component. - * @param options The options for the position. - * @param options.x The x position. - * @param options.y The y position. - * @example - * ```ts - * component.setPosition({ x: 0, y: 0 }) - * ``` - */ - setPosition(options: { x: number, y: number }): void { - this.transform.position = { x: options.x, y: options.y } - this.__CONTAINER__.position.set(options.x * 100, -options.y * 100) - // If a rigidBody exists, update its position - if (this.rigidBody) - this.rigidBody.updatePosition() - // Else if a collider exists, update its position - else if (this.collider) - this.collider.updatePosition() - // If a sensor exists, update its position - if (this.sensor) - this.sensor.updatePosition() - } - - /** - * Set the rotation of the component in radians. - * @param rotation The rotation in radians. - * @example - * ```ts - * component.setRotation(Math.PI / 2) - * ``` - */ - setRotation(rotation: number): void { - this.transform.rotation = rotation - this.__CONTAINER__.rotation = rotation - // If a rigidBody exists, update its rotation - if (this.rigidBody) - this.rigidBody.updateRotation() - // Else if a collider exists, update its rotation - else if (this.collider) - this.collider.updateRotation() - // If a sensor exists, update its rotation - if (this.sensor) - this.sensor.updateRotation() - } - - /** - * Set the rotation of the component in degrees. - * @param rotation The rotation in degrees. - * @example - * ```ts - * component.setRotationDegree(90) - * ``` + * Update the rotation of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the rotation update. + * Set this to true to propagate the rotation update to the rigidBody, collider and sensor. */ - setRotationDegree(rotation: number): void { - this.setRotation(rotation * (Math.PI / 180)) + __UPDATE_ROTATION__(initiator: boolean = false): void { + // If the component is the initiator + if (initiator) { + // Rotate the component + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update to the rigidBody, collider and sensor + if (this.rigidBody) + this.rigidBody.__UPDATE_ROTATION__() + else if (this.collider) + this.collider.__UPDATE_ROTATION__() + if (this.sensor) + this.sensor.__UPDATE_ROTATION__() + } + else { + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Rotate the component + this.__SET_ROTATION__(this.rigidBody.transform.rotation - this.rigidBody.offset.rotation) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Rotate the component + this.__SET_ROTATION__(this.collider.transform.rotation) + } + } } /** - * Set the scale of the component. - * @param options The options for the scale. - * @param options.x The x scale. - * @param options.y The y scale. - * @example - * ```ts - * component.setScale({ x: 1, y: 1 }) - * ``` + * Update the scale of the component according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the component won't be considered as the initiator of the scale update. + * Set this to true to propagate the scale update to the rigidBody, collider and sensor. */ - setScale(options: { x: number, y: number }): void { - this.transform.scale = { x: options.x, y: options.y } - this.__CONTAINER__.height = options.y * 100 - this.__CONTAINER__.width = options.x * 100 - // If a rigidBody exists, update its scale - if (this.rigidBody) - this.rigidBody.updateScale() - // Else if a collider exists, update its scale - else if (this.collider) - this.collider.updateScale() - // If a sensor exists, update its scale - if (this.sensor) - this.sensor.updateScale() + __UPDATE_SCALE__(initiator: boolean = false): void { + // If the component is the initiator + if (initiator) { + // Scale the component + this.__SET_SCALE__(this.transform.scale) + // Propagate the scale update to the rigidBody, collider and sensor + if (this.rigidBody) + this.rigidBody.__UPDATE_SCALE__() + else if (this.collider) + this.collider.__UPDATE_SCALE__() + if (this.sensor) + this.sensor.__UPDATE_SCALE__() + } + else { + // The event was propagated to the component + // If a rigidBody exists, the propagation comes from the rigidBody + if (this.rigidBody) { + // Scale the component + this.__SET_SCALE__({ + x: this.rigidBody.transform.scale.x - this.rigidBody.offset.scaleX, + y: this.rigidBody.transform.scale.y - this.rigidBody.offset.scaleY, + }) + } + // If a collider exists, the propagation comes from the collider + else if (this.collider) { + // Scale the component + this.__SET_SCALE__({ + x: this.collider.transform.scale.x - this.collider.offset.scaleX, + y: this.collider.transform.scale.y - this.collider.offset.scaleY, + }) + } + } } - /** - * Init a rigidBody for the model. - * @param options The options for the rigidBody. - * @param options.position The position of the rigidBody. - * @param options.scale The scale of the rigidBody. - * @param options.rotation The rotation of the rigidBody. - * @param options.shape The shape of the rigidBody. - * @param options.lockTranslations Lock the translations of the rigidBody. - * @param options.lockRotations Lock the rotations of the rigidBody. - * @param options.enabledTranslations Enable only specific translations of the rigidBody. - * @param options.enabledTranslations.enableX Enable the x translation of the rigidBody. - * @param options.enabledTranslations.enableY Enable the y translation of the rigidBody. - * @example - * ```ts - * component.initRigidBody({ - * position: { x: 0, y: 0 }, - * scale: { x: 1, y: 1 }, - * rotation: 0, - * shape: FShapes.SQUARE - * }) - * ``` - */ - initRigidBody(options?: FRigidBodyOptions): void { - // Initialize the rigidBody - this.rigidBody = new FRigidBody(this, options) - - // Set the collider - this.collider = this.rigidBody?.collider + __SET_POSITION__(position: FVector2): void { + // Move the container + this.__CONTAINER__.position.set(position.x * 100, -position.y * 100) + // Update the transform + this.transform.__POSITION__ = position } - /** - * Only init a collider for the component, without a rigidBody. - * This is useful for static objects. - * @param options The options for the collider. - * @param options.position The position of the collider. - * @param options.scale The scale of the collider. - * @param options.rotation The rotation of the collider. - * @param options.shape The shape of the collider. - * @param options.sensor If true, the collider will be a sensor. - * @example - * ```ts - * component.initCollider({ - * position: { x: 0, y: 0 }, - * scale: { x: 1, y: 1 }, - * rotation: 0, - * shape: FShapes.SQUARE - * }) - * ``` - */ - initCollider(options?: FColliderOptions): void { - // Initialize the collider - this.collider = new FCollider(this, options) + __SET_ROTATION__(rotation: number): void { + // Rotate the container + this.__CONTAINER__.rotation = rotation + // Update the transform + this.transform.__ROTATION__ = rotation } - /** - * Init a sensor for the component. - * This is useful for triggerings events when the component collides with other components. - * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the collider. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the collider. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the collider. If not defined, it will default to FShapes.CUBOID. - * @param options.sensor If true, the collider will be a sensor. - * @example - * ```ts - * component.initSensor({ - * position: { x: 0, y: 0 }, - * scale: { x: 1, y: 1 }, - * rotation: { x: 0, y: 0 }, - * shape: FShapes.SQUARE - * }) - * ``` - */ - initSensor(options?: FColliderOptions): void { - // Initialize the sensor - this.sensor = new FRigidBody(this, { - sensor: true, - rigidBodyType: RAPIER.RigidBodyType.KinematicPositionBased, - ...options, - }) + __SET_SCALE__(scale: FVector2): void { + // Scale the container + this.__CONTAINER__.scale.set(scale.x * 100, scale.y * 100) + // Set the pivot of the container to the center + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) + // Update the transform + this.transform.__SCALE__ = scale } onCollisionWith(classOrObject: any, callback: (data: OnCollisionWithData) => void): () => void { @@ -348,69 +258,27 @@ export abstract class FComponent extends FComponentCore { return super.onCollisionWith(classOrObject, callback) } - // Setters & Getters - - get position(): { x: number, y: number } { - return this.transform.position - } - - set position(position: { x: number, y: number }) { - this.setPosition(position) - } - - get x(): number { - return this.transform.position.x - } - - set x(x: number) { - this.setPosition({ x, y: this.transform.position.y }) + initCollider(options?: FColliderOptions) { + this.collider = new FCollider(this.scene, options) + this.collider.component = this + this.scene.addHandle(this.collider.__COLLIDER__.handle, this) } - get y(): number { - return this.transform.position.y + initRigidBody(options?: FRigidBodyOptions) { + this.rigidBody = new FRigidBody(this.scene, options) + this.rigidBody.component = this + this.scene.addHandle(this.rigidBody.collider.__COLLIDER__.handle, this) } - set y(y: number) { - this.setPosition({ x: this.transform.position.x, y }) - } - - get rotation(): number { - return this.transform.rotation - } - - set rotation(rotation: number) { - this.setRotation(rotation) - } - - get rotationDegree(): number { - return this.transform.rotation * (180 / Math.PI) - } - - set rotationDegree(rotation: number) { - this.setRotationDegree(rotation) - } - - get scale(): { x: number, y: number } { - return this.transform.scale - } - - set scale(s: { x: number, y: number }) { - this.setScale(s) - } - - get scaleX(): number { - return this.transform.scale.x - } - - set scaleX(x: number) { - this.setScale({ x, y: this.transform.scale.y }) - } - - get scaleY(): number { - return this.transform.scale.y - } - - set scaleY(y: number) { - this.setScale({ x: this.transform.scale.x, y }) + initSensor(options?: FRigidBodyOptions) { + this.sensor = new FSensor(this.scene, options) + this.sensor.component = this + // If a rigidBody or collider is already defined, remove its handle from being used to detect collisions + if (this.rigidBody) + this.scene.removeHandle(this.rigidBody.__RIGIDBODY__.handle) + else if (this.collider) + this.scene.removeHandle(this.collider.__COLLIDER__.handle) + // Add the sensor's handle to the scene's handle map + this.scene.addHandle(this.sensor.collider.__COLLIDER__.handle, this) } } diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 2e50d947..5d6276b6 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -1,15 +1,23 @@ import * as RAPIER from '@dimforge/rapier2d' +import type { FVector2 } from '../types/FVector2' +import { FRigidBodyType } from '../types/FRigidBodyType' import { FShapes } from '../types/FShapes' import type { FComponent } from './FComponent' import { FCollider } from './FCollider' +import { FTransform } from './FTransform' +import type { FScene } from './FScene' export interface FRigidBodyOptions { - position?: { x: number, y: number } - scale?: { x: number, y: number } + position?: FVector2 rotation?: number rotationDegree?: number + scale?: FVector2 + positionOffset?: FVector2 + rotationOffset?: number + rotationDegreeOffset?: number + scaleOffset?: FVector2 shape?: FShapes - rigidBodyType?: RAPIER.RigidBodyType + rigidBodyType?: FRigidBodyType sensor?: boolean lockTranslations?: boolean lockRotations?: boolean @@ -33,97 +41,107 @@ export class FRigidBody { */ collider: FCollider /** - * Position Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the component. + * The component the rigidBody is attached to. */ - __RIGIDBODY_POSITION_OFFSET__: { x: number, y: number } + __COMPONENT__?: FComponent /** - * Rotation Offset for the rigidBody. - * This is used to adjust the rigidBody position relative to the component. + * The transform of the rigidBody. */ - __RIGIDBODY_ROTATION_OFFSET__: number + transform: FTransform /** - * The component the rigidBody is attached to. + * The transform offset of the rigidBody. */ - component: FComponent + offset: FTransform /** * Creates a rigidBody for the given component. - * @param component The component which the rigidBody will be attached to. + * @param scene The scene the rigidBody belongs to. * @param options The options for the rigidBody. - * @param options.position The position of the rigidBody. If not defined, it will use the default position of the FComponent. - * @param options.scale The scale of the rigidBody. If not defined, it will use the default scale of the FComponent. - * @param options.rotation The rotation of the rigidBody. If not defined, it will use the default rotation of the FComponent. - * @param options.shape The shape of the rigidBody. If not defined, it will default to FShapes.CUBOID. - * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to RAPIER.RigidBodyType.Dynamic. + * @param options.position The position of the rigidBody. Default is { x: 0, y: 0 }. + * @param options.rotation The rotation of the rigidBody in radians. Default is 0. + * @param options.scale The scale of the rigidBody. Default is { x: 1, y: 1 }. + * @param options.positionOffset The position offset of the rigidBody. Only used if the rigidBody is attached to a component. Default is { x: 0, y: 0 }. + * @param options.rotationOffset The rotation offset of the rigidBody in radians. Only used if the rigidBody is attached to a component. Default is 0. + * @param options.scaleOffset The scale offset of the rigidBody. Only used if the rigidBody is attached to a component. Default is { x: 0, y: 0 }. + * @param options.shape The shape of the collider that will be generated from the rigidBody. If not defined, it will default to 'CUBOID'. + * @param options.rigidBodyType The type of the rigidBody. If not defined, it will default to FRigidBodyType.Dynamic. * @param options.lockTranslations If true, the rigidBody will not be able to move. * @param options.lockRotations If true, the rigidBody will not be able to rotate. * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. * @param options.enabledTranslations.enableX If true, the rigidBody will be able to move on the x-axis. * @param options.enabledTranslations.enableY If true, the rigidBody will be able to move on the y-axis. - * @param options.enabledTranslations.enableZ If true, the rigidBody will be able to move on the z-axis. - * @param options.enabledRotations If defined, it will enable or disable rotations on the x and y axis. - * @param options.enabledRotations.enableX If true, the rigidBody will be able to rotate on the x-axis. - * @param options.enabledRotations.enableY If true, the rigidBody will be able to rotate on the y-axis. - * @param options.enabledRotations.enableZ If true, the rigidBody will be able to rotate on the z-axis. * @example * ```ts - * const rigidBody = new FRigidBody(component, { + * const rigidBody = new FRigidBody(scene, { * position: { x: 0, y: 0 }, * scale: { x: 1, y: 1 }, - * rotation: 0, - * shape: FShapes.RECTANGLE + * shape: 'CUBOID' * }) * ``` */ - constructor(component: FComponent, options?: FRigidBodyOptions) { + constructor(scene: FScene, options?: FRigidBodyOptions) { // Apply default options const DEFAULT_OPTIONS = { - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, + position: { x: 0, y: 0 }, + scale: { x: 1, y: 1 }, rotation: 0, - rotationDegree: undefined, shape: FShapes.RECTANGLE, + rigidBodyType: FRigidBodyType.DYNAMIC, sensor: false, - rigidBodyType: RAPIER.RigidBodyType.Dynamic, lockTranslations: false, lockRotations: false, enabledTranslations: undefined, enabledRotations: undefined, } options = { ...DEFAULT_OPTIONS, ...options } + // Validate options - if (!options.position || !options.scale || options.rotation === undefined || !options.shape) + if (!options.position || !options.rotation || !options.scale || !options.shape) throw new Error('FibboError: initRigidBody requires transforms options') // Check if the world exists - if (!component.scene.world) + if (!scene.world) throw new Error('FibboError: FScene must have a world to create a rigidBody') - // Store the options - this.__RIGIDBODY_POSITION_OFFSET__ = { x: options.position.x, y: options.position.y } - this.__RIGIDBODY_ROTATION_OFFSET__ = options.rotation - this.component = component - - // If rotation degree is given, convert it to radians - if (options.rotationDegree !== undefined) { - // Convert the degree to radians - options.rotation = (options.rotationDegree * Math.PI) / 180 - } + // Configure transform + this.transform = new FTransform({ + position: options.position, + rotation: options.rotation, + rotationDegree: options.rotationDegree, + scale: options.scale, + }) + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) + this.offset = new FTransform({ + position: options.positionOffset || { x: 0, y: 0 }, + rotation: options.rotationOffset, + rotationDegree: options.rotationDegreeOffset, + scale: options.scaleOffset || { x: 0, y: 0 }, + }) // Create a rigidBody description according to the type - const rigidBodyDesc = new RAPIER.RigidBodyDesc(options.rigidBodyType as RAPIER.RigidBodyType) + const rigidBodyDesc = new RAPIER.RigidBodyDesc( + options.rigidBodyType === FRigidBodyType.DYNAMIC + ? RAPIER.RigidBodyType.Dynamic + : options.rigidBodyType === FRigidBodyType.KINEMATIC_POSITION_BASED + ? RAPIER.RigidBodyType.KinematicPositionBased + : options.rigidBodyType === FRigidBodyType.KINEMATIC_VELOCITY_BASED + ? RAPIER.RigidBodyType.KinematicVelocityBased + : RAPIER.RigidBodyType.Fixed, + ) + // Interprete the given position as relative to the component's position rigidBodyDesc.setTranslation( - component.transform.position.x + options.position.x, - component.transform.position.y + options.position.y, + this.transform.position.x, + this.transform.position.y, ) // Interprete the given rotation as relative to the component's rotation - rigidBodyDesc.setRotation(component.transform.rotation + options.rotation) + rigidBodyDesc.setRotation(this.transform.rotation) // Create the rigidBody - this.__RIGIDBODY__ = component.scene.world.createRigidBody(rigidBodyDesc) + this.__RIGIDBODY__ = scene.world.createRigidBody(rigidBodyDesc) // Lock the translation if needed if (options.lockTranslations) @@ -140,181 +158,162 @@ export class FRigidBody { ) } - // Create the collider attached to the rigidBody - this.collider = new FCollider(component, { + // Create the collider + this.collider = new FCollider(scene, { ...options, rigidBody: this, }) + + // Add the rigidBody to the scene + scene.addRigidBody(this) } - /** - * Set the position of the rigidBody. - * @param position The new position of the rigidBody. - * @param position.x The new x position of the rigidBody. - * @param position.y The new y position of the rigidBody. - */ - setPosition(position: { x: number, y: number }) { - this.__RIGIDBODY__.setTranslation(position, true) - this.collider.setPosition(position) + frame(_delta: number): void { + // As the rigidBody should have moved, update the transform to sync with the rigidBody + this.transform.position = { x: this.__RIGIDBODY__.translation().x, y: this.__RIGIDBODY__.translation().y } + this.transform.rotation = this.__RIGIDBODY__.rotation() } /** - * Set the rotation of the rigidBody. - * @param rotation The new rotation of the rigidBody. + * Set the linear velocity of the rigidBody. + * @param velocity The new linear velocity of the rigidBody. */ - setRotation(rotation: number) { - this.__RIGIDBODY__.setRotation(rotation, true) - this.collider.setRotation(rotation) + setLinvel(velocity: FVector2): void { + this.__RIGIDBODY__.setLinvel(new RAPIER.Vector2(velocity.x, velocity.y), true) } /** - * Set the rotation of the rigidBody in degrees. - * @param rotation The new rotation of the rigidBody in degrees. + * Set the angular velocity of the rigidBody. + * @param velocity The new angular velocity of the rigidBody. */ - setRotationDegree(rotation: number) { - const newRotation = (rotation * Math.PI) / 180 - this.__RIGIDBODY__.setRotation(newRotation, true) - this.collider.setRotation(newRotation) + setAngvel(velocity: number): void { + this.__RIGIDBODY__.setAngvel(velocity, true) } /** - * Set the scale of the rigidBody. - * @param scale The new scale of the rigidBody. - * @param scale.x The new x scale of the rigidBody. - * @param scale.y The new y scale of the rigidBody. + * Update the position of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the position update. + * This means the new position will be the position of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - setScale(scale: { x: number, y: number }) { - this.collider.setScale(scale) + __UPDATE_POSITION__(initiator: boolean = false): void { + // If the rigidBody is the initiator + if (initiator) { + if (this.component) { + // Update the rigidBody position + this.__SET_POSITION__(this.transform.position) + // Propagate the position update + this.component.__UPDATE_POSITION__() + this.component.sensor?.__UPDATE_POSITION__() + } + } + // Else, it was propagated to the rigidBody, so move the rigidBody to the new position with the offset + else if (this.component) { + const newPosition = { + x: this.component.transform.position.x + this.offset.position.x, + y: this.component.transform.position.y + this.offset.position.y, + } + // Update the rigidBody position + this.__SET_POSITION__(newPosition) + } } /** - * Update the position of the rigidBody according to the component's position. - * This takes into account the position offset. + * Update the rotation of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the rotation update. + * This means the new rotation will be the rotation of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - updatePosition() { - const newPosition = this.component.transform.position - newPosition.x += this.__RIGIDBODY_POSITION_OFFSET__.x - newPosition.y += this.__RIGIDBODY_POSITION_OFFSET__.y - this.setPosition(newPosition) - this.collider.setPosition(newPosition) + __UPDATE_ROTATION__(initiator: boolean = false): void { + // If the rigidBody is the initiator + if (initiator) { + if (this.component) { + // Update the rigidBody rotation + this.__SET_ROTATION__(this.transform.rotation) + // Propagate the rotation update + this.component.__UPDATE_ROTATION__() + this.component.sensor?.__UPDATE_ROTATION__() + } + } + // Else, it was propagated to the rigidBody, so rotate the rigidBody to the new rotation with the offset + else if (this.component) { + const newRotation = this.component.transform.rotation + this.offset.rotation + // Update the rigidBody rotation + this.__SET_ROTATION__(newRotation) + } } /** - * Update the rotation of the rigidBody according to the component's rotation. - * This takes into account the rotation offset. + * Update the scale of the rigidBody according to the transform. + * This method should be called after updating the transform properties. + * @param initiator By default (false), the rigidBody won't be considered as the initiator of the scale update. + * This means the new scale will be the scale of the attached component, plus the offset. + * Setting this to true will propagate the event to other objects (component, sensor,...). */ - updateRotation() { - const newRotation = this.component.transform.rotation + this.__RIGIDBODY_ROTATION_OFFSET__ - this.setRotation(newRotation) - this.collider.setRotation(newRotation) + __UPDATE_SCALE__(initiator: boolean = false): void { + // If the rigidBody is the initiator + if (initiator) { + // Update the rigidBody scale + this.__SET_SCALE__(this.transform.scale) + if (this.component) { + // Propagate the scale update + this.component.__UPDATE_SCALE__() + this.component.sensor?.__UPDATE_SCALE__() + } + } + // Else, it was propagated to the rigidBody, so scale the rigidBody to the new scale with the offset + else if (this.component) { + const newScale = { + x: this.component.transform.scale.x + this.offset.scale.x, + y: this.component.transform.scale.y + this.offset.scale.y, + } + // Update the rigidBody scale + this.__SET_SCALE__(newScale) + } } /** - * Update the scale of the rigidBody's collider according to the component's scale. - * This takes into account the scale offset. - * As a rigidBody does not have a scale, this will only update the attached collider's scale. + * Set the position of the rigidBody. + * @param position The new position of the rigidBody. */ - updateScale() { - this.collider.updateScale() + __SET_POSITION__(position: FVector2): void { + this.__RIGIDBODY__.setTranslation(position, true) + this.transform.__POSITION__ = position + this.collider.__SET_POSITION__(position) } /** - * Set the velocity of the rigidBody. - * @param velocity The new velocity of the rigidBody. - * @param velocity.x The new x velocity of the rigidBody. - * @param velocity.y The new y velocity of the rigidBody. + * Set the rotation of the rigidBody. + * @param rotation The new rotation of the rigidBody. */ - setVelocity(velocity: { x: number, y: number }) { - this.__RIGIDBODY__.setLinvel(new RAPIER.Vector2(velocity.x, velocity.y), true) - } - - // Setters & getters for transform properties - - get position() { - return this.__RIGIDBODY__.translation() - } - - set position(position: { x: number, y: number }) { - this.setPosition(position) - } - - get x() { - return this.position.x - } - - set x(x: number) { - this.setPosition({ x, y: this.position.y }) - } - - get y() { - return this.position.y - } - - set y(y: number) { - this.setPosition({ x: this.position.x, y }) - } - - get rotation() { - return this.__RIGIDBODY__.rotation() - } - - set rotation(rotation: number) { - this.setRotation(rotation) - } - - get rotationDegree() { - return (this.rotation * 180) / Math.PI - } - - set rotationDegree(rotation: number) { - this.setRotationDegree(rotation) - } - - get scale() { - return this.collider.scale - } - - set scale(scale: { x: number, y: number }) { - this.setScale(scale) - } - - get scaleX() { - return this.collider.scaleX - } - - set scaleX(x: number) { - this.setScale({ x, y: this.scaleY }) - } - - get scaleY() { - return this.collider.scaleY - } - - set scaleY(y: number) { - this.setScale({ x: this.scaleX, y }) - } - - get velocity() { - return this.__RIGIDBODY__.linvel() - } - - set velocity(velocity: { x: number, y: number }) { - this.setVelocity(velocity) + __SET_ROTATION__(rotation: number): void { + this.__RIGIDBODY__.setRotation(rotation, true) + this.transform.__ROTATION__ = rotation + this.collider.__SET_ROTATION__(rotation) } - get velocityX() { - return this.velocity.x + /** + * Set the scale of the rigidBody. + * @param scale The new scale of the rigidBody. + */ + __SET_SCALE__(scale: FVector2): void { + this.transform.__SCALE__ = scale + this.collider.__SET_SCALE__(scale) } - set velocityX(x: number) { - this.setVelocity({ x, y: this.velocity.y }) - } + // Setters & Getters - get velocityY() { - return this.velocity.y + get component(): FComponent | undefined { + return this.__COMPONENT__ } - set velocityY(y: number) { - this.setVelocity({ x: this.velocity.x, y }) + set component(component: FComponent | undefined) { + this.__COMPONENT__ = component + // Update the position, rotation and scale of the rigidBody + this.__UPDATE_POSITION__() + this.__UPDATE_ROTATION__() + this.__UPDATE_SCALE__() } } diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index 83180fb4..a7d9fffe 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -8,6 +8,8 @@ import type { FCamera } from '../cameras/FCamera' import { FFreeCamera } from '../cameras/FFreeCamera' import type { FLight } from '../lights/FLight' import type { FComponent } from './FComponent' +import type { FCollider } from './FCollider' +import type { FRigidBody } from './FRigidBody' export interface FSceneOptions extends FSceneOptionsCore { gravity?: { x: number, y: number } @@ -41,6 +43,10 @@ export class FScene extends FSceneCore { declare components: FComponent[] // Lights can be declared as it will be initialized by the parent class declare lights: FLight[] + // The colliders of the scene + colliders: FCollider[] + // The rigidBodies of the scene + rigidBodies: FRigidBody[] // Camera declare __CAMERA__: FCamera @@ -66,6 +72,10 @@ export class FScene extends FSceneCore { window.addEventListener('resize', () => { this.app.renderer.resize(window.innerWidth, window.innerHeight) }) + + // Initialize collider and rigidBody arrays + this.colliders = [] + this.rigidBodies = [] } /** @@ -152,6 +162,10 @@ export class FScene extends FSceneCore { this.world.timestep = delta this.world.step(this.eventQueue) + // Call frame for each collider and rigidBody + this.colliders.forEach(collider => collider.frame(delta)) + this.rigidBodies.forEach(rigidBody => rigidBody.frame(delta)) + // Drain collision events this.eventQueue.drainCollisionEvents((handle1: RAPIER.ColliderHandle, handle2: RAPIER.ColliderHandle, started: boolean) => { this.handleCollision(handle1, handle2, started) @@ -190,6 +204,14 @@ export class FScene extends FSceneCore { } } + addHandle(handle: number, component: FComponent) { + this.__RAPIER_TO_COMPONENT__.set(handle, component) + } + + removeHandle(handle: number) { + this.__RAPIER_TO_COMPONENT__.delete(handle) + } + addComponent(component: FComponent) { super.addComponent(component) @@ -199,10 +221,10 @@ export class FScene extends FSceneCore { // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.set(component.sensor.collider.__COLLIDER__.handle, component) + this.addHandle(component.sensor.collider.__COLLIDER__.handle, component) // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map else if (component.collider) - this.__RAPIER_TO_COMPONENT__.set(component.collider.__COLLIDER__.handle, component) + this.addHandle(component.collider.__COLLIDER__.handle, component) }) } @@ -214,19 +236,52 @@ export class FScene extends FSceneCore { // Remove colliders and rigidBodies from rapier world if (component.rigidBody) - this.world.removeRigidBody(component.rigidBody.__RIGIDBODY__) + this.removeRigidBody(component.rigidBody) if (component.collider) - this.world.removeCollider(component.collider.__COLLIDER__, false) + this.removeCollider(component.collider) if (component.sensor) - this.world.removeCollider(component.sensor.collider.__COLLIDER__, false) + this.removeRigidBody(component.sensor) // Remove handle from rapier map if (component.sensor) - this.__RAPIER_TO_COMPONENT__.delete(component.sensor.collider.__COLLIDER__.handle) + this.removeHandle(component.sensor.collider.__COLLIDER__.handle) if (component.collider) - this.__RAPIER_TO_COMPONENT__.delete(component.collider.__COLLIDER__.handle) + this.removeHandle(component.collider.__COLLIDER__.handle) + } + + addLight(light: FLight): void { + super.addLight(light) + } + + removeLight(light: FLight): void { + super.removeLight(light) + } + + addCollider(collider: FCollider): void { + this.colliders.push(collider) } + removeCollider(collider: FCollider): void { + const index = this.colliders.indexOf(collider) + if (index !== -1) + this.colliders.splice(index, 1) + this.world.removeCollider(collider.__COLLIDER__, false) + } + + addRigidBody(rigidBody: FRigidBody): void { + this.rigidBodies.push(rigidBody) + } + + removeRigidBody(rigidBody: FRigidBody): void { + this.removeCollider(rigidBody.collider) + const index = this.rigidBodies.indexOf(rigidBody) + if (index !== -1) + this.rigidBodies.splice(index, 1) + this.world.removeRigidBody(rigidBody.__RIGIDBODY__) + } + + // Setters & Getters + /** * Getter for the camera. * This is required because the camera is a private property. @@ -243,12 +298,4 @@ export class FScene extends FSceneCore { this.__CAMERA__ = camera camera.__ON_CAMERA_ADDED_TO_SCENE_PLEASE_DO_NOT_CALL_THIS_BY_HAND__() } - - addLight(light: FLight): void { - super.addLight(light) - } - - removeLight(light: FLight): void { - super.removeLight(light) - } } diff --git a/packages/2d/src/core/FSensor.ts b/packages/2d/src/core/FSensor.ts new file mode 100644 index 00000000..be66ae67 --- /dev/null +++ b/packages/2d/src/core/FSensor.ts @@ -0,0 +1,45 @@ +import { FRigidBodyType } from '../types/FRigidBodyType' +import type { FRigidBodyOptions } from './FRigidBody' +import { FRigidBody } from './FRigidBody' +import type { FScene } from './FScene' + +/** + * A 2d sensor that can be attached to a component. + * @category Core + */ +export class FSensor extends FRigidBody { + /** + * Creates a sensor for the given component. + * @param scene The scene the sensor belongs to. + * @param options The options for the sensor. + * @param options.position The position of the sensor. Default is { x: 0, y: 0 }. + * @param options.rotation The rotation of the sensor in radians. Default is 0. + * @param options.scale The scale of the sensor. Default is { x: 1, y: 1 }. + * @param options.positionOffset The position offset of the sensor. Only used if the sensor is attached to a component. Default is { x: 0, y: 0 }. + * @param options.rotationOffset The rotation offset of the sensor in radians. Only used if the sensor is attached to a component. Default is 0. + * @param options.scaleOffset The scale offset of the sensor. Only used if the sensor is attached to a component. Default is { x: 0, y: 0 }. + * @param options.shape The shape of the collider that will be generated from the sensor. If not defined, it will default to 'CUBOID'. + * @param options.rigidBodyType The type of the sensor. If not defined, it will default to FRigidBodyType.Dynamic. + * @param options.lockTranslations If true, the sensor will not be able to move. + * @param options.lockRotations If true, the sensor will not be able to rotate. + * @param options.enabledTranslations If defined, it will enable or disable translations on the x and y axis. + * @param options.enabledTranslations.enableX If true, the sensor will be able to move on the x-axis. + * @param options.enabledTranslations.enableY If true, the sensor will be able to move on the y-axis. + * @example + * ```ts + * const sensor = new FSensor(scene, { + * position: { x: 0, y: 0, z: 0 }, + * rotation: { x: 0, y: 0, z: 0 }, + * scale: { x: 1, y: 1, z: 1 }, + * shape: FShapes.CUBOID + * }) + * ``` + */ + constructor(scene: FScene, options?: FRigidBodyOptions) { + super(scene, { + sensor: true, + rigidBodyType: FRigidBodyType.KINEMATIC_POSITION_BASED, + ...options, + }) + } +} diff --git a/packages/2d/src/core/FTransform.ts b/packages/2d/src/core/FTransform.ts index 7d589154..40c6f061 100644 --- a/packages/2d/src/core/FTransform.ts +++ b/packages/2d/src/core/FTransform.ts @@ -1,70 +1,257 @@ +import type { FVector2 } from '../types/FVector2' + export interface FTransformOptions { position?: { x: number, y: number } - scale?: { x: number, y: number } rotation?: number rotationDegree?: number + scale?: { x: number, y: number } } /** - * 2D Transforms for a component. + * 2D Transform * @category Core */ export class FTransform { + // Callback /** - * Position of the component. + * Callback for when the position is updated. */ - position: { x: number, y: number } + __CALLBACKS_ON_POSITION_UPDATED__: (() => void)[] = [] /** - * Scale of the component. + * Callback for when the rotation is updated. */ - scale: { x: number, y: number } + __CALLBACKS_ON_ROTATION_UPDATED__: (() => void)[] = [] /** - * Rotation of the component. + * Callback for when the scale is updated. */ - rotation: number + __CALLBACKS_ON_SCALE_UPDATED__: (() => void)[] = [] + + /** + * The position of the transform. + */ + __POSITION__: FVector2 + /** + * The scale of the transform. + */ + __SCALE__: FVector2 + /** + * The rotation of the transform in radians. + */ + __ROTATION__: number /** * Create a new FTransform. - * @param options The options for the collider. - * @param options.position The position of the collider. If not defined, it will default to `{ x: 0, y: 5 }`. - * @param options.scale The scale of the collider. If not defined, it will default to `{ x: 1, y: 1 }`. - * @param options.rotation The rotation of the collider. If not defined, it will default to 0. - * @param options.rotationDegree The rotation of the collider in degrees. If not defined, it will default to undefined. + * @param options The options for the transform. + * @param options.position The position of the transform. If not defined, it will default to `{ x: 0, y: 0 }`. + * @param options.rotation The rotation of the transform in radians. If not defined, it will default to 0. + * @param options.rotationDegree The rotation of the transform in degrees. If not defined, it will default to 0. + * @param options.scale The scale of the transform. If not defined, it will default to `{ x: 1, y: 1 }`. * @example * ```ts - * const collider = new FTransform({ + * const transform = new FTransform({ * position: { x: 0, y: 0 }, - * scale: { x: 1, y: 1 }, * rotation: 0, + * scale: { x: 1, y: 1 }, * }) * ``` */ constructor(options?: FTransformOptions) { - // Define default options + // Apply default options const DEFAULT_OPTIONS = { - position: { x: 0, y: 5 }, - scale: { x: 1, y: 1 }, + position: { x: 0, y: 0 }, rotation: 0, + scale: { x: 1, y: 1 }, } - // Apply default options options = { ...DEFAULT_OPTIONS, ...options } + // Validate options - if (!options.position || !options.scale || (options.rotation === undefined && options.rotationDegree === undefined)) - throw new Error('FibboError: FComponent requires position, scale and rotation options') + if (!options.position || !options.scale) + throw new Error('FibboError: options missing for FTransform') // Set the transform values - this.position = options.position - this.scale = options.scale - this.rotation = options.rotationDegree ? options.rotationDegree * (Math.PI / 180) : options.rotation ?? 0 + this.__POSITION__ = options.position + this.__ROTATION__ = options.rotationDegree !== undefined ? options.rotationDegree * (Math.PI / 180) : options.rotation || 0 + this.__SCALE__ = options.scale + } + + /** + * Add a callback for when the position is updated. + * @param callback The callback to add. + */ + onPositionUpdated(callback: () => void) { + this.__CALLBACKS_ON_POSITION_UPDATED__.push(callback) + } + + /** + * Add a callback for when the rotation is updated. + * @param callback The callback to add. + */ + onRotationUpdated(callback: () => void) { + this.__CALLBACKS_ON_ROTATION_UPDATED__.push(callback) + } + + /** + * Add a callback for when the scale is updated. + * @param callback The callback to add. + */ + onScaleUpdated(callback: () => void) { + this.__CALLBACKS_ON_SCALE_UPDATED__.push(callback) + } + + /** + * Set a new position. + * @param position The new position. + * @param position.x The new position on the x axis. + * @param position.y The new position on the y axis. + */ + setPosition(position: { x: number, y: number }) { + this.__POSITION__ = position + this.__CALLBACKS_ON_POSITION_UPDATED__.forEach(callback => callback()) + } + + /** + * Set a new rotation in radians. + * @param rotation The new rotation in radians. + */ + setRotation(rotation: number) { + this.__ROTATION__ = rotation + this.__CALLBACKS_ON_ROTATION_UPDATED__.forEach(callback => callback()) + } + + /** + * Set a new scale. + * @param scale The new scale. + * @param scale.x The new scale on the x axis. + * @param scale.y The new scale on the y axis. + */ + setScale(scale: { x: number, y: number }) { + this.__SCALE__ = scale + this.__CALLBACKS_ON_SCALE_UPDATED__.forEach(callback => callback()) } // Setters & Getters + /** + * Get the position. + */ + get position() { + return this.__POSITION__ + } + + /** + * Set the position. + * @param position The new position. + * @param position.x The new position on the x axis. + * @param position.y The new position on the y axis. + */ + set position(position: { x: number, y: number }) { + this.setPosition(position) + } + + /** + * Get the position on the x axis. + */ + get x() { + return this.__POSITION__.x + } + + /** + * Set the x position. + * @param x The new position on the x axis. + */ + set x(x: number) { + this.setPosition({ x, y: this.__POSITION__.y }) + } + + /** + * Get the position on the y axis. + */ + get y() { + return this.__POSITION__.y + } + + /** + * Set the y position. + * @param y The new position on the y axis. + */ + set y(y: number) { + this.setPosition({ x: this.__POSITION__.x, y }) + } + + /** + * Get the rotation in radians. + */ + get rotation() { + return this.__ROTATION__ + } + + /** + * Set the rotation in radians. + * @param rotation The new rotation in radians. + */ + set rotation(rotation: number) { + this.setRotation(rotation) + } + + /** + * Get the rotation in degrees. + */ get rotationDegree() { - return this.rotation * (180 / Math.PI) + return this.__ROTATION__ * (180 / Math.PI) + } + + /** + * Set the rotation in degrees. + * @param rotationDegree The new rotation in degrees. + */ + set rotationDegree(rotationDegree: number) { + this.setRotation(rotationDegree * (Math.PI / 180)) + } + + /** + * Get the scale. + */ + get scale() { + return this.__SCALE__ } - set rotationDegree(rotation: number) { - this.rotation = rotation * (Math.PI / 180) + /** + * Set the scale. + * @param scale The new scale. + * @param scale.x The new scale on the x axis. + * @param scale.y The new scale on the y axis. + */ + set scale(scale: { x: number, y: number }) { + this.setScale(scale) + } + + /** + * Get the scale on the x axis. + */ + get scaleX() { + return this.__SCALE__.x + } + + /** + * Set the x scale. + * @param x The new scale on the x axis. + */ + set scaleX(x: number) { + this.setScale({ x, y: this.__SCALE__.y }) + } + + /** + * Get the scale on the y axis. + */ + get scaleY() { + return this.__SCALE__.y + } + + /** + * Set the y scale. + * @param y The new scale on the y axis. + */ + set scaleY(y: number) { + this.setScale({ x: this.__SCALE__.x, y }) } } diff --git a/packages/2d/src/index.ts b/packages/2d/src/index.ts index 778271c8..2fed00c1 100644 --- a/packages/2d/src/index.ts +++ b/packages/2d/src/index.ts @@ -35,4 +35,6 @@ export * from './polygons/FRectangle' export * from './sprite/FSprite' // Types +export * from './types/FRigidBodyType' export * from './types/FShapes' +export * from './types/FVector2' diff --git a/packages/2d/src/lights/FLight.ts b/packages/2d/src/lights/FLight.ts index 07654174..3ca85ec7 100644 --- a/packages/2d/src/lights/FLight.ts +++ b/packages/2d/src/lights/FLight.ts @@ -25,7 +25,7 @@ export abstract class FLight extends FLightCore { /** * The original light object from PIXI.js. */ - declare light: any + declare __LIGHT__: any /** * Scene the light is in. @@ -61,98 +61,59 @@ export abstract class FLight extends FLightCore { // Store scene this.scene = scene - // Store options + // Configure transform this.transform = new FTransform({ position: options.position, rotation: options.rotation, rotationDegree: options.rotationDegree, }) - this.__LOOK_AT__ = options.lookAt - } + this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__()) + this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__()) + this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__()) - setPosition(position: { x: number, y: number }): void { - this.transform.position = position - this.light.position.set(position.x, position.y) + this.__LOOK_AT__ = options.lookAt } - setRotation(rotation: number): void { - this.transform.rotation = rotation - this.light.rotation = rotation + /** + * Update the position of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_POSITION__(): void { + this.__LIGHT__.position.set(this.transform.position.x, this.transform.position.y) } - setRotationDegree(rotationDegree: number): void { - this.setRotation(rotationDegree * (Math.PI / 180)) + /** + * Update the rotation of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_ROTATION__(): void { + this.__LIGHT__.rotation.set(this.transform.rotation) } - setScale(scale: { x: number, y: number }): void { - this.transform.scale = scale - this.light.scale.set(scale.x, scale.y) + /** + * Update the scale of the light according to the transform. + * This method should be called after updating the transform properties. + */ + __UPDATE_SCALE__(): void { + this.__LIGHT__.scale.set(this.transform.scale.x, this.transform.scale.y) } // Setters & Getters - get position(): { x: number, y: number } { - return this.transform.position - } - - set position(position: { x: number, y: number }) { - this.setPosition(position) - } - - get rotation(): number { - return this.transform.rotation - } - - set rotation(rotation: number) { - this.setRotation(rotation) - } - - get rotationDegree(): number { - return this.transform.rotationDegree - } - - set rotationDegree(rotationDegree: number) { - this.setRotationDegree(rotationDegree) - } - - get scale(): { x: number, y: number } { - return this.transform.scale - } - - set scale(scale: { x: number, y: number }) { - this.setScale(scale) - } - - get scaleX(): number { - return this.transform.scale.x - } - - set scaleX(scaleX: number) { - this.scale = { x: scaleX, y: this.scaleY } - } - - get scaleY(): number { - return this.transform.scale.y - } - - set scaleY(scaleY: number) { - this.setScale({ x: this.scaleX, y: scaleY }) - } - set color(color: number) { - this.light.color = color + this.__LIGHT__.color = color } get color(): number { - return this.light.color + return this.__LIGHT__.color } set intensity(intensity: number) { - this.light.brightness = intensity + this.__LIGHT__.brightness = intensity } get intensity(): number { - return this.light.brightness + return this.__LIGHT__.brightness } get lookAt(): { x: number, y: number } { diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index 8b6dba30..575f8d89 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -85,7 +85,7 @@ export class FSprite extends FComponent { * @param width The width of the sprite. */ setScaleWidth(width: number) { - this.setScale({ x: width, y: width * this.texture.height / this.texture.width }) + this.__SET_SCALE__({ x: width, y: width * this.texture.height / this.texture.width }) } /** @@ -94,6 +94,6 @@ export class FSprite extends FComponent { * @param height The height of the sprite. */ setScaleHeight(height: number) { - this.setScale({ x: height * this.texture.width / this.texture.height, y: height }) + this.__SET_SCALE__({ x: height * this.texture.width / this.texture.height, y: height }) } } diff --git a/packages/2d/src/types/FRigidBodyType.ts b/packages/2d/src/types/FRigidBodyType.ts new file mode 100644 index 00000000..25b51399 --- /dev/null +++ b/packages/2d/src/types/FRigidBodyType.ts @@ -0,0 +1,7 @@ +// FRigidBodyType enum +export enum FRigidBodyType { + DYNAMIC = 'Dynamic', + KINEMATIC_POSITION_BASED = 'KinematicPositionBased', + KINEMATIC_VELOCITY_BASED = 'KinematicVelocityBased', + FIXED = 'Fixed', +} diff --git a/packages/2d/src/types/FVector2.ts b/packages/2d/src/types/FVector2.ts new file mode 100644 index 00000000..db859413 --- /dev/null +++ b/packages/2d/src/types/FVector2.ts @@ -0,0 +1,13 @@ +/** + * A 2d vector with x and y coordinates. + */ +export interface FVector2 { + /** + * The x coordinate of the vector. + */ + x: number + /** + * The y coordinate of the vector. + */ + y: number +} diff --git a/packages/3d/src/core/FCollider.ts b/packages/3d/src/core/FCollider.ts index cb228bf9..6686c81c 100644 --- a/packages/3d/src/core/FCollider.ts +++ b/packages/3d/src/core/FCollider.ts @@ -97,8 +97,8 @@ export class FCollider { // Configure transform this.transform = new FTransform({ position: options.position, - rotation: options.rotation, - rotationDegree: options.rotationDegree, + rotation: options.rotation ? options.rotation : (options.rotationDegree ? undefined : { x: 0, y: 0, z: 0 }), + rotationDegree: options.rotationDegree ? options.rotationDegree : (options.rotation ? undefined : { x: 0, y: 0, z: 0 }), scale: options.scale, }) this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) diff --git a/packages/3d/src/core/FComponent.ts b/packages/3d/src/core/FComponent.ts index 9296a33b..b0123d43 100644 --- a/packages/3d/src/core/FComponent.ts +++ b/packages/3d/src/core/FComponent.ts @@ -14,9 +14,9 @@ import { FSensor } from './FSensor' export interface FComponentOptions { position?: FVector3 - scale?: FVector3 rotation?: FVector3 rotationDegree?: FVector3 + scale?: FVector3 } /** @@ -69,10 +69,6 @@ export abstract class FComponent extends FComponentCore { * @param options.position.x The position on the x-axis. * @param options.position.y The position on the y-axis. * @param options.position.z The position on the z-axis. - * @param options.scale The scale of the component. - * @param options.scale.x The scale on the x-axis. - * @param options.scale.y The scale on the y-axis. - * @param options.scale.z The scale on the z-axis. * @param options.rotation The rotation of the component. * @param options.rotation.x The rotation in radians on the x-axis. * @param options.rotation.y The rotation in radians on the y-axis. @@ -81,6 +77,10 @@ export abstract class FComponent extends FComponentCore { * @param options.rotationDegree.x The rotation in degrees on the x-axis. * @param options.rotationDegree.y The rotation in degrees on the y-axis. * @param options.rotationDegree.z The rotation in degrees on the z-axis. + * @param options.scale The scale of the component. + * @param options.scale.x The scale on the x-axis. + * @param options.scale.y The scale on the y-axis. + * @param options.scale.z The scale on the z-axis. */ constructor(scene: FScene, options?: FComponentOptions) { super(scene) @@ -95,8 +95,8 @@ export abstract class FComponent extends FComponentCore { // Apply default options options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || (!options.rotation && !options.rotationDegree)) - throw new Error('FibboError: FComponent requires position, scale and rotation options') + if (!options.position || (!options.rotation && !options.rotationDegree) || !options.scale) + throw new Error('FibboError: FComponent requires transform properties.') // Configure transform this.transform = new FTransform({ diff --git a/packages/3d/src/core/FRigidBody.ts b/packages/3d/src/core/FRigidBody.ts index 80b21a4c..65baa8d5 100644 --- a/packages/3d/src/core/FRigidBody.ts +++ b/packages/3d/src/core/FRigidBody.ts @@ -112,7 +112,7 @@ export class FRigidBody { } options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || !options.rotation || !options.shape) + if (!options.position || (!options.rotation && !options.rotationDegree) || !options.scale || !options.shape) throw new Error('FibboError: initRigidBody requires transforms options') // Check if the world exists @@ -122,8 +122,8 @@ export class FRigidBody { // Configure transform this.transform = new FTransform({ position: options.position, - rotation: options.rotation, - rotationDegree: options.rotationDegree, + rotation: options.rotation ? options.rotation : (options.rotationDegree ? undefined : { x: 0, y: 0, z: 0 }), + rotationDegree: options.rotationDegree ? options.rotationDegree : (options.rotation ? undefined : { x: 0, y: 0, z: 0 }), scale: options.scale, }) this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index fc1e9413..90f648da 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -59,9 +59,9 @@ export class FScene extends FSceneCore { // Lights can be declared as it will be initialized by the parent class declare lights: FLight[] // The colliders of the scene - declare colliders: FCollider[] + colliders: FCollider[] // The rigidBodies of the scene - declare rigidBodies: FRigidBody[] + rigidBodies: FRigidBody[] // Three.js THREE: typeof THREE = THREE declare scene: THREE.Scene @@ -121,9 +121,6 @@ export class FScene extends FSceneCore { // Each frame this.onFrame((delta) => { - // Call frame for each collider and rigidBody - this.colliders.forEach(collider => collider.frame(delta)) - this.rigidBodies.forEach(rigidBody => rigidBody.frame(delta)) // Call frame for each component this.components.forEach(component => component.frame(delta)) @@ -156,6 +153,10 @@ export class FScene extends FSceneCore { this.world.timestep = delta this.world.step(this.eventQueue) + // Call frame for each collider and rigidBody + this.colliders.forEach(collider => collider.frame(delta)) + this.rigidBodies.forEach(rigidBody => rigidBody.frame(delta)) + // Drain collision events this.eventQueue.drainCollisionEvents((handle1: RAPIER.ColliderHandle, handle2: RAPIER.ColliderHandle, started: boolean) => { this.handleCollision(handle1, handle2, started) diff --git a/packages/3d/src/core/FTransform.ts b/packages/3d/src/core/FTransform.ts index d373821c..3f8b614f 100644 --- a/packages/3d/src/core/FTransform.ts +++ b/packages/3d/src/core/FTransform.ts @@ -3,13 +3,13 @@ import type { FVector3 } from '../types/FVector3' export interface FTransformOptions { position?: FVector3 - scale?: FVector3 rotation?: FVector3 rotationDegree?: FVector3 + scale?: FVector3 } /** - * 3D Transform for a component. + * 3D Transform * @category Core */ export class FTransform { @@ -28,26 +28,25 @@ export class FTransform { __CALLBACKS_ON_SCALE_UPDATED__: (() => void)[] = [] /** - * The position of the component. + * The position of the transform. */ __POSITION__: FVector3 /** - * The scale of the component. + * The scale of the transform. */ __SCALE__: FVector3 /** - * The rotation of the component. + * The rotation of the transform. */ __ROTATION__: FVector3 /** * Create a new FTransform. * @param options The options for the transform. - * @param options.component The component that the transform is attached to. If provided, the transform will automatically update the component's position, rotation and scale when changed. * @param options.position The position of the transform. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. - * @param options.scale The scale of the transform. If not defined, it will default to `{ x: 1, y: 1, z: 1 }`. * @param options.rotation The rotation of the transform. If not defined, it will default to `{ x: 0, y: 0, z: 0 }`. * @param options.rotationDegree The rotation of the transform in degrees. If not defined, it will default to undefined. + * @param options.scale The scale of the transform. If not defined, it will default to `{ x: 1, y: 1, z: 1 }`. * @example * ```ts * const transform = new FTransform({ @@ -60,7 +59,6 @@ export class FTransform { constructor(options?: FTransformOptions) { // Apply default options const DEFAULT_OPTIONS = { - component: undefined, position: { x: 0, y: 0, z: 0 }, rotation: { x: 0, y: 0, z: 0 }, rotationDegree: undefined, @@ -68,15 +66,15 @@ export class FTransform { } options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || (!options.rotation && !options.rotationDegree)) - throw new Error('FibboError: FTransform requires position, scale, rotation and shape options') + if (!options.position || (!options.rotation && !options.rotationDegree) || !options.scale) + throw new Error('FibboError: options missing for FTransform') // Set the transform values this.__POSITION__ = options.position - this.__SCALE__ = options.scale this.__ROTATION__ = options.rotationDegree ? { x: THREE.MathUtils.degToRad(options.rotationDegree.x), y: THREE.MathUtils.degToRad(options.rotationDegree.y), z: THREE.MathUtils.degToRad(options.rotationDegree.z) } : options.rotation || { x: 0, y: 0, z: 0 } + this.__SCALE__ = options.scale } /** diff --git a/packages/3d/src/lights/FLight.ts b/packages/3d/src/lights/FLight.ts index ab794336..0a95992b 100644 --- a/packages/3d/src/lights/FLight.ts +++ b/packages/3d/src/lights/FLight.ts @@ -71,6 +71,7 @@ export abstract class FLight extends FLightCore { this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__()) this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__()) this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__()) + this.__LOOK_AT__ = options.lookAt } From 0a5a8c45154547cd91f1440b3ebc64fca587b732 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 17:47:00 +0200 Subject: [PATCH 33/36] test(2d): fix physic + tests --- packages/2d/src/core/FCollider.ts | 10 +- packages/2d/src/core/FRigidBody.ts | 6 +- packages/2d/src/core/FScene.ts | 1 - packages/2d/src/polygons/FCircle.ts | 31 +-- packages/2d/test/browser/collider.test.ts | 290 +++++++++++++------- packages/2d/test/browser/rigidbody.test.ts | 301 ++++++++++----------- 6 files changed, 358 insertions(+), 281 deletions(-) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index ce4642a2..19a86609 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -9,6 +9,7 @@ import type { FScene } from './FScene' export interface FColliderOptions { position?: FVector2 rotation?: number + rotationDegree?: number scale?: FVector2 positionOffset?: FVector2 rotationOffset?: number @@ -70,14 +71,14 @@ export class FCollider { // Apply default options const DEFAULT_OPTIONS = { position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, rotation: 0, - shape: FShapes.CIRCLE, + scale: { x: 1, y: 1 }, + shape: FShapes.RECTANGLE, sensor: false, } options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale || !options.shape || options.sensor === undefined) + if (!options.position || (options.rotation === undefined && options.rotationDegree === undefined) || !options.scale || !options.shape || options.sensor === undefined) throw new Error('FibboError: options missing in FCollider constructor') // Check if the world exists @@ -91,6 +92,7 @@ export class FCollider { this.transform = new FTransform({ position: options.position, rotation: options.rotation, + rotationDegree: options.rotationDegree, scale: options.scale, }) this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) @@ -236,7 +238,7 @@ export class FCollider { * @param rotation The new rotation of the collider in degrees. */ __SET_ROTATION__(rotation: number): void { - this.__COLLIDER__.setRotation(rotation * (Math.PI / 180)) + this.__COLLIDER__.setRotation(rotation) this.transform.__ROTATION__ = rotation } diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index 5d6276b6..bbe518c8 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -83,8 +83,8 @@ export class FRigidBody { // Apply default options const DEFAULT_OPTIONS = { position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, rotation: 0, + scale: { x: 1, y: 1 }, shape: FShapes.RECTANGLE, rigidBodyType: FRigidBodyType.DYNAMIC, sensor: false, @@ -96,8 +96,8 @@ export class FRigidBody { options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.rotation || !options.scale || !options.shape) - throw new Error('FibboError: initRigidBody requires transforms options') + if (!options.position || (options.rotation === undefined && options.rotationDegree === undefined) || !options.scale || !options.shape) + throw new Error('FibboError: options missing in FRigidBody constructor') // Check if the world exists if (!scene.world) diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index a7d9fffe..a6d7bf03 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -3,7 +3,6 @@ import type { FSceneOptions as FSceneOptionsCore } from '@fibbojs/core' import * as PIXI from 'pixi.js' import { Viewport } from 'pixi-viewport' import type RAPIER from '@dimforge/rapier2d' -import { FSprite } from '../sprite/FSprite' import type { FCamera } from '../cameras/FCamera' import { FFreeCamera } from '../cameras/FFreeCamera' import type { FLight } from '../lights/FLight' diff --git a/packages/2d/src/polygons/FCircle.ts b/packages/2d/src/polygons/FCircle.ts index b01c44e9..33f0bf24 100644 --- a/packages/2d/src/polygons/FCircle.ts +++ b/packages/2d/src/polygons/FCircle.ts @@ -2,6 +2,8 @@ import * as PIXI from 'pixi.js' import type { FComponentOptions } from '../core/FComponent' import type { FScene } from '../core/FScene' import { FShapes } from '../types/FShapes' +import type { FRigidBodyOptions } from '../core/FRigidBody' +import type { FColliderOptions } from '../core/FCollider' import { FPolygon } from './FPolygon' /** @@ -28,31 +30,22 @@ export class FCircle extends FPolygon { this.emitOnLoaded() } - initRigidBody(options?: { - position?: PIXI.PointData - scale?: PIXI.PointData - rotation?: number - shape?: FShapes - lockTranslations?: boolean - lockRotations?: boolean - enabledTranslations?: { - enableX: boolean - enableY: boolean - } - }): void { + initCollider(options?: FColliderOptions): void { + super.initCollider({ + ...options, + shape: FShapes.CIRCLE, + }) + } + + initRigidBody(options?: FRigidBodyOptions): void { super.initRigidBody({ ...options, shape: FShapes.CIRCLE, }) } - initCollider(options?: { - position?: PIXI.PointData - scale?: PIXI.PointData - rotation?: number - shape?: FShapes - }): void { - super.initCollider({ + initSensor(options?: FRigidBodyOptions): void { + super.initSensor({ ...options, shape: FShapes.CIRCLE, }) diff --git a/packages/2d/test/browser/collider.test.ts b/packages/2d/test/browser/collider.test.ts index 301d312d..4cff3b72 100644 --- a/packages/2d/test/browser/collider.test.ts +++ b/packages/2d/test/browser/collider.test.ts @@ -2,6 +2,30 @@ import { beforeEach, describe, expect, it } from 'vitest' import RAPIER from '@dimforge/rapier2d' import { FRectangle, FScene, FShapes } from '../../src' +function validateRapierCollider(collider: RAPIER.Collider, transform: { + position: { x: number, y: number } + rotation: number + scale: { x: number, y: number } + shape: RAPIER.ShapeType +}) { + // Validate RAPIER collider + expect(collider).toBeDefined() + expect(collider.translation().x).toEqual(transform.position.x) + expect(collider.translation().y).toEqual(transform.position.y) + expect(collider.rotation()).closeTo(transform.rotation, 0.0001) + expect(collider.shape).toBeDefined() + expect(collider.shape.type).toEqual(transform.shape) + if (transform.shape === RAPIER.ShapeType.Cuboid) { + const colliderShape = collider.shape as RAPIER.Cuboid + expect(colliderShape.halfExtents.x).toEqual(transform.scale.x) + expect(colliderShape.halfExtents.y).toEqual(transform.scale.y) + } + else if (transform.shape === RAPIER.ShapeType.Ball) { + const colliderShape = collider.shape as RAPIER.Ball + expect(colliderShape.radius).toEqual(transform.scale.x) + } +} + describe('fCollider', () => { let scene: FScene @@ -16,29 +40,38 @@ describe('fCollider', () => { it('should create a collider with default options', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, - rotationDegree: 0, + rotation: 0, scale: { x: 1, y: 1 }, }) rectangle.initCollider() expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate offset - expect(rectangle.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: 0, y: 0 }) - expect(rectangle.collider.__COLLIDER_ROTATION_OFFSET__).toEqual(0) - expect(rectangle.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1 }) + expect(rectangle.collider.offset.position).toEqual({ x: 0, y: 0 }) + expect(rectangle.collider.offset.rotation).closeTo(0, 0.0001) + expect(rectangle.collider.offset.scale).toEqual({ x: 0, y: 0 }) // Validate transforms - expect(rectangle.collider.position.x).toEqual(0) - expect(rectangle.collider.position.y).toEqual(0) - expect(rectangle.collider.rotation).toEqual(0) - expect(rectangle.collider.scale.x).toEqual(1) - expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.transform.position.x).toEqual(0) + expect(rectangle.collider.transform.position.y).toEqual(0) + expect(rectangle.collider.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(1) + expect(rectangle.collider.transform.scale.y).toEqual(1) expect(rectangle.collider.shape).toEqual(FShapes.RECTANGLE) - // Validate scaleX and scaleY - rectangle.collider.scaleX = 2 - rectangle.collider.scaleY = 3 - expect(rectangle.collider.scaleX).toEqual(2) - expect(rectangle.collider.scaleY).toEqual(3) - expect(rectangle.collider.scaleX).toEqual(rectangle.collider.scale.x) - expect(rectangle.collider.scaleY).toEqual(rectangle.collider.scale.y) + // Validate scaleX, scaleY + rectangle.collider.transform.scaleX = 2 + rectangle.collider.transform.scaleY = 3 + expect(rectangle.collider.transform.scaleX).toEqual(2) + expect(rectangle.collider.transform.scaleY).toEqual(3) + expect(rectangle.collider.transform.scaleX).toEqual(rectangle.collider.transform.scale.x) + expect(rectangle.collider.transform.scaleY).toEqual(rectangle.collider.transform.scale.y) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 1, y: 1.5 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should create a collider with custom transforms', () => { @@ -48,21 +81,30 @@ describe('fCollider', () => { scale: { x: 1, y: 2 }, }) rectangle.initCollider({ - position: { x: -2, y: 3 }, - rotation: 0.3, - scale: { x: 2, y: 2 }, + positionOffset: { x: -2, y: 3 }, + rotationOffset: 0.2, + scaleOffset: { x: 2, y: 2 }, }) expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate offset - expect(rectangle.collider.__COLLIDER_POSITION_OFFSET__).toEqual({ x: -2, y: 3 }) - expect(rectangle.collider.__COLLIDER_ROTATION_OFFSET__).toEqual(0.3) - expect(rectangle.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2 }) + expect(rectangle.collider.offset.position).toEqual({ x: -2, y: 3 }) + expect(rectangle.collider.offset.rotation).closeTo(0.2, 0.0001) + expect(rectangle.collider.offset.scale).toEqual({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.collider.position.x).toEqual(-1) - expect(rectangle.collider.position.y).toEqual(4) - expect(rectangle.collider.rotation).closeTo(0.4, 0.0001) - expect(rectangle.collider.scale.x).toEqual(2) - expect(rectangle.collider.scale.y).toEqual(4) + expect(rectangle.collider.transform.position.x).toEqual(-1) + expect(rectangle.collider.transform.position.y).toEqual(4) + expect(rectangle.collider.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(3) + expect(rectangle.collider.transform.scale.y).toEqual(4) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: -1, y: 4 }, + rotation: 0.3, + scale: { x: 1.5, y: 2 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should create a collider with a circle shape', () => { @@ -75,52 +117,77 @@ describe('fCollider', () => { shape: FShapes.CIRCLE, }) expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate shape expect(rectangle.collider.shape).toEqual(FShapes.CIRCLE) expect(rectangle.collider.__COLLIDER__.shape).toBeDefined() expect(rectangle.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(rectangle.collider.position.x).toEqual(0) - expect(rectangle.collider.position.y).toEqual(0) - expect(rectangle.collider.rotation).toEqual(0) - expect(rectangle.collider.scale.x).toEqual(1) - expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.transform.position.x).toEqual(0) + expect(rectangle.collider.transform.position.y).toEqual(0) + expect(rectangle.collider.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(1) + expect(rectangle.collider.transform.scale.y).toEqual(1) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 0, y: 0 }, + rotation: 0, + scale: { x: 0.5, y: 0.5 }, + shape: RAPIER.ShapeType.Ball, + }) }) it('should modify collider transforms', () => { const rectangle = new FRectangle(scene, { - position: { x: 0, y: 0 }, - rotation: 0, + position: { x: 1, y: 0 }, + rotation: 0.2, scale: { x: 1, y: 1 }, }) rectangle.initCollider() expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate transforms - expect(rectangle.collider.position.x).toEqual(0) - expect(rectangle.collider.position.y).toEqual(0) - expect(rectangle.collider.rotation).toEqual(0) - expect(rectangle.collider.scale.x).toEqual(1) - expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.transform.position.x).toEqual(1) + expect(rectangle.collider.transform.position.y).toEqual(0) + expect(rectangle.collider.transform.rotation).toEqual(0.2) + expect(rectangle.collider.transform.scale.x).toEqual(1) + expect(rectangle.collider.transform.scale.y).toEqual(1) // Modify transforms with functions - rectangle.collider.setPosition({ x: 1, y: 1 }) - rectangle.collider.setRotation(0.1) - rectangle.collider.setScale({ x: 2, y: 2 }) + rectangle.collider.transform.setPosition({ x: 1, y: 1 }) + rectangle.collider.transform.setRotation(0.3) + rectangle.collider.transform.setScale({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.collider.position.x).toEqual(1) - expect(rectangle.collider.position.y).toEqual(1) - expect(rectangle.collider.rotation).closeTo(0.1, 0.0001) - expect(rectangle.collider.scale.x).toEqual(2) - expect(rectangle.collider.scale.y).toEqual(2) - // Moify transforms with setters - rectangle.collider.position = { x: 2, y: 2 } - rectangle.collider.rotation = 0.2 - rectangle.collider.scale = { x: 3, y: 4 } + expect(rectangle.collider.transform.position.x).toEqual(1) + expect(rectangle.collider.transform.position.y).toEqual(1) + expect(rectangle.collider.transform.rotation).toEqual(0.3) + expect(rectangle.collider.transform.scale.x).toEqual(2) + expect(rectangle.collider.transform.scale.y).toEqual(2) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 1, y: 1 }, + rotation: 0.3, + scale: { x: 1, y: 1 }, + shape: RAPIER.ShapeType.Cuboid, + }) + // Modify transforms with setters + rectangle.collider.transform.position = { x: 2, y: 2 } + rectangle.collider.transform.rotation = 0.4 + rectangle.collider.transform.scale = { x: 3, y: 4 } // Validate transforms - expect(rectangle.collider.position.x).toEqual(2) - expect(rectangle.collider.position.y).toEqual(2) - expect(rectangle.collider.rotation).closeTo(0.2, 0.0001) - expect(rectangle.collider.scale.x).toEqual(3) - expect(rectangle.collider.scale.y).toEqual(4) + expect(rectangle.collider.transform.position.x).toEqual(2) + expect(rectangle.collider.transform.position.y).toEqual(2) + expect(rectangle.collider.transform.rotation).toEqual(0.4) + expect(rectangle.collider.transform.scale.x).toEqual(3) + expect(rectangle.collider.transform.scale.y).toEqual(4) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 2, y: 2 }, + rotation: 0.4, + scale: { x: 1.5, y: 2 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) it('should modify collider transforms with a circle shape', () => { @@ -133,66 +200,97 @@ describe('fCollider', () => { shape: FShapes.CIRCLE, }) expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate shape expect(rectangle.collider.shape).toEqual(FShapes.CIRCLE) expect(rectangle.collider.__COLLIDER__.shape).toBeDefined() expect(rectangle.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(rectangle.collider.position.x).toEqual(0) - expect(rectangle.collider.position.y).toEqual(0) - expect(rectangle.collider.rotation).toEqual(0) - expect(rectangle.collider.scale.x).toEqual(1) - expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.transform.position.x).toEqual(0) + expect(rectangle.collider.transform.position.y).toEqual(0) + expect(rectangle.collider.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(1) + expect(rectangle.collider.transform.scale.y).toEqual(1) // Modify transforms with functions - rectangle.collider.setPosition({ x: 1, y: 1 }) - rectangle.collider.setRotation(0.1) - rectangle.collider.setScale({ x: 2, y: 2 }) + rectangle.collider.transform.setPosition({ x: 1, y: 1 }) + rectangle.collider.transform.setRotation(0.2) + rectangle.collider.transform.setScale({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.collider.position.x).toEqual(1) - expect(rectangle.collider.position.y).toEqual(1) - expect(rectangle.collider.rotation).closeTo(0.1, 0.0001) - expect(rectangle.collider.scale.x).toEqual(2) - expect(rectangle.collider.scale.y).toEqual(2) - // Moify transforms with setters - rectangle.collider.position = { x: 2, y: 2 } - rectangle.collider.rotation = 0.2 - rectangle.collider.scale = { x: 3, y: 4 } + expect(rectangle.collider.transform.position.x).toEqual(1) + expect(rectangle.collider.transform.position.y).toEqual(1) + expect(rectangle.collider.transform.rotation).closeTo(0.2, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(2) + expect(rectangle.collider.transform.scale.y).toEqual(2) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 1, y: 1 }, + rotation: 0.2, + scale: { x: 1, y: 1 }, + shape: RAPIER.ShapeType.Ball, + }) + // Modify transforms with setters + rectangle.collider.transform.position = { x: 2, y: 2 } + rectangle.collider.transform.rotation = 0.3 + rectangle.collider.transform.scale = { x: 3, y: 4 } // Validate transforms - expect(rectangle.collider.position.x).toEqual(2) - expect(rectangle.collider.position.y).toEqual(2) - expect(rectangle.collider.rotation).closeTo(0.2, 0.0001) - // Circle shape has the same scale for x and y (the highest value is used) - expect(rectangle.collider.scale.x).toEqual(4) - expect(rectangle.collider.scale.y).toEqual(4) + expect(rectangle.collider.transform.position.x).toEqual(2) + expect(rectangle.collider.transform.position.y).toEqual(2) + expect(rectangle.collider.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(4) + expect(rectangle.collider.transform.scale.y).toEqual(4) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 2, y: 2 }, + rotation: 0.3, + scale: { x: 2, y: 2 }, + shape: RAPIER.ShapeType.Ball, + }) }) it('should update collider transforms with attached component transforms', () => { const rectangle = new FRectangle(scene, { position: { x: 1, y: 1 }, rotation: 0.1, - scale: { x: 1, y: 0.5 }, + scale: { x: 1, y: 2 }, }) rectangle.initCollider({ - position: { x: -2, y: 3 }, - rotation: 0.3, - scale: { x: 2, y: 2 }, + positionOffset: { x: -2, y: 3 }, + rotationOffset: 0.2, + scaleOffset: { x: 2, y: 2 }, }) expect(rectangle.collider).toBeDefined() + if (!rectangle.collider) + return // Validate transforms - expect(rectangle.collider.position.x).toEqual(-1) - expect(rectangle.collider.position.y).toEqual(4) - expect(rectangle.collider.rotation).closeTo(0.4, 0.0001) - expect(rectangle.collider.scale.x).toEqual(2) - expect(rectangle.collider.scale.y).toEqual(1) + expect(rectangle.collider.transform.position.x).toEqual(-1) + expect(rectangle.collider.transform.position.y).toEqual(4) + expect(rectangle.collider.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(3) + expect(rectangle.collider.transform.scale.y).toEqual(4) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: -1, y: 4 }, + rotation: 0.3, + scale: { x: 1.5, y: 2 }, + shape: RAPIER.ShapeType.Cuboid, + }) // Modify component transforms - rectangle.setPosition({ x: 2, y: 2 }) - rectangle.setRotation(0.2) - rectangle.setScale({ x: 3, y: 4 }) + rectangle.transform.setPosition({ x: 2, y: 2 }) + rectangle.transform.setRotation(0.4) + rectangle.transform.setScale({ x: 3, y: 4 }) // Validate transforms - expect(rectangle.collider.position.x).toEqual(0) - expect(rectangle.collider.position.y).toEqual(5) - expect(rectangle.collider.rotation).closeTo(0.5, 0.0001) - expect(rectangle.collider.scale.x).toEqual(6) - expect(rectangle.collider.scale.y).toEqual(8) + expect(rectangle.collider.transform.position.x).toEqual(0) + expect(rectangle.collider.transform.position.y).toEqual(5) + expect(rectangle.collider.transform.rotation).closeTo(0.6, 0.0001) + expect(rectangle.collider.transform.scale.x).toEqual(5) + expect(rectangle.collider.transform.scale.y).toEqual(6) + // Validate RAPIER collider + validateRapierCollider(rectangle.collider.__COLLIDER__, { + position: { x: 0, y: 5 }, + rotation: 0.6, + scale: { x: 2.5, y: 3 }, + shape: RAPIER.ShapeType.Cuboid, + }) }) }) diff --git a/packages/2d/test/browser/rigidbody.test.ts b/packages/2d/test/browser/rigidbody.test.ts index 8c25fbac..db8efbc9 100644 --- a/packages/2d/test/browser/rigidbody.test.ts +++ b/packages/2d/test/browser/rigidbody.test.ts @@ -2,6 +2,18 @@ import { beforeEach, describe, expect, it } from 'vitest' import RAPIER from '@dimforge/rapier2d' import { FRectangle, FScene, FShapes } from '../../src' +function validateRapierRigidBody(rigidBody: RAPIER.RigidBody, transform: { + position: { x: number, y: number } + rotation: number +}) { + // Validate RAPIER collider + expect(rigidBody).toBeDefined() + expect(rigidBody.translation().x).toEqual(transform.position.x) + expect(rigidBody.translation().y).toEqual(transform.position.y) + const rotation = rigidBody.rotation() + expect(rotation).closeTo(transform.rotation, 0.0001) +} + describe('fRigidBody', () => { let scene: FScene @@ -13,59 +25,66 @@ describe('fRigidBody', () => { await scene.initPhysics() }) - it('should create a rigidBody with default options', () => { + it('should create a collider with default options', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, - rotationDegree: 0, + rotation: 0, scale: { x: 1, y: 1 }, }) rectangle.initRigidBody() expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate offset - expect(rectangle.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: 0, y: 0 }) - expect(rectangle.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual(0) - expect(rectangle.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 1, y: 1 }) + expect(rectangle.rigidBody.offset.position).toEqual({ x: 0, y: 0 }) + expect(rectangle.rigidBody.offset.rotation).toEqual(0) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toEqual(0) - expect(rectangle.rigidBody.rotation).toEqual(0) - expect(rectangle.rigidBody.scale.x).toEqual(1) - expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.transform.position.x).toEqual(0) + expect(rectangle.rigidBody.transform.position.y).toEqual(0) + expect(rectangle.rigidBody.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(1) + expect(rectangle.rigidBody.transform.scale.y).toEqual(1) expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.RECTANGLE) - // Validate scaleX and scaleY - rectangle.rigidBody.scaleX = 2 - rectangle.rigidBody.scaleY = 3 - expect(rectangle.rigidBody.scaleX).toEqual(2) - expect(rectangle.rigidBody.scaleY).toEqual(3) - expect(rectangle.rigidBody.scaleX).toEqual(rectangle.rigidBody.scale.x) - expect(rectangle.rigidBody.scaleY).toEqual(rectangle.rigidBody.scale.y) + // Validate scaleX, scaleY + rectangle.rigidBody.transform.scaleX = 2 + rectangle.rigidBody.transform.scaleY = 3 + expect(rectangle.rigidBody.transform.scaleX).toEqual(2) + expect(rectangle.rigidBody.transform.scaleY).toEqual(3) + expect(rectangle.rigidBody.transform.scaleX).toEqual(rectangle.rigidBody.transform.scale.x) + expect(rectangle.rigidBody.transform.scaleY).toEqual(rectangle.rigidBody.transform.scale.y) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) - it('should create a rigidBody with custom transforms', () => { + it('should create a collider with custom transforms', () => { const rectangle = new FRectangle(scene, { position: { x: 1, y: 1 }, rotation: 0.1, scale: { x: 1, y: 2 }, }) rectangle.initRigidBody({ - position: { x: -2, y: 3 }, - rotation: 0.3, - scale: { x: 2, y: 2 }, + positionOffset: { x: -2, y: 3 }, + rotationOffset: 0.2, + scaleOffset: { x: 2, y: 2 }, }) expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate offset - expect(rectangle.rigidBody.__RIGIDBODY_POSITION_OFFSET__).toEqual({ x: -2, y: 3 }) - expect(rectangle.rigidBody.__RIGIDBODY_ROTATION_OFFSET__).toEqual(0.3) - expect(rectangle.rigidBody.collider.__COLLIDER_SCALE_OFFSET__).toEqual({ x: 2, y: 2 }) + expect(rectangle.rigidBody.offset.position).toEqual({ x: -2, y: 3 }) + expect(rectangle.rigidBody.offset.rotation).toEqual(0.2) + expect(rectangle.rigidBody.collider.offset.scale).toEqual({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(-1) - expect(rectangle.rigidBody.position.y).toEqual(4) - expect(rectangle.rigidBody.rotation).closeTo(0.4, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(2) - expect(rectangle.rigidBody.scale.y).toEqual(4) + expect(rectangle.rigidBody.transform.position.x).toEqual(-1) + expect(rectangle.rigidBody.transform.position.y).toEqual(4) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(3) + expect(rectangle.rigidBody.transform.scale.y).toEqual(4) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) - it('should create a rigidBody with a circle shape', () => { + it('should create a collider with a circle shape', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, rotation: 0, @@ -75,55 +94,65 @@ describe('fRigidBody', () => { shape: FShapes.CIRCLE, }) expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate shape expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.CIRCLE) expect(rectangle.rigidBody.collider.__COLLIDER__.shape).toBeDefined() expect(rectangle.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toEqual(0) - expect(rectangle.rigidBody.rotation).toEqual(0) - expect(rectangle.rigidBody.scale.x).toEqual(1) - expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.transform.position.x).toEqual(0) + expect(rectangle.rigidBody.transform.position.y).toEqual(0) + expect(rectangle.rigidBody.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(1) + expect(rectangle.rigidBody.transform.scale.y).toEqual(1) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) - it('should modify rigidBody transforms', () => { + it('should modify collider transforms', () => { const rectangle = new FRectangle(scene, { - position: { x: 0, y: 0 }, - rotation: 0, + position: { x: 1, y: 0 }, + rotation: 0.2, scale: { x: 1, y: 1 }, }) rectangle.initRigidBody() expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toEqual(0) - expect(rectangle.rigidBody.rotation).toEqual(0) - expect(rectangle.rigidBody.scale.x).toEqual(1) - expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.transform.position.x).toEqual(1) + expect(rectangle.rigidBody.transform.position.y).toEqual(0) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.2, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(1) + expect(rectangle.rigidBody.transform.scale.y).toEqual(1) // Modify transforms with functions - rectangle.rigidBody.setPosition({ x: 1, y: 1 }) - rectangle.rigidBody.setRotation(0.1) - rectangle.rigidBody.setScale({ x: 2, y: 2 }) + rectangle.rigidBody.transform.setPosition({ x: 1, y: 1 }) + rectangle.rigidBody.transform.setRotation(0.3) + rectangle.rigidBody.transform.setScale({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(1) - expect(rectangle.rigidBody.position.y).toEqual(1) - expect(rectangle.rigidBody.rotation).closeTo(0.1, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(2) - expect(rectangle.rigidBody.scale.y).toEqual(2) - // Moify transforms with setters - rectangle.rigidBody.position = { x: 2, y: 2 } - rectangle.rigidBody.rotation = 0.2 - rectangle.rigidBody.scale = { x: 3, y: 4 } + expect(rectangle.rigidBody.transform.position.x).toEqual(1) + expect(rectangle.rigidBody.transform.position.y).toEqual(1) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(2) + expect(rectangle.rigidBody.transform.scale.y).toEqual(2) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) + // Modify transforms with setters + rectangle.rigidBody.transform.position = { x: 2, y: 4 } + rectangle.rigidBody.transform.rotation = 0.4 + rectangle.rigidBody.transform.scale = { x: 3, y: 5 } // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(2) - expect(rectangle.rigidBody.position.y).toEqual(2) - expect(rectangle.rigidBody.rotation).closeTo(0.2, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(3) - expect(rectangle.rigidBody.scale.y).toEqual(4) + expect(rectangle.rigidBody.transform.position.x).toEqual(2) + expect(rectangle.rigidBody.transform.position.y).toEqual(4) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.4, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(3) + expect(rectangle.rigidBody.transform.scale.y).toEqual(5) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) - it('should modify rigidBody transforms with a circle shape', () => { + it('should modify collider transforms with a circle shape', () => { const rectangle = new FRectangle(scene, { position: { x: 0, y: 0 }, rotation: 0, @@ -133,123 +162,79 @@ describe('fRigidBody', () => { shape: FShapes.CIRCLE, }) expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate shape expect(rectangle.rigidBody.collider.shape).toEqual(FShapes.CIRCLE) expect(rectangle.rigidBody.collider.__COLLIDER__.shape).toBeDefined() expect(rectangle.rigidBody.collider.__COLLIDER__.shape.type).toEqual(RAPIER.ShapeType.Ball) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toEqual(0) - expect(rectangle.rigidBody.rotation).toEqual(0) - expect(rectangle.rigidBody.scale.x).toEqual(1) - expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.transform.position.x).toEqual(0) + expect(rectangle.rigidBody.transform.position.y).toEqual(0) + expect(rectangle.rigidBody.transform.rotation).closeTo(0, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(1) + expect(rectangle.rigidBody.transform.scale.y).toEqual(1) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) // Modify transforms with functions - rectangle.rigidBody.setPosition({ x: 1, y: 1 }) - rectangle.rigidBody.setRotation(0.1) - rectangle.rigidBody.setScale({ x: 2, y: 2 }) + rectangle.rigidBody.transform.setPosition({ x: 1, y: 1 }) + rectangle.rigidBody.transform.setRotation(0.1) + rectangle.rigidBody.transform.setScale({ x: 2, y: 2 }) // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(1) - expect(rectangle.rigidBody.position.y).toEqual(1) - expect(rectangle.rigidBody.rotation).closeTo(0.1, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(2) - expect(rectangle.rigidBody.scale.y).toEqual(2) - // Moify transforms with setters - rectangle.rigidBody.position = { x: 2, y: 2 } - rectangle.rigidBody.rotation = 0.2 - rectangle.rigidBody.scale = { x: 3, y: 4 } + expect(rectangle.rigidBody.transform.position.x).toEqual(1) + expect(rectangle.rigidBody.transform.position.y).toEqual(1) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.1, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(2) + expect(rectangle.rigidBody.transform.scale.y).toEqual(2) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) + // Modify transforms with setters + rectangle.rigidBody.transform.position = { x: 2, y: 4 } + rectangle.rigidBody.transform.rotation = 0.2 + rectangle.rigidBody.transform.scale = { x: 3, y: 5 } // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(2) - expect(rectangle.rigidBody.position.y).toEqual(2) - expect(rectangle.rigidBody.rotation).closeTo(0.2, 0.0001) - // Circle shape has the same scale for x and y (the highest value is used) - expect(rectangle.rigidBody.scale.x).toEqual(4) - expect(rectangle.rigidBody.scale.y).toEqual(4) + expect(rectangle.rigidBody.transform.position.x).toEqual(2) + expect(rectangle.rigidBody.transform.position.y).toEqual(4) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.2, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(5) + expect(rectangle.rigidBody.transform.scale.y).toEqual(5) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) - it('should update rigidBody transforms with attached component transforms', () => { + it('should update collider transforms with attached component transforms', () => { const rectangle = new FRectangle(scene, { position: { x: 1, y: 1 }, rotation: 0.1, scale: { x: 1, y: 0.5 }, }) rectangle.initRigidBody({ - position: { x: -2, y: 3 }, - rotation: 0.3, - scale: { x: 2, y: 2 }, + positionOffset: { x: -2, y: 3 }, + rotationOffset: 0.2, + scaleOffset: { x: 2, y: 4 }, }) expect(rectangle.rigidBody).toBeDefined() + if (!rectangle.rigidBody) + return // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(-1) - expect(rectangle.rigidBody.position.y).toEqual(4) - expect(rectangle.rigidBody.rotation).closeTo(0.4, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(2) - expect(rectangle.rigidBody.scale.y).toEqual(1) + expect(rectangle.rigidBody.transform.position.x).toEqual(-1) + expect(rectangle.rigidBody.transform.position.y).toEqual(4) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.3, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(3) + expect(rectangle.rigidBody.transform.scale.y).toEqual(4.5) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) // Modify component transforms - rectangle.setPosition({ x: 2, y: 2 }) - rectangle.setRotation(0.2) - rectangle.setScale({ x: 3, y: 4 }) + rectangle.transform.position = { x: 2, y: 2 } + rectangle.transform.rotation = 0.2 + rectangle.transform.scale = { x: 3, y: 4 } // Validate transforms - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toEqual(5) - expect(rectangle.rigidBody.rotation).closeTo(0.5, 0.0001) - expect(rectangle.rigidBody.scale.x).toEqual(6) - expect(rectangle.rigidBody.scale.y).toEqual(8) - }) - - it('should move the rigidBody according to its X velocity', async () => { - const rectangle = new FRectangle(scene, { - position: { x: 0, y: 0 }, - rotation: 0, - scale: { x: 1, y: 1 }, - }) - // Lock translations on Y axis - rectangle.initRigidBody({ - enabledTranslations: { - enableX: true, - enableY: false, - }, - }) - expect(rectangle.rigidBody).toBeDefined() - // Set velocity - rectangle.rigidBody.setVelocity({ x: 1, y: 0 }) - // Run 60 frames - for (let i = 0; i < 60; i++) { - scene.frame(1 / 60) - } - // Validate velocity - expect(rectangle.rigidBody.velocity.x).toEqual(1) - expect(rectangle.rigidBody.velocity.y).toEqual(0) - // Validate new position - expect(rectangle.rigidBody.position.x).closeTo(1, 0.1) - expect(rectangle.rigidBody.position.y).toEqual(0) - }) - - it('should move the rigidBody according to its Y velocity', async () => { - const rectangle = new FRectangle(scene, { - position: { x: 0, y: 0 }, - rotation: 0, - scale: { x: 1, y: 1 }, - }) - // Lock translations on X axis - rectangle.initRigidBody({ - enabledTranslations: { - enableX: false, - enableY: true, - }, - }) - expect(rectangle.rigidBody).toBeDefined() - // Set velocity - rectangle.rigidBody.velocity = { x: 0, y: 100 } - // Run 60 frames - for (let i = 0; i < 60; i++) { - scene.frame(1 / 60) - } - // Validate velocity - expect(rectangle.rigidBody.velocity.x).toEqual(0) - expect(rectangle.rigidBody.velocity.y).closeTo(90, 1) - // Validate new position - expect(rectangle.rigidBody.position.x).toEqual(0) - expect(rectangle.rigidBody.position.y).toBeGreaterThan(90) - expect(rectangle.rigidBody.position.y).toBeLessThanOrEqual(100) + expect(rectangle.rigidBody.transform.position.x).toEqual(0) + expect(rectangle.rigidBody.transform.position.y).toEqual(5) + expect(rectangle.rigidBody.transform.rotation).closeTo(0.4, 0.0001) + expect(rectangle.rigidBody.transform.scale.x).toEqual(5) + expect(rectangle.rigidBody.transform.scale.y).toEqual(8) + // Validate RAPIER rigidBody + validateRapierRigidBody(rectangle.rigidBody.__RIGIDBODY__, rectangle.rigidBody.transform) }) }) From 31a9adc82b7f9e94d4aaa254912cda4482699c0d Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 19:06:39 +0200 Subject: [PATCH 34/36] feat(2d): refactor transform system --- apps/playground-2d/src/classes/Character.ts | 1 + apps/playground-2d/src/classes/MySquare.ts | 6 +--- apps/playground-2d/src/level.ts | 11 ++----- apps/playground-2d/src/main.ts | 24 ++++----------- .../src/controllers/FCharacterControllerK.ts | 2 +- packages/2d/src/core/FCollider.ts | 28 +++++++++-------- packages/2d/src/core/FComponent.ts | 14 ++------- packages/2d/src/core/FRigidBody.ts | 24 +++++++-------- packages/2d/src/core/FScene.ts | 21 ++++++------- packages/2d/src/core/FTransform.ts | 2 +- packages/2d/src/polygons/FCircle.ts | 4 +++ packages/2d/src/polygons/FPolygon.ts | 7 ----- packages/2d/src/polygons/FRectangle.ts | 15 ++++++++++ packages/2d/src/sprite/FSprite.ts | 30 +++++++++++-------- packages/3d/src/core/FScene.ts | 12 ++++---- .../src/components/2d/FComponent2d.vue | 10 +++---- 16 files changed, 99 insertions(+), 112 deletions(-) diff --git a/apps/playground-2d/src/classes/Character.ts b/apps/playground-2d/src/classes/Character.ts index 10375f63..0fb7e79f 100644 --- a/apps/playground-2d/src/classes/Character.ts +++ b/apps/playground-2d/src/classes/Character.ts @@ -6,6 +6,7 @@ export default class Character extends FSprite { super(scene, { texture: 'character_0000.png', position: { x: 0, y: 10 }, + // rotationDegree: 45, scale: { x: 0.5, y: 0.5 }, }) diff --git a/apps/playground-2d/src/classes/MySquare.ts b/apps/playground-2d/src/classes/MySquare.ts index 5aef047a..e4718cad 100644 --- a/apps/playground-2d/src/classes/MySquare.ts +++ b/apps/playground-2d/src/classes/MySquare.ts @@ -4,11 +4,7 @@ import { FRectangle } from '@fibbojs/2d' export default class MySquare extends FRectangle { constructor(scene: FScene) { super(scene) - this.setRotationDegree(30) + this.transform.rotationDegree = 30 this.initRigidBody() } - - onFrame(delta: number) { - super.onFrame(delta) - } } diff --git a/apps/playground-2d/src/level.ts b/apps/playground-2d/src/level.ts index d1fd16ad..418bf004 100644 --- a/apps/playground-2d/src/level.ts +++ b/apps/playground-2d/src/level.ts @@ -7,7 +7,6 @@ function addBelowGround(scene: FScene, position: { x: number, y: number }) { position, }) ground.initCollider() - scene.addComponent(ground) } function addGround(scene: FScene, position: { x: number, y: number }) { @@ -16,7 +15,6 @@ function addGround(scene: FScene, position: { x: number, y: number }) { position, }) ground.initCollider() - scene.addComponent(ground) } function addBackground(scene: FScene, position: { x: number, y: number }) { @@ -25,9 +23,8 @@ function addBackground(scene: FScene, position: { x: number, y: number }) { position, }) background.onLoaded(() => { - background.container.zIndex = -1 + background.__CONTAINER__.zIndex = -1 }) - scene.addComponent(background) } function addBackgroundDark(scene: FScene, position: { x: number, y: number }) { @@ -36,9 +33,8 @@ function addBackgroundDark(scene: FScene, position: { x: number, y: number }) { position, }) background.onLoaded(() => { - background.container.zIndex = -1 + background.__CONTAINER__.zIndex = -1 }) - scene.addComponent(background) } function addBackgroundVariation(scene: FScene, position: { x: number, y: number }, variation = 0) { @@ -53,9 +49,8 @@ function addBackgroundVariation(scene: FScene, position: { x: number, y: number position, }) background.onLoaded(() => { - background.container.zIndex = -1 + background.__CONTAINER__.zIndex = -1 }) - scene.addComponent(background) } export function loadLevel(scene: FScene) { diff --git a/apps/playground-2d/src/main.ts b/apps/playground-2d/src/main.ts index 132ee44a..521307c3 100644 --- a/apps/playground-2d/src/main.ts +++ b/apps/playground-2d/src/main.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-new */ import './style.css' import { FAttachedCamera, FCircle, FComponentEmpty, FRectangle, FScene, FShapes } from '@fibbojs/2d' import { fDebug } from '@fibbojs/devtools' @@ -20,13 +21,10 @@ import Character from './classes/Character' scale: { x: 20, y: 0.1 }, }) deathZone.initCollider() - scene.addComponent(deathZone) - // Load level loadLevel(scene) - const square = new MySquare(scene) - scene.addComponent(square) + new MySquare(scene) const square2 = new FRectangle(scene, { position: { x: 0, y: 3 }, @@ -36,7 +34,6 @@ import Character from './classes/Character' square2.initCollider({ rotationDegree: 45, }) - scene.addComponent(square2) const square3 = new FRectangle(scene, { position: { x: 4, y: 1 }, @@ -44,7 +41,6 @@ import Character from './classes/Character' square3.initCollider({ shape: FShapes.CIRCLE, }) - scene.addComponent(square3) const square4 = new FRectangle(scene, { position: { x: -2.2, y: 1 }, @@ -56,21 +52,18 @@ import Character from './classes/Character' square4.initSensor({ scale: { x: 2.5, y: 2.5 }, }) - scene.addComponent(square4) const square5 = new FRectangle(scene, { position: { x: 1, y: 2 }, scale: { x: 0.5, y: 0.5 }, }) square5.initSensor() - scene.addComponent(square5) const circle = new FCircle(scene, { position: { x: 0, y: 3 }, scale: { x: 1, y: 1 }, }) circle.initRigidBody() - scene.addComponent(circle) // Create a rotating square const rotatingSquare = new FRectangle(scene, { @@ -78,12 +71,11 @@ import Character from './classes/Character' }) rotatingSquare.initSensor() let totalDelta = 0 - scene.addComponent(rotatingSquare) scene.onFrame((delta) => { // Each frame, move the cube on a circle of radius 3 const x = Math.cos(totalDelta) * 3 const y = Math.sin(totalDelta) * 3 - rotatingSquare.setPosition({ x, y }) + rotatingSquare.transform.setPosition({ x, y }) totalDelta += delta }) @@ -102,24 +94,20 @@ import Character from './classes/Character' console.log('Sprite collided with the circle!') }) character.onCollisionWith(deathZone, () => { - character.setPosition({ x: 0, y: 5 }) + character.transform.setPosition({ x: 0, y: 5 }) console.log('Sprite collided with the death zone!') }) - scene.addComponent(character) // Create keyboard const keyboard = new FKeyboard(scene) keyboard.onKeyDown('p', () => { - character.setPosition({ x: 0, y: 5 }) - - // Remove a square - scene.removeComponent(square4) + character.transform.setPosition({ x: 0, y: 5 }) // Remove the collision callback with FRectangle removeCollisionCallbackWithFRectangle() // Make character 2 times bigger on Y axis - character.setScale({ x: 0.5, y: 1 }) + character.transform.setScale({ x: 0.5, y: 1 }) // Zoom in the camera scene.camera.setZoom(1) diff --git a/packages/2d/src/controllers/FCharacterControllerK.ts b/packages/2d/src/controllers/FCharacterControllerK.ts index 1072eb0c..a0a50707 100644 --- a/packages/2d/src/controllers/FCharacterControllerK.ts +++ b/packages/2d/src/controllers/FCharacterControllerK.ts @@ -53,7 +53,7 @@ export abstract class FCharacterControllerK extends FCharacterController { } // Compute the desired movement this.characterController.computeColliderMovement( - this.component.collider?.__COLLIDER__ as RAPIER.Collider, + this.component.rigidBody ? this.component.rigidBody.collider.__COLLIDER__ : this.component.collider?.__COLLIDER__ as RAPIER.Collider, desiredMovement, RAPIER.QueryFilterFlags.EXCLUDE_SENSORS, ) diff --git a/packages/2d/src/core/FCollider.ts b/packages/2d/src/core/FCollider.ts index 19a86609..3b53ee4b 100644 --- a/packages/2d/src/core/FCollider.ts +++ b/packages/2d/src/core/FCollider.ts @@ -13,6 +13,7 @@ export interface FColliderOptions { scale?: FVector2 positionOffset?: FVector2 rotationOffset?: number + rotationDegreeOffset?: number scaleOffset?: FVector2 shape?: FShapes rigidBody?: FRigidBody @@ -90,18 +91,19 @@ export class FCollider { // Configure transform this.transform = new FTransform({ - position: options.position, - rotation: options.rotation, - rotationDegree: options.rotationDegree, - scale: options.scale, + position: options.position ? options.position : { x: 0, y: 0 }, + rotation: options.rotation ? options.rotation : (options.rotationDegree ? undefined : 0), + rotationDegree: options.rotationDegree ? options.rotationDegree : (options.rotation ? undefined : 0), + scale: options.scale ? options.scale : { x: 1, y: 1 }, }) this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) this.offset = new FTransform({ - position: options.positionOffset || { x: 0, y: 0 }, - rotation: options.rotationOffset || 0, - scale: options.scaleOffset || { x: 0, y: 0 }, + position: options.positionOffset ? options.positionOffset : { x: 0, y: 0 }, + rotation: options.rotationOffset ? options.rotationOffset : (options.rotationDegreeOffset ? undefined : 0), + rotationDegree: options.rotationDegreeOffset ? options.rotationDegreeOffset : (options.rotationOffset ? undefined : 0), + scale: options.scaleOffset ? options.scaleOffset : { x: 0, y: 0 }, }) // Create a collider description according to the shape given @@ -150,9 +152,9 @@ export class FCollider { __UPDATE_POSITION__(initiator: boolean = false): void { // If the collider is the initiator if (initiator) { + // Update the collider position + this.__SET_POSITION__(this.transform.position) if (this.component) { - // Update the collider position - this.__SET_POSITION__(this.transform.position) // Propagate the position update this.component.__UPDATE_POSITION__() this.component.sensor?.__UPDATE_POSITION__() @@ -179,9 +181,9 @@ export class FCollider { __UPDATE_ROTATION__(initiator: boolean = false): void { // If the collider is the initiator if (initiator) { + // Update the collider rotation + this.__SET_ROTATION__(this.transform.rotation) if (this.component) { - // Update the collider rotation - this.__SET_ROTATION__(this.transform.rotation) // Propagate the rotation update this.component.__UPDATE_ROTATION__() this.component.sensor?.__UPDATE_ROTATION__() @@ -205,9 +207,9 @@ export class FCollider { __UPDATE_SCALE__(initiator: boolean = false): void { // If the collider is the initiator if (initiator) { + // Update the collider scale + this.__SET_SCALE__(this.transform.scale) if (this.component) { - // Update the collider scale - this.__SET_SCALE__(this.transform.scale) // Propagate the scale update this.component.__UPDATE_SCALE__() this.component.sensor?.__UPDATE_SCALE__() diff --git a/packages/2d/src/core/FComponent.ts b/packages/2d/src/core/FComponent.ts index 6f925220..b8b53f99 100644 --- a/packages/2d/src/core/FComponent.ts +++ b/packages/2d/src/core/FComponent.ts @@ -98,13 +98,6 @@ export abstract class FComponent extends FComponentCore { this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) - - // Set the container values - this.__CONTAINER__.position.set(this.transform.position.x * 100, -this.transform.position.y * 100) - this.__CONTAINER__.rotation = this.transform.rotation - this.__CONTAINER__.scale.set(this.transform.scale.x * 100, this.transform.scale.y * 100) - // Set the pivot of the container to the center - this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } frame(_delta: number): void { @@ -234,16 +227,15 @@ export abstract class FComponent extends FComponentCore { __SET_ROTATION__(rotation: number): void { // Rotate the container - this.__CONTAINER__.rotation = rotation + this.__CONTAINER__.rotation = -rotation // Update the transform this.transform.__ROTATION__ = rotation } __SET_SCALE__(scale: FVector2): void { // Scale the container - this.__CONTAINER__.scale.set(scale.x * 100, scale.y * 100) - // Set the pivot of the container to the center - this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) + this.__CONTAINER__.height = scale.y * 100 + this.__CONTAINER__.width = scale.x * 100 // Update the transform this.transform.__SCALE__ = scale } diff --git a/packages/2d/src/core/FRigidBody.ts b/packages/2d/src/core/FRigidBody.ts index bbe518c8..07615e69 100644 --- a/packages/2d/src/core/FRigidBody.ts +++ b/packages/2d/src/core/FRigidBody.ts @@ -105,19 +105,19 @@ export class FRigidBody { // Configure transform this.transform = new FTransform({ - position: options.position, - rotation: options.rotation, - rotationDegree: options.rotationDegree, - scale: options.scale, + position: options.position ? options.position : { x: 0, y: 0 }, + rotation: options.rotation ? options.rotation : (options.rotationDegree ? undefined : 0), + rotationDegree: options.rotationDegree ? options.rotationDegree : (options.rotation ? undefined : 0), + scale: options.scale ? options.scale : { x: 1, y: 1 }, }) this.transform.onPositionUpdated(() => this.__UPDATE_POSITION__(true)) this.transform.onRotationUpdated(() => this.__UPDATE_ROTATION__(true)) this.transform.onScaleUpdated(() => this.__UPDATE_SCALE__(true)) this.offset = new FTransform({ - position: options.positionOffset || { x: 0, y: 0 }, - rotation: options.rotationOffset, - rotationDegree: options.rotationDegreeOffset, - scale: options.scaleOffset || { x: 0, y: 0 }, + position: options.positionOffset ? options.positionOffset : { x: 0, y: 0 }, + rotation: options.rotationOffset ? options.rotationOffset : (options.rotationDegreeOffset ? undefined : 0), + rotationDegree: options.rotationDegreeOffset ? options.rotationDegreeOffset : (options.rotationOffset ? undefined : 0), + scale: options.scaleOffset ? options.scaleOffset : { x: 0, y: 0 }, }) // Create a rigidBody description according to the type @@ -200,9 +200,9 @@ export class FRigidBody { __UPDATE_POSITION__(initiator: boolean = false): void { // If the rigidBody is the initiator if (initiator) { + // Update the rigidBody position + this.__SET_POSITION__(this.transform.position) if (this.component) { - // Update the rigidBody position - this.__SET_POSITION__(this.transform.position) // Propagate the position update this.component.__UPDATE_POSITION__() this.component.sensor?.__UPDATE_POSITION__() @@ -229,9 +229,9 @@ export class FRigidBody { __UPDATE_ROTATION__(initiator: boolean = false): void { // If the rigidBody is the initiator if (initiator) { + // Update the rigidBody rotation + this.__SET_ROTATION__(this.transform.rotation) if (this.component) { - // Update the rigidBody rotation - this.__SET_ROTATION__(this.transform.rotation) // Propagate the rotation update this.component.__UPDATE_ROTATION__() this.component.sensor?.__UPDATE_ROTATION__() diff --git a/packages/2d/src/core/FScene.ts b/packages/2d/src/core/FScene.ts index a6d7bf03..38edd908 100644 --- a/packages/2d/src/core/FScene.ts +++ b/packages/2d/src/core/FScene.ts @@ -15,7 +15,7 @@ export interface FSceneOptions extends FSceneOptionsCore { } /** - * A scene which contains the models, the Pixi.js scene and the Rapier world. + * A scene which contains the components, the Pixi.js scene and the Rapier world. * @category Core * @example * ```ts @@ -28,7 +28,6 @@ export interface FSceneOptions extends FSceneOptionsCore { * * const square = new FRectangle(scene) * square.initRigidBody() - * scene.addComponent(square) * })() * ``` */ @@ -214,17 +213,15 @@ export class FScene extends FSceneCore { addComponent(component: FComponent) { super.addComponent(component) - // Wait for the component to be loaded before adding it to the scene - component.onLoaded(() => { - this.viewport.addChild(component.__CONTAINER__) + // Add the component to the viewport + this.viewport.addChild(component.__CONTAINER__) - // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - if (component.sensor) - this.addHandle(component.sensor.collider.__COLLIDER__.handle, component) - // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map - else if (component.collider) - this.addHandle(component.collider.__COLLIDER__.handle, component) - }) + // If a sensor is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + if (component.sensor) + this.addHandle(component.sensor.collider.__COLLIDER__.handle, component) + // Else if a collider is defined, add it's handle to the __RAPIER_TO_COMPONENT__ map + else if (component.collider) + this.addHandle(component.collider.__COLLIDER__.handle, component) } removeComponent(component: FComponent): void { diff --git a/packages/2d/src/core/FTransform.ts b/packages/2d/src/core/FTransform.ts index 40c6f061..2af5a096 100644 --- a/packages/2d/src/core/FTransform.ts +++ b/packages/2d/src/core/FTransform.ts @@ -65,7 +65,7 @@ export class FTransform { options = { ...DEFAULT_OPTIONS, ...options } // Validate options - if (!options.position || !options.scale) + if (!options.position || (!options.rotation === undefined && options.rotationDegree === undefined) || !options.scale) throw new Error('FibboError: options missing for FTransform') // Set the transform values diff --git a/packages/2d/src/polygons/FCircle.ts b/packages/2d/src/polygons/FCircle.ts index 33f0bf24..a7c1726d 100644 --- a/packages/2d/src/polygons/FCircle.ts +++ b/packages/2d/src/polygons/FCircle.ts @@ -26,6 +26,10 @@ export class FCircle extends FPolygon { this.__CONTAINER__ = new PIXI.Graphics() .circle(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100 / 2) .fill(new PIXI.FillGradient(0, 0, 10, 10).addColorStop(0, 0x0000FF).addColorStop(1, 0xFFFF00)) + // Reset transform + this.__SET_POSITION__(this.transform.position) + this.__SET_ROTATION__(this.transform.rotation) + this.__SET_SCALE__(this.transform.scale) // Emit the onLoaded event this.emitOnLoaded() } diff --git a/packages/2d/src/polygons/FPolygon.ts b/packages/2d/src/polygons/FPolygon.ts index f7adc6d2..f77304a0 100644 --- a/packages/2d/src/polygons/FPolygon.ts +++ b/packages/2d/src/polygons/FPolygon.ts @@ -1,4 +1,3 @@ -import * as PIXI from 'pixi.js' import type { FComponentOptions } from '../core/FComponent' import { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' @@ -10,11 +9,5 @@ import type { FScene } from '../core/FScene' export abstract class FPolygon extends FComponent { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) - // Create a square - this.__CONTAINER__ = new PIXI.Graphics() - .rect(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100, this.transform.scale.y * 100) - .fill(new PIXI.FillGradient(0, 0, this.transform.scale.x * 100, this.transform.scale.y * 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) - // Set the pivot of the container to the center - this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) } } diff --git a/packages/2d/src/polygons/FRectangle.ts b/packages/2d/src/polygons/FRectangle.ts index bdcdcf7f..fa02a770 100644 --- a/packages/2d/src/polygons/FRectangle.ts +++ b/packages/2d/src/polygons/FRectangle.ts @@ -1,5 +1,7 @@ +import * as PIXI from 'pixi.js' import type { FComponentOptions } from '../core/FComponent' import type { FScene } from '../core/FScene' +import type { FVector2 } from '../types/FVector2' import { FPolygon } from './FPolygon' /** @@ -18,7 +20,20 @@ import { FPolygon } from './FPolygon' export class FRectangle extends FPolygon { constructor(scene: FScene, options?: FComponentOptions) { super(scene, options) + // Create a square + this.__CONTAINER__ = new PIXI.Graphics() + .rect(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100, this.transform.scale.y * 100) + .fill(new PIXI.FillGradient(0, 0, this.transform.scale.x * 100, this.transform.scale.y * 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) + // Reset transform + this.__SET_POSITION__(this.transform.position) + this.__SET_ROTATION__(this.transform.rotation) + this.__SET_SCALE__(this.transform.scale) // Emit the onLoaded event this.emitOnLoaded() } + + __SET_SCALE__(scale: FVector2): void { + super.__SET_SCALE__(scale) + this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) + } } diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index 575f8d89..bdb932e0 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -2,6 +2,7 @@ import * as PIXI from 'pixi.js' import type { FComponentOptions } from '../core/FComponent' import { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' +import type { FVector2 } from '../types/FVector2' export interface FSpriteOptions extends FComponentOptions { texture: string @@ -17,23 +18,26 @@ export interface FSpriteOptions extends FComponentOptions { * const scene = new FScene() * * const sprite = new FSprite(scene, '/my-texture.png') - * scene.addComponent(sprite) * ``` */ export class FSprite extends FComponent { + /** + * PIXI container + */ + __CONTAINER__: PIXI.Sprite /** * The texture of the sprite. */ - texture: PIXI.Texture + __TEXTURE__: PIXI.Texture constructor(scene: FScene, options: FSpriteOptions) { super(scene, options) // Define the texture and container while loading - this.texture = PIXI.Texture.EMPTY + this.__TEXTURE__ = PIXI.Texture.EMPTY this.__CONTAINER__ = new PIXI.Graphics() .rect(this.transform.position.x, this.transform.position.y, this.transform.scale.x * 100, this.transform.scale.y * 100) - .fill(new PIXI.FillGradient(0, 0, 100, 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) + .fill(new PIXI.FillGradient(0, 0, 100, 100).addColorStop(0, 0xFF00FF).addColorStop(1, 0xFFFF00)) as unknown as PIXI.Sprite // Set the pivot of the container to the center this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) @@ -65,15 +69,17 @@ export class FSprite extends FComponent { // Interpret the path const path = interpretPath(texture) // Load the texture - this.texture = await PIXI.Assets.load(path) - this.texture.source.scaleMode = 'nearest' + this.__TEXTURE__ = await PIXI.Assets.load(path) + this.__TEXTURE__.source.scaleMode = 'nearest' // Create a sprite - this.__CONTAINER__ = new PIXI.Sprite(this.texture) + this.__CONTAINER__ = new PIXI.Sprite(this.__TEXTURE__) + this.__CONTAINER__.anchor.set(0.5, 0.5) this.__CONTAINER__.zIndex = 0 - // Set the pivot of the container to the center - this.__CONTAINER__.pivot.set(this.__CONTAINER__.width / 2, this.__CONTAINER__.height / 2) + // Reset transform + this.__SET_POSITION__(this.transform.position) + this.__SET_ROTATION__(this.transform.rotation) // Set the scale of the component so it fits the texture by its width - // Width will be 1 unit, height will be calculated according to the aspect ratio + // Width will be the actual width, height will be calculated according to the aspect ratio this.setScaleWidth(this.transform.scale.x) // Call the onLoaded method this.emitOnLoaded() @@ -85,7 +91,7 @@ export class FSprite extends FComponent { * @param width The width of the sprite. */ setScaleWidth(width: number) { - this.__SET_SCALE__({ x: width, y: width * this.texture.height / this.texture.width }) + this.__SET_SCALE__({ x: width, y: width * this.__TEXTURE__.height / this.__TEXTURE__.width }) } /** @@ -94,6 +100,6 @@ export class FSprite extends FComponent { * @param height The height of the sprite. */ setScaleHeight(height: number) { - this.__SET_SCALE__({ x: height * this.texture.width / this.texture.height, y: height }) + this.__SET_SCALE__({ x: height * this.__TEXTURE__.width / this.__TEXTURE__.height, y: height }) } } diff --git a/packages/3d/src/core/FScene.ts b/packages/3d/src/core/FScene.ts index 90f648da..1a471d28 100644 --- a/packages/3d/src/core/FScene.ts +++ b/packages/3d/src/core/FScene.ts @@ -4,7 +4,6 @@ import type { FSceneOptions as FSceneOptionsCore } from '@fibbojs/core' import type RAPIER from '@dimforge/rapier3d' import type { FCamera } from '../cameras/FCamera' import { FFixedCamera } from '../cameras/FFixedCamera' -import { FModel } from '../model/FModel' import type { FLight } from '../lights/FLight' import type { FVector3 } from '../types/FVector3' import type { FComponent } from './FComponent' @@ -17,7 +16,7 @@ export interface FSceneOptions extends FSceneOptionsCore { } /** - * A scene which contains the models, the Three.js scene and the Rapier world. + * A scene which contains the components, the Three.js scene and the Rapier world. * @category Core * @example * ```ts @@ -31,19 +30,17 @@ export interface FSceneOptions extends FSceneOptionsCore { * * // Create a ground * const ground = new FCuboid(scene) - * ground.setScale(15, 0.1, 15) - * ground.setPosition(0, -0.1, 0) + * ground.transform.setScale(15, 0.1, 15) + * ground.transform.setPosition(0, -0.1, 0) * ground.initCollider() * ground.setColor(0x1F1F1F) - * scene.addComponent(ground) * * // Create a cube * const cube = new FCuboid(scene) * cube.initRigidBody() - * scene.addComponent(cube) * * // Attach a camera to the cube - * scene.camera = new FGameCamera(cube) + * scene.camera = new FGameCamera(scene, {target: cube}) * })() * ``` */ @@ -205,6 +202,7 @@ export class FScene extends FSceneCore { addComponent(component: FComponent) { super.addComponent(component) + // Add mesh to scene if (component.__MESH__) this.scene.add(component.__MESH__) diff --git a/packages/devtools/src/components/2d/FComponent2d.vue b/packages/devtools/src/components/2d/FComponent2d.vue index 4f49e50c..8e92672c 100644 --- a/packages/devtools/src/components/2d/FComponent2d.vue +++ b/packages/devtools/src/components/2d/FComponent2d.vue @@ -11,25 +11,25 @@

Position

x :

- +

y :

- +

Scale

x :

- +

y :

- +

Rotation (Degree)

r :

- +
From 4400eece7fcd62aaf31b3e9ceec62398a9dad32b Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 19:15:40 +0200 Subject: [PATCH 35/36] chore: update API reference + lint --- apps/playground-3d/pages/rainbowls/main.ts | 10 +- docs/.vitepress/config.ts | 8 + docs/api/2d/classes/FAttachedCamera.md | 273 +- docs/api/2d/classes/FCamera.md | 245 +- docs/api/2d/classes/FCharacterController.md | 21 +- docs/api/2d/classes/FCharacterControllerD.md | 21 +- docs/api/2d/classes/FCharacterControllerK.md | 61 +- docs/api/2d/classes/FCharacterControllerKP.md | 65 +- docs/api/2d/classes/FCharacterControllerKV.md | 65 +- docs/api/2d/classes/FCircle.md | 500 +-- docs/api/2d/classes/FCollider.md | 368 +- docs/api/2d/classes/FComponent.md | 452 +-- docs/api/2d/classes/FComponentEmpty.md | 476 +-- docs/api/2d/classes/FController.md | 15 +- docs/api/2d/classes/FFixedCamera.md | 261 +- docs/api/2d/classes/FFreeCamera.md | 261 +- docs/api/2d/classes/FLight.md | 215 +- docs/api/2d/classes/FPolygon.md | 474 +-- docs/api/2d/classes/FRectangle.md | 476 +-- docs/api/2d/classes/FRigidBody.md | 356 +- docs/api/2d/classes/FScene.md | 233 +- docs/api/2d/classes/FSprite.md | 539 +-- docs/api/2d/classes/FTransform.md | 458 ++- docs/api/2d/enumerations/FRigidBodyType.md | 43 + docs/api/2d/enumerations/FShapes.md | 4 +- docs/api/2d/index.md | 2 + .../2d/interfaces/FAttachedCameraOptions.md | 4 +- docs/api/2d/interfaces/FCameraOptions.md | 2 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/2d/interfaces/FColliderOptions.md | 58 +- docs/api/2d/interfaces/FComponentOptions.md | 26 +- docs/api/2d/interfaces/FControllerOptions.md | 2 +- docs/api/2d/interfaces/FLightOptions.md | 14 +- docs/api/2d/interfaces/FRigidBodyOptions.md | 66 +- docs/api/2d/interfaces/FSceneOptions.md | 18 +- docs/api/2d/interfaces/FSpriteOptions.md | 24 +- docs/api/2d/interfaces/FTransformOptions.md | 8 +- docs/api/2d/interfaces/FVector2.md | 29 + docs/api/3d/classes/FAmbientLight.md | 238 +- docs/api/3d/classes/FAttachedCamera.md | 3116 ++-------------- docs/api/3d/classes/FCamera.md | 3086 +--------------- docs/api/3d/classes/FCapsule.md | 772 +--- docs/api/3d/classes/FCharacterController.md | 53 +- docs/api/3d/classes/FCharacterControllerD.md | 51 +- docs/api/3d/classes/FCharacterControllerK.md | 75 +- docs/api/3d/classes/FCharacterControllerKP.md | 79 +- docs/api/3d/classes/FCharacterControllerKV.md | 79 +- docs/api/3d/classes/FCollider.md | 623 +--- docs/api/3d/classes/FComponent.md | 706 +--- docs/api/3d/classes/FComponentEmpty.md | 752 +--- docs/api/3d/classes/FController.md | 15 +- docs/api/3d/classes/FCuboid.md | 770 +--- docs/api/3d/classes/FDirectionalLight.md | 238 +- docs/api/3d/classes/FFBX.md | 797 +---- docs/api/3d/classes/FFixedCamera.md | 3080 +--------------- docs/api/3d/classes/FGLB.md | 795 +---- docs/api/3d/classes/FGLTF.md | 795 +---- docs/api/3d/classes/FGameCamera.md | 3136 ++--------------- docs/api/3d/classes/FHemisphereLight.md | 238 +- docs/api/3d/classes/FLight.md | 246 +- docs/api/3d/classes/FLightProbe.md | 238 +- docs/api/3d/classes/FModel.md | 801 +---- docs/api/3d/classes/FOBJ.md | 795 +---- docs/api/3d/classes/FOrbitCamera.md | 3110 ++-------------- docs/api/3d/classes/FPointLight.md | 238 +- docs/api/3d/classes/FPointerLockCamera.md | 3104 ++-------------- docs/api/3d/classes/FPolyhedron.md | 774 +--- docs/api/3d/classes/FRigidBody.md | 609 +--- docs/api/3d/classes/FScene.md | 254 +- docs/api/3d/classes/FSensor.md | 393 +++ docs/api/3d/classes/FSphere.md | 772 +--- docs/api/3d/classes/FSpotLight.md | 238 +- docs/api/3d/classes/FTransform.md | 638 +++- docs/api/3d/enumerations/FRigidBodyType.md | 43 + docs/api/3d/enumerations/FShapes.md | 8 +- docs/api/3d/index.md | 3 + .../3d/interfaces/FAttachedCameraOptions.md | 66 +- docs/api/3d/interfaces/FCameraOptions.md | 64 +- .../interfaces/FCharacterControllerOptions.md | 4 +- docs/api/3d/interfaces/FColliderOptions.md | 82 +- docs/api/3d/interfaces/FComponentOptions.md | 64 +- docs/api/3d/interfaces/FControllerOptions.md | 2 +- .../3d/interfaces/FHemisphereLightOptions.md | 88 +- docs/api/3d/interfaces/FLightOptions.md | 84 +- docs/api/3d/interfaces/FLightProbeOptions.md | 86 +- docs/api/3d/interfaces/FModelOptions.md | 72 +- docs/api/3d/interfaces/FRigidBodyOptions.md | 92 +- docs/api/3d/interfaces/FSceneOptions.md | 30 +- docs/api/3d/interfaces/FSpotLightOptions.md | 92 +- docs/api/3d/interfaces/FTransformOptions.md | 64 +- docs/api/3d/interfaces/FVector3.md | 41 + docs/api/core/classes/FCamera.md | 145 +- docs/api/core/classes/FComponent.md | 134 +- docs/api/core/classes/FController.md | 13 +- docs/api/core/classes/FGroup.md | 14 +- docs/api/core/classes/FLight.md | 206 +- docs/api/core/classes/FScene.md | 80 +- docs/api/core/index.md | 2 + docs/api/core/interfaces/FComponentOptions.md | 13 + .../api/core/interfaces/FControllerOptions.md | 2 +- docs/api/core/interfaces/FLightOptions.md | 13 + docs/api/core/interfaces/FSceneOptions.md | 14 +- .../core/interfaces/OnCollisionWithData.md | 2 +- docs/api/event/classes/FKeyboard.md | 18 +- packages/2d/src/sprite/FSprite.ts | 1 - .../src/controllers/FCharacterController.ts | 1 - .../src/controllers/FCharacterControllerD.ts | 1 - .../src/controllers/FCharacterControllerKP.ts | 1 - .../src/controllers/FCharacterControllerKV.ts | 1 - packages/core/src/FComponent.ts | 1 - 110 files changed, 9038 insertions(+), 30470 deletions(-) create mode 100644 docs/api/2d/enumerations/FRigidBodyType.md create mode 100644 docs/api/2d/interfaces/FVector2.md create mode 100644 docs/api/3d/classes/FSensor.md create mode 100644 docs/api/3d/enumerations/FRigidBodyType.md create mode 100644 docs/api/3d/interfaces/FVector3.md create mode 100644 docs/api/core/interfaces/FComponentOptions.md create mode 100644 docs/api/core/interfaces/FLightOptions.md diff --git a/apps/playground-3d/pages/rainbowls/main.ts b/apps/playground-3d/pages/rainbowls/main.ts index d8e5205c..a82d33a7 100644 --- a/apps/playground-3d/pages/rainbowls/main.ts +++ b/apps/playground-3d/pages/rainbowls/main.ts @@ -21,14 +21,14 @@ import * as THREE from 'three' for (let j = 0; j < GRID_COLS; j++) { // Create the sphere to display const sphere = new FSphere(scene) - sphere.setPosition({ x: i * GRID_GAP - GRID_ROWS * GRID_GAP / 2, y: 1, z: j * GRID_GAP - GRID_COLS * GRID_GAP / 2 }) + sphere.transform.setPosition({ x: i * GRID_GAP - GRID_ROWS * GRID_GAP / 2, y: 1, z: j * GRID_GAP - GRID_COLS * GRID_GAP / 2 }) // @ts-expect-error Disable typing for the mesh property sphere.__MESH__.material.color.set(new THREE.Color(0x2C2C2C)) // Create a cube for the hitbox const cube = new FCuboid(scene) - cube.setPosition({ x: i * GRID_GAP - GRID_ROWS * GRID_GAP / 2, y: 1, z: j * GRID_GAP - GRID_COLS * GRID_GAP / 2 }) - cube.setScale({ x: GRID_GAP, y: 1, z: GRID_GAP }) + cube.transform.setPosition({ x: i * GRID_GAP - GRID_ROWS * GRID_GAP / 2, y: 1, z: j * GRID_GAP - GRID_COLS * GRID_GAP / 2 }) + cube.transform.setScale({ x: GRID_GAP, y: 1, z: GRID_GAP }) // Make the cube invisible // @ts-expect-error Disable typing for the mesh property cube.__MESH__.material.transparent = true @@ -49,12 +49,12 @@ import * as THREE from 'three' // Create a camera target const cameraTarget = new FCuboid(scene) - cameraTarget.setPosition({ x: 0, y: 1, z: 0 }) + cameraTarget.transform.setPosition({ x: 0, y: 1, z: 0 }) // Create a camera const camera = new FOrbitCamera(scene, { target: cameraTarget, }) - camera.setPosition({ x: 14, y: 12, z: 14 }) + camera.transform.setPosition({ x: 14, y: 12, z: 14 }) camera.lookAt({ x: 0, y: 0, z: 0 }) scene.camera = camera diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9117b2ef..6c7f90cb 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -105,6 +105,7 @@ export default defineConfig({ ] }, { text: 'Core', collapsed: true, items: [ { text: 'FRigidBody', link: '/api/2d/classes/FRigidBody.md' }, + { text: 'FSensor', link: '/api/2d/classes/FSensor.md' }, { text: 'FCollider', link: '/api/2d/classes/FCollider.md' }, { text: 'FComponent', link: '/api/2d/classes/FComponent.md' }, { text: 'FComponentEmpty', link: '/api/2d/classes/FComponentEmpty.md' }, @@ -123,9 +124,11 @@ export default defineConfig({ { text: 'FSprite', link: '/api/2d/classes/FSprite.md' }, ] }, { text: 'Enumerations', collapsed: true, items: [ + { text: 'FRigidBodyType', link: '/api/2d/enumerations/FRigidBodyType.md' }, { text: 'FShapes', link: '/api/2d/enumerations/FShapes.md' }, ] }, { text: 'Interfaces', collapsed: true, items: [ + { text: 'FVector2', link: '/api/2d/interfaces/FVector2.md' }, { text: 'FRigidBodyOptions', link: '/api/2d/interfaces/FRigidBodyOptions.md' }, { text: 'FColliderOptions', link: '/api/2d/interfaces/FColliderOptions.md' }, { text: 'FComponentOptions', link: '/api/2d/interfaces/FComponentOptions.md' }, @@ -157,6 +160,7 @@ export default defineConfig({ ] }, { text: 'Core', collapsed: true, items: [ { text: 'FRigidBody', link: '/api/3d/classes/FRigidBody.md' }, + { text: 'FSensor', link: '/api/3d/classes/FSensor.md' }, { text: 'FCollider', link: '/api/3d/classes/FCollider.md' }, { text: 'FComponent', link: '/api/3d/classes/FComponent.md' }, { text: 'FComponentEmpty', link: '/api/3d/classes/FComponentEmpty.md' }, @@ -186,9 +190,11 @@ export default defineConfig({ { text: 'FSphere', link: '/api/3d/classes/FSphere.md' }, ] }, { text: 'Enumerations', collapsed: true, items: [ + { text: 'FRigidBodyType', link: '/api/3d/enumerations/FRigidBodyType.md' }, { text: 'FShapes', link: '/api/3d/enumerations/FShapes.md' }, ] }, { text: 'Interfaces', collapsed: true, items: [ + { text: 'FVector3', link: '/api/3d/interfaces/FVector3.md' }, { text: 'FRigidBodyOptions', link: '/api/3d/interfaces/FRigidBodyOptions.md' }, { text: 'FColliderOptions', link: '/api/3d/interfaces/FColliderOptions.md' }, { text: 'FComponentOptions', link: '/api/3d/interfaces/FComponentOptions.md' }, @@ -216,7 +222,9 @@ export default defineConfig({ ] }, { text: 'Interfaces', collapsed: true, items: [ { text: 'FControllerOptions', link: '/api/core/interfaces/FControllerOptions.md' }, + { text: 'FComponentOptions', link: '/api/core/interfaces/FComponentOptions.md' }, { text: 'OnCollisionWithData', link: '/api/core/interfaces/OnCollisionWithData.md' }, + { text: 'FLightOptions', link: '/api/core/interfaces/FLightOptions.md' }, { text: 'FSceneOptions', link: '/api/core/interfaces/FSceneOptions.md' }, ] }, ] }, diff --git a/docs/api/2d/classes/FAttachedCamera.md b/docs/api/2d/classes/FAttachedCamera.md index e5ab4676..5979d06d 100644 --- a/docs/api/2d/classes/FAttachedCamera.md +++ b/docs/api/2d/classes/FAttachedCamera.md @@ -30,7 +30,7 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L20) +[2d/src/cameras/FAttachedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FAttachedCamera.ts#L20) ## Methods @@ -48,7 +48,97 @@ A camera attached to a given target. #### Defined in -[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L33) +[2d/src/cameras/FAttachedCamera.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FAttachedCamera.ts#L33) + +*** + +### \_\_SET\_POSITION\_\_() + +> **\_\_SET\_POSITION\_\_**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L88) + +*** + +### \_\_UPDATE\_POSITION\_\_() + +> **\_\_UPDATE\_POSITION\_\_**(): `void` + +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L67) + +*** + +### \_\_UPDATE\_ROTATION\_\_() + +> **\_\_UPDATE\_ROTATION\_\_**(): `void` + +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:75](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L75) + +*** + +### \_\_UPDATE\_SCALE\_\_() + +> **\_\_UPDATE\_SCALE\_\_**(): `void` + +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L84) *** @@ -100,7 +190,52 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`_delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **\_delta**: `number` + +#### Returns + +`void` + +#### Overrides + +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) + +#### Defined in + +[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FAttachedCamera.ts#L25) *** @@ -154,33 +289,59 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:270 *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -[2d/src/cameras/FAttachedCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L25) +core/dist/index.d.ts:238 + +*** + +### onLoaded() + +> **onLoaded**(`callback`): `void` + +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + +#### Parameters + +• **callback** + +The callback function. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) + +#### Defined in + +core/dist/index.d.ts:243 *** @@ -188,8 +349,6 @@ Any changes on its transform should be done on the controller, not here. > **setZoom**(`zoom`): `void` -Set the zoom of the camera. - #### Parameters • **zoom**: `number` @@ -204,7 +363,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L59) ## Properties @@ -225,7 +384,39 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:216 + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] + +Callbacks for when a frame is rendered. + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) + +#### Defined in + +core/dist/index.d.ts:207 + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) + +#### Defined in + +core/dist/index.d.ts:211 *** @@ -242,7 +433,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -258,7 +449,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L17) *** @@ -274,7 +465,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -290,56 +481,50 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:64 +core/dist/index.d.ts:226 *** -### position - -> **position**: `object` - -Position of the camera. - -#### x - -> **x**: `number` +### scene -#### y +> **scene**: [`FScene`](FScene.md) -> **y**: `number` +The scene the camera is in. #### Inherited from -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L22) *** -### scene - -> **scene**: [`FScene`](FScene.md) - -The scene the camera is in. +### target -#### Inherited from +> **target**: [`FComponent`](FComponent.md) -[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) +The target to follow. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FAttachedCamera.ts#L18) *** -### target +### transform -> **target**: [`FComponent`](FComponent.md) +> **transform**: [`FTransform`](FTransform.md) -The target to follow. +Transform of the camera. +It is used to store the position of the camera. +The scale and rotation of the transform are not used. + +#### Inherited from + +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[2d/src/cameras/FAttachedCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L18) +[2d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/2d/classes/FCamera.md b/docs/api/2d/classes/FCamera.md index dcb3ac09..25809e61 100644 --- a/docs/api/2d/classes/FCamera.md +++ b/docs/api/2d/classes/FCamera.md @@ -42,7 +42,7 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L34) +[2d/src/cameras/FCamera.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L36) ## Methods @@ -56,7 +56,81 @@ The options for the camera. #### Defined in -[2d/src/cameras/FCamera.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L55) +[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L57) + +*** + +### \_\_SET\_POSITION\_\_() + +> **\_\_SET\_POSITION\_\_**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`void` + +#### Defined in + +[2d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L88) + +*** + +### \_\_UPDATE\_POSITION\_\_() + +> **\_\_UPDATE\_POSITION\_\_**(): `void` + +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Defined in + +[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L67) + +*** + +### \_\_UPDATE\_ROTATION\_\_() + +> **\_\_UPDATE\_ROTATION\_\_**(): `void` + +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Defined in + +[2d/src/cameras/FCamera.ts:75](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L75) + +*** + +### \_\_UPDATE\_SCALE\_\_() + +> **\_\_UPDATE\_SCALE\_\_**(): `void` + +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. + +#### Returns + +`void` + +#### Defined in + +[2d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L84) *** @@ -108,7 +182,54 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Inherited from + +`FCameraCore.emitOnLoaded` + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Inherited from + +`FCameraCore.frame` + +#### Defined in + +core/dist/index.d.ts:233 *** @@ -162,57 +283,77 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:270 *** ### onFrame() -> `abstract` **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from `FCameraCore.onFrame` #### Defined in -[2d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L53) +core/dist/index.d.ts:238 *** -### setZoom() +### onLoaded() -> **setZoom**(`zoom`): `void` +> **onLoaded**(`callback`): `void` -Set the zoom of the camera. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **zoom**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -`FCameraCore.setZoom` +`FCameraCore.onLoaded` #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) +core/dist/index.d.ts:243 + +*** + +### setZoom() + +> **setZoom**(`zoom`): `void` + +#### Parameters + +• **zoom**: `number` + +#### Returns + +`void` + +#### Defined in + +[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L59) ## Properties @@ -233,7 +374,39 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:216 + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] + +Callbacks for when a frame is rendered. + +#### Inherited from + +`FCameraCore.__CALLBACKS_ON_FRAME__` + +#### Defined in + +core/dist/index.d.ts:207 + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +`FCameraCore.__CALLBACKS_ON_LOADED__` + +#### Defined in + +core/dist/index.d.ts:211 *** @@ -250,7 +423,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -266,7 +439,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L17) *** @@ -282,7 +455,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -298,36 +471,34 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:64 +core/dist/index.d.ts:226 *** -### position - -> **position**: `object` - -Position of the camera. +### scene -#### x +> **scene**: [`FScene`](FScene.md) -> **x**: `number` +The scene the camera is in. -#### y +#### Overrides -> **y**: `number` +`FCameraCore.scene` #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L22) *** -### scene +### transform -> **scene**: [`FScene`](FScene.md) +> **transform**: [`FTransform`](FTransform.md) -The scene the camera is in. +Transform of the camera. +It is used to store the position of the camera. +The scale and rotation of the transform are not used. #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/2d/classes/FCharacterController.md b/docs/api/2d/classes/FCharacterController.md index 6a0b128a..0a59f061 100644 --- a/docs/api/2d/classes/FCharacterController.md +++ b/docs/api/2d/classes/FCharacterController.md @@ -35,17 +35,16 @@ An abstract pre-defined character controller. #### Defined in -[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L38) +[2d/src/controllers/FCharacterController.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L38) ## Methods -### onFrame() +### frame() -> `abstract` **onFrame**(`delta`): `void` +> `abstract` **frame**(`delta`): `void` 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. +The purpose of this method is to update the component transform based on the controller logic. #### Parameters @@ -59,11 +58,11 @@ The time since the last frame. #### Inherited from -[`FController`](FController.md).[`onFrame`](FController.md#onframe) +[`FController`](FController.md).[`frame`](FController.md#frame) #### Defined in -core/dist/index.d.ts:27 +core/dist/index.d.ts:26 ## Properties @@ -80,7 +79,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) *** @@ -108,7 +107,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -120,7 +119,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -132,4 +131,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerD.md b/docs/api/2d/classes/FCharacterControllerD.md index 2db1f69f..c19738b0 100644 --- a/docs/api/2d/classes/FCharacterControllerD.md +++ b/docs/api/2d/classes/FCharacterControllerD.md @@ -42,17 +42,16 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerD.ts#L22) +[2d/src/controllers/FCharacterControllerD.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerD.ts#L22) ## Methods -### onFrame() +### frame() -> **onFrame**(`_delta`): `void` +> **frame**(`_delta`): `void` 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. +The purpose of this method is to update the component transform based on the controller logic. #### Parameters @@ -64,11 +63,11 @@ Any rendering process should be done on the component, not here. #### Overrides -[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) +[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame) #### Defined in -[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerD.ts#L38) +[2d/src/controllers/FCharacterControllerD.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerD.ts#L38) ## Properties @@ -85,7 +84,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) *** @@ -117,7 +116,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -133,7 +132,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -149,4 +148,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L31) diff --git a/docs/api/2d/classes/FCharacterControllerK.md b/docs/api/2d/classes/FCharacterControllerK.md index 5a0d323f..f6ba3330 100644 --- a/docs/api/2d/classes/FCharacterControllerK.md +++ b/docs/api/2d/classes/FCharacterControllerK.md @@ -35,59 +35,58 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L22) +[2d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L22) ## Methods -### getCorrectedMovements() +### frame() -> **getCorrectedMovements**(): `object` +> `abstract` **frame**(`delta`): `void` -Return the corrected movements for the current frame. +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -#### Returns +#### Parameters -`object` +• **delta**: `number` -##### x +The time since the last frame. -> **x**: `number` +#### Returns -##### y +`void` -> **y**: `number` +#### Inherited from + +[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame) #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +core/dist/index.d.ts:26 *** -### onFrame() - -> `abstract` **onFrame**(`delta`): `void` +### getCorrectedMovements() -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. +> **getCorrectedMovements**(): `object` -#### Parameters +Return the corrected movements for the current frame. -• **delta**: `number` +#### Returns -The time since the last frame. +`object` -#### Returns +##### x -`void` +> **x**: `number` -#### Inherited from +##### y -[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) +> **y**: `number` #### Defined in -core/dist/index.d.ts:27 +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L44) ## Properties @@ -99,7 +98,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -116,7 +115,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) *** @@ -148,7 +147,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -164,7 +163,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -180,7 +179,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -192,4 +191,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKP.md b/docs/api/2d/classes/FCharacterControllerKP.md index b5d82952..ddc795a4 100644 --- a/docs/api/2d/classes/FCharacterControllerKP.md +++ b/docs/api/2d/classes/FCharacterControllerKP.md @@ -42,63 +42,62 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) +[2d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerKP.ts#L21) ## Methods -### getCorrectedMovements() +### frame() -> **getCorrectedMovements**(): `object` +> **frame**(`delta`): `void` -Return the corrected movements for the current frame. - -#### Returns +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -`object` +#### Parameters -##### x +• **delta**: `number` -> **x**: `number` +The time since the last frame. -##### y +#### Returns -> **y**: `number` +`void` -#### Inherited from +#### Overrides -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) +[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame) #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) *** -### onFrame() +### getCorrectedMovements() -> **onFrame**(`delta`): `void` +> **getCorrectedMovements**(): `object` -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. +Return the corrected movements for the current frame. -#### Parameters +#### Returns -• **delta**: `number` +`object` -The time since the last frame. +##### x -#### Returns +> **x**: `number` -`void` +##### y -#### Overrides +> **y**: `number` + +#### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) #### Defined in -[2d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKP.ts#L32) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L44) ## Properties @@ -114,7 +113,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +130,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +162,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +178,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +194,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +210,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCharacterControllerKV.md b/docs/api/2d/classes/FCharacterControllerKV.md index fbbdb69c..d445a7c6 100644 --- a/docs/api/2d/classes/FCharacterControllerKV.md +++ b/docs/api/2d/classes/FCharacterControllerKV.md @@ -42,63 +42,62 @@ scene.addComponent(capsule) #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) +[2d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerKV.ts#L21) ## Methods -### getCorrectedMovements() +### frame() -> **getCorrectedMovements**(): `object` +> **frame**(`delta`): `void` -Return the corrected movements for the current frame. - -#### Returns +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -`object` +#### Parameters -##### x +• **delta**: `number` -> **x**: `number` +The time since the last frame. -##### y +#### Returns -> **y**: `number` +`void` -#### Inherited from +#### Overrides -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) +[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame) #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L44) +[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) *** -### onFrame() +### getCorrectedMovements() -> **onFrame**(`delta`): `void` +> **getCorrectedMovements**(): `object` -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. +Return the corrected movements for the current frame. -#### Parameters +#### Returns -• **delta**: `number` +`object` -The time since the last frame. +##### x -#### Returns +> **x**: `number` -`void` +##### y -#### Overrides +> **y**: `number` + +#### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) #### Defined in -[2d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerKV.ts#L32) +[2d/src/controllers/FCharacterControllerK.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L44) ## Properties @@ -114,7 +113,7 @@ The character controller that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L20) +[2d/src/controllers/FCharacterControllerK.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L20) *** @@ -131,7 +130,7 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) *** @@ -163,7 +162,7 @@ The inputs that will be used to move the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L21) +[2d/src/controllers/FCharacterController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L21) *** @@ -179,7 +178,7 @@ The scene where the character is. #### Defined in -[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L36) +[2d/src/controllers/FCharacterController.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L36) *** @@ -195,7 +194,7 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L31) +[2d/src/controllers/FCharacterController.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L31) *** @@ -211,4 +210,4 @@ The y velocity of the character. Used to simulate gravity. #### Defined in -[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterControllerK.ts#L15) +[2d/src/controllers/FCharacterControllerK.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterControllerK.ts#L15) diff --git a/docs/api/2d/classes/FCircle.md b/docs/api/2d/classes/FCircle.md index e3c35492..ef772bf4 100644 --- a/docs/api/2d/classes/FCircle.md +++ b/docs/api/2d/classes/FCircle.md @@ -19,247 +19,181 @@ scene.addComponent(circle) - [`FPolygon`](FPolygon.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FCircle() -> `set` **position**(`p`): `void` +> **new FCircle**(`scene`, `options`?): [`FCircle`](FCircle.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FCircle`](FCircle.md) -#### Inherited from +#### Overrides -[`FPolygon`](FPolygon.md).[`position`](FPolygon.md#position) +[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) - -*** +[2d/src/polygons/FCircle.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FCircle.ts#L23) -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`rotation`](FPolygon.md#rotation) +[`FPolygon`](FPolygon.md).[`__SET_POSITION__`](FPolygon.md#__set_position__) #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree - -> `get` **rotationDegree**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`rotationDegree`](FPolygon.md#rotationdegree) +[`FPolygon`](FPolygon.md).[`__SET_ROTATION__`](FPolygon.md#__set_rotation__) #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale +### \_\_SET\_SCALE\_\_() -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`scale`](FPolygon.md#scale) +[`FPolygon`](FPolygon.md).[`__SET_SCALE__`](FPolygon.md#__set_scale__) #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/core/FComponent.ts:235](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L235) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`scaleX`](FPolygon.md#scalex) - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY - -> `get` **scaleY**(): `number` +• **initiator**: `boolean` = `false` -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`scaleY`](FPolygon.md#scaley) +[`FPolygon`](FPolygon.md).[`__UPDATE_POSITION__`](FPolygon.md#__update_position__) #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`x`](FPolygon.md#x) +[`FPolygon`](FPolygon.md).[`__UPDATE_ROTATION__`](FPolygon.md#__update_rotation__) #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y +### \_\_UPDATE\_SCALE\_\_() -> `get` **y**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **y**(`y`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`y`](FPolygon.md#y) - -#### Defined in - -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) - -## Constructors - -### new FCircle() - -> **new FCircle**(`scene`, `options`?): [`FCircle`](FCircle.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FCircle`](FCircle.md) +`void` -#### Overrides +#### Inherited from -[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) +[`FPolygon`](FPolygon.md).[`__UPDATE_SCALE__`](FPolygon.md#__update_scale__) #### Defined in -[2d/src/polygons/FCircle.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L21) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -309,130 +243,96 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** -### initCollider() +### emitOnLoaded() -> **initCollider**(`options`?): `void` +> **emitOnLoaded**(): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Emit the onLoaded callbacks. -#### Parameters +#### Returns -• **options?** +`void` + +#### Inherited from -The options for the collider. +[`FPolygon`](FPolygon.md).[`emitOnLoaded`](FPolygon.md#emitonloaded) -• **options.position?**: `PointData` +#### Defined in -The position of the collider. +core/dist/index.d.ts:247 -• **options.rotation?**: `number` +*** -The rotation of the collider. +### frame() -• **options.scale?**: `PointData` +> **frame**(`_delta`): `void` -The scale of the collider. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. -• **options.shape?**: [`FShapes`](../enumerations/FShapes.md) +#### Parameters -The shape of the collider. +• **\_delta**: `number` #### Returns `void` -#### Example - -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - -#### Overrides +#### Inherited from -[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider) +[`FPolygon`](FPolygon.md).[`frame`](FPolygon.md#frame) #### Defined in -[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L51) +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) *** -### initRigidBody() - -> **initRigidBody**(`options`?): `void` +### initCollider() -Init a rigidBody for the model. +> **initCollider**(`options`?): `void` #### Parameters -• **options?** - -The options for the rigidBody. - -• **options.enabledTranslations?** - -Enable only specific translations of the rigidBody. - -• **options.enabledTranslations.enableX?**: `boolean` - -• **options.enabledTranslations.enableY?**: `boolean` - -• **options.lockRotations?**: `boolean` +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -Lock the rotations of the rigidBody. +#### Returns -• **options.lockTranslations?**: `boolean` +`void` -Lock the translations of the rigidBody. +#### Overrides -• **options.position?**: `PointData` +[`FPolygon`](FPolygon.md).[`initCollider`](FPolygon.md#initcollider) -The position of the rigidBody. +#### Defined in -• **options.rotation?**: `number` +[2d/src/polygons/FCircle.ts:37](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FCircle.ts#L37) -The rotation of the rigidBody. +*** -• **options.scale?**: `PointData` +### initRigidBody() -The scale of the rigidBody. +> **initRigidBody**(`options`?): `void` -• **options.shape?**: [`FShapes`](../enumerations/FShapes.md) +#### Parameters -The shape of the rigidBody. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Overrides [`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody) #### Defined in -[2d/src/polygons/FCircle.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L33) +[2d/src/polygons/FCircle.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FCircle.ts#L44) *** @@ -440,37 +340,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - -#### Inherited from +#### Overrides [`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor) #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/polygons/FCircle.ts:51](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FCircle.ts#L51) *** @@ -524,198 +408,128 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe) #### Defined in -[2d/src/polygons/FCircle.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FCircle.ts#L29) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` +• **callback** -The y position. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - #### Inherited from -[`FPolygon`](FPolygon.md).[`setPosition`](FPolygon.md#setposition) +[`FPolygon`](FPolygon.md).[`onLoaded`](FPolygon.md#onloaded) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -Set the rotation of the component in radians. +core/dist/index.d.ts:243 -#### Parameters - -• **r**: `number` +## Properties -The rotation in radians. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotation(Math.PI / 2) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FPolygon`](FPolygon.md).[`setRotation`](FPolygon.md#setrotation) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) #### Defined in -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -Set the rotation of the component in degrees. - -#### Parameters - -• **r**: `number` - -The rotation in degrees. +### \_\_CALLBACKS\_ON\_FRAME\_\_ -#### Returns - -`void` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Example - -```ts -component.setRotationDegree(90) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FPolygon`](FPolygon.md).[`setRotationDegree`](FPolygon.md#setrotationdegree) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_FRAME__`](FPolygon.md#__callbacks_on_frame__) #### Defined in -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Example +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -```ts -component.setScale({ x: 1, y: 1 }) -``` +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FPolygon`](FPolygon.md).[`setScale`](FPolygon.md#setscale) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_LOADED__`](FPolygon.md#__callbacks_on_loaded__) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +core/dist/index.d.ts:211 -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CONTAINER\_\_ -#### Index Signature +> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\> - \[`key`: `string`\]: (`data`) => `void`[] +PIXI container #### Inherited from -[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) +[`FPolygon`](FPolygon.md).[`__CONTAINER__`](FPolygon.md#__container__) #### Defined in -core/dist/index.d.ts:58 +[2d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L44) *** @@ -732,7 +546,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -748,7 +562,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -764,7 +578,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -780,23 +594,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`container`](FPolygon.md#container) - -#### Defined in - -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -812,7 +610,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -828,7 +626,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -844,7 +642,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -860,7 +658,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -876,4 +674,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FCollider.md b/docs/api/2d/classes/FCollider.md index 35f619f8..ae3c0ec8 100644 --- a/docs/api/2d/classes/FCollider.md +++ b/docs/api/2d/classes/FCollider.md @@ -6,201 +6,37 @@ A 2d collider that can be attached to a component. ## Accessors -### position - -> `get` **position**(): `object` - -> `set` **position**(`position`): `void` - -#### Parameters - -• **position** - -• **position.x**: `number` - -• **position.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Defined in - -[2d/src/core/FCollider.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L223) - -*** - -### rotation - -> `get` **rotation**(): `number` - -> `set` **rotation**(`rotation`): `void` - -#### Parameters - -• **rotation**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FCollider.ts:247](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L247) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`rotation`): `void` - -#### Parameters - -• **rotation**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FCollider.ts:255](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L255) - -*** - -### scale - -> `get` **scale**(): `object` - -> `set` **scale**(`scale`): `void` - -#### Parameters - -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -#### Defined in - -[2d/src/core/FCollider.ts:263](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L263) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FCollider.ts:285](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L285) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FCollider.ts:293](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L293) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FCollider.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L231) - -*** - -### y +### component -> `get` **y**(): `number` +> `get` **component**(): `undefined` \| [`FComponent`](FComponent.md) -> `set` **y**(`y`): `void` +> `set` **component**(`component`): `void` #### Parameters -• **y**: `number` +• **component**: `undefined` \| [`FComponent`](FComponent.md) #### Returns -`number` +`undefined` \| [`FComponent`](FComponent.md) #### Defined in -[2d/src/core/FCollider.ts:239](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L239) +[2d/src/core/FCollider.ts:270](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L270) ## Constructors ### new FCollider() -> **new FCollider**(`component`, `options`?): [`FCollider`](FCollider.md) +> **new FCollider**(`scene`, `options`?): [`FCollider`](FCollider.md) Creates a collider for a given component. #### Parameters -• **component**: [`FComponent`](FComponent.md) +• **scene**: [`FScene`](FScene.md) -The component which the collider will be attached to. +The scene the collider belongs to. • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) @@ -213,53 +49,44 @@ The options for the collider. #### Example ```ts -const collider = new FCollider(component, { - position: { x: 0, y: 1 }, +const collider = new FCollider(scene, { + position: { x: 0, y: 0 }, scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.RECTANGLE + shape: FShapes.CIRCLE }) ``` #### Defined in -[2d/src/core/FCollider.ts:70](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L70) +[2d/src/core/FCollider.ts:71](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L71) ## Methods -### setPosition() +### \_\_SET\_POSITION\_\_() -> **setPosition**(`position`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` Set the position of the collider. #### Parameters -• **position** +• **position**: [`FVector2`](../interfaces/FVector2.md) The new position of the collider. -• **position.x**: `number` - -The new x position of the collider. - -• **position.y**: `number` - -The new y position of the collider. - #### Returns `void` #### Defined in -[2d/src/core/FCollider.ts:154](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L154) +[2d/src/core/FCollider.ts:233](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L233) *** -### setRotation() +### \_\_SET\_ROTATION\_\_() -> **setRotation**(`rotation`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` Set the rotation of the collider. @@ -267,7 +94,7 @@ Set the rotation of the collider. • **rotation**: `number` -The new rotation of the collider. +The new rotation of the collider in degrees. #### Returns @@ -275,21 +102,21 @@ The new rotation of the collider. #### Defined in -[2d/src/core/FCollider.ts:162](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L162) +[2d/src/core/FCollider.ts:242](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L242) *** -### setRotationDegree() +### \_\_SET\_SCALE\_\_() -> **setRotationDegree**(`rotation`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` -Set the rotation of the collider in degrees. +Set the scale of the collider. #### Parameters -• **rotation**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) -The new rotation of the collider in degrees. +The new scale of the collider. #### Returns @@ -297,29 +124,24 @@ The new rotation of the collider in degrees. #### Defined in -[2d/src/core/FCollider.ts:170](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L170) +[2d/src/core/FCollider.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L251) *** -### setScale() +### \_\_UPDATE\_POSITION\_\_() -> **setScale**(`scale`): `void` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -Set the scale of the collider. +Update the position of the collider according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -The new scale of the collider. - -• **scale.x**: `number` - -The new x scale of the collider. +• **initiator**: `boolean` = `false` -• **scale.y**: `number` - -The new y scale of the collider. +By default (false), the collider won't be considered as the initiator of the position update. +This means the new position will be the position of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -327,33 +149,24 @@ The new y scale of the collider. #### Defined in -[2d/src/core/FCollider.ts:180](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L180) +[2d/src/core/FCollider.ts:152](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L152) *** -### updatePosition() - -> **updatePosition**(): `void` - -Update the position of the collider according to its component's position. -This takes into account the position offset. +### \_\_UPDATE\_ROTATION\_\_() -#### Returns +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -`void` +Update the rotation of the collider according to the transform. +This method should be called after updating the transform properties. -#### Defined in - -[2d/src/core/FCollider.ts:195](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L195) - -*** - -### updateRotation() +#### Parameters -> **updateRotation**(): `void` +• **initiator**: `boolean` = `false` -Update the rotation of the collider according to its component's rotation. -This takes into account the rotation offset. +By default (false), the collider won't be considered as the initiator of the rotation update. +This means the new rotation will be the rotation of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -361,16 +174,24 @@ This takes into account the rotation offset. #### Defined in -[2d/src/core/FCollider.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L206) +[2d/src/core/FCollider.ts:181](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L181) *** -### updateScale() +### \_\_UPDATE\_SCALE\_\_() -> **updateScale**(): `void` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -Update the scale of the collider according to its component's scale. -This takes into account the scale offset. +Update the scale of the collider according to the transform. +This method should be called after updating the transform properties. + +#### Parameters + +• **initiator**: `boolean` = `false` + +By default (false), the collider won't be considered as the initiator of the scale update. +This means the new scale will be the scale of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -378,95 +199,82 @@ This takes into account the scale offset. #### Defined in -[2d/src/core/FCollider.ts:214](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L214) - -## Properties +[2d/src/core/FCollider.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L207) -### \_\_COLLIDER\_POSITION\_OFFSET\_\_ +*** -> **\_\_COLLIDER\_POSITION\_OFFSET\_\_**: `object` +### frame() -Position Offset for the collider. -This is used to adjust the collider position relative to the component. +> **frame**(`_delta`): `void` -#### x +#### Parameters -> **x**: `number` +• **\_delta**: `number` -#### y +#### Returns -> **y**: `number` +`void` #### Defined in -[2d/src/core/FCollider.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L29) +[2d/src/core/FCollider.ts:139](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L139) -*** +## Properties -### \_\_COLLIDER\_ROTATION\_OFFSET\_\_ +### \_\_COLLIDER\_\_ -> **\_\_COLLIDER\_ROTATION\_OFFSET\_\_**: `number` +> **\_\_COLLIDER\_\_**: `Collider` -Rotation Offset for the collider. -This is used to adjust the collider position relative to the component. +RAPIER Collider #### Defined in -[2d/src/core/FCollider.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L34) +[2d/src/core/FCollider.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L31) *** -### \_\_COLLIDER\_SCALE\_OFFSET\_\_ - -> **\_\_COLLIDER\_SCALE\_OFFSET\_\_**: `object` +### \_\_COMPONENT\_\_? -Scale Offset for the collider. -This is used to adjust the collider scale relative to the component. +> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md) -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +The component the collider is attached to. #### Defined in -[2d/src/core/FCollider.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L39) +[2d/src/core/FCollider.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L35) *** -### \_\_COLLIDER\_\_ +### offset -> **\_\_COLLIDER\_\_**: `Collider` +> **offset**: [`FTransform`](FTransform.md) -RAPIER Collider +The transform offset of the collider. #### Defined in -[2d/src/core/FCollider.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L24) +[2d/src/core/FCollider.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L43) *** -### component +### shape -> **component**: [`FComponent`](FComponent.md) +> **shape**: [`FShapes`](../enumerations/FShapes.md) -The component the collider is attached to. +The shape of the collider. #### Defined in -[2d/src/core/FCollider.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L43) +[2d/src/core/FCollider.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L47) *** -### shape +### transform -> **shape**: [`FShapes`](../enumerations/FShapes.md) +> **transform**: [`FTransform`](FTransform.md) -The shape of the collider. +The transform of the collider. #### Defined in -[2d/src/core/FCollider.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L47) +[2d/src/core/FCollider.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L39) diff --git a/docs/api/2d/classes/FComponent.md b/docs/api/2d/classes/FComponent.md index f31cb2fc..479e41a8 100644 --- a/docs/api/2d/classes/FComponent.md +++ b/docs/api/2d/classes/FComponent.md @@ -14,219 +14,161 @@ The base class for all 2D components in Fibbo. - [`FPolygon`](FPolygon.md) - [`FSprite`](FSprite.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FComponent() -> `set` **position**(`p`): `void` +> **new FComponent**(`scene`, `options`?): [`FComponent`](FComponent.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +The 2D scene where the component will be added. -#### Returns +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) -`object` +The options for the component. -##### x +#### Returns -> **x**: `number` +[`FComponent`](FComponent.md) -##### y +#### Overrides -> **y**: `number` +`FComponentCore.constructor` #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) +[2d/src/core/FComponent.ts:73](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L73) -*** - -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree +### \_\_SET\_ROTATION\_\_() -> `get` **rotationDegree**(): `number` - -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale - -> `get` **scale**(): `object` +### \_\_SET\_SCALE\_\_() -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/core/FComponent.ts:235](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L235) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters +• **initiator**: `boolean` = `false` -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) +### \_\_UPDATE\_SCALE\_\_() -## Constructors +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -### new FComponent() - -> **new FComponent**(`scene`, `options`?): [`FComponent`](FComponent.md) +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scene**: [`FScene`](FScene.md) - -The 2D scene where the component will be added. +• **initiator**: `boolean` = `false` -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -The options for the component. +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FComponent`](FComponent.md) - -#### Overrides - -`FComponentCore.constructor` +`void` #### Defined in -[2d/src/core/FComponent.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L71) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -276,41 +218,70 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** -### initCollider() +### emitOnLoaded() -> **initCollider**(`options`?): `void` +> **emitOnLoaded**(): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Emit the onLoaded callbacks. -#### Parameters +#### Returns -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) +`void` -The options for the collider. +#### Inherited from + +`FComponentCore.emitOnLoaded` + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`_delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **\_delta**: `number` #### Returns `void` -#### Example +#### Overrides -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` +`FComponentCore.frame` #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FComponent.ts:253](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L253) *** @@ -318,32 +289,17 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the model. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L259) *** @@ -351,33 +307,17 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:265](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L265) *** @@ -431,182 +371,124 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from `FComponentCore.onFrame` #### Defined in -[2d/src/core/FComponent.ts:104](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L104) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` +• **callback** -The y position. +The callback function. #### Returns `void` -#### Example +#### Inherited from -```ts -component.setPosition({ x: 0, y: 0 }) -``` +`FComponentCore.onLoaded` #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` +core/dist/index.d.ts:243 -Set the rotation of the component in radians. +## Properties -#### Parameters +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -• **r**: `number` +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -The rotation in radians. +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. -#### Returns +#### Index Signature -`void` + \[`key`: `string`\]: (`data`) => `void`[] -#### Example +#### Inherited from -```ts -component.setRotation(Math.PI / 2) -``` +`FComponentCore.__CALLBACKS_ON_COLLISION__` #### Defined in -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) +core/dist/index.d.ts:216 *** -### setRotationDegree() +### \_\_CALLBACKS\_ON\_FRAME\_\_ -> **setRotationDegree**(`r`): `void` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -Set the rotation of the component in degrees. +Callbacks for when a frame is rendered. -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Example +#### Inherited from -```ts -component.setRotationDegree(90) -``` +`FComponentCore.__CALLBACKS_ON_FRAME__` #### Defined in -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -• **options.x**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -The x scale. +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Example +#### Inherited from -```ts -component.setScale({ x: 1, y: 1 }) -``` +`FComponentCore.__CALLBACKS_ON_LOADED__` #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +core/dist/index.d.ts:211 -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature +*** - \[`key`: `string`\]: (`data`) => `void`[] +### \_\_CONTAINER\_\_ -#### Inherited from +> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\> -`FComponentCore.__CALLBACKS_ON_COLLISION__` +PIXI container #### Defined in -core/dist/index.d.ts:58 +[2d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L44) *** @@ -623,7 +505,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -639,7 +521,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -655,7 +537,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -667,19 +549,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Defined in - -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -695,7 +565,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -707,7 +577,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -717,9 +587,13 @@ RAPIER RigidBody The scene which the component is in. +#### Overrides + +`FComponentCore.scene` + #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -731,7 +605,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -743,4 +617,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FComponentEmpty.md b/docs/api/2d/classes/FComponentEmpty.md index a125ab27..ed2283e6 100644 --- a/docs/api/2d/classes/FComponentEmpty.md +++ b/docs/api/2d/classes/FComponentEmpty.md @@ -2,253 +2,187 @@ # Class: FComponentEmpty -An empty component. The container is empty. +An empty component. The PIXI container will be empty. ## Extends - [`FComponent`](FComponent.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FComponentEmpty() -> `set` **position**(`p`): `void` +> **new FComponentEmpty**(`scene`, `options`?): [`FComponentEmpty`](FComponentEmpty.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FComponentEmpty`](FComponentEmpty.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) - -*** +[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponentEmpty.ts#L10) -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree - -> `get` **rotationDegree**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale +### \_\_SET\_SCALE\_\_() -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/core/FComponent.ts:235](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L235) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY +• **initiator**: `boolean` = `false` -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y +### \_\_UPDATE\_SCALE\_\_() -> `get` **y**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **y**(`y`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) - -#### Defined in - -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) - -## Constructors - -### new FComponentEmpty() - -> **new FComponentEmpty**(`scene`, `options`?): [`FComponentEmpty`](FComponentEmpty.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FComponentEmpty`](FComponentEmpty.md) +`void` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[2d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponentEmpty.ts#L10) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -298,37 +232,66 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** -### initCollider() +### emitOnLoaded() -> **initCollider**(`options`?): `void` +> **emitOnLoaded**(): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Emit the onLoaded callbacks. -#### Parameters +#### Returns -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) +`void` -The options for the collider. +#### Inherited from + +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`_delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) + +#### Defined in + +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -336,7 +299,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:253](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L253) *** @@ -344,36 +307,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the model. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L259) *** @@ -381,37 +329,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:265](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L265) *** @@ -465,198 +397,128 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) #### Defined in -[2d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponentEmpty.ts#L14) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` +• **callback** -The y position. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() +core/dist/index.d.ts:243 -> **setRotation**(`r`): `void` - -Set the rotation of the component in radians. - -#### Parameters - -• **r**: `number` +## Properties -The rotation in radians. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotation(Math.PI / 2) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) #### Defined in -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -Set the rotation of the component in degrees. - -#### Parameters - -• **r**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The rotation in degrees. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Returns - -`void` - -#### Example - -```ts -component.setRotationDegree(90) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) #### Defined in -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) - -## Properties +core/dist/index.d.ts:211 -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CONTAINER\_\_ -#### Index Signature +> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\> - \[`key`: `string`\]: (`data`) => `void`[] +PIXI container #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__) #### Defined in -core/dist/index.d.ts:58 +[2d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L44) *** @@ -673,7 +535,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -689,7 +551,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -705,7 +567,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -721,23 +583,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FComponent`](FComponent.md).[`container`](FComponent.md#container) - -#### Defined in - -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -753,7 +599,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -769,7 +615,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -785,7 +631,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -801,7 +647,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -817,4 +663,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FController.md b/docs/api/2d/classes/FController.md index 79fff9f8..09eafe34 100644 --- a/docs/api/2d/classes/FController.md +++ b/docs/api/2d/classes/FController.md @@ -34,17 +34,16 @@ The options for the controller. #### Defined in -[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L23) +[2d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L23) ## Methods -### onFrame() +### frame() -> `abstract` **onFrame**(`delta`): `void` +> `abstract` **frame**(`delta`): `void` 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. +The purpose of this method is to update the component transform based on the controller logic. #### Parameters @@ -58,11 +57,11 @@ The time since the last frame. #### Inherited from -`FControllerCore.onFrame` +`FControllerCore.frame` #### Defined in -core/dist/index.d.ts:27 +core/dist/index.d.ts:26 ## Properties @@ -79,4 +78,4 @@ It is redefined here to get the correct type (with 2D properties). #### Defined in -[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L17) +[2d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L17) diff --git a/docs/api/2d/classes/FFixedCamera.md b/docs/api/2d/classes/FFixedCamera.md index 91693e12..fcba6cfd 100644 --- a/docs/api/2d/classes/FFixedCamera.md +++ b/docs/api/2d/classes/FFixedCamera.md @@ -30,7 +30,7 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L10) +[2d/src/cameras/FFixedCamera.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FFixedCamera.ts#L10) ## Methods @@ -48,7 +48,97 @@ A fixed camera. #### Defined in -[2d/src/cameras/FFixedCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L17) +[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FFixedCamera.ts#L14) + +*** + +### \_\_SET\_POSITION\_\_() + +> **\_\_SET\_POSITION\_\_**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L88) + +*** + +### \_\_UPDATE\_POSITION\_\_() + +> **\_\_UPDATE\_POSITION\_\_**(): `void` + +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L67) + +*** + +### \_\_UPDATE\_ROTATION\_\_() + +> **\_\_UPDATE\_ROTATION\_\_**(): `void` + +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:75](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L75) + +*** + +### \_\_UPDATE\_SCALE\_\_() + +> **\_\_UPDATE\_SCALE\_\_**(): `void` + +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L84) *** @@ -100,7 +190,54 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) + +#### Defined in + +core/dist/index.d.ts:233 *** @@ -154,33 +291,59 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:270 *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -[2d/src/cameras/FFixedCamera.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFixedCamera.ts#L14) +core/dist/index.d.ts:238 + +*** + +### onLoaded() + +> **onLoaded**(`callback`): `void` + +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + +#### Parameters + +• **callback** + +The callback function. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) + +#### Defined in + +core/dist/index.d.ts:243 *** @@ -188,8 +351,6 @@ Any changes on its transform should be done on the controller, not here. > **setZoom**(`zoom`): `void` -Set the zoom of the camera. - #### Parameters • **zoom**: `number` @@ -204,7 +365,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L59) ## Properties @@ -225,7 +386,39 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:216 + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] + +Callbacks for when a frame is rendered. + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) + +#### Defined in + +core/dist/index.d.ts:207 + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) + +#### Defined in + +core/dist/index.d.ts:211 *** @@ -242,7 +435,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -258,7 +451,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L17) *** @@ -274,7 +467,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -290,44 +483,38 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:64 +core/dist/index.d.ts:226 *** -### position - -> **position**: `object` - -Position of the camera. - -#### x - -> **x**: `number` +### scene -#### y +> **scene**: [`FScene`](FScene.md) -> **y**: `number` +The scene the camera is in. #### Inherited from -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L22) *** -### scene +### transform -> **scene**: [`FScene`](FScene.md) +> **transform**: [`FTransform`](FTransform.md) -The scene the camera is in. +Transform of the camera. +It is used to store the position of the camera. +The scale and rotation of the transform are not used. #### Inherited from -[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/2d/classes/FFreeCamera.md b/docs/api/2d/classes/FFreeCamera.md index 1fc5801c..4c2eb414 100644 --- a/docs/api/2d/classes/FFreeCamera.md +++ b/docs/api/2d/classes/FFreeCamera.md @@ -30,7 +30,7 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L10) +[2d/src/cameras/FFreeCamera.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FFreeCamera.ts#L10) ## Methods @@ -48,7 +48,97 @@ A free camera that can be moved around. #### Defined in -[2d/src/cameras/FFreeCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L17) +[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FFreeCamera.ts#L14) + +*** + +### \_\_SET\_POSITION\_\_() + +> **\_\_SET\_POSITION\_\_**(`position`): `void` + +#### Parameters + +• **position** + +• **position.x**: `number` + +• **position.y**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__SET_POSITION__`](FCamera.md#__set_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L88) + +*** + +### \_\_UPDATE\_POSITION\_\_() + +> **\_\_UPDATE\_POSITION\_\_**(): `void` + +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:67](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L67) + +*** + +### \_\_UPDATE\_ROTATION\_\_() + +> **\_\_UPDATE\_ROTATION\_\_**(): `void` + +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:75](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L75) + +*** + +### \_\_UPDATE\_SCALE\_\_() + +> **\_\_UPDATE\_SCALE\_\_**(): `void` + +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) + +#### Defined in + +[2d/src/cameras/FCamera.ts:84](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L84) *** @@ -100,7 +190,54 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) + +#### Defined in + +core/dist/index.d.ts:233 *** @@ -154,33 +291,59 @@ player.onCollisionWith(enemy, () => { #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:270 *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -[2d/src/cameras/FFreeCamera.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FFreeCamera.ts#L14) +core/dist/index.d.ts:238 + +*** + +### onLoaded() + +> **onLoaded**(`callback`): `void` + +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + +#### Parameters + +• **callback** + +The callback function. + +#### Returns + +`void` + +#### Inherited from + +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) + +#### Defined in + +core/dist/index.d.ts:243 *** @@ -188,8 +351,6 @@ Any changes on its transform should be done on the controller, not here. > **setZoom**(`zoom`): `void` -Set the zoom of the camera. - #### Parameters • **zoom**: `number` @@ -204,7 +365,7 @@ Set the zoom of the camera. #### Defined in -[2d/src/cameras/FCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L57) +[2d/src/cameras/FCamera.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L59) ## Properties @@ -225,7 +386,39 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:216 + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] + +Callbacks for when a frame is rendered. + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) + +#### Defined in + +core/dist/index.d.ts:207 + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) + +#### Defined in + +core/dist/index.d.ts:211 *** @@ -242,7 +435,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -258,7 +451,7 @@ Internal flags #### Defined in -[2d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L16) +[2d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L17) *** @@ -274,7 +467,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -290,44 +483,38 @@ The controller attached to the component. #### Defined in -core/dist/index.d.ts:64 +core/dist/index.d.ts:226 *** -### position - -> **position**: `object` - -Position of the camera. - -#### x - -> **x**: `number` +### scene -#### y +> **scene**: [`FScene`](FScene.md) -> **y**: `number` +The scene the camera is in. #### Inherited from -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -[2d/src/cameras/FCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L27) +[2d/src/cameras/FCamera.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L22) *** -### scene +### transform -> **scene**: [`FScene`](FScene.md) +> **transform**: [`FTransform`](FTransform.md) -The scene the camera is in. +Transform of the camera. +It is used to store the position of the camera. +The scale and rotation of the transform are not used. #### Inherited from -[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) +[`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[2d/src/cameras/FCamera.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L21) +[2d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/2d/classes/FLight.md b/docs/api/2d/classes/FLight.md index de1876a5..91e2c8e8 100644 --- a/docs/api/2d/classes/FLight.md +++ b/docs/api/2d/classes/FLight.md @@ -26,7 +26,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L88) +[2d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L107) *** @@ -46,7 +46,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:96](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L96) +[2d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L115) *** @@ -78,7 +78,7 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:100](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L100) +[2d/src/lights/FLight.ts:119](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L119) ## Constructors @@ -102,13 +102,16 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L45) +[2d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L45) ## Methods -### applyTransform() +### \_\_UPDATE\_POSITION\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` + +Update the position of the light according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -116,139 +119,87 @@ The base class for 2d lights in Fibbo. #### Defined in -[2d/src/lights/FLight.ts:75](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L75) +[2d/src/lights/FLight.ts:81](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L81) *** -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. - -#### Parameters - -• **options** - -The options for the collision event. - -• **options.class?**: `any` +### \_\_UPDATE\_ROTATION\_\_() -The class to emit the collision event with. +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -• **options.component?**: `FComponent` - -The component to emit the collision event with. +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - -#### Inherited from - -`FLightCore.emitCollisionWith` - #### Defined in -core/dist/index.d.ts:118 +[2d/src/lights/FLight.ts:89](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L89) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **classOrObject**: `any` +`void` -The class or object to add the callback to. +#### Defined in -• **callback** +[2d/src/lights/FLight.ts:97](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L97) -The callback to add. +*** -#### Returns +### emitOnLoaded() -`Function` +> **emitOnLoaded**(): `void` -A function to remove the callback. +Emit the onLoaded callbacks. -##### Returns +#### Returns `void` -#### 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 -`FLightCore.onCollisionWith` +`FLightCore.emitOnLoaded` #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> `abstract` **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -`FLightCore.onFrame` +`FLightCore.onLoaded` #### Defined in -[2d/src/lights/FLight.ts:73](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L73) +core/dist/index.d.ts:50 ## Properties @@ -256,20 +207,29 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] -#### Overrides +#### Defined in + +[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L23) + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -`FLightCore.__CALLBACKS_ON_COLLISION__` +Callbacks for when the light is loaded. + +#### Inherited from + +`FLightCore.__CALLBACKS_ON_LOADED__` #### Defined in -[2d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** @@ -277,16 +237,9 @@ It is a dictionary where the key is the class name or object id and the value is > **\_\_ID\_\_**: `number` -Unique identifier for the component. -It is generated automatically. - -#### Overrides - -`FLightCore.__ID__` - #### Defined in -[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L22) +[2d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L22) *** @@ -294,13 +247,9 @@ It is generated automatically. > **\_\_IS\_2D\_\_**: `boolean` = `true` -#### Overrides - -`FLightCore.__IS_2D__` - #### Defined in -[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L21) +[2d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L21) *** @@ -310,13 +259,21 @@ It is generated automatically. Internal flags -#### Overrides +#### Defined in -`FLightCore.__IS_3D__` +[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L20) + +*** + +### \_\_LIGHT\_\_ + +> **\_\_LIGHT\_\_**: `any` + +The original light object from PIXI.js. #### Defined in -[2d/src/lights/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L20) +[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L28) *** @@ -336,35 +293,7 @@ Look at target of the light. #### Defined in -[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L43) - -*** - -### controller? - -> `optional` **controller**: `FController` - -The controller attached to the component. - -#### Inherited from - -`FLightCore.controller` - -#### Defined in - -core/dist/index.d.ts:64 - -*** - -### light - -> **light**: `any` - -The original light object from PIXI.js. - -#### Defined in - -[2d/src/lights/FLight.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L28) +[2d/src/lights/FLight.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L43) *** @@ -374,9 +303,13 @@ The original light object from PIXI.js. Scene the light is in. +#### Overrides + +`FLightCore.scene` + #### Defined in -[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L33) +[2d/src/lights/FLight.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L33) *** @@ -388,4 +321,4 @@ Transform of the light. #### Defined in -[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L38) +[2d/src/lights/FLight.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L38) diff --git a/docs/api/2d/classes/FPolygon.md b/docs/api/2d/classes/FPolygon.md index bb8c0a0b..ed390ddd 100644 --- a/docs/api/2d/classes/FPolygon.md +++ b/docs/api/2d/classes/FPolygon.md @@ -13,247 +13,181 @@ A simple polygon in Fibbo. - [`FCircle`](FCircle.md) - [`FRectangle`](FRectangle.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FPolygon() -> `set` **position**(`p`): `void` +> **new FPolygon**(`scene`, `options`?): [`FPolygon`](FPolygon.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FPolygon`](FPolygon.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) - -*** +[2d/src/polygons/FPolygon.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FPolygon.ts#L10) -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree - -> `get` **rotationDegree**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale +### \_\_SET\_SCALE\_\_() -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/core/FComponent.ts:235](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L235) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY - -> `get` **scaleY**(): `number` +• **initiator**: `boolean` = `false` -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +### \_\_UPDATE\_SCALE\_\_() -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) - -#### Defined in +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) - -## Constructors - -### new FPolygon() - -> **new FPolygon**(`scene`, `options`?): [`FPolygon`](FPolygon.md) +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scene**: [`FScene`](FScene.md) +• **initiator**: `boolean` = `false` -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FPolygon`](FPolygon.md) +`void` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[2d/src/polygons/FPolygon.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FPolygon.ts#L11) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -303,37 +237,66 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** -### initCollider() +### emitOnLoaded() -> **initCollider**(`options`?): `void` +> **emitOnLoaded**(): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Emit the onLoaded callbacks. -#### Parameters +#### Returns -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) +`void` + +#### Inherited from + +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`_delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. -The options for the collider. +#### Parameters + +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) + +#### Defined in + +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -341,7 +304,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:253](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L253) *** @@ -349,36 +312,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the model. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L259) *** @@ -386,37 +334,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:265](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L265) *** @@ -470,198 +402,128 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) #### Defined in -[2d/src/polygons/FPolygon.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FPolygon.ts#L21) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` +• **callback** -The y position. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() +core/dist/index.d.ts:243 -> **setRotation**(`r`): `void` - -Set the rotation of the component in radians. - -#### Parameters - -• **r**: `number` +## Properties -The rotation in radians. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotation(Math.PI / 2) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) #### Defined in -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -Set the rotation of the component in degrees. - -#### Parameters - -• **r**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The rotation in degrees. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Returns - -`void` - -#### Example - -```ts -component.setRotationDegree(90) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) #### Defined in -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) - -## Properties +core/dist/index.d.ts:211 -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CONTAINER\_\_ -#### Index Signature +> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\> - \[`key`: `string`\]: (`data`) => `void`[] +PIXI container #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__) #### Defined in -core/dist/index.d.ts:58 +[2d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L44) *** @@ -678,7 +540,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -694,7 +556,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -710,7 +572,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -726,23 +588,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FComponent`](FComponent.md).[`container`](FComponent.md#container) - -#### Defined in - -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -758,7 +604,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -774,7 +620,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -790,7 +636,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -806,7 +652,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -822,4 +668,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FRectangle.md b/docs/api/2d/classes/FRectangle.md index 56d45ee8..c5414e6a 100644 --- a/docs/api/2d/classes/FRectangle.md +++ b/docs/api/2d/classes/FRectangle.md @@ -19,247 +19,181 @@ scene.addComponent(square) - [`FPolygon`](FPolygon.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FRectangle() -> `set` **position**(`p`): `void` +> **new FRectangle**(`scene`, `options`?): [`FRectangle`](FRectangle.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FRectangle`](FRectangle.md) -#### Inherited from +#### Overrides -[`FPolygon`](FPolygon.md).[`position`](FPolygon.md#position) +[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) - -*** +[2d/src/polygons/FRectangle.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FRectangle.ts#L21) -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`rotation`](FPolygon.md#rotation) +[`FPolygon`](FPolygon.md).[`__SET_POSITION__`](FPolygon.md#__set_position__) #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree - -> `get` **rotationDegree**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`rotationDegree`](FPolygon.md#rotationdegree) +[`FPolygon`](FPolygon.md).[`__SET_ROTATION__`](FPolygon.md#__set_rotation__) #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale +### \_\_SET\_SCALE\_\_() -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` -#### Inherited from +#### Overrides -[`FPolygon`](FPolygon.md).[`scale`](FPolygon.md#scale) +[`FPolygon`](FPolygon.md).[`__SET_SCALE__`](FPolygon.md#__set_scale__) #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/polygons/FRectangle.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/polygons/FRectangle.ts#L35) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`scaleX`](FPolygon.md#scalex) - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY - -> `get` **scaleY**(): `number` +• **initiator**: `boolean` = `false` -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`scaleY`](FPolygon.md#scaley) +[`FPolygon`](FPolygon.md).[`__UPDATE_POSITION__`](FPolygon.md#__update_position__) #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolygon`](FPolygon.md).[`x`](FPolygon.md#x) +[`FPolygon`](FPolygon.md).[`__UPDATE_ROTATION__`](FPolygon.md#__update_rotation__) #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y +### \_\_UPDATE\_SCALE\_\_() -> `get` **y**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **y**(`y`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns +• **initiator**: `boolean` = `false` -`number` - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`y`](FPolygon.md#y) - -#### Defined in - -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) - -## Constructors - -### new FRectangle() - -> **new FRectangle**(`scene`, `options`?): [`FRectangle`](FRectangle.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FRectangle`](FRectangle.md) +`void` -#### Overrides +#### Inherited from -[`FPolygon`](FPolygon.md).[`constructor`](FPolygon.md#constructors) +[`FPolygon`](FPolygon.md).[`__UPDATE_SCALE__`](FPolygon.md#__update_scale__) #### Defined in -[2d/src/polygons/FRectangle.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FRectangle.ts#L19) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -309,37 +243,66 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** -### initCollider() +### emitOnLoaded() -> **initCollider**(`options`?): `void` +> **emitOnLoaded**(): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Emit the onLoaded callbacks. -#### Parameters +#### Returns -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) +`void` -The options for the collider. +#### Inherited from + +[`FPolygon`](FPolygon.md).[`emitOnLoaded`](FPolygon.md#emitonloaded) + +#### Defined in + +core/dist/index.d.ts:247 + +*** + +### frame() + +> **frame**(`_delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` +[`FPolygon`](FPolygon.md).[`frame`](FPolygon.md#frame) + +#### Defined in + +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -347,7 +310,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:253](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L253) *** @@ -355,36 +318,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the model. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FPolygon`](FPolygon.md).[`initRigidBody`](FPolygon.md#initrigidbody) #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L259) *** @@ -392,37 +340,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FPolygon`](FPolygon.md).[`initSensor`](FPolygon.md#initsensor) #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:265](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L265) *** @@ -476,198 +408,128 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FPolygon`](FPolygon.md).[`onFrame`](FPolygon.md#onframe) #### Defined in -[2d/src/polygons/FRectangle.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/polygons/FRectangle.ts#L23) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` +• **callback** -The y position. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - #### Inherited from -[`FPolygon`](FPolygon.md).[`setPosition`](FPolygon.md#setposition) +[`FPolygon`](FPolygon.md).[`onLoaded`](FPolygon.md#onloaded) #### Defined in -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` +core/dist/index.d.ts:243 -Set the rotation of the component in radians. - -#### Parameters - -• **r**: `number` +## Properties -The rotation in radians. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotation(Math.PI / 2) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FPolygon`](FPolygon.md).[`setRotation`](FPolygon.md#setrotation) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) #### Defined in -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -Set the rotation of the component in degrees. - -#### Parameters - -• **r**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The rotation in degrees. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Returns - -`void` - -#### Example - -```ts -component.setRotationDegree(90) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FPolygon`](FPolygon.md).[`setRotationDegree`](FPolygon.md#setrotationdegree) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_FRAME__`](FPolygon.md#__callbacks_on_frame__) #### Defined in -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) +core/dist/index.d.ts:207 *** -### setScale() +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FPolygon`](FPolygon.md).[`setScale`](FPolygon.md#setscale) +[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_LOADED__`](FPolygon.md#__callbacks_on_loaded__) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +core/dist/index.d.ts:211 -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CONTAINER\_\_ -#### Index Signature +> **\_\_CONTAINER\_\_**: `Container`\<`ContainerChild`\> - \[`key`: `string`\]: (`data`) => `void`[] +PIXI container #### Inherited from -[`FPolygon`](FPolygon.md).[`__CALLBACKS_ON_COLLISION__`](FPolygon.md#__callbacks_on_collision__) +[`FPolygon`](FPolygon.md).[`__CONTAINER__`](FPolygon.md#__container__) #### Defined in -core/dist/index.d.ts:58 +[2d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L44) *** @@ -684,7 +546,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -700,7 +562,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -716,7 +578,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** @@ -732,23 +594,7 @@ RAPIER Collider #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) - -*** - -### container - -> **container**: `Container`\<`ContainerChild`\> - -PIXI container - -#### Inherited from - -[`FPolygon`](FPolygon.md).[`container`](FPolygon.md#container) - -#### Defined in - -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -764,7 +610,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -780,7 +626,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -796,7 +642,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -812,7 +658,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -828,4 +674,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FRigidBody.md b/docs/api/2d/classes/FRigidBody.md index dbdf911a..297ba12d 100644 --- a/docs/api/2d/classes/FRigidBody.md +++ b/docs/api/2d/classes/FRigidBody.md @@ -6,246 +6,167 @@ A 2d rigidBody that can be attached to a component. ## Accessors -### position +### component -> `get` **position**(): `object` +> `get` **component**(): `undefined` \| [`FComponent`](FComponent.md) -> `set` **position**(`position`): `void` +> `set` **component**(`component`): `void` #### Parameters -• **position** - -• **position.x**: `number` - -• **position.y**: `number` +• **component**: `undefined` \| [`FComponent`](FComponent.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`undefined` \| [`FComponent`](FComponent.md) #### Defined in -[2d/src/core/FRigidBody.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L223) +[2d/src/core/FRigidBody.ts:308](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L308) -*** +## Constructors -### rotation +### new FRigidBody() -> `get` **rotation**(): `number` +> **new FRigidBody**(`scene`, `options`?): [`FRigidBody`](FRigidBody.md) -> `set` **rotation**(`rotation`): `void` +Creates a rigidBody for the given component. #### Parameters -• **rotation**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FRigidBody.ts:247](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L247) - -*** +• **scene**: [`FScene`](FScene.md) -### rotationDegree +The scene the rigidBody belongs to. -> `get` **rotationDegree**(): `number` +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -> `set` **rotationDegree**(`rotation`): `void` +The options for the rigidBody. -#### Parameters +#### Returns -• **rotation**: `number` +[`FRigidBody`](FRigidBody.md) -#### Returns +#### Example -`number` +```ts +const rigidBody = new FRigidBody(scene, { + position: { x: 0, y: 0 }, + scale: { x: 1, y: 1 }, + shape: 'CUBOID' +}) +``` #### Defined in -[2d/src/core/FRigidBody.ts:255](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L255) +[2d/src/core/FRigidBody.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L82) -*** +## Methods -### scale +### \_\_SET\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_SET\_POSITION\_\_**(`position`): `void` -> `set` **scale**(`scale`): `void` +Set the position of the rigidBody. #### Parameters -• **scale** - -• **scale.x**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) -• **scale.y**: `number` +The new position of the rigidBody. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Defined in -[2d/src/core/FRigidBody.ts:263](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L263) +[2d/src/core/FRigidBody.ts:281](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L281) *** -### scaleX +### \_\_SET\_ROTATION\_\_() -> `get` **scaleX**(): `number` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` -> `set` **scaleX**(`x`): `void` +Set the rotation of the rigidBody. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[2d/src/core/FRigidBody.ts:271](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L271) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters +• **rotation**: `number` -• **y**: `number` +The new rotation of the rigidBody. #### Returns -`number` +`void` #### Defined in -[2d/src/core/FRigidBody.ts:279](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L279) +[2d/src/core/FRigidBody.ts:291](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L291) *** -### x +### \_\_SET\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` -> `set` **x**(`x`): `void` +Set the scale of the rigidBody. #### Parameters -• **x**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) + +The new scale of the rigidBody. #### Returns -`number` +`void` #### Defined in -[2d/src/core/FRigidBody.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L231) +[2d/src/core/FRigidBody.ts:301](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L301) *** -### y +### \_\_UPDATE\_POSITION\_\_() -> `get` **y**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **y**(`y`): `void` +Update the position of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Defined in +• **initiator**: `boolean` = `false` -[2d/src/core/FRigidBody.ts:239](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L239) - -## Constructors - -### new FRigidBody() - -> **new FRigidBody**(`component`, `options`?): [`FRigidBody`](FRigidBody.md) - -Creates a rigidBody for the given component. - -#### Parameters - -• **component**: [`FComponent`](FComponent.md) - -The component which the rigidBody will be attached to. - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigidBody. +By default (false), the rigidBody won't be considered as the initiator of the position update. +This means the new position will be the position of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns -[`FRigidBody`](FRigidBody.md) - -#### Example - -```ts -const rigidBody = new FRigidBody(component, { - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.RECTANGLE -}) -``` +`void` #### Defined in -[2d/src/core/FRigidBody.ts:79](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L79) +[2d/src/core/FRigidBody.ts:200](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L200) -## Methods +*** -### setPosition() +### \_\_UPDATE\_ROTATION\_\_() -> **setPosition**(`position`): `void` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -Set the position of the rigidBody. +Update the rotation of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **position** +• **initiator**: `boolean` = `false` -The new position of the rigidBody. - -• **position.x**: `number` - -The new x position of the rigidBody. - -• **position.y**: `number` - -The new y position of the rigidBody. +By default (false), the rigidBody won't be considered as the initiator of the rotation update. +This means the new rotation will be the rotation of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -253,21 +174,24 @@ The new y position of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:156](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L156) +[2d/src/core/FRigidBody.ts:229](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L229) *** -### setRotation() +### \_\_UPDATE\_SCALE\_\_() -> **setRotation**(`rotation`): `void` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -Set the rotation of the rigidBody. +Update the scale of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **rotation**: `number` +• **initiator**: `boolean` = `false` -The new rotation of the rigidBody. +By default (false), the rigidBody won't be considered as the initiator of the scale update. +This means the new scale will be the scale of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -275,21 +199,17 @@ The new rotation of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:165](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L165) +[2d/src/core/FRigidBody.ts:255](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L255) *** -### setRotationDegree() - -> **setRotationDegree**(`rotation`): `void` +### frame() -Set the rotation of the rigidBody in degrees. +> **frame**(`_delta`): `void` #### Parameters -• **rotation**: `number` - -The new rotation of the rigidBody in degrees. +• **\_delta**: `number` #### Returns @@ -297,29 +217,21 @@ The new rotation of the rigidBody in degrees. #### Defined in -[2d/src/core/FRigidBody.ts:174](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L174) +[2d/src/core/FRigidBody.ts:171](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L171) *** -### setScale() +### setAngvel() -> **setScale**(`scale`): `void` +> **setAngvel**(`velocity`): `void` -Set the scale of the rigidBody. +Set the angular velocity of the rigidBody. #### Parameters -• **scale** - -The new scale of the rigidBody. - -• **scale.x**: `number` - -The new x scale of the rigidBody. +• **velocity**: `number` -• **scale.y**: `number` - -The new y scale of the rigidBody. +The new angular velocity of the rigidBody. #### Returns @@ -327,51 +239,21 @@ The new y scale of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L186) +[2d/src/core/FRigidBody.ts:189](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L189) *** -### updatePosition() - -> **updatePosition**(): `void` +### setLinvel() -Update the position of the rigidBody according to the component's position. -This takes into account the position offset. +> **setLinvel**(`velocity`): `void` -#### Returns +Set the linear velocity of the rigidBody. -`void` - -#### Defined in - -[2d/src/core/FRigidBody.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L194) - -*** - -### updateRotation() - -> **updateRotation**(): `void` - -Update the rotation of the rigidBody according to the component's rotation. -This takes into account the rotation offset. - -#### Returns - -`void` - -#### Defined in - -[2d/src/core/FRigidBody.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L206) - -*** - -### updateScale() +#### Parameters -> **updateScale**(): `void` +• **velocity**: [`FVector2`](../interfaces/FVector2.md) -Update the scale of the rigidBody's collider according to the component's scale. -This takes into account the scale offset. -As a rigidBody does not have a scale, this will only update the attached collider's scale. +The new linear velocity of the rigidBody. #### Returns @@ -379,74 +261,64 @@ As a rigidBody does not have a scale, this will only update the attached collide #### Defined in -[2d/src/core/FRigidBody.ts:217](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L217) +[2d/src/core/FRigidBody.ts:181](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L181) ## Properties -### \_\_RIGIDBODY\_POSITION\_OFFSET\_\_ +### \_\_COMPONENT\_\_? -> **\_\_RIGIDBODY\_POSITION\_OFFSET\_\_**: `object` +> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md) -Position Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the component. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +The component the rigidBody is attached to. #### Defined in -[2d/src/core/FRigidBody.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L39) +[2d/src/core/FRigidBody.ts:46](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L46) *** -### \_\_RIGIDBODY\_ROTATION\_OFFSET\_\_ +### \_\_RIGIDBODY\_\_ -> **\_\_RIGIDBODY\_ROTATION\_OFFSET\_\_**: `number` +> **\_\_RIGIDBODY\_\_**: `RigidBody` -Rotation Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the component. +RAPIER RigidBody #### Defined in -[2d/src/core/FRigidBody.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L44) +[2d/src/core/FRigidBody.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L38) *** -### \_\_RIGIDBODY\_\_ +### collider -> **\_\_RIGIDBODY\_\_**: `RigidBody` +> **collider**: [`FCollider`](FCollider.md) -RAPIER RigidBody +Fibbo Collider #### Defined in -[2d/src/core/FRigidBody.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L30) +[2d/src/core/FRigidBody.ts:42](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L42) *** -### collider +### offset -> **collider**: [`FCollider`](FCollider.md) +> **offset**: [`FTransform`](FTransform.md) -Fibbo Collider +The transform offset of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L34) +[2d/src/core/FRigidBody.ts:54](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L54) *** -### component +### transform -> **component**: [`FComponent`](FComponent.md) +> **transform**: [`FTransform`](FTransform.md) -The component the rigidBody is attached to. +The transform of the rigidBody. #### Defined in -[2d/src/core/FRigidBody.ts:48](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L48) +[2d/src/core/FRigidBody.ts:50](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L50) diff --git a/docs/api/2d/classes/FScene.md b/docs/api/2d/classes/FScene.md index 1a52c145..a4e1bcc1 100644 --- a/docs/api/2d/classes/FScene.md +++ b/docs/api/2d/classes/FScene.md @@ -2,7 +2,7 @@ # Class: FScene -A scene which contains the models, the Pixi.js scene and the Rapier world. +A scene which contains the components, the Pixi.js scene and the Rapier world. ## Example @@ -16,7 +16,6 @@ import { FRectangle, FScene } from '@fibbojs/2d' const square = new FRectangle(scene) square.initRigidBody() - scene.addComponent(square) })() ``` @@ -48,7 +47,7 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L248) +[2d/src/core/FScene.ts:285](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L285) ## Constructors @@ -70,10 +69,28 @@ This is required so when the camera is set, its method to defined the viewport b #### Defined in -[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L59) +[2d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L63) ## Methods +### addCollider() + +> **addCollider**(`collider`): `void` + +#### Parameters + +• **collider**: [`FCollider`](FCollider.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:256](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L256) + +*** + ### addComponent() > **addComponent**(`component`): `void` @@ -94,7 +111,27 @@ Add a component to the scene. #### Defined in -[2d/src/core/FScene.ts:193](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L193) +[2d/src/core/FScene.ts:213](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L213) + +*** + +### addHandle() + +> **addHandle**(`handle`, `component`): `void` + +#### Parameters + +• **handle**: `number` + +• **component**: [`FComponent`](FComponent.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:205](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L205) *** @@ -118,7 +155,52 @@ Add a light to the scene. #### Defined in -[2d/src/core/FScene.ts:261](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L261) +[2d/src/core/FScene.ts:248](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L248) + +*** + +### addRigidBody() + +> **addRigidBody**(`rigidBody`): `void` + +#### Parameters + +• **rigidBody**: [`FRigidBody`](FRigidBody.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:267](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L267) + +*** + +### frame() + +> **frame**(`delta`): `void` + +Compute a frame with the given delta time. +By default, it is called every frame, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene. + +#### Parameters + +• **delta**: `number` + +The time in seconds since the last frame. + +#### Returns + +`void` + +#### Inherited from + +`FSceneCore.frame` + +#### Defined in + +core/dist/index.d.ts:149 *** @@ -148,7 +230,7 @@ If the collision has started or ended #### Defined in -[2d/src/core/FScene.ts:169](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L169) +[2d/src/core/FScene.ts:181](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L181) *** @@ -167,7 +249,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:77](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L77) +[2d/src/core/FScene.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L85) *** @@ -181,7 +263,7 @@ and the root stage PIXI.Container. #### Defined in -[2d/src/core/FScene.ts:138](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L138) +[2d/src/core/FScene.ts:146](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L146) *** @@ -205,7 +287,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -core/dist/index.d.ts:275 +core/dist/index.d.ts:157 *** @@ -229,7 +311,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -core/dist/index.d.ts:279 +core/dist/index.d.ts:161 *** @@ -253,7 +335,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -core/dist/index.d.ts:271 +core/dist/index.d.ts:153 *** @@ -277,7 +359,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -core/dist/index.d.ts:288 +core/dist/index.d.ts:170 *** @@ -301,7 +383,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -core/dist/index.d.ts:292 +core/dist/index.d.ts:174 *** @@ -326,7 +408,25 @@ The scene is ready when the `init` method has finished. #### Defined in -core/dist/index.d.ts:284 +core/dist/index.d.ts:166 + +*** + +### removeCollider() + +> **removeCollider**(`collider`): `void` + +#### Parameters + +• **collider**: [`FCollider`](FCollider.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:260](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L260) *** @@ -350,7 +450,25 @@ Remove a component from the scene. #### Defined in -[2d/src/core/FScene.ts:223](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L223) +[2d/src/core/FScene.ts:227](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L227) + +*** + +### removeHandle() + +> **removeHandle**(`handle`): `void` + +#### Parameters + +• **handle**: `number` + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:209](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L209) *** @@ -374,7 +492,25 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:265](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L265) +[2d/src/core/FScene.ts:252](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L252) + +*** + +### removeRigidBody() + +> **removeRigidBody**(`rigidBody`): `void` + +#### Parameters + +• **rigidBody**: [`FRigidBody`](FRigidBody.md) + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FScene.ts:271](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L271) ## Properties @@ -384,7 +520,7 @@ Remove a light from the scene. #### Defined in -[2d/src/core/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L49) +[2d/src/core/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L53) *** @@ -393,7 +529,6 @@ Remove a light from the scene. > **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[] Callbacks for when a component is added to the scene. -It is an array of functions that take the component as an argument. #### Inherited from @@ -401,7 +536,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:231 +core/dist/index.d.ts:110 *** @@ -410,7 +545,6 @@ core/dist/index.d.ts:231 > **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[] Callbacks for when a component is remove from the scene. -It is an array of functions that take the component as an argument. #### Inherited from @@ -418,7 +552,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:236 +core/dist/index.d.ts:114 *** @@ -427,7 +561,6 @@ core/dist/index.d.ts:236 > **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[] Callbacks for when a frame is rendered. -It is an array of functions that take the delta time as an argument. #### Inherited from @@ -435,7 +568,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -core/dist/index.d.ts:226 +core/dist/index.d.ts:106 *** @@ -444,7 +577,6 @@ core/dist/index.d.ts:226 > **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[] Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Inherited from @@ -452,7 +584,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:245 +core/dist/index.d.ts:122 *** @@ -461,7 +593,6 @@ core/dist/index.d.ts:245 > **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[] Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Inherited from @@ -469,7 +600,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:250 +core/dist/index.d.ts:126 *** @@ -485,7 +616,7 @@ Callbacks for when the scene is ready. #### Defined in -core/dist/index.d.ts:240 +core/dist/index.d.ts:118 *** @@ -495,7 +626,7 @@ core/dist/index.d.ts:240 #### Defined in -[2d/src/core/FScene.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L46) +[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L50) *** @@ -511,7 +642,7 @@ DOM element that the renderer will be appended to #### Defined in -core/dist/index.d.ts:202 +core/dist/index.d.ts:83 *** @@ -527,7 +658,7 @@ Internal flags #### Defined in -[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L38) +[2d/src/core/FScene.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L38) *** @@ -543,7 +674,7 @@ Internal flags #### Defined in -core/dist/index.d.ts:197 +core/dist/index.d.ts:78 *** @@ -557,7 +688,7 @@ core/dist/index.d.ts:197 #### Defined in -[2d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L57) +[2d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L61) *** @@ -567,7 +698,17 @@ core/dist/index.d.ts:197 #### Defined in -[2d/src/core/FScene.ts:50](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L50) +[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L54) + +*** + +### colliders + +> **colliders**: [`FCollider`](FCollider.md)[] + +#### Defined in + +[2d/src/core/FScene.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L45) *** @@ -583,7 +724,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L41) +[2d/src/core/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L41) *** @@ -597,7 +738,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L56) +[2d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L60) *** @@ -619,7 +760,7 @@ The components in the scene. #### Defined in -[2d/src/core/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L54) +[2d/src/core/FScene.ts:58](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L58) *** @@ -635,7 +776,17 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L43) +[2d/src/core/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L43) + +*** + +### rigidBodies + +> **rigidBodies**: [`FRigidBody`](FRigidBody.md)[] + +#### Defined in + +[2d/src/core/FScene.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L47) *** @@ -645,7 +796,7 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L51) +[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L55) *** @@ -659,4 +810,4 @@ The lights in the scene. #### Defined in -[2d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L55) +[2d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L59) diff --git a/docs/api/2d/classes/FSprite.md b/docs/api/2d/classes/FSprite.md index 25c276eb..182c18f7 100644 --- a/docs/api/2d/classes/FSprite.md +++ b/docs/api/2d/classes/FSprite.md @@ -12,254 +12,187 @@ import { FScene, FSprite } from '@fibbojs/2d' const scene = new FScene() const sprite = new FSprite(scene, '/my-texture.png') -scene.addComponent(sprite) ``` ## Extends - [`FComponent`](FComponent.md) -## Accessors - -### position +## Constructors -> `get` **position**(): `object` +### new FSprite() -> `set` **position**(`p`): `void` +> **new FSprite**(`scene`, `options`): [`FSprite`](FSprite.md) #### Parameters -• **p** - -• **p.x**: `number` +• **scene**: [`FScene`](FScene.md) -• **p.y**: `number` +• **options**: [`FSpriteOptions`](../interfaces/FSpriteOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FSprite`](FSprite.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[2d/src/core/FComponent.ts:353](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L353) - -*** +[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L33) -### rotation +## Methods -> `get` **rotation**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`r`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **r**: `number` +• **position**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[2d/src/core/FComponent.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L377) +[2d/src/core/FComponent.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L221) *** -### rotationDegree - -> `get` **rotationDegree**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegree**(`r`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **r**: `number` +• **rotation**: `number` #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[2d/src/core/FComponent.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L385) +[2d/src/core/FComponent.ts:228](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L228) *** -### scale +### \_\_SET\_SCALE\_\_() -> `get` **scale**(): `object` - -> `set` **scale**(`s`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **s** - -• **s.x**: `number` - -• **s.y**: `number` +• **scale**: [`FVector2`](../interfaces/FVector2.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[2d/src/core/FComponent.ts:393](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L393) +[2d/src/core/FComponent.ts:235](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L235) *** -### scaleX +### \_\_UPDATE\_POSITION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from +• **initiator**: `boolean` = `false` -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) - -#### Defined in - -[2d/src/core/FComponent.ts:401](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L401) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[2d/src/core/FComponent.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L409) +[2d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L113) *** -### x +### \_\_UPDATE\_ROTATION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` + +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[2d/src/core/FComponent.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L361) +[2d/src/core/FComponent.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L153) *** -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns +### \_\_UPDATE\_SCALE\_\_() -`number` - -#### Inherited from +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) - -#### Defined in - -[2d/src/core/FComponent.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L369) - -## Constructors - -### new FSprite() - -> **new FSprite**(`scene`, `options`): [`FSprite`](FSprite.md) +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scene**: [`FScene`](FScene.md) +• **initiator**: `boolean` = `false` -• **options**: [`FSpriteOptions`](../interfaces/FSpriteOptions.md) +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -[`FSprite`](FSprite.md) +`void` -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[2d/src/sprite/FSprite.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L33) +[2d/src/core/FComponent.ts:187](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L187) -## Methods +*** ### emitCollisionWith() @@ -309,7 +242,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -323,39 +256,52 @@ Emit the onLoaded callbacks. `void` +#### Inherited from + +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) + #### Defined in -[2d/src/sprite/FSprite.ts:119](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L119) +core/dist/index.d.ts:247 *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```ts -component.initCollider({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) + +#### Defined in + +[2d/src/core/FComponent.ts:103](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L103) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -363,7 +309,7 @@ component.initCollider({ #### Defined in -[2d/src/core/FComponent.ts:308](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L308) +[2d/src/core/FComponent.ts:253](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L253) *** @@ -371,36 +317,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the model. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### Example - -```ts -component.initRigidBody({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: 0, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[2d/src/core/FComponent.ts:281](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L281) +[2d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L259) *** @@ -408,37 +339,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### Example - -```ts -component.initSensor({ - position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, - rotation: { x: 0, y: 0 }, - shape: FShapes.SQUARE -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[2d/src/core/FComponent.ts:332](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L332) +[2d/src/core/FComponent.ts:265](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L265) *** @@ -460,7 +375,7 @@ The path to the texture. #### Defined in -[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L52) +[2d/src/sprite/FSprite.ts:52](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L52) *** @@ -514,33 +429,33 @@ player.onCollisionWith(enemy, () => { #### Defined in -[2d/src/core/FComponent.ts:341](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L341) +[2d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L243) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from [`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) #### Defined in -[2d/src/sprite/FSprite.ts:104](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L104) +core/dist/index.d.ts:238 *** @@ -548,7 +463,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the texture is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -560,153 +475,13 @@ The callback function. `void` -#### Defined in - -[2d/src/sprite/FSprite.ts:112](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L112) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### Parameters - -• **options** - -The options for the position. - -• **options.x**: `number` - -The x position. - -• **options.y**: `number` - -The y position. - -#### Returns - -`void` - -#### Example - -```ts -component.setPosition({ x: 0, y: 0 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) - -#### Defined in - -[2d/src/core/FComponent.ts:186](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L186) - -*** - -### setRotation() - -> **setRotation**(`r`): `void` - -Set the rotation of the component in radians. - -#### Parameters - -• **r**: `number` - -The rotation in radians. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotation(Math.PI / 2) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) - -#### Defined in - -[2d/src/core/FComponent.ts:208](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L208) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`r`): `void` - -Set the rotation of the component in degrees. - -#### Parameters - -• **r**: `number` - -The rotation in degrees. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotationDegree(90) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) - -#### Defined in - -[2d/src/core/FComponent.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L230) - -*** - -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The x scale. - -• **options.y**: `number` - -The y scale. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[2d/src/core/FComponent.ts:244](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L244) +core/dist/index.d.ts:243 *** @@ -729,7 +504,7 @@ The height of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:100](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L100) +[2d/src/sprite/FSprite.ts:102](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L102) *** @@ -752,7 +527,7 @@ The width of the sprite. #### Defined in -[2d/src/sprite/FSprite.ts:91](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L91) +[2d/src/sprite/FSprite.ts:93](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L93) ## Properties @@ -773,19 +548,55 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:216 + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] + +Callbacks for when a frame is rendered. + +#### Inherited from + +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) + +#### Defined in + +core/dist/index.d.ts:207 *** ### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) + +#### Defined in -Callbacks for when the texture is loaded +core/dist/index.d.ts:211 + +*** + +### \_\_CONTAINER\_\_ + +> **\_\_CONTAINER\_\_**: `Sprite` + +PIXI container + +#### Overrides + +[`FComponent`](FComponent.md).[`__CONTAINER__`](FComponent.md#__container__) #### Defined in -[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L31) +[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L27) *** @@ -802,7 +613,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -818,7 +629,7 @@ Internal flags #### Defined in -[2d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L28) +[2d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L30) *** @@ -834,39 +645,35 @@ Internal flags #### Defined in -core/dist/index.d.ts:47 +core/dist/index.d.ts:197 *** -### collider - -> **collider**: [`FCollider`](FCollider.md) - -RAPIER Collider +### \_\_TEXTURE\_\_ -#### Inherited from +> **\_\_TEXTURE\_\_**: `Texture` -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) +The texture of the sprite. #### Defined in -[2d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L57) +[2d/src/sprite/FSprite.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L31) *** -### container +### collider -> **container**: `Container`\<`ContainerChild`\> +> **collider**: [`FCollider`](FCollider.md) -PIXI container +RAPIER Collider #### Inherited from -[`FComponent`](FComponent.md).[`container`](FComponent.md#container) +[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) #### Defined in -[2d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L42) +[2d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L59) *** @@ -882,7 +689,7 @@ The controller attached to the component. #### Defined in -[2d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L37) +[2d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L39) *** @@ -898,7 +705,7 @@ RAPIER RigidBody #### Defined in -[2d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L53) +[2d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L55) *** @@ -914,7 +721,7 @@ The scene which the component is in. #### Defined in -[2d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L33) +[2d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L35) *** @@ -930,19 +737,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[2d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L61) - -*** - -### texture - -> **texture**: `Texture` - -The texture of the sprite. - -#### Defined in - -[2d/src/sprite/FSprite.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L27) +[2d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L63) *** @@ -958,4 +753,4 @@ Transforms #### Defined in -[2d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L47) +[2d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L49) diff --git a/docs/api/2d/classes/FTransform.md b/docs/api/2d/classes/FTransform.md index 8041381b..e4d74951 100644 --- a/docs/api/2d/classes/FTransform.md +++ b/docs/api/2d/classes/FTransform.md @@ -2,7 +2,247 @@ # Class: FTransform -2D Transforms for a component. +2D Transform + +## Accessors + +### position + +> `get` **position**(): `object` + +Get the position. + +> `set` **position**(`position`): `void` + +Set the position. + +#### Parameters + +• **position** + +The new position. + +• **position.x**: `number` + +The new position on the x axis. + +• **position.y**: `number` + +The new position on the y axis. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FTransform.ts:137](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L137) + +*** + +### rotation + +> `get` **rotation**(): `number` + +Get the rotation in radians. + +> `set` **rotation**(`rotation`): `void` + +Set the rotation in radians. + +#### Parameters + +• **rotation**: `number` + +The new rotation in radians. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:184](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L184) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): `number` + +Get the rotation in degrees. + +> `set` **rotationDegree**(`rotationDegree`): `void` + +Set the rotation in degrees. + +#### Parameters + +• **rotationDegree**: `number` + +The new rotation in degrees. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:199](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L199) + +*** + +### scale + +> `get` **scale**(): `object` + +Get the scale. + +> `set` **scale**(`scale`): `void` + +Set the scale. + +#### Parameters + +• **scale** + +The new scale. + +• **scale.x**: `number` + +The new scale on the x axis. + +• **scale.y**: `number` + +The new scale on the y axis. + +#### Returns + +`object` + +##### x + +> **x**: `number` + +##### y + +> **y**: `number` + +#### Defined in + +[2d/src/core/FTransform.ts:214](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L214) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +Get the scale on the x axis. + +> `set` **scaleX**(`x`): `void` + +Set the x scale. + +#### Parameters + +• **x**: `number` + +The new scale on the x axis. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:231](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L231) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +Get the scale on the y axis. + +> `set` **scaleY**(`y`): `void` + +Set the y scale. + +#### Parameters + +• **y**: `number` + +The new scale on the y axis. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:246](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L246) + +*** + +### x + +> `get` **x**(): `number` + +Get the position on the x axis. + +> `set` **x**(`x`): `void` + +Set the x position. + +#### Parameters + +• **x**: `number` + +The new position on the x axis. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:154](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L154) + +*** + +### y + +> `get` **y**(): `number` + +Get the position on the y axis. + +> `set` **y**(`y`): `void` + +Set the y position. + +#### Parameters + +• **y**: `number` + +The new position on the y axis. + +#### Returns + +`number` + +#### Defined in + +[2d/src/core/FTransform.ts:169](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L169) ## Constructors @@ -16,7 +256,7 @@ Create a new FTransform. • **options?**: [`FTransformOptions`](../interfaces/FTransformOptions.md) -The options for the collider. +The options for the transform. #### Returns @@ -25,65 +265,233 @@ The options for the collider. #### Example ```ts -const collider = new FTransform({ +const transform = new FTransform({ position: { x: 0, y: 0 }, - scale: { x: 1, y: 1 }, rotation: 0, + scale: { x: 1, y: 1 }, }) ``` #### Defined in -[2d/src/core/FTransform.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L42) +[2d/src/core/FTransform.ts:58](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L58) + +## Methods + +### onPositionUpdated() + +> **onPositionUpdated**(`callback`): `void` + +Add a callback for when the position is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:81](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L81) + +*** + +### onRotationUpdated() + +> **onRotationUpdated**(`callback`): `void` + +Add a callback for when the rotation is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:89](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L89) + +*** + +### onScaleUpdated() + +> **onScaleUpdated**(`callback`): `void` + +Add a callback for when the scale is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:97](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L97) + +*** + +### setPosition() + +> **setPosition**(`position`): `void` + +Set a new position. + +#### Parameters + +• **position** + +The new position. + +• **position.x**: `number` + +The new position on the x axis. + +• **position.y**: `number` + +The new position on the y axis. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L107) + +*** + +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set a new rotation in radians. + +#### Parameters + +• **rotation**: `number` + +The new rotation in radians. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:116](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L116) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set a new scale. + +#### Parameters + +• **scale** + +The new scale. + +• **scale.x**: `number` + +The new scale on the x axis. + +• **scale.y**: `number` + +The new scale on the y axis. + +#### Returns + +`void` + +#### Defined in + +[2d/src/core/FTransform.ts:127](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L127) ## Properties -### position +### \_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_ -> **position**: `object` +> **\_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_**: () => `void`[] = `[]` -Position of the component. +Callback for when the position is updated. -#### x +#### Defined in -> **x**: `number` +[2d/src/core/FTransform.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L19) + +*** -#### y +### \_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_ -> **y**: `number` +> **\_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_**: () => `void`[] = `[]` + +Callback for when the rotation is updated. #### Defined in -[2d/src/core/FTransform.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L16) +[2d/src/core/FTransform.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L23) *** -### rotation +### \_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_ -> **rotation**: `number` +> **\_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_**: () => `void`[] = `[]` -Rotation of the component. +Callback for when the scale is updated. #### Defined in -[2d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L24) +[2d/src/core/FTransform.ts:27](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L27) *** -### scale +### \_\_POSITION\_\_ -> **scale**: `object` +> **\_\_POSITION\_\_**: [`FVector2`](../interfaces/FVector2.md) -Scale of the component. +The position of the transform. -#### x +#### Defined in -> **x**: `number` +[2d/src/core/FTransform.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L32) -#### y +*** -> **y**: `number` +### \_\_ROTATION\_\_ + +> **\_\_ROTATION\_\_**: `number` + +The rotation of the transform in radians. + +#### Defined in + +[2d/src/core/FTransform.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L40) + +*** + +### \_\_SCALE\_\_ + +> **\_\_SCALE\_\_**: [`FVector2`](../interfaces/FVector2.md) + +The scale of the transform. #### Defined in -[2d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L20) +[2d/src/core/FTransform.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L36) diff --git a/docs/api/2d/enumerations/FRigidBodyType.md b/docs/api/2d/enumerations/FRigidBodyType.md new file mode 100644 index 00000000..8f9dcdc0 --- /dev/null +++ b/docs/api/2d/enumerations/FRigidBodyType.md @@ -0,0 +1,43 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FRigidBodyType + +# Enumeration: FRigidBodyType + +## Enumeration Members + +### DYNAMIC + +> **DYNAMIC**: `"Dynamic"` + +#### Defined in + +[2d/src/types/FRigidBodyType.ts:3](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FRigidBodyType.ts#L3) + +*** + +### FIXED + +> **FIXED**: `"Fixed"` + +#### Defined in + +[2d/src/types/FRigidBodyType.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FRigidBodyType.ts#L6) + +*** + +### KINEMATIC\_POSITION\_BASED + +> **KINEMATIC\_POSITION\_BASED**: `"KinematicPositionBased"` + +#### Defined in + +[2d/src/types/FRigidBodyType.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FRigidBodyType.ts#L4) + +*** + +### KINEMATIC\_VELOCITY\_BASED + +> **KINEMATIC\_VELOCITY\_BASED**: `"KinematicVelocityBased"` + +#### Defined in + +[2d/src/types/FRigidBodyType.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FRigidBodyType.ts#L5) diff --git a/docs/api/2d/enumerations/FShapes.md b/docs/api/2d/enumerations/FShapes.md index 1be2e777..90f46d8c 100644 --- a/docs/api/2d/enumerations/FShapes.md +++ b/docs/api/2d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/types/FShapes.ts#L4) +[2d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FShapes.ts#L4) *** @@ -20,4 +20,4 @@ #### Defined in -[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/types/FShapes.ts#L3) +[2d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FShapes.ts#L3) diff --git a/docs/api/2d/index.md b/docs/api/2d/index.md index 4ba8fee3..d2854fa3 100644 --- a/docs/api/2d/index.md +++ b/docs/api/2d/index.md @@ -50,6 +50,7 @@ ### Enumerations +- [FRigidBodyType](enumerations/FRigidBodyType.md) - [FShapes](enumerations/FShapes.md) ### Interfaces @@ -65,3 +66,4 @@ - [FSceneOptions](interfaces/FSceneOptions.md) - [FSpriteOptions](interfaces/FSpriteOptions.md) - [FTransformOptions](interfaces/FTransformOptions.md) +- [FVector2](interfaces/FVector2.md) diff --git a/docs/api/2d/interfaces/FAttachedCameraOptions.md b/docs/api/2d/interfaces/FAttachedCameraOptions.md index a1102814..968a09e2 100644 --- a/docs/api/2d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/2d/interfaces/FAttachedCameraOptions.md @@ -26,7 +26,7 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L6) *** @@ -36,4 +36,4 @@ #### Defined in -[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FAttachedCamera.ts#L7) +[2d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FAttachedCamera.ts#L7) diff --git a/docs/api/2d/interfaces/FCameraOptions.md b/docs/api/2d/interfaces/FCameraOptions.md index b581e85d..c559c330 100644 --- a/docs/api/2d/interfaces/FCameraOptions.md +++ b/docs/api/2d/interfaces/FCameraOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/cameras/FCamera.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/cameras/FCamera.ts#L5) +[2d/src/cameras/FCamera.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/cameras/FCamera.ts#L6) diff --git a/docs/api/2d/interfaces/FCharacterControllerOptions.md b/docs/api/2d/interfaces/FCharacterControllerOptions.md index f1efe963..c887ae1b 100644 --- a/docs/api/2d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/2d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FCharacterController.ts#L10) +[2d/src/controllers/FCharacterController.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FCharacterController.ts#L10) diff --git a/docs/api/2d/interfaces/FColliderOptions.md b/docs/api/2d/interfaces/FColliderOptions.md index de44801e..14569ef6 100644 --- a/docs/api/2d/interfaces/FColliderOptions.md +++ b/docs/api/2d/interfaces/FColliderOptions.md @@ -6,19 +6,21 @@ ### position? -> `optional` **position**: `object` +> `optional` **position**: [`FVector2`](FVector2.md) -#### x +#### Defined in + +[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L10) -> **x**: `number` +*** -#### y +### positionOffset? -> **y**: `number` +> `optional` **positionOffset**: [`FVector2`](FVector2.md) #### Defined in -[2d/src/core/FCollider.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L7) +[2d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L14) *** @@ -28,7 +30,7 @@ #### Defined in -[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L12) +[2d/src/core/FCollider.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L19) *** @@ -38,7 +40,7 @@ #### Defined in -[2d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L9) +[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L11) *** @@ -48,25 +50,47 @@ #### Defined in -[2d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L10) +[2d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L12) + +*** + +### rotationDegreeOffset? + +> `optional` **rotationDegreeOffset**: `number` + +#### Defined in + +[2d/src/core/FCollider.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L16) + +*** + +### rotationOffset? + +> `optional` **rotationOffset**: `number` + +#### Defined in + +[2d/src/core/FCollider.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L15) *** ### scale? -> `optional` **scale**: `object` +> `optional` **scale**: [`FVector2`](FVector2.md) -#### x +#### Defined in -> **x**: `number` +[2d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L13) + +*** -#### y +### scaleOffset? -> **y**: `number` +> `optional` **scaleOffset**: [`FVector2`](FVector2.md) #### Defined in -[2d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L8) +[2d/src/core/FCollider.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L17) *** @@ -76,7 +100,7 @@ #### Defined in -[2d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L13) +[2d/src/core/FCollider.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L20) *** @@ -86,4 +110,4 @@ #### Defined in -[2d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FCollider.ts#L11) +[2d/src/core/FCollider.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FCollider.ts#L18) diff --git a/docs/api/2d/interfaces/FComponentOptions.md b/docs/api/2d/interfaces/FComponentOptions.md index bc69f124..6ed2cdb3 100644 --- a/docs/api/2d/interfaces/FComponentOptions.md +++ b/docs/api/2d/interfaces/FComponentOptions.md @@ -2,12 +2,30 @@ # Interface: FComponentOptions +## Extends + +- `FComponentOptions` + ## Extended by - [`FSpriteOptions`](FSpriteOptions.md) ## Properties +### addToScene? + +> `optional` **addToScene**: `boolean` + +#### Inherited from + +`FComponentOptionsCore.addToScene` + +#### Defined in + +core/dist/index.d.ts:178 + +*** + ### position? > `optional` **position**: `object` @@ -22,7 +40,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L16) *** @@ -32,7 +50,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L17) *** @@ -42,7 +60,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L18) *** @@ -60,4 +78,4 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L19) diff --git a/docs/api/2d/interfaces/FControllerOptions.md b/docs/api/2d/interfaces/FControllerOptions.md index 734648ca..32c50310 100644 --- a/docs/api/2d/interfaces/FControllerOptions.md +++ b/docs/api/2d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/controllers/FController.ts#L6) +[2d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/controllers/FController.ts#L6) diff --git a/docs/api/2d/interfaces/FLightOptions.md b/docs/api/2d/interfaces/FLightOptions.md index 83191949..93d1ff78 100644 --- a/docs/api/2d/interfaces/FLightOptions.md +++ b/docs/api/2d/interfaces/FLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L7) +[2d/src/lights/FLight.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L7) *** @@ -24,7 +24,7 @@ #### Defined in -[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L8) +[2d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L8) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/lights/FLight.ts#L9) +[2d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/lights/FLight.ts#L9) *** @@ -64,7 +64,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L4) *** @@ -78,7 +78,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L5) *** @@ -92,7 +92,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L6) *** @@ -114,4 +114,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L7) diff --git a/docs/api/2d/interfaces/FRigidBodyOptions.md b/docs/api/2d/interfaces/FRigidBodyOptions.md index e8b00edf..7c83c68e 100644 --- a/docs/api/2d/interfaces/FRigidBodyOptions.md +++ b/docs/api/2d/interfaces/FRigidBodyOptions.md @@ -18,7 +18,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L16) +[2d/src/core/FRigidBody.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L24) *** @@ -28,7 +28,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L15) +[2d/src/core/FRigidBody.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L23) *** @@ -38,35 +38,37 @@ #### Defined in -[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L14) +[2d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L22) *** ### position? -> `optional` **position**: `object` +> `optional` **position**: [`FVector2`](FVector2.md) -#### x +#### Defined in + +[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L11) -> **x**: `number` +*** -#### y +### positionOffset? -> **y**: `number` +> `optional` **positionOffset**: [`FVector2`](FVector2.md) #### Defined in -[2d/src/core/FRigidBody.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L7) +[2d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L15) *** ### rigidBodyType? -> `optional` **rigidBodyType**: `RigidBodyType` +> `optional` **rigidBodyType**: [`FRigidBodyType`](../enumerations/FRigidBodyType.md) #### Defined in -[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L12) +[2d/src/core/FRigidBody.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L20) *** @@ -76,7 +78,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L9) +[2d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L12) *** @@ -86,25 +88,47 @@ #### Defined in -[2d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L10) +[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L13) + +*** + +### rotationDegreeOffset? + +> `optional` **rotationDegreeOffset**: `number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L17) + +*** + +### rotationOffset? + +> `optional` **rotationOffset**: `number` + +#### Defined in + +[2d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L16) *** ### scale? -> `optional` **scale**: `object` +> `optional` **scale**: [`FVector2`](FVector2.md) -#### x +#### Defined in -> **x**: `number` +[2d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L14) + +*** -#### y +### scaleOffset? -> **y**: `number` +> `optional` **scaleOffset**: [`FVector2`](FVector2.md) #### Defined in -[2d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L8) +[2d/src/core/FRigidBody.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L18) *** @@ -114,7 +138,7 @@ #### Defined in -[2d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L13) +[2d/src/core/FRigidBody.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L21) *** @@ -124,4 +148,4 @@ #### Defined in -[2d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FRigidBody.ts#L11) +[2d/src/core/FRigidBody.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FRigidBody.ts#L19) diff --git a/docs/api/2d/interfaces/FSceneOptions.md b/docs/api/2d/interfaces/FSceneOptions.md index 9f5fb7ed..ce66b3f7 100644 --- a/docs/api/2d/interfaces/FSceneOptions.md +++ b/docs/api/2d/interfaces/FSceneOptions.md @@ -8,6 +8,20 @@ ## Properties +### autoLoop? + +> `optional` **autoLoop**: `boolean` + +#### Inherited from + +`FSceneOptionsCore.autoLoop` + +#### Defined in + +core/dist/index.d.ts:67 + +*** + ### domNode? > `optional` **domNode**: `HTMLElement` @@ -18,7 +32,7 @@ #### Defined in -core/dist/index.d.ts:186 +core/dist/index.d.ts:66 *** @@ -40,4 +54,4 @@ core/dist/index.d.ts:186 #### Defined in -[2d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FScene.ts#L13) +[2d/src/core/FScene.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FScene.ts#L14) diff --git a/docs/api/2d/interfaces/FSpriteOptions.md b/docs/api/2d/interfaces/FSpriteOptions.md index e7db02dc..9bba55c4 100644 --- a/docs/api/2d/interfaces/FSpriteOptions.md +++ b/docs/api/2d/interfaces/FSpriteOptions.md @@ -8,6 +8,20 @@ ## Properties +### addToScene? + +> `optional` **addToScene**: `boolean` + +#### Inherited from + +[`FComponentOptions`](FComponentOptions.md).[`addToScene`](FComponentOptions.md#addtoscene) + +#### Defined in + +core/dist/index.d.ts:178 + +*** + ### position? > `optional` **position**: `object` @@ -26,7 +40,7 @@ #### Defined in -[2d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L14) +[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L16) *** @@ -40,7 +54,7 @@ #### Defined in -[2d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L16) +[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L17) *** @@ -54,7 +68,7 @@ #### Defined in -[2d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L17) +[2d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L18) *** @@ -76,7 +90,7 @@ #### Defined in -[2d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FComponent.ts#L15) +[2d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FComponent.ts#L19) *** @@ -86,4 +100,4 @@ #### Defined in -[2d/src/sprite/FSprite.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/sprite/FSprite.ts#L7) +[2d/src/sprite/FSprite.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/sprite/FSprite.ts#L8) diff --git a/docs/api/2d/interfaces/FTransformOptions.md b/docs/api/2d/interfaces/FTransformOptions.md index b5c0f321..dae951e4 100644 --- a/docs/api/2d/interfaces/FTransformOptions.md +++ b/docs/api/2d/interfaces/FTransformOptions.md @@ -22,7 +22,7 @@ #### Defined in -[2d/src/core/FTransform.ts:2](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L2) +[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L4) *** @@ -32,7 +32,7 @@ #### Defined in -[2d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L4) +[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L5) *** @@ -42,7 +42,7 @@ #### Defined in -[2d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L5) +[2d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L6) *** @@ -60,4 +60,4 @@ #### Defined in -[2d/src/core/FTransform.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/2d/src/core/FTransform.ts#L3) +[2d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/core/FTransform.ts#L7) diff --git a/docs/api/2d/interfaces/FVector2.md b/docs/api/2d/interfaces/FVector2.md new file mode 100644 index 00000000..02118de3 --- /dev/null +++ b/docs/api/2d/interfaces/FVector2.md @@ -0,0 +1,29 @@ +[@fibbojs](/api/index) / [2d](/api/2d) / FVector2 + +# Interface: FVector2 + +A 2d vector with x and y coordinates. + +## Properties + +### x + +> **x**: `number` + +The x coordinate of the vector. + +#### Defined in + +[2d/src/types/FVector2.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FVector2.ts#L8) + +*** + +### y + +> **y**: `number` + +The y coordinate of the vector. + +#### Defined in + +[2d/src/types/FVector2.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/2d/src/types/FVector2.ts#L12) diff --git a/docs/api/3d/classes/FAmbientLight.md b/docs/api/3d/classes/FAmbientLight.md index e4197523..f67689e1 100644 --- a/docs/api/3d/classes/FAmbientLight.md +++ b/docs/api/3d/classes/FAmbientLight.md @@ -30,7 +30,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -54,41 +54,23 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -96,7 +78,7 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -120,13 +102,16 @@ An ambient light in 3d space. #### Defined in -[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FAmbientLight.ts#L11) +[3d/src/lights/FAmbientLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FAmbientLight.ts#L11) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -134,143 +119,120 @@ An ambient light in 3d space. #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FAmbientLight.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FAmbientLight.ts#L31) +core/dist/index.d.ts:50 ## Properties @@ -278,9 +240,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -291,114 +250,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -414,7 +358,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -430,4 +374,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FAttachedCamera.md b/docs/api/3d/classes/FAttachedCamera.md index 2b94ba82..a3c65711 100644 --- a/docs/api/3d/classes/FAttachedCamera.md +++ b/docs/api/3d/classes/FAttachedCamera.md @@ -21,85 +21,66 @@ scene.camera = new FAttachedCamera(cube) - [`FCamera`](FCamera.md) -## Constructors +## Accessors -### new FAttachedCamera() +### zoom -> **new FAttachedCamera**(`attachedComponent`): [`FAttachedCamera`](FAttachedCamera.md) +> `get` **zoom**(): `number` -#### Parameters +> `set` **zoom**(`zoom`): `void` -• **attachedComponent**: [`FComponent`](FComponent.md) +#### Parameters -Model that the camera is attached to +• **zoom**: `number` #### Returns -[`FAttachedCamera`](FAttachedCamera.md) +`number` -#### Overrides +#### Inherited from -[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) +[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) #### Defined in -[3d/src/cameras/FAttachedCamera.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L34) - -## Methods +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -### add() +## Constructors -> **add**(...`object`): `this` +### new FAttachedCamera() -Adds another Object3D as child of this Object3D. +> **new FAttachedCamera**(`scene`, `attachedComponent`): [`FAttachedCamera`](FAttachedCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns +• **scene**: [`FScene`](FScene.md) -`this` +Scene that the camera is in -#### Remarks +• **attachedComponent**: [`FComponent`](FComponent.md) -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +Component that the camera is attached to -#### See +#### Returns - - [attach](FAttachedCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FAttachedCamera`](FAttachedCamera.md) -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`add`](FCamera.md#add) +[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` +[3d/src/cameras/FAttachedCamera.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FAttachedCamera.ts#L36) -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FAttachedCamera`](FAttachedCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -107,23 +88,20 @@ The function that gets called when the event is fired. #### Inherited from -[`FCamera`](FCamera.md).[`addEventListener`](FCamera.md#addeventlistener) +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() - -> **applyMatrix4**(`matrix`): `void` +### \_\_UPDATE\_ROTATION\_\_() -Applies the matrix transform to the object and updates the object's position, rotation and scale. +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Parameters - -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -131,95 +109,93 @@ Applies the matrix transform to the object and updates the object's position, ro #### Inherited from -[`FCamera`](FCamera.md).[`applyMatrix4`](FCamera.md#applymatrix4) +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() - -> **applyQuaternion**(`quaternion`): `this` - -Applies the rotation represented by the quaternion to the object. +### \_\_UPDATE\_SCALE\_\_() -#### Parameters +> **\_\_UPDATE\_SCALE\_\_**(): `void` -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`applyQuaternion`](FCamera.md#applyquaternion) +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` - -#### Remarks +• **options** -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). +The options for the collision event. -#### See +• **options.class?**: `any` -[add](FAttachedCamera.md#add) +The class to emit the collision event with. -#### Inherited from - -[`FCamera`](FCamera.md).[`attach`](FCamera.md#attach) - -#### Defined in +• **options.component?**: `FComponent` -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 +The component to emit the collision event with. -*** - -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FCamera`](FCamera.md).[`clear`](FCamera.md#clear) +[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -227,88 +203,73 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -[`FCamera`](FCamera.md).[`clearViewOffset`](FCamera.md#clearviewoffset) +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`_delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` - -If true, descendants of the object are also cloned. Default `true` +• **\_delta**: `number` #### Returns -`this` +`void` -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`clone`](FCamera.md#clone) +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +[3d/src/cameras/FAttachedCamera.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FAttachedCamera.ts#L41) *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks +`Vector3` -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. +The direction of the camera. It is a normalized vector. #### Inherited from -[`FCamera`](FCamera.md).[`copy`](FCamera.md#copy) +[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns @@ -316,26 +277,38 @@ The event that gets fired. #### Inherited from -[`FCamera`](FCamera.md).[`dispatchEvent`](FCamera.md#dispatchevent) +[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -343,2938 +316,259 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` #### Inherited from -[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) +[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() - -> **getCameraDirection**(): `Vector3` - -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. - -#### Returns - -`Vector3` - -The direction of the camera. It is a normalized vector. - -#### Inherited from - -[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) - -#### Defined in +### onFrame() -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +> **onFrame**(`callback`): `void` -*** +Add a callback to be called every frame. -### getEffectiveFOV() +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getEffectiveFOV`](FCamera.md#geteffectivefov) +[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:238 *** -### getFilmHeight() +### onLoaded() -> **getFilmHeight**(): `number` +> **onLoaded**(`callback`): `void` -Returns the height of the image on the film +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). -#### Returns +#### Parameters -`number` +• **callback** -#### Remarks +The callback function. -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +#### Returns + +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getFilmHeight`](FCamera.md#getfilmheight) +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 - -*** - -### getFilmWidth() +core/dist/index.d.ts:243 -> **getFilmWidth**(): `number` +## Properties -Returns the width of the image on the film +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`number` +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. -#### Remarks +#### Index Signature -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FCamera`](FCamera.md).[`getFilmWidth`](FCamera.md#getfilmwidth) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +core/dist/index.d.ts:216 *** -### getFocalLength() - -> **getFocalLength**(): `number` - -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). +### \_\_CALLBACKS\_ON\_FRAME\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -`number` +Callbacks for when a frame is rendered. #### Inherited from -[`FCamera`](FCamera.md).[`getFocalLength`](FCamera.md#getfocallength) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +core/dist/index.d.ts:207 *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. - -#### Parameters - -• **id**: `number` - -Unique number of the object instance. Expects a `Integer` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### See - -id +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FCamera`](FCamera.md).[`getObjectById`](FCamera.md#getobjectbyid) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 +core/dist/index.d.ts:211 *** -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. - -#### Parameters - -• **name**: `string` - -String to match to the children's Object3D.name property. - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> +### \_\_CAMERA\_\_ -#### Remarks +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. +Three.js camera object. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByName`](FCamera.md#getobjectbyname) +[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) *** -### getObjectByProperty() - -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -the property name to search for. - -• **value**: `any` - -value of the given property. +### \_\_ID\_\_ -#### Returns +> **\_\_ID\_\_**: `number` -`undefined` \| `Object3D`\<`Object3DEventMap`\> +Unique identifier for the component. +It is generated automatically. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByProperty`](FCamera.md#getobjectbyproperty) +[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +core/dist/index.d.ts:203 *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -The property name to search for. - -• **value**: `any` - -Value of the given property. - -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] - -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). - -#### Returns +### \_\_IS\_2D\_\_ -`Object3D`\<`Object3DEventMap`\>[] +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FCamera`](FCamera.md).[`getObjectsByProperty`](FCamera.md#getobjectsbyproperty) +[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) *** -### getViewBounds() - -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` - -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. - -#### Parameters - -• **distance**: `number` - -• **minTarget**: `Vector2` - -• **maxTarget**: `Vector2` +### \_\_IS\_3D\_\_ -#### Returns +> **\_\_IS\_3D\_\_**: `boolean` = `true` -`void` +Internal flags #### Inherited from -[`FCamera`](FCamera.md).[`getViewBounds`](FCamera.md#getviewbounds) +[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) *** -### getViewSize() +### attachedComponent -> **getViewSize**(`distance`, `target`): `Vector2` +> **attachedComponent**: [`FComponent`](FComponent.md) -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. +#### Defined in -#### Parameters +[3d/src/cameras/FAttachedCamera.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FAttachedCamera.ts#L28) -• **distance**: `number` +*** -• **target**: `Vector2` +### controller? -#### Returns +> `optional` **controller**: `FController` -`Vector2` +The controller attached to the component. #### Inherited from -[`FCamera`](FCamera.md).[`getViewSize`](FCamera.md#getviewsize) +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +core/dist/index.d.ts:226 *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. +### offset -#### Parameters +> **offset**: [`FVector3`](../interfaces/FVector3.md) -• **target**: `Vector3` +#### Defined in -The result will be copied into this Vector3. +[3d/src/cameras/FAttachedCamera.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FAttachedCamera.ts#L30) -#### Returns +*** -`Vector3` +### scene -#### Remarks +> **scene**: `FScene` -Note: A Camera looks down its local, negative z-axis. +The scene the component is attached to. #### Inherited from -[`FCamera`](FCamera.md).[`getWorldDirection`](FCamera.md#getworlddirection) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 +core/dist/index.d.ts:222 *** -### getWorldPosition() - -> **getWorldPosition**(`target`): `Vector3` - -Returns a vector representing the position of the object in world space. - -#### Parameters +### transform -• **target**: `Vector3` +> **transform**: [`FTransform`](FTransform.md) -The result will be copied into this Vector3. +Transform of the camera. -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldPosition`](FCamera.md#getworldposition) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldQuaternion`](FCamera.md#getworldquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldScale`](FCamera.md#getworldscale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FAttachedCamera`](FAttachedCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -[`FCamera`](FCamera.md).[`hasEventListener`](FCamera.md#haseventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`localToWorld`](FCamera.md#localtoworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterRender`](FCamera.md#onafterrender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterShadow`](FCamera.md#onaftershadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeRender`](FCamera.md#onbeforerender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeShadow`](FCamera.md#onbeforeshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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 - -[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) - -#### Defined in - -[3d/src/cameras/FAttachedCamera.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L39) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`raycast`](FCamera.md#raycast) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`remove`](FCamera.md#remove) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FAttachedCamera`](FAttachedCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeEventListener`](FCamera.md#removeeventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeFromParent`](FCamera.md#removefromparent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnAxis`](FCamera.md#rotateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnWorldAxis`](FCamera.md#rotateonworldaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateX`](FCamera.md#rotatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateY`](FCamera.md#rotatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateZ`](FCamera.md#rotatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setFocalLength`](FCamera.md#setfocallength) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setLens`](FCamera.md#setlens) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`setPosition`](FCamera.md#setposition) - -#### Defined in - -[3d/src/cameras/FAttachedCamera.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L51) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotation`](FCamera.md#setrotation) - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromAxisAngle`](FCamera.md#setrotationfromaxisangle) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromEuler`](FCamera.md#setrotationfromeuler) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromMatrix`](FCamera.md#setrotationfrommatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromQuaternion`](FCamera.md#setrotationfromquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setScale`](FCamera.md#setscale) - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setViewOffset`](FCamera.md#setviewoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom) - -#### Defined in - -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -[`FCamera`](FCamera.md).[`toJSON`](FCamera.md#tojson) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateOnAxis`](FCamera.md#translateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateX`](FCamera.md#translatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateY`](FCamera.md#translatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateZ`](FCamera.md#translatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverse`](FCamera.md#traverse) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseAncestors`](FCamera.md#traverseancestors) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseVisible`](FCamera.md#traversevisible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrix`](FCamera.md#updatematrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrixWorld`](FCamera.md#updatematrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateProjectionMatrix`](FCamera.md#updateprojectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateWorldMatrix`](FCamera.md#updateworldmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`worldToLocal`](FCamera.md#worldtolocal) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Inherited from - -[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`animations`](FCamera.md#animations) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`aspect`](FCamera.md#aspect) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### attachedComponent - -> **attachedComponent**: [`FComponent`](FComponent.md) - -#### Defined in - -[3d/src/cameras/FAttachedCamera.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L27) - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`castShadow`](FCamera.md#castshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`children`](FCamera.md#children) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -[`FCamera`](FCamera.md).[`coordinateSystem`](FCamera.md#coordinatesystem) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDepthMaterial`](FCamera.md#customdepthmaterial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDistanceMaterial`](FCamera.md#customdistancematerial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -[`FCamera`](FCamera.md).[`far`](FCamera.md#far) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmGauge`](FCamera.md#filmgauge) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmOffset`](FCamera.md#filmoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -[`FCamera`](FCamera.md).[`focus`](FCamera.md#focus) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -[`FCamera`](FCamera.md).[`fov`](FCamera.md#fov) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`frustumCulled`](FCamera.md#frustumculled) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -[`FCamera`](FCamera.md).[`id`](FCamera.md#id) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isCamera`](FCamera.md#iscamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isObject3D`](FCamera.md#isobject3d) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isPerspectiveCamera`](FCamera.md#isperspectivecamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`layers`](FCamera.md#layers) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrix`](FCamera.md#matrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixAutoUpdate`](FCamera.md#matrixautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorld`](FCamera.md#matrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldAutoUpdate`](FCamera.md#matrixworldautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldInverse`](FCamera.md#matrixworldinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldNeedsUpdate`](FCamera.md#matrixworldneedsupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`modelViewMatrix`](FCamera.md#modelviewmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -[`FCamera`](FCamera.md).[`name`](FCamera.md#name) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`near`](FCamera.md#near) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`normalMatrix`](FCamera.md#normalmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### offset - -> **offset**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` - -#### Defined in - -[3d/src/cameras/FAttachedCamera.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L29) - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`parent`](FCamera.md#parent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrix`](FCamera.md#projectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrixInverse`](FCamera.md#projectionmatrixinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`quaternion`](FCamera.md#quaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`receiveShadow`](FCamera.md#receiveshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`renderOrder`](FCamera.md#renderorder) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotation`](FCamera.md#rotation) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -[`FCamera`](FCamera.md).[`scale`](FCamera.md#scale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transform of the camera. - -#### Inherited from +#### Inherited from [`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -[`FCamera`](FCamera.md).[`type`](FCamera.md#type) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FAttachedCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`up`](FCamera.md#up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`userData`](FCamera.md#userdata) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -[`FCamera`](FCamera.md).[`uuid`](FCamera.md#uuid) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`view`](FCamera.md#view) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -[`FCamera`](FCamera.md).[`viewport`](FCamera.md#viewport) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`visible`](FCamera.md#visible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_AUTO_UPDATE`](FCamera.md#default_matrix_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](FCamera.md#default_matrix_world_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_UP`](FCamera.md#default_up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FCamera.md b/docs/api/3d/classes/FCamera.md index 6fd37a95..b268f25f 100644 --- a/docs/api/3d/classes/FCamera.md +++ b/docs/api/3d/classes/FCamera.md @@ -6,7 +6,7 @@ The base class for 3d cameras in Fibbo. ## Extends -- `PerspectiveCamera` +- `FCamera` ## Extended by @@ -15,207 +15,161 @@ The base class for 3d cameras in Fibbo. - [`FOrbitCamera`](FOrbitCamera.md) - [`FPointerLockCamera`](FPointerLockCamera.md) -## Implements - -- `FCamera` +## Accessors -## Constructors +### zoom -### new FCamera() +> `get` **zoom**(): `number` -> **new FCamera**(`options`?): [`FCamera`](FCamera.md) +> `set` **zoom**(`zoom`): `void` #### Parameters -• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) +• **zoom**: `number` #### Returns -[`FCamera`](FCamera.md) - -#### Overrides - -`THREE.PerspectiveCamera.constructor` +`number` #### Defined in -[3d/src/cameras/FCamera.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L26) - -## Methods +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -### add() +## Constructors -> **add**(...`object`): `this` +### new FCamera() -Adds another Object3D as child of this Object3D. +> **new FCamera**(`scene`, `options`?): [`FCamera`](FCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` +• **scene**: [`FScene`](FScene.md) -#### Remarks - -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) -#### See +#### Returns - - [attach](FCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FCamera`](FCamera.md) -#### Inherited from +#### Overrides -`THREE.PerspectiveCamera.add` +`FCameraCore.constructor` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. - -#### Type Parameters +[3d/src/cameras/FCamera.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L31) -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FCamera`](FCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns `void` -#### Inherited from - -`THREE.PerspectiveCamera.addEventListener` - #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() - -> **applyMatrix4**(`matrix`): `void` +### \_\_UPDATE\_ROTATION\_\_() -Applies the matrix transform to the object and updates the object's position, rotation and scale. +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Parameters - -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns `void` -#### Inherited from - -`THREE.PerspectiveCamera.applyMatrix4` - #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() - -> **applyQuaternion**(`quaternion`): `this` +### \_\_UPDATE\_SCALE\_\_() -Applies the rotation represented by the quaternion to the object. - -#### Parameters +> **\_\_UPDATE\_SCALE\_\_**(): `void` -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.applyQuaternion` +`void` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` - -#### Remarks - -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). - -#### See +• **options** -[add](FCamera.md#add) +The options for the collision event. -#### Inherited from - -`THREE.PerspectiveCamera.attach` +• **options.class?**: `any` -#### Defined in +The class to emit the collision event with. -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 +• **options.component?**: `FComponent` -*** +The component to emit the collision event with. -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -`THREE.PerspectiveCamera.clear` +`FCameraCore.emitCollisionWith` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -223,115 +177,106 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -`THREE.PerspectiveCamera.clearViewOffset` +`FCameraCore.emitOnLoaded` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` +• **delta**: `number` -If true, descendants of the object are also cloned. Default `true` +The time since the last frame. #### Returns -`this` +`void` #### Inherited from -`THREE.PerspectiveCamera.clone` +`FCameraCore.frame` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +core/dist/index.d.ts:233 *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks - -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. - -#### Inherited from +`Vector3` -`THREE.PerspectiveCamera.copy` +The direction of the camera. It is a normalized vector. #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns `void` -#### Inherited from - -`THREE.PerspectiveCamera.dispatchEvent` - #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -339,2886 +284,231 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` -#### Implementation of +#### Inherited from -`FCameraCore.emitCollisionWith` +`FCameraCore.onCollisionWith` #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() - -> **getCameraDirection**(): `Vector3` - -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. - -#### Returns - -`Vector3` - -The direction of the camera. It is a normalized vector. - -#### Defined in +### onFrame() -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +> **onFrame**(`callback`): `void` -*** +Add a callback to be called every frame. -### getEffectiveFOV() +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -`THREE.PerspectiveCamera.getEffectiveFOV` +`FCameraCore.onFrame` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:238 *** -### getFilmHeight() - -> **getFilmHeight**(): `number` - -Returns the height of the image on the film - -#### Returns - -`number` - -#### Remarks - -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Inherited from - -`THREE.PerspectiveCamera.getFilmHeight` - -#### Defined in +### onLoaded() -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 +> **onLoaded**(`callback`): `void` -*** +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). -### getFilmWidth() +#### Parameters -> **getFilmWidth**(): `number` +• **callback** -Returns the width of the image on the film +The callback function. #### Returns -`number` - -#### Remarks - -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -`THREE.PerspectiveCamera.getFilmWidth` +`FCameraCore.onLoaded` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +core/dist/index.d.ts:243 -*** +## Properties -### getFocalLength() +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -> **getFocalLength**(): `number` +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). +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. -#### Returns +#### Index Signature -`number` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -`THREE.PerspectiveCamera.getFocalLength` +`FCameraCore.__CALLBACKS_ON_COLLISION__` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +core/dist/index.d.ts:216 *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. - -#### Parameters - -• **id**: `number` - -Unique number of the object instance. Expects a `Integer` - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> - -#### Remarks +### \_\_CALLBACKS\_ON\_FRAME\_\_ -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### See - -id +Callbacks for when a frame is rendered. #### Inherited from -`THREE.PerspectiveCamera.getObjectById` +`FCameraCore.__CALLBACKS_ON_FRAME__` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 +core/dist/index.d.ts:207 *** -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. - -#### Parameters - -• **name**: `string` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -String to match to the children's Object3D.name property. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> - -#### Remarks - -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -`THREE.PerspectiveCamera.getObjectByName` +`FCameraCore.__CALLBACKS_ON_LOADED__` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +core/dist/index.d.ts:211 *** -### getObjectByProperty() +### \_\_CAMERA\_\_ -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +Three.js camera object. -#### Parameters - -• **name**: `string` +#### Defined in -the property name to search for. +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) -• **value**: `any` +*** -value of the given property. +### \_\_ID\_\_ -#### Returns +> **\_\_ID\_\_**: `number` -`undefined` \| `Object3D`\<`Object3DEventMap`\> +Unique identifier for the component. +It is generated automatically. #### Inherited from -`THREE.PerspectiveCamera.getObjectByProperty` +`FCameraCore.__ID__` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +core/dist/index.d.ts:203 *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +### \_\_IS\_2D\_\_ -#### Parameters +> **\_\_IS\_2D\_\_**: `boolean` = `false` -• **name**: `string` +#### Overrides -The property name to search for. +`FCameraCore.__IS_2D__` -• **value**: `any` +#### Defined in -Value of the given property. +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] +*** -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). +### \_\_IS\_3D\_\_ -#### Returns +> **\_\_IS\_3D\_\_**: `boolean` = `true` -`Object3D`\<`Object3DEventMap`\>[] +Internal flags -#### Inherited from +#### Overrides -`THREE.PerspectiveCamera.getObjectsByProperty` +`FCameraCore.__IS_3D__` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) *** -### getViewBounds() - -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` - -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. +### controller? -#### Parameters - -• **distance**: `number` - -• **minTarget**: `Vector2` - -• **maxTarget**: `Vector2` +> `optional` **controller**: `FController` -#### Returns - -`void` +The controller attached to the component. #### Inherited from -`THREE.PerspectiveCamera.getViewBounds` +`FCameraCore.controller` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +core/dist/index.d.ts:226 *** -### getViewSize() - -> **getViewSize**(`distance`, `target`): `Vector2` +### scene -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. +> **scene**: `FScene` -#### Parameters - -• **distance**: `number` - -• **target**: `Vector2` - -#### Returns - -`Vector2` +The scene the component is attached to. #### Inherited from -`THREE.PerspectiveCamera.getViewSize` +`FCameraCore.scene` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +core/dist/index.d.ts:222 *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. +### transform -#### Returns - -`Vector3` - -#### Remarks - -Note: A Camera looks down its local, negative z-axis. - -#### Inherited from - -`THREE.PerspectiveCamera.getWorldDirection` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 - -*** - -### getWorldPosition() - -> **getWorldPosition**(`target`): `Vector3` - -Returns a vector representing the position of the object in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -`THREE.PerspectiveCamera.getWorldPosition` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -`THREE.PerspectiveCamera.getWorldQuaternion` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -`THREE.PerspectiveCamera.getWorldScale` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FCamera`](FCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -`THREE.PerspectiveCamera.hasEventListener` - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -`THREE.PerspectiveCamera.localToWorld` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -`THREE.PerspectiveCamera.lookAt` - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -`THREE.PerspectiveCamera.lookAt` - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -`THREE.PerspectiveCamera.onAfterRender` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -`THREE.PerspectiveCamera.onAfterShadow` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -`THREE.PerspectiveCamera.onBeforeRender` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -`THREE.PerspectiveCamera.onBeforeShadow` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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!') -}) -``` - -#### Implementation of - -`FCameraCore.onCollisionWith` - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> `abstract` **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Implementation of - -`FCameraCore.onFrame` - -#### Defined in - -[3d/src/cameras/FCamera.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L53) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -`THREE.PerspectiveCamera.raycast` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -`THREE.PerspectiveCamera.remove` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FCamera`](FCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.removeEventListener` - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.removeFromParent` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -`THREE.PerspectiveCamera.rotateOnAxis` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -`THREE.PerspectiveCamera.rotateOnWorldAxis` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.rotateX` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.rotateY` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.rotateZ` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -`THREE.PerspectiveCamera.setFocalLength` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -`THREE.PerspectiveCamera.setLens` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Defined in - -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.setRotationFromAxisAngle` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.setRotationFromEuler` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -`THREE.PerspectiveCamera.setRotationFromMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.setRotationFromQuaternion` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -`THREE.PerspectiveCamera.setViewOffset` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Implementation of - -`FCameraCore.setZoom` - -#### Defined in - -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -`THREE.PerspectiveCamera.toJSON` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -`THREE.PerspectiveCamera.translateOnAxis` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.translateX` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.translateY` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -`THREE.PerspectiveCamera.translateZ` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -`THREE.PerspectiveCamera.traverse` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -`THREE.PerspectiveCamera.traverseAncestors` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -`THREE.PerspectiveCamera.traverseVisible` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.updateMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.updateMatrixWorld` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -`THREE.PerspectiveCamera.updateProjectionMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -`THREE.PerspectiveCamera.updateWorldMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -`THREE.PerspectiveCamera.worldToLocal` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Implementation of - -`FCameraCore.__CALLBACKS_ON_COLLISION__` - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Implementation of - -`FCameraCore.__ID__` - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Implementation of - -`FCameraCore.__IS_2D__` - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Implementation of - -`FCameraCore.__IS_3D__` - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -`THREE.PerspectiveCamera.animations` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -`THREE.PerspectiveCamera.aspect` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -`THREE.PerspectiveCamera.castShadow` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -`THREE.PerspectiveCamera.children` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -`THREE.PerspectiveCamera.coordinateSystem` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -`THREE.PerspectiveCamera.customDepthMaterial` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -`THREE.PerspectiveCamera.customDistanceMaterial` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -`THREE.PerspectiveCamera.far` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -`THREE.PerspectiveCamera.filmGauge` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -`THREE.PerspectiveCamera.filmOffset` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -`THREE.PerspectiveCamera.focus` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -`THREE.PerspectiveCamera.fov` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.frustumCulled` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -`THREE.PerspectiveCamera.id` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.isCamera` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.isObject3D` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.isPerspectiveCamera` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -`THREE.PerspectiveCamera.layers` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.matrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -`THREE.PerspectiveCamera.matrixAutoUpdate` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.matrixWorld` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -`THREE.PerspectiveCamera.matrixWorldAutoUpdate` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.matrixWorldInverse` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -`THREE.PerspectiveCamera.matrixWorldNeedsUpdate` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.modelViewMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -`THREE.PerspectiveCamera.name` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -`THREE.PerspectiveCamera.near` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -`THREE.PerspectiveCamera.normalMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -`THREE.PerspectiveCamera.parent` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -`THREE.PerspectiveCamera.position` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.projectionMatrix` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -`THREE.PerspectiveCamera.projectionMatrixInverse` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -`THREE.PerspectiveCamera.quaternion` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -`THREE.PerspectiveCamera.receiveShadow` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -`THREE.PerspectiveCamera.renderOrder` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -`THREE.PerspectiveCamera.rotation` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -`THREE.PerspectiveCamera.scale` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) +> **transform**: [`FTransform`](FTransform.md) Transform of the camera. #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -`THREE.PerspectiveCamera.type` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -`THREE.PerspectiveCamera.up` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -`THREE.PerspectiveCamera.userData` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -`THREE.PerspectiveCamera.uuid` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -`THREE.PerspectiveCamera.view` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -`THREE.PerspectiveCamera.viewport` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.visible` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -`THREE.PerspectiveCamera.zoom` - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.DEFAULT_MATRIX_AUTO_UPDATE` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -`THREE.PerspectiveCamera.DEFAULT_MATRIX_WORLD_AUTO_UPDATE` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -`THREE.PerspectiveCamera.DEFAULT_UP` - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FCapsule.md b/docs/api/3d/classes/FCapsule.md index c58390ac..fe9e62df 100644 --- a/docs/api/3d/classes/FCapsule.md +++ b/docs/api/3d/classes/FCapsule.md @@ -19,539 +19,276 @@ scene.addComponent(capsule) - [`FPolyhedron`](FPolyhedron.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 - -[`FPolyhedron`](FPolyhedron.md).[`position`](FPolyhedron.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### rotation +## Constructors -> `get` **rotation**(): `object` +### new FCapsule() -> `set` **rotation**(`rotation`): `void` +> **new FCapsule**(`scene`, `options`?): [`FCapsule`](FCapsule.md) #### Parameters -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` +• **scene**: [`FScene`](FScene.md) -• **rotation.z**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +[`FCapsule`](FCapsule.md) -#### Inherited from +#### Overrides -[`FPolyhedron`](FPolyhedron.md).[`rotation`](FPolyhedron.md#rotation) +[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** +[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FCapsule.ts#L23) -### rotationDegree +## Methods -> `get` **rotationDegree**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotationDegree**(`rotationDegree`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegree`](FPolyhedron.md#rotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeX`](FPolyhedron.md#rotationdegreex) +[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY +### \_\_SET\_SCALE\_\_() -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeY`](FPolyhedron.md#rotationdegreey) +[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeZ`](FPolyhedron.md#rotationdegreez) - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** +• **initiator**: `boolean` = `false` -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationX`](FPolyhedron.md#rotationx) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationY`](FPolyhedron.md#rotationy) - -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationZ`](FPolyhedron.md#rotationz) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** +• **initiator**: `boolean` = `false` -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scale`](FPolyhedron.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`scaleX`](FPolyhedron.md#scalex) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleY +### emitCollisionWith() -> `get` **scaleY**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleY**(`y`): `void` +Emit a collision event with a given class or object. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleY`](FPolyhedron.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** +• **options** -### scaleZ +The options for the collision event. -> `get` **scaleZ**(): `number` +• **options.class?**: `any` -> `set` **scaleZ**(`z`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **z**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleZ`](FPolyhedron.md#scalez) - -#### Defined in - -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters +`void` -• **x**: `number` +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`x`](FPolyhedron.md#x) +[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) #### Defined in -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) +core/dist/index.d.ts:293 *** -### y +### emitOnLoaded() -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters +> **emitOnLoaded**(): `void` -• **y**: `number` +Emit the onLoaded callbacks. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`y`](FPolyhedron.md#y) +[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` +### frame() -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`z`](FPolyhedron.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FCapsule() - -> **new FCapsule**(`scene`, `options`?): [`FCapsule`](FCapsule.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCapsule`](FCapsule.md) - -#### Overrides +> **frame**(`_delta`): `void` -[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) - -#### Defined in - -[3d/src/polyhedrons/FCapsule.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L23) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) +[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame) #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -559,37 +296,21 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Overrides [`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider) #### Defined in -[3d/src/polyhedrons/FCapsule.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L47) +[3d/src/polyhedrons/FCapsule.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FCapsule.ts#L38) *** @@ -597,36 +318,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Overrides [`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody) #### Defined in -[3d/src/polyhedrons/FCapsule.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L40) +[3d/src/polyhedrons/FCapsule.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FCapsule.ts#L45) *** @@ -634,37 +340,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - -#### Inherited from +#### Overrides [`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/polyhedrons/FCapsule.ts:52](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FCapsule.ts#L52) *** @@ -718,135 +408,73 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) - -#### Defined in - -[3d/src/polyhedrons/FCapsule.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCapsule.ts#L36) - -*** - -### setColor() +> **onFrame**(`callback`): `void` -> **setColor**(`color`): `void` - -Change the color of the polyhedron. +Add a callback to be called every frame. #### Parameters -• **color**: `number` +• **callback** -The color of the polyhedron. +The callback function. #### Returns `void` -#### Example - -```ts -cube.setColor(0xFF0000) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) +[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setPosition`](FPolyhedron.md#setposition) +[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:243 *** -### setRotation() +### setColor() -> **setRotation**(`options`): `void` +> **setColor**(`color`): `void` -Set the rotation of the component from radians. +Change the color of the polyhedron. #### 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` +• **color**: `number` -The rotation on the z-axis. +The color of the polyhedron. #### Returns @@ -855,125 +483,69 @@ The rotation on the z-axis. #### Example ```ts -component.setRotation({ x: 0, y: 0, z: 0 }) +cube.setColor(0xFF0000) ``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotation`](FPolyhedron.md#setrotation) +[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` +[3d/src/polyhedrons/FPolyhedron.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L43) -The rotation in degrees on the y-axis. - -• **options.z**: `number` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotationDegree`](FPolyhedron.md#setrotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the x-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setScale`](FPolyhedron.md#setscale) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties +core/dist/index.d.ts:207 -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +*** -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -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. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -990,7 +562,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1004,7 +576,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1020,62 +592,62 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_ -> **collider**: [`FCollider`](FCollider.md) +> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> -Collider +mesh is redefined from FComponent without the ? because it is +directly available after the constructor, as a polyhedron is created synchronously. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) +[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) +[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh +### controller? -> **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -mesh is redefined from FComponent without the ? because it is -directly available after the constructor, as a polyhedron is created synchronously. +The controller attached to the component. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`mesh`](FPolyhedron.md#mesh) +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +657,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1101,13 +673,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +689,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1133,4 +705,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FCharacterController.md b/docs/api/3d/classes/FCharacterController.md index f9b8d07c..c3b44077 100644 --- a/docs/api/3d/classes/FCharacterController.md +++ b/docs/api/3d/classes/FCharacterController.md @@ -35,52 +35,51 @@ An abstract pre-defined character controller. #### Defined in -[3d/src/controllers/FCharacterController.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L41) +[3d/src/controllers/FCharacterController.ts:42](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L42) ## Methods -### getCorrectedRotation() +### frame() -> **getCorrectedRotation**(): `Quaternion` +> `abstract` **frame**(`delta`): `void` -Return the corrected rotation for the current frame. -Uses the camera so the character nevers faces the camera. +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -#### Returns +#### Parameters -`Quaternion` +• **delta**: `number` -#### Defined in +The time since the last frame. -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) +#### Returns -*** +`void` -### onFrame() +#### Inherited from -> `abstract` **onFrame**(`delta`): `void` +[`FController`](FController.md).[`frame`](FController.md#frame) -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 -#### Parameters +core/dist/index.d.ts:26 -• **delta**: `number` +*** -The time since the last frame. +### getCorrectedRotation() -#### Returns +> **getCorrectedRotation**(): `Quaternion` -`void` +Return the corrected rotation for the current frame. +Uses the camera so the character nevers faces the camera. -#### Inherited from +#### Returns -[`FController`](FController.md).[`onFrame`](FController.md#onframe) +`Quaternion` #### Defined in -core/dist/index.d.ts:27 +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L122) ## Properties @@ -97,7 +96,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) *** @@ -125,7 +124,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L25) *** @@ -137,7 +136,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L40) *** @@ -149,4 +148,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L35) diff --git a/docs/api/3d/classes/FCharacterControllerD.md b/docs/api/3d/classes/FCharacterControllerD.md index 035ba484..91a54355 100644 --- a/docs/api/3d/classes/FCharacterControllerD.md +++ b/docs/api/3d/classes/FCharacterControllerD.md @@ -42,54 +42,53 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerD.ts#L23) +[3d/src/controllers/FCharacterControllerD.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerD.ts#L24) ## Methods -### getCorrectedRotation() +### frame() -> **getCorrectedRotation**(): `Quaternion` +> **frame**(`_delta`): `void` -Return the corrected rotation for the current frame. -Uses the camera so the character nevers faces the camera. +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. + +#### Parameters + +• **\_delta**: `number` #### Returns -`Quaternion` +`void` -#### Inherited from +#### Overrides -[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation) +[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame) #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterControllerD.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerD.ts#L40) *** -### onFrame() - -> **onFrame**(`_delta`): `void` - -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. +### getCorrectedRotation() -#### Parameters +> **getCorrectedRotation**(): `Quaternion` -• **\_delta**: `number` +Return the corrected rotation for the current frame. +Uses the camera so the character nevers faces the camera. #### Returns -`void` +`Quaternion` -#### Overrides +#### Inherited from -[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) +[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation) #### Defined in -[3d/src/controllers/FCharacterControllerD.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerD.ts#L39) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L122) ## Properties @@ -106,7 +105,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) *** @@ -138,7 +137,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L25) *** @@ -154,7 +153,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L40) *** @@ -170,4 +169,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L35) diff --git a/docs/api/3d/classes/FCharacterControllerK.md b/docs/api/3d/classes/FCharacterControllerK.md index d7a004ce..ed1e08d2 100644 --- a/docs/api/3d/classes/FCharacterControllerK.md +++ b/docs/api/3d/classes/FCharacterControllerK.md @@ -35,84 +35,71 @@ An abstract pre-defined character controller based on Kinematic rigidbodies. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L23) +[3d/src/controllers/FCharacterControllerK.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L24) ## Methods -### getCorrectedMovements() - -> **getCorrectedMovements**(): `object` +### frame() -Return the corrected movements for the current frame. +> `abstract` **frame**(`delta`): `void` -#### Returns +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -`object` +#### Parameters -##### x +• **delta**: `number` -> **x**: `number` +The time since the last frame. -##### y +#### Returns -> **y**: `number` +`void` -##### z +#### Inherited from -> **z**: `number` +[`FCharacterController`](FCharacterController.md).[`frame`](FCharacterController.md#frame) #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +core/dist/index.d.ts:26 *** -### getCorrectedRotation() +### getCorrectedMovements() -> **getCorrectedRotation**(): `Quaternion` +> **getCorrectedMovements**(): [`FVector3`](../interfaces/FVector3.md) -Return the corrected rotation for the current frame. -Uses the camera so the character nevers faces the camera. +Return the corrected movements for the current frame. #### Returns -`Quaternion` - -#### Inherited from - -[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation) +[`FVector3`](../interfaces/FVector3.md) #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterControllerK.ts:48](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L48) *** -### onFrame() - -> `abstract` **onFrame**(`delta`): `void` - -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. - -#### Parameters +### getCorrectedRotation() -• **delta**: `number` +> **getCorrectedRotation**(): `Quaternion` -The time since the last frame. +Return the corrected rotation for the current frame. +Uses the camera so the character nevers faces the camera. #### Returns -`void` +`Quaternion` #### Inherited from -[`FCharacterController`](FCharacterController.md).[`onFrame`](FCharacterController.md#onframe) +[`FCharacterController`](FCharacterController.md).[`getCorrectedRotation`](FCharacterController.md#getcorrectedrotation) #### Defined in -core/dist/index.d.ts:27 +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L122) ## Properties @@ -124,7 +111,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L22) *** @@ -141,7 +128,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) *** @@ -173,7 +160,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L25) *** @@ -189,7 +176,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L40) *** @@ -205,7 +192,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L35) *** @@ -217,4 +204,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L17) diff --git a/docs/api/3d/classes/FCharacterControllerKP.md b/docs/api/3d/classes/FCharacterControllerKP.md index 051326fb..452d3065 100644 --- a/docs/api/3d/classes/FCharacterControllerKP.md +++ b/docs/api/3d/classes/FCharacterControllerKP.md @@ -42,88 +42,75 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKP.ts#L21) +[3d/src/controllers/FCharacterControllerKP.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerKP.ts#L22) ## Methods -### getCorrectedMovements() - -> **getCorrectedMovements**(): `object` - -Return the corrected movements for the current frame. - -#### Returns +### frame() -`object` +> **frame**(`delta`): `void` -##### x +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -> **x**: `number` +#### Parameters -##### y +• **delta**: `number` -> **y**: `number` +The time since the last frame. -##### z +#### Returns -> **z**: `number` +`void` -#### Inherited from +#### Overrides -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) +[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame) #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerKP.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerKP.ts#L32) *** -### getCorrectedRotation() +### getCorrectedMovements() -> **getCorrectedRotation**(): `Quaternion` +> **getCorrectedMovements**(): [`FVector3`](../interfaces/FVector3.md) -Return the corrected rotation for the current frame. -Uses the camera so the character nevers faces the camera. +Return the corrected movements for the current frame. #### Returns -`Quaternion` +[`FVector3`](../interfaces/FVector3.md) #### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterControllerK.ts:48](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L48) *** -### onFrame() - -> **onFrame**(`delta`): `void` - -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. - -#### Parameters +### getCorrectedRotation() -• **delta**: `number` +> **getCorrectedRotation**(): `Quaternion` -The time since the last frame. +Return the corrected rotation for the current frame. +Uses the camera so the character nevers faces the camera. #### Returns -`void` +`Quaternion` -#### Overrides +#### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation) #### Defined in -[3d/src/controllers/FCharacterControllerKP.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKP.ts#L31) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L122) ## Properties @@ -139,7 +126,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L22) *** @@ -156,7 +143,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +175,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L25) *** @@ -204,7 +191,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L40) *** @@ -220,7 +207,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L35) *** @@ -236,4 +223,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L17) diff --git a/docs/api/3d/classes/FCharacterControllerKV.md b/docs/api/3d/classes/FCharacterControllerKV.md index b4c04bba..a9143e03 100644 --- a/docs/api/3d/classes/FCharacterControllerKV.md +++ b/docs/api/3d/classes/FCharacterControllerKV.md @@ -42,88 +42,75 @@ scene.addComponent(capsule) #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKV.ts#L21) +[3d/src/controllers/FCharacterControllerKV.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerKV.ts#L22) ## Methods -### getCorrectedMovements() - -> **getCorrectedMovements**(): `object` - -Return the corrected movements for the current frame. - -#### Returns +### frame() -`object` +> **frame**(`delta`): `void` -##### x +Update the controller. Should be called every frame. +The purpose of this method is to update the component transform based on the controller logic. -> **x**: `number` +#### Parameters -##### y +• **delta**: `number` -> **y**: `number` +The time since the last frame. -##### z +#### Returns -> **z**: `number` +`void` -#### Inherited from +#### Overrides -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) +[`FCharacterControllerK`](FCharacterControllerK.md).[`frame`](FCharacterControllerK.md#frame) #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L47) +[3d/src/controllers/FCharacterControllerKV.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerKV.ts#L32) *** -### getCorrectedRotation() +### getCorrectedMovements() -> **getCorrectedRotation**(): `Quaternion` +> **getCorrectedMovements**(): [`FVector3`](../interfaces/FVector3.md) -Return the corrected rotation for the current frame. -Uses the camera so the character nevers faces the camera. +Return the corrected movements for the current frame. #### Returns -`Quaternion` +[`FVector3`](../interfaces/FVector3.md) #### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedMovements`](FCharacterControllerK.md#getcorrectedmovements) #### Defined in -[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L122) +[3d/src/controllers/FCharacterControllerK.ts:48](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L48) *** -### onFrame() - -> **onFrame**(`delta`): `void` - -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. - -#### Parameters +### getCorrectedRotation() -• **delta**: `number` +> **getCorrectedRotation**(): `Quaternion` -The time since the last frame. +Return the corrected rotation for the current frame. +Uses the camera so the character nevers faces the camera. #### Returns -`void` +`Quaternion` -#### Overrides +#### Inherited from -[`FCharacterControllerK`](FCharacterControllerK.md).[`onFrame`](FCharacterControllerK.md#onframe) +[`FCharacterControllerK`](FCharacterControllerK.md).[`getCorrectedRotation`](FCharacterControllerK.md#getcorrectedrotation) #### Defined in -[3d/src/controllers/FCharacterControllerKV.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerKV.ts#L31) +[3d/src/controllers/FCharacterController.ts:122](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L122) ## Properties @@ -139,7 +126,7 @@ The character controller that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L21) +[3d/src/controllers/FCharacterControllerK.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L22) *** @@ -156,7 +143,7 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) *** @@ -188,7 +175,7 @@ The inputs that will be used to move the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L24) +[3d/src/controllers/FCharacterController.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L25) *** @@ -204,7 +191,7 @@ The scene where the character is. #### Defined in -[3d/src/controllers/FCharacterController.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L39) +[3d/src/controllers/FCharacterController.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L40) *** @@ -220,7 +207,7 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L34) +[3d/src/controllers/FCharacterController.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L35) *** @@ -236,4 +223,4 @@ The y velocity of the character. Used to apply gravity. #### Defined in -[3d/src/controllers/FCharacterControllerK.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterControllerK.ts#L16) +[3d/src/controllers/FCharacterControllerK.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterControllerK.ts#L17) diff --git a/docs/api/3d/classes/FCollider.md b/docs/api/3d/classes/FCollider.md index 897a106e..3b10c6bb 100644 --- a/docs/api/3d/classes/FCollider.md +++ b/docs/api/3d/classes/FCollider.md @@ -6,409 +6,37 @@ A 3d collider that can be attached to a component. ## Accessors -### position - -> `get` **position**(): `object` - -> `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` - -#### Defined in - -[3d/src/core/FCollider.ts:279](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L279) - -*** - -### 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` - -#### Defined in - -[3d/src/core/FCollider.ts:311](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L311) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Defined in - -[3d/src/core/FCollider.ts:352](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L352) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:361](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L361) - -*** - -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:369](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L369) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:377](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L377) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:328](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L328) - -*** - -### rotationY - -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:336](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L336) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:344](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L344) - -*** - -### 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` - -#### Defined in - -[3d/src/core/FCollider.ts:385](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L385) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:409](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L409) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:417](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L417) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:425](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L425) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:287](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L287) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FCollider.ts:295](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L295) - -*** - -### z +### component -> `get` **z**(): `number` +> `get` **component**(): `undefined` \| [`FComponent`](FComponent.md) -> `set` **z**(`z`): `void` +> `set` **component**(`component`): `void` #### Parameters -• **z**: `number` +• **component**: `undefined` \| [`FComponent`](FComponent.md) #### Returns -`number` +`undefined` \| [`FComponent`](FComponent.md) #### Defined in -[3d/src/core/FCollider.ts:303](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L303) +[3d/src/core/FCollider.ts:314](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L314) ## Constructors ### new FCollider() -> **new FCollider**(`component`, `options`?): [`FCollider`](FCollider.md) +> **new FCollider**(`scene`, `options`?): [`FCollider`](FCollider.md) Creates a collider for a given component. #### Parameters -• **component**: [`FComponent`](FComponent.md) +• **scene**: [`FScene`](FScene.md) -The component which the collider will be attached to. +The scene the collider belongs to. • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) @@ -421,7 +49,7 @@ The options for the collider. #### Example ```ts -const collider = new FCollider(component, { +const collider = new FCollider(scene, { position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, @@ -431,101 +59,65 @@ const collider = new FCollider(component, { #### Defined in -[3d/src/core/FCollider.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L71) +[3d/src/core/FCollider.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L76) ## Methods -### setPosition() +### \_\_SET\_POSITION\_\_() -> **setPosition**(`position`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` Set the position of the collider. #### Parameters -• **position** +• **position**: [`FVector3`](../interfaces/FVector3.md) The new position of the collider. -• **position.x**: `number` - -The new x position of the collider. - -• **position.y**: `number` - -The new y position of the collider. - -• **position.z**: `number` - -The new z position of the collider. - #### Returns `void` #### Defined in -[3d/src/core/FCollider.ts:193](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L193) +[3d/src/core/FCollider.ts:267](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L267) *** -### setRotation() +### \_\_SET\_ROTATION\_\_() -> **setRotation**(`rotation`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` Set the rotation of the collider. #### Parameters -• **rotation** +• **rotation**: [`FVector3`](../interfaces/FVector3.md) The new rotation of the collider. -• **rotation.x**: `number` - -The new x rotation of the collider. - -• **rotation.y**: `number` - -The new y rotation of the collider. - -• **rotation.z**: `number` - -The new z rotation of the collider. - #### Returns `void` #### Defined in -[3d/src/core/FCollider.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L204) +[3d/src/core/FCollider.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L276) *** -### setRotationDegree() +### \_\_SET\_SCALE\_\_() -> **setRotationDegree**(`rotation`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` -Set the rotation of the collider in degrees. +Set the scale of the collider. #### Parameters -• **rotation** - -The new rotation of the collider in degrees. - -• **rotation.x**: `number` - -The new x rotation of the collider in degrees. - -• **rotation.y**: `number` - -The new y rotation of the collider in degrees. - -• **rotation.z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) -The new z rotation of the collider in degrees. +The new scale of the collider. #### Returns @@ -533,33 +125,24 @@ The new z rotation of the collider in degrees. #### Defined in -[3d/src/core/FCollider.ts:215](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L215) +[3d/src/core/FCollider.ts:285](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L285) *** -### setScale() +### \_\_UPDATE\_POSITION\_\_() -> **setScale**(`scale`): `void` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -Set the scale of the collider. +Update the position of the collider according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -The new scale of the collider. - -• **scale.x**: `number` +• **initiator**: `boolean` = `false` -The new x scale of the collider. - -• **scale.y**: `number` - -The new y scale of the collider. - -• **scale.z**: `number` - -The new z scale of the collider. +By default (false), the collider won't be considered as the initiator of the position update. +This means the new position will be the position of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -567,33 +150,24 @@ The new z scale of the collider. #### Defined in -[3d/src/core/FCollider.ts:230](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L230) +[3d/src/core/FCollider.ts:180](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L180) *** -### updatePosition() - -> **updatePosition**(): `void` +### \_\_UPDATE\_ROTATION\_\_() -Update the position of the collider according to its component's position. -This takes into account the position offset. +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -#### Returns - -`void` - -#### Defined in +Update the rotation of the collider according to the transform. +This method should be called after updating the transform properties. -[3d/src/core/FCollider.ts:245](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L245) - -*** - -### updateRotation() +#### Parameters -> **updateRotation**(): `void` +• **initiator**: `boolean` = `false` -Update the rotation of the collider according to its component's rotation. -This takes into account the rotation offset. +By default (false), the collider won't be considered as the initiator of the rotation update. +This means the new rotation will be the rotation of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -601,132 +175,107 @@ This takes into account the rotation offset. #### Defined in -[3d/src/core/FCollider.ts:257](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L257) +[3d/src/core/FCollider.ts:210](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L210) *** -### updateScale() +### \_\_UPDATE\_SCALE\_\_() -> **updateScale**(): `void` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -Update the scale of the collider according to its component's scale. -This takes into account the scale offset. +Update the scale of the collider according to the transform. +This method should be called after updating the transform properties. -#### Returns - -`void` - -#### Defined in - -[3d/src/core/FCollider.ts:269](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L269) - -## Properties - -### \_\_COLLIDER\_POSITION\_OFFSET\_\_ - -> **\_\_COLLIDER\_POSITION\_OFFSET\_\_**: `object` - -Position Offset for the collider. -This is used to adjust the collider position relative to the component. - -#### x - -> **x**: `number` +#### Parameters -#### y +• **initiator**: `boolean` = `false` -> **y**: `number` +By default (false), the collider won't be considered as the initiator of the scale update. +This means the new scale will be the scale of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). -#### z +#### Returns -> **z**: `number` +`void` #### Defined in -[3d/src/core/FCollider.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L30) +[3d/src/core/FCollider.ts:240](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L240) *** -### \_\_COLLIDER\_ROTATION\_OFFSET\_\_ +### frame() -> **\_\_COLLIDER\_ROTATION\_OFFSET\_\_**: `object` +> **frame**(`_delta`): `void` -Rotation Offset for the collider. -This is used to adjust the collider position relative to the component. - -#### x - -> **x**: `number` - -#### y +#### Parameters -> **y**: `number` +• **\_delta**: `number` -#### z +#### Returns -> **z**: `number` +`void` #### Defined in -[3d/src/core/FCollider.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L35) +[3d/src/core/FCollider.ts:167](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L167) -*** +## Properties -### \_\_COLLIDER\_SCALE\_OFFSET\_\_ +### \_\_COLLIDER\_\_ -> **\_\_COLLIDER\_SCALE\_OFFSET\_\_**: `object` +> **\_\_COLLIDER\_\_**: `Collider` -Scale Offset for the collider. -This is used to adjust the collider scale relative to the component. +RAPIER Collider -#### x +#### Defined in -> **x**: `number` +[3d/src/core/FCollider.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L33) -#### y +*** -> **y**: `number` +### \_\_COMPONENT\_\_? -#### z +> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md) -> **z**: `number` +The component the collider is attached to. #### Defined in -[3d/src/core/FCollider.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L40) +[3d/src/core/FCollider.ts:37](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L37) *** -### \_\_COLLIDER\_\_ +### offset -> **\_\_COLLIDER\_\_**: `Collider` +> **offset**: [`FTransform`](FTransform.md) -RAPIER Collider +The transform offset of the collider. #### Defined in -[3d/src/core/FCollider.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L25) +[3d/src/core/FCollider.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L45) *** -### component +### shape -> **component**: [`FComponent`](FComponent.md) +> **shape**: [`FShapes`](../enumerations/FShapes.md) -The component the collider is attached to. +The shape of the collider. #### Defined in -[3d/src/core/FCollider.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L44) +[3d/src/core/FCollider.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L49) *** -### shape +### transform -> **shape**: [`FShapes`](../enumerations/FShapes.md) +> **transform**: [`FTransform`](FTransform.md) -The shape of the collider. +The transform of the collider. #### Defined in -[3d/src/core/FCollider.ts:48](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L48) +[3d/src/core/FCollider.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L41) diff --git a/docs/api/3d/classes/FComponent.md b/docs/api/3d/classes/FComponent.md index 68269b2d..6bc9faec 100644 --- a/docs/api/3d/classes/FComponent.md +++ b/docs/api/3d/classes/FComponent.md @@ -14,479 +14,256 @@ The base class for all 3D objects in Fibbo. - [`FModel`](FModel.md) - [`FPolyhedron`](FPolyhedron.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` - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### rotation +## Constructors -> `get` **rotation**(): `object` +### new FComponent() -> `set` **rotation**(`rotation`): `void` +> **new FComponent**(`scene`, `options`?): [`FComponent`](FComponent.md) #### Parameters -• **rotation** +• **scene**: [`FScene`](FScene.md) -• **rotation.x**: `number` +The 3D scene where the component will be added. -• **rotation.y**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) -• **rotation.z**: `number` +The options for the component. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` +[`FComponent`](FComponent.md) -##### z +#### Overrides -> **z**: `number` +`FComponentCore.constructor` #### Defined in -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** +[3d/src/core/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L85) -### rotationDegree +## Methods -> `get` **rotationDegree**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotationDegree**(`rotationDegree`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX +### \_\_SET\_ROTATION\_\_() -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters +• **initiator**: `boolean` = `false` -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` +• **initiator**: `boolean` = `false` -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** +• **initiator**: `boolean` = `false` -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Defined in -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleX +### emitCollisionWith() -> `get` **scaleX**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleX**(`x`): `void` +Emit a collision event with a given class or object. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) - -*** +• **options** -### scaleY +The options for the collision event. -> `get` **scaleY**(): `number` +• **options.class?**: `any` -> `set` **scaleY**(`y`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **y**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` +`void` -> `set` **scaleZ**(`z`): `void` +#### Examples -#### Parameters +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -• **z**: `number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` -#### Returns +#### Inherited from -`number` +`FComponentCore.emitCollisionWith` #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +core/dist/index.d.ts:293 *** -### x +### emitOnLoaded() -> `get` **x**(): `number` +> **emitOnLoaded**(): `void` -> `set` **x**(`x`): `void` - -#### Parameters - -• **x**: `number` +Emit the onLoaded callbacks. #### Returns -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +`void` -#### Returns +#### Inherited from -`number` +`FComponentCore.emitOnLoaded` #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FComponent() - -> **new FComponent**(`scene`, `options`?): [`FComponent`](FComponent.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -The 3D scene where the component will be added. - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -The options for the component. - -#### Returns - -[`FComponent`](FComponent.md) - -#### Overrides - -`FComponentCore.constructor` - -#### Defined in +### frame() -[3d/src/core/FComponent.ts:83](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L83) +> **frame**(`_delta`): `void` -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - -#### Inherited from +#### Overrides -`FComponentCore.emitCollisionWith` +`FComponentCore.frame` #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -494,33 +271,17 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -528,32 +289,17 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -561,33 +307,17 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -641,214 +371,112 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from `FComponentCore.onFrame` #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example +#### Inherited from -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` +`FComponentCore.onLoaded` #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:243 -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. - -• **options.y**: `number` +## Properties -The rotation on the y-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -• **options.z**: `number` +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -The rotation on the z-axis. +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. -#### Returns +#### Index Signature -`void` + \[`key`: `string`\]: (`data`) => `void`[] -#### Example +#### Inherited from -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` +`FComponentCore.__CALLBACKS_ON_COLLISION__` #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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. +### \_\_CALLBACKS\_ON\_FRAME\_\_ -• **options.z**: `number` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -The rotation in degrees on the z-axis. +Callbacks for when a frame is rendered. -#### Returns - -`void` - -#### Example +#### Inherited from -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` +`FComponentCore.__CALLBACKS_ON_FRAME__` #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### 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. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -• **options.z**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -`FComponentCore.__CALLBACKS_ON_COLLISION__` +`FComponentCore.__CALLBACKS_ON_LOADED__` #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -865,7 +493,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -879,7 +507,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -895,59 +523,59 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. - -#### Overrides - -`FComponentCore.controller` +Collider #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh? +### controller? -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -Mesh +The controller attached to the component. + +#### Overrides + +`FComponentCore.controller` #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -957,21 +585,25 @@ RigidBody The scene which the component is in. +#### Overrides + +`FComponentCore.scene` + #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -983,4 +615,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FComponentEmpty.md b/docs/api/3d/classes/FComponentEmpty.md index 71ac768b..1e543fac 100644 --- a/docs/api/3d/classes/FComponentEmpty.md +++ b/docs/api/3d/classes/FComponentEmpty.md @@ -8,539 +8,276 @@ An empty component. No mesh is created. - [`FComponent`](FComponent.md) -## Accessors - -### position - -> `get` **position**(): `object` +## Constructors -Setters & getters for transform properties +### new FComponentEmpty() -> `set` **position**(`position`): `void` +> **new FComponentEmpty**(`scene`, `options`?): [`FComponentEmpty`](FComponentEmpty.md) #### Parameters -• **position** - -• **position.x**: `number` - -• **position.y**: `number` +• **scene**: [`FScene`](FScene.md) -• **position.z**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +[`FComponentEmpty`](FComponentEmpty.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`position`](FComponent.md#position) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) +[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponentEmpty.ts#L10) -*** - -### rotation +## Methods -> `get` **rotation**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotation**(`rotation`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) - -#### Defined in - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX +### \_\_SET\_ROTATION\_\_() -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegreeX`](FComponent.md#rotationdegreex) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegreeY`](FComponent.md#rotationdegreey) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeZ`](FComponent.md#rotationdegreez) - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` +• **initiator**: `boolean` = `false` -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationX`](FComponent.md#rotationx) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationY`](FComponent.md#rotationy) +• **initiator**: `boolean` = `false` -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationZ`](FComponent.md#rotationz) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` +• **initiator**: `boolean` = `false` -• **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 - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleY +### emitCollisionWith() -> `get` **scaleY**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleY**(`y`): `void` +Emit a collision event with a given class or object. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** +• **options** -### scaleZ +The options for the collision event. -> `get` **scaleZ**(): `number` +• **options.class?**: `any` -> `set` **scaleZ**(`z`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **z**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleZ`](FComponent.md#scalez) - -#### Defined in - -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters +`void` -• **x**: `number` +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) #### Defined in -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) +core/dist/index.d.ts:293 *** -### y - -> `get` **y**(): `number` +### emitOnLoaded() -> `set` **y**(`y`): `void` +> **emitOnLoaded**(): `void` -#### Parameters - -• **y**: `number` +Emit the onLoaded callbacks. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`z`](FComponent.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) +### frame() -## Constructors +> **frame**(`_delta`): `void` -### new FComponentEmpty() - -> **new FComponentEmpty**(`scene`, `options`?): [`FComponentEmpty`](FComponentEmpty.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FComponentEmpty`](FComponentEmpty.md) - -#### Overrides - -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) - -#### Defined in - -[3d/src/core/FComponentEmpty.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponentEmpty.ts#L10) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -548,37 +285,21 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider) #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -586,36 +307,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -623,37 +329,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -707,230 +397,112 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) - -#### Defined in - -[3d/src/core/FComponentEmpty.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponentEmpty.ts#L14) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` +> **onFrame**(`callback`): `void` -Set the position of the component. +Add a callback to be called every frame. #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:238 *** -### setRotation() +### onLoaded() -> **setRotation**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the rotation of the component from radians. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The rotation on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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. +core/dist/index.d.ts:243 -• **options.z**: `number` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. +### \_\_CALLBACKS\_ON\_FRAME\_\_ -• **options.x**: `number` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -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` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +core/dist/index.d.ts:207 -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Index Signature +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -947,7 +519,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -961,7 +533,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -977,61 +549,61 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Inherited from -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) +[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) +[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh? +### controller? -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -Mesh +The controller attached to the component. #### Inherited from -[`FComponent`](FComponent.md).[`mesh`](FComponent.md#mesh) +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1041,7 +613,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1057,13 +629,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1073,7 +645,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1089,4 +661,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FController.md b/docs/api/3d/classes/FController.md index a038af3d..7f5e7908 100644 --- a/docs/api/3d/classes/FController.md +++ b/docs/api/3d/classes/FController.md @@ -34,17 +34,16 @@ The options for the controller. #### Defined in -[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L23) +[3d/src/controllers/FController.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L23) ## Methods -### onFrame() +### frame() -> `abstract` **onFrame**(`delta`): `void` +> `abstract` **frame**(`delta`): `void` 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. +The purpose of this method is to update the component transform based on the controller logic. #### Parameters @@ -58,11 +57,11 @@ The time since the last frame. #### Inherited from -`FControllerCore.onFrame` +`FControllerCore.frame` #### Defined in -core/dist/index.d.ts:27 +core/dist/index.d.ts:26 ## Properties @@ -79,4 +78,4 @@ It is redefined here to get the correct type (with 3D properties). #### Defined in -[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L17) +[3d/src/controllers/FController.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L17) diff --git a/docs/api/3d/classes/FCuboid.md b/docs/api/3d/classes/FCuboid.md index 98f58eac..242a20df 100644 --- a/docs/api/3d/classes/FCuboid.md +++ b/docs/api/3d/classes/FCuboid.md @@ -19,539 +19,276 @@ scene.addComponent(cube) - [`FPolyhedron`](FPolyhedron.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 - -[`FPolyhedron`](FPolyhedron.md).[`position`](FPolyhedron.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### rotation +## Constructors -> `get` **rotation**(): `object` +### new FCuboid() -> `set` **rotation**(`rotation`): `void` +> **new FCuboid**(`scene`, `options`?): [`FCuboid`](FCuboid.md) #### Parameters -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` +• **scene**: [`FScene`](FScene.md) -• **rotation.z**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +[`FCuboid`](FCuboid.md) -#### Inherited from +#### Overrides -[`FPolyhedron`](FPolyhedron.md).[`rotation`](FPolyhedron.md#rotation) +[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) +[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FCuboid.ts#L19) -*** - -### rotationDegree +## Methods -> `get` **rotationDegree**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotationDegree**(`rotationDegree`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegree`](FPolyhedron.md#rotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeX`](FPolyhedron.md#rotationdegreex) +[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY - -> `get` **rotationDegreeY**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeY`](FPolyhedron.md#rotationdegreey) +[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeZ`](FPolyhedron.md#rotationdegreez) - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters +• **initiator**: `boolean` = `false` -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationX`](FPolyhedron.md#rotationx) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationY`](FPolyhedron.md#rotationy) - -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ +• **initiator**: `boolean` = `false` -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationZ`](FPolyhedron.md#rotationz) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` +• **initiator**: `boolean` = `false` -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scale`](FPolyhedron.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`scaleX`](FPolyhedron.md#scalex) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleY +### emitCollisionWith() -> `get` **scaleY**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleY**(`y`): `void` +Emit a collision event with a given class or object. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleY`](FPolyhedron.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** +• **options** -### scaleZ +The options for the collision event. -> `get` **scaleZ**(): `number` +• **options.class?**: `any` -> `set` **scaleZ**(`z`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **z**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleZ`](FPolyhedron.md#scalez) - -#### Defined in - -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters +`void` -• **x**: `number` +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`x`](FPolyhedron.md#x) +[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) #### Defined in -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) +core/dist/index.d.ts:293 *** -### y - -> `get` **y**(): `number` +### emitOnLoaded() -> `set` **y**(`y`): `void` +> **emitOnLoaded**(): `void` -#### Parameters - -• **y**: `number` +Emit the onLoaded callbacks. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`y`](FPolyhedron.md#y) +[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`z`](FPolyhedron.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FCuboid() - -> **new FCuboid**(`scene`, `options`?): [`FCuboid`](FCuboid.md) +### frame() -#### Parameters +> **frame**(`_delta`): `void` -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FCuboid`](FCuboid.md) - -#### Overrides - -[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) - -#### Defined in - -[3d/src/polyhedrons/FCuboid.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCuboid.ts#L19) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) +[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame) #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -559,37 +296,21 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider) #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -597,36 +318,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -634,37 +340,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -718,135 +408,73 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) - -#### Defined in - -[3d/src/polyhedrons/FCuboid.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FCuboid.ts#L23) - -*** - -### setColor() - -> **setColor**(`color`): `void` +> **onFrame**(`callback`): `void` -Change the color of the polyhedron. +Add a callback to be called every frame. #### Parameters -• **color**: `number` +• **callback** -The color of the polyhedron. +The callback function. #### Returns `void` -#### Example - -```ts -cube.setColor(0xFF0000) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) +[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setPosition`](FPolyhedron.md#setposition) +[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:243 *** -### setRotation() +### setColor() -> **setRotation**(`options`): `void` +> **setColor**(`color`): `void` -Set the rotation of the component from radians. +Change the color of the polyhedron. #### 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` +• **color**: `number` -The rotation on the z-axis. +The color of the polyhedron. #### Returns @@ -855,125 +483,69 @@ The rotation on the z-axis. #### Example ```ts -component.setRotation({ x: 0, y: 0, z: 0 }) +cube.setColor(0xFF0000) ``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotation`](FPolyhedron.md#setrotation) +[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### Parameters - -• **options** - -The options for the rotation. +[3d/src/polyhedrons/FPolyhedron.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L43) -• **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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotationDegree`](FPolyhedron.md#setrotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. +### \_\_CALLBACKS\_ON\_FRAME\_\_ -• **options.y**: `number` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setScale`](FPolyhedron.md#setscale) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties +core/dist/index.d.ts:207 -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +*** -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -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. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -990,7 +562,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1004,7 +576,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1020,62 +592,62 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_ -> **collider**: [`FCollider`](FCollider.md) +> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> -Collider +mesh is redefined from FComponent without the ? because it is +directly available after the constructor, as a polyhedron is created synchronously. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) +[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) +[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh +### controller? -> **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -mesh is redefined from FComponent without the ? because it is -directly available after the constructor, as a polyhedron is created synchronously. +The controller attached to the component. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`mesh`](FPolyhedron.md#mesh) +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +657,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1101,13 +673,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +689,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1133,4 +705,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FDirectionalLight.md b/docs/api/3d/classes/FDirectionalLight.md index fab19cc5..596d374b 100644 --- a/docs/api/3d/classes/FDirectionalLight.md +++ b/docs/api/3d/classes/FDirectionalLight.md @@ -30,7 +30,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -54,41 +54,23 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -96,7 +78,7 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -120,13 +102,16 @@ A directional light in 3d space. #### Defined in -[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FDirectionalLight.ts#L11) +[3d/src/lights/FDirectionalLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FDirectionalLight.ts#L11) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -134,143 +119,120 @@ A directional light in 3d space. #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FDirectionalLight.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FDirectionalLight.ts#L46) +core/dist/index.d.ts:50 ## Properties @@ -278,9 +240,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -291,114 +250,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -414,7 +358,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -430,4 +374,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FFBX.md b/docs/api/3d/classes/FFBX.md index 52b1ad1e..31b5a470 100644 --- a/docs/api/3d/classes/FFBX.md +++ b/docs/api/3d/classes/FFBX.md @@ -21,490 +21,182 @@ scene.addComponent(fbx) - [`FModel`](FModel.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 - -[`FModel`](FModel.md).[`position`](FModel.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotation`](FModel.md#rotation) - -#### Defined in - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotationDegree`](FModel.md#rotationdegree) - -#### Defined in - -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeX`](FModel.md#rotationdegreex) - -#### Defined in - -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) - -*** - -### rotationDegreeY +## Constructors -> `get` **rotationDegreeY**(): `number` +### new FFBX() -> `set` **rotationDegreeY**(`y`): `void` +> **new FFBX**(`scene`, `options`): [`FFBX`](FFBX.md) #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeY`](FModel.md#rotationdegreey) - -#### Defined in - -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters +• **scene**: [`FScene`](FScene.md) -• **z**: `number` +• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) #### Returns -`number` +[`FFBX`](FFBX.md) -#### Inherited from +#### Overrides -[`FModel`](FModel.md).[`rotationDegreeZ`](FModel.md#rotationdegreez) +[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** +[3d/src/model/FFBX.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FFBX.ts#L24) -### rotationX +## Methods -> `get` **rotationX**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotationX**(`x`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **x**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationX`](FModel.md#rotationx) +[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationY - -> `get` **rotationY**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationY**(`y`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **y**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationY`](FModel.md#rotationy) +[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationZ - -> `get` **rotationZ**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationZ**(`z`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` -#### Inherited from +#### Overrides -[`FModel`](FModel.md).[`rotationZ`](FModel.md#rotationz) +[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/model/FFBX.ts:79](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FFBX.ts#L79) *** -### scale +### \_\_UPDATE\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` +• **initiator**: `boolean` = `false` -• **scale.z**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scale`](FModel.md#scale) +[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### scaleX +### \_\_UPDATE\_ROTATION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` +• **initiator**: `boolean` = `false` -#### Inherited from - -[`FModel`](FModel.md).[`scaleX`](FModel.md#scalex) - -#### Defined in - -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) - -*** - -### scaleY - -> `get` **scaleY**(): `number` - -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`scaleY`](FModel.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scaleZ`](FModel.md#scalez) +[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### x +### \_\_UPDATE\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`x`](FModel.md#x) - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters +• **initiator**: `boolean` = `false` -• **y**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`y`](FModel.md#y) +[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`z`](FModel.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FFBX() - -> **new FFBX**(`scene`, `options`): [`FFBX`](FFBX.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) - -#### Returns - -[`FFBX`](FFBX.md) - -#### Overrides - -[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) - -#### Defined in - -[3d/src/model/FFBX.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FFBX.ts#L23) - -## Methods - ### defineMeshTransforms() > **defineMeshTransforms**(): `void` @@ -521,7 +213,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FFBX.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FFBX.ts#L65) +[3d/src/model/FFBX.ts:66](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FFBX.ts#L66) *** @@ -573,7 +265,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -582,6 +274,7 @@ core/dist/index.d.ts:118 > **emitOnLoaded**(): `void` Emit the onLoaded callbacks. +It was overridden to add shadow support. #### Returns @@ -593,37 +286,46 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:104](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L104) *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```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.CUBOID -}) -``` +[`FModel`](FModel.md).[`frame`](FModel.md#frame) + +#### Defined in + +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -631,7 +333,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -639,36 +341,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -676,37 +363,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -738,7 +409,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:147](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L147) *** @@ -792,21 +463,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns @@ -818,7 +489,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** @@ -826,7 +497,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the model is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -844,212 +515,52 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### 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` - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setPosition`](FModel.md#setposition) - -#### Defined in - -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### 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` - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setRotation`](FModel.md#setrotation) - -#### Defined in - -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### Parameters - -• **options** - -The options for the rotation. +core/dist/index.d.ts:243 -• **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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FModel`](FModel.md).[`setRotationDegree`](FModel.md#setrotationdegree) +[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the y-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setScale`](FModel.md#setscale) - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when a frame is rendered. #### Inherited from -[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) +[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:207 *** ### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Callbacks for when the model is loaded +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from @@ -1057,7 +568,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) +core/dist/index.d.ts:211 *** @@ -1074,7 +585,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1088,7 +599,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1104,72 +615,72 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Inherited from -[`FModel`](FModel.md).[`collider`](FModel.md#collider) +[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FModel`](FModel.md).[`controller`](FModel.md#controller) +[`FModel`](FModel.md).[`collider`](FModel.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### fileExtension +### controller? -> **fileExtension**: `string` +> `optional` **controller**: [`FController`](FController.md) -The file extension of the model. -Default is 'obj'. +The controller attached to the component. #### Inherited from -[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) +[`FModel`](FModel.md).[`controller`](FModel.md#controller) #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### mesh? +### fileExtension -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> **fileExtension**: `string` -Mesh +The file extension of the model. +Default is 'obj'. #### Inherited from -[`FModel`](FModel.md).[`mesh`](FModel.md#mesh) +[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L47) *** @@ -1186,7 +697,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L22) *** @@ -1205,13 +716,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L30) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1221,7 +732,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1237,13 +748,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1253,7 +764,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1277,7 +788,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L41) *** @@ -1293,4 +804,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FFixedCamera.md b/docs/api/3d/classes/FFixedCamera.md index 76c2e4b1..545ebf2b 100644 --- a/docs/api/3d/classes/FFixedCamera.md +++ b/docs/api/3d/classes/FFixedCamera.md @@ -20,83 +20,62 @@ scene.camera.lookAt(0, 0, 0) - [`FCamera`](FCamera.md) -## Constructors +## Accessors -### new FFixedCamera() +### zoom + +> `get` **zoom**(): `number` -> **new FFixedCamera**(`options`?): [`FFixedCamera`](FFixedCamera.md) +> `set` **zoom**(`zoom`): `void` #### Parameters -• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) +• **zoom**: `number` #### Returns -[`FFixedCamera`](FFixedCamera.md) +`number` -#### Overrides +#### Inherited from -[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) +[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) #### Defined in -[3d/src/cameras/FFixedCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FFixedCamera.ts#L19) +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -## Methods - -### add() +## Constructors -> **add**(...`object`): `this` +### new FFixedCamera() -Adds another Object3D as child of this Object3D. +> **new FFixedCamera**(`scene`, `options`?): [`FFixedCamera`](FFixedCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] +• **scene**: [`FScene`](FScene.md) -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +• **options?**: [`FCameraOptions`](../interfaces/FCameraOptions.md) -#### See +#### Returns - - [attach](FFixedCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FFixedCamera`](FFixedCamera.md) -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`add`](FCamera.md#add) +[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. - -#### Type Parameters +[3d/src/cameras/FFixedCamera.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FFixedCamera.ts#L20) -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FFixedCamera`](FFixedCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -104,23 +83,20 @@ The function that gets called when the event is fired. #### Inherited from -[`FCamera`](FCamera.md).[`addEventListener`](FCamera.md#addeventlistener) +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() +### \_\_UPDATE\_ROTATION\_\_() -> **applyMatrix4**(`matrix`): `void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -Applies the matrix transform to the object and updates the object's position, rotation and scale. - -#### Parameters - -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -128,95 +104,93 @@ Applies the matrix transform to the object and updates the object's position, ro #### Inherited from -[`FCamera`](FCamera.md).[`applyMatrix4`](FCamera.md#applymatrix4) +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() - -> **applyQuaternion**(`quaternion`): `this` +### \_\_UPDATE\_SCALE\_\_() -Applies the rotation represented by the quaternion to the object. +> **\_\_UPDATE\_SCALE\_\_**(): `void` -#### Parameters - -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`applyQuaternion`](FCamera.md#applyquaternion) +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` +• **options** -#### Remarks +The options for the collision event. -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). +• **options.class?**: `any` -#### See +The class to emit the collision event with. -[add](FFixedCamera.md#add) +• **options.component?**: `FComponent` -#### Inherited from - -[`FCamera`](FCamera.md).[`attach`](FCamera.md#attach) - -#### Defined in +The component to emit the collision event with. -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 - -*** - -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FCamera`](FCamera.md).[`clear`](FCamera.md#clear) +[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -224,88 +198,75 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -[`FCamera`](FCamera.md).[`clearViewOffset`](FCamera.md#clearviewoffset) +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` +• **delta**: `number` -If true, descendants of the object are also cloned. Default `true` +The time since the last frame. #### Returns -`this` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`clone`](FCamera.md#clone) +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +core/dist/index.d.ts:233 *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks +`Vector3` -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. +The direction of the camera. It is a normalized vector. #### Inherited from -[`FCamera`](FCamera.md).[`copy`](FCamera.md#copy) +[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns @@ -313,26 +274,38 @@ The event that gets fired. #### Inherited from -[`FCamera`](FCamera.md).[`dispatchEvent`](FCamera.md#dispatchevent) +[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -340,2906 +313,239 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` #### Inherited from -[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) +[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() - -> **getCameraDirection**(): `Vector3` - -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. - -#### Returns - -`Vector3` - -The direction of the camera. It is a normalized vector. - -#### Inherited from - -[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) - -#### Defined in +### onFrame() -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +> **onFrame**(`callback`): `void` -*** +Add a callback to be called every frame. -### getEffectiveFOV() +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getEffectiveFOV`](FCamera.md#geteffectivefov) +[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:238 *** -### getFilmHeight() +### onLoaded() -> **getFilmHeight**(): `number` +> **onLoaded**(`callback`): `void` -Returns the height of the image on the film +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). -#### Returns +#### Parameters -`number` +• **callback** + +The callback function. -#### Remarks +#### Returns -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getFilmHeight`](FCamera.md#getfilmheight) +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 +core/dist/index.d.ts:243 -*** - -### getFilmWidth() - -> **getFilmWidth**(): `number` +## Properties -Returns the width of the image on the film +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`number` +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. -#### Remarks +#### Index Signature -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FCamera`](FCamera.md).[`getFilmWidth`](FCamera.md#getfilmwidth) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +core/dist/index.d.ts:216 *** -### getFocalLength() - -> **getFocalLength**(): `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Returns - -`number` +Callbacks for when a frame is rendered. #### Inherited from -[`FCamera`](FCamera.md).[`getFocalLength`](FCamera.md#getfocallength) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +core/dist/index.d.ts:207 *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. - -#### Parameters - -• **id**: `number` - -Unique number of the object instance. Expects a `Integer` - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Remarks +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. - -#### See - -id +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FCamera`](FCamera.md).[`getObjectById`](FCamera.md#getobjectbyid) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 +core/dist/index.d.ts:211 *** -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. - -#### Parameters - -• **name**: `string` - -String to match to the children's Object3D.name property. +### \_\_CAMERA\_\_ -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -#### Remarks - -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. +Three.js camera object. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByName`](FCamera.md#getobjectbyname) +[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) *** -### getObjectByProperty() - -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -the property name to search for. - -• **value**: `any` - -value of the given property. +### \_\_ID\_\_ -#### Returns +> **\_\_ID\_\_**: `number` -`undefined` \| `Object3D`\<`Object3DEventMap`\> +Unique identifier for the component. +It is generated automatically. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByProperty`](FCamera.md#getobjectbyproperty) +[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +core/dist/index.d.ts:203 *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -The property name to search for. - -• **value**: `any` - -Value of the given property. - -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] - -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). - -#### Returns +### \_\_IS\_2D\_\_ -`Object3D`\<`Object3DEventMap`\>[] +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FCamera`](FCamera.md).[`getObjectsByProperty`](FCamera.md#getobjectsbyproperty) +[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) *** -### getViewBounds() - -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` - -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. - -#### Parameters - -• **distance**: `number` - -• **minTarget**: `Vector2` - -• **maxTarget**: `Vector2` +### \_\_IS\_3D\_\_ -#### Returns +> **\_\_IS\_3D\_\_**: `boolean` = `true` -`void` +Internal flags #### Inherited from -[`FCamera`](FCamera.md).[`getViewBounds`](FCamera.md#getviewbounds) +[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) *** -### getViewSize() - -> **getViewSize**(`distance`, `target`): `Vector2` - -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. - -#### Parameters - -• **distance**: `number` +### controller? -• **target**: `Vector2` - -#### Returns +> `optional` **controller**: `FController` -`Vector2` +The controller attached to the component. #### Inherited from -[`FCamera`](FCamera.md).[`getViewSize`](FCamera.md#getviewsize) +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +core/dist/index.d.ts:226 *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` +### scene -#### Remarks +> **scene**: `FScene` -Note: A Camera looks down its local, negative z-axis. +The scene the component is attached to. #### Inherited from -[`FCamera`](FCamera.md).[`getWorldDirection`](FCamera.md#getworlddirection) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 +core/dist/index.d.ts:222 *** -### getWorldPosition() - -> **getWorldPosition**(`target`): `Vector3` - -Returns a vector representing the position of the object in world space. - -#### Parameters +### transform -• **target**: `Vector3` +> **transform**: [`FTransform`](FTransform.md) -The result will be copied into this Vector3. +Transform of the camera. -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldPosition`](FCamera.md#getworldposition) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldQuaternion`](FCamera.md#getworldquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldScale`](FCamera.md#getworldscale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FFixedCamera`](FFixedCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -[`FCamera`](FCamera.md).[`hasEventListener`](FCamera.md#haseventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`localToWorld`](FCamera.md#localtoworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterRender`](FCamera.md#onafterrender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterShadow`](FCamera.md#onaftershadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeRender`](FCamera.md#onbeforerender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeShadow`](FCamera.md#onbeforeshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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 - -[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) - -#### Defined in - -[3d/src/cameras/FFixedCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FFixedCamera.ts#L23) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`raycast`](FCamera.md#raycast) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`remove`](FCamera.md#remove) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FFixedCamera`](FFixedCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeEventListener`](FCamera.md#removeeventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeFromParent`](FCamera.md#removefromparent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnAxis`](FCamera.md#rotateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnWorldAxis`](FCamera.md#rotateonworldaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateX`](FCamera.md#rotatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateY`](FCamera.md#rotatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateZ`](FCamera.md#rotatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setFocalLength`](FCamera.md#setfocallength) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setLens`](FCamera.md#setlens) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setPosition`](FCamera.md#setposition) - -#### Defined in - -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotation`](FCamera.md#setrotation) - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromAxisAngle`](FCamera.md#setrotationfromaxisangle) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromEuler`](FCamera.md#setrotationfromeuler) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromMatrix`](FCamera.md#setrotationfrommatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromQuaternion`](FCamera.md#setrotationfromquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setScale`](FCamera.md#setscale) - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setViewOffset`](FCamera.md#setviewoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom) - -#### Defined in - -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -[`FCamera`](FCamera.md).[`toJSON`](FCamera.md#tojson) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateOnAxis`](FCamera.md#translateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateX`](FCamera.md#translatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateY`](FCamera.md#translatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateZ`](FCamera.md#translatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverse`](FCamera.md#traverse) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseAncestors`](FCamera.md#traverseancestors) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseVisible`](FCamera.md#traversevisible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrix`](FCamera.md#updatematrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrixWorld`](FCamera.md#updatematrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateProjectionMatrix`](FCamera.md#updateprojectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateWorldMatrix`](FCamera.md#updateworldmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`worldToLocal`](FCamera.md#worldtolocal) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Inherited from - -[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`animations`](FCamera.md#animations) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`aspect`](FCamera.md#aspect) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`castShadow`](FCamera.md#castshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`children`](FCamera.md#children) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -[`FCamera`](FCamera.md).[`coordinateSystem`](FCamera.md#coordinatesystem) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDepthMaterial`](FCamera.md#customdepthmaterial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDistanceMaterial`](FCamera.md#customdistancematerial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -[`FCamera`](FCamera.md).[`far`](FCamera.md#far) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmGauge`](FCamera.md#filmgauge) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmOffset`](FCamera.md#filmoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -[`FCamera`](FCamera.md).[`focus`](FCamera.md#focus) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -[`FCamera`](FCamera.md).[`fov`](FCamera.md#fov) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`frustumCulled`](FCamera.md#frustumculled) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -[`FCamera`](FCamera.md).[`id`](FCamera.md#id) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isCamera`](FCamera.md#iscamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isObject3D`](FCamera.md#isobject3d) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isPerspectiveCamera`](FCamera.md#isperspectivecamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`layers`](FCamera.md#layers) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrix`](FCamera.md#matrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixAutoUpdate`](FCamera.md#matrixautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorld`](FCamera.md#matrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldAutoUpdate`](FCamera.md#matrixworldautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldInverse`](FCamera.md#matrixworldinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldNeedsUpdate`](FCamera.md#matrixworldneedsupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`modelViewMatrix`](FCamera.md#modelviewmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -[`FCamera`](FCamera.md).[`name`](FCamera.md#name) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`near`](FCamera.md#near) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`normalMatrix`](FCamera.md#normalmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`parent`](FCamera.md#parent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrix`](FCamera.md#projectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrixInverse`](FCamera.md#projectionmatrixinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`quaternion`](FCamera.md#quaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`receiveShadow`](FCamera.md#receiveshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`renderOrder`](FCamera.md#renderorder) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotation`](FCamera.md#rotation) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -[`FCamera`](FCamera.md).[`scale`](FCamera.md#scale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transform of the camera. - -#### Inherited from +#### Inherited from [`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -[`FCamera`](FCamera.md).[`type`](FCamera.md#type) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FFixedCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`up`](FCamera.md#up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`userData`](FCamera.md#userdata) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -[`FCamera`](FCamera.md).[`uuid`](FCamera.md#uuid) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`view`](FCamera.md#view) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -[`FCamera`](FCamera.md).[`viewport`](FCamera.md#viewport) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`visible`](FCamera.md#visible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_AUTO_UPDATE`](FCamera.md#default_matrix_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](FCamera.md#default_matrix_world_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_UP`](FCamera.md#default_up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FGLB.md b/docs/api/3d/classes/FGLB.md index ede5e6d8..80d9e71f 100644 --- a/docs/api/3d/classes/FGLB.md +++ b/docs/api/3d/classes/FGLB.md @@ -22,490 +22,182 @@ scene.addComponent(glb) - [`FGLTF`](FGLTF.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 - -[`FGLTF`](FGLTF.md).[`position`](FGLTF.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### 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 - -[`FGLTF`](FGLTF.md).[`rotation`](FGLTF.md#rotation) - -#### Defined in - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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 - -[`FGLTF`](FGLTF.md).[`rotationDegree`](FGLTF.md#rotationdegree) - -#### Defined in - -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`rotationDegreeX`](FGLTF.md#rotationdegreex) - -#### Defined in - -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) - -*** - -### rotationDegreeY +## Constructors -> `get` **rotationDegreeY**(): `number` +### new FGLB() -> `set` **rotationDegreeY**(`y`): `void` +> **new FGLB**(`scene`, `options`): [`FGLB`](FGLB.md) #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`rotationDegreeY`](FGLTF.md#rotationdegreey) - -#### Defined in - -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters +• **scene**: [`FScene`](FScene.md) -• **z**: `number` +• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) #### Returns -`number` +[`FGLB`](FGLB.md) -#### Inherited from +#### Overrides -[`FGLTF`](FGLTF.md).[`rotationDegreeZ`](FGLTF.md#rotationdegreez) +[`FGLTF`](FGLTF.md).[`constructor`](FGLTF.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) +[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FGLB.ts#L22) -*** - -### rotationX +## Methods -> `get` **rotationX**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotationX**(`x`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **x**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`rotationX`](FGLTF.md#rotationx) +[`FGLTF`](FGLTF.md).[`__SET_POSITION__`](FGLTF.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationY - -> `get` **rotationY**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationY**(`y`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **y**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`rotationY`](FGLTF.md#rotationy) +[`FGLTF`](FGLTF.md).[`__SET_ROTATION__`](FGLTF.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationZ - -> `get` **rotationZ**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationZ**(`z`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`rotationZ`](FGLTF.md#rotationz) +[`FGLTF`](FGLTF.md).[`__SET_SCALE__`](FGLTF.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### scale +### \_\_UPDATE\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` +• **initiator**: `boolean` = `false` -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`scale`](FGLTF.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`scaleX`](FGLTF.md#scalex) +[`FGLTF`](FGLTF.md).[`__UPDATE_POSITION__`](FGLTF.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### scaleY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **scaleY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **scaleY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`scaleY`](FGLTF.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` +• **initiator**: `boolean` = `false` -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`scaleZ`](FGLTF.md#scalez) +[`FGLTF`](FGLTF.md).[`__UPDATE_ROTATION__`](FGLTF.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### x +### \_\_UPDATE\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`x`](FGLTF.md#x) - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FGLTF`](FGLTF.md).[`y`](FGLTF.md#y) +[`FGLTF`](FGLTF.md).[`__UPDATE_SCALE__`](FGLTF.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`z`](FGLTF.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FGLB() - -> **new FGLB**(`scene`, `options`): [`FGLB`](FGLB.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) - -#### Returns - -[`FGLB`](FGLB.md) - -#### Overrides - -[`FGLTF`](FGLTF.md).[`constructor`](FGLTF.md#constructors) - -#### Defined in - -[3d/src/model/FGLB.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FGLB.ts#L22) - -## Methods - ### defineMeshTransforms() > **defineMeshTransforms**(): `void` @@ -522,7 +214,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:121](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L121) *** @@ -574,7 +266,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -583,6 +275,7 @@ core/dist/index.d.ts:118 > **emitOnLoaded**(): `void` Emit the onLoaded callbacks. +It was overridden to add shadow support. #### Returns @@ -594,37 +287,46 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:104](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L104) *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```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.CUBOID -}) -``` +[`FGLTF`](FGLTF.md).[`frame`](FGLTF.md#frame) + +#### Defined in + +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -632,7 +334,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -640,36 +342,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FGLTF`](FGLTF.md).[`initRigidBody`](FGLTF.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -677,37 +364,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FGLTF`](FGLTF.md).[`initSensor`](FGLTF.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -739,7 +410,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:147](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L147) *** @@ -793,21 +464,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns @@ -819,7 +490,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** @@ -827,7 +498,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the model is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -845,212 +516,52 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### 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` - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`setPosition`](FGLTF.md#setposition) - -#### Defined in - -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### 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. +core/dist/index.d.ts:243 -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`setRotation`](FGLTF.md#setrotation) - -#### Defined in - -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FGLTF`](FGLTF.md).[`setRotationDegree`](FGLTF.md#setrotationdegree) +[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_COLLISION__`](FGLTF.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the y-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FGLTF`](FGLTF.md).[`setScale`](FGLTF.md#setscale) - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when a frame is rendered. #### Inherited from -[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_COLLISION__`](FGLTF.md#__callbacks_on_collision__) +[`FGLTF`](FGLTF.md).[`__CALLBACKS_ON_FRAME__`](FGLTF.md#__callbacks_on_frame__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:207 *** ### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Callbacks for when the model is loaded +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from @@ -1058,7 +569,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) +core/dist/index.d.ts:211 *** @@ -1075,7 +586,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1089,7 +600,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1105,72 +616,72 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Inherited from -[`FGLTF`](FGLTF.md).[`collider`](FGLTF.md#collider) +[`FGLTF`](FGLTF.md).[`__MESH__`](FGLTF.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FGLTF`](FGLTF.md).[`controller`](FGLTF.md#controller) +[`FGLTF`](FGLTF.md).[`collider`](FGLTF.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### fileExtension +### controller? -> **fileExtension**: `string` +> `optional` **controller**: [`FController`](FController.md) -The file extension of the model. -Default is 'obj'. +The controller attached to the component. #### Inherited from -[`FGLTF`](FGLTF.md).[`fileExtension`](FGLTF.md#fileextension) +[`FGLTF`](FGLTF.md).[`controller`](FGLTF.md#controller) #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### mesh? +### fileExtension -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> **fileExtension**: `string` -Mesh +The file extension of the model. +Default is 'obj'. #### Inherited from -[`FGLTF`](FGLTF.md).[`mesh`](FGLTF.md#mesh) +[`FGLTF`](FGLTF.md).[`fileExtension`](FGLTF.md#fileextension) #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L47) *** @@ -1187,7 +698,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L22) *** @@ -1206,13 +717,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L30) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1222,7 +733,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1238,13 +749,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1254,7 +765,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1278,7 +789,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L41) *** @@ -1294,4 +805,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FGLTF.md b/docs/api/3d/classes/FGLTF.md index c0bee0c3..aebb1687 100644 --- a/docs/api/3d/classes/FGLTF.md +++ b/docs/api/3d/classes/FGLTF.md @@ -25,490 +25,182 @@ scene.addComponent(gltf) - [`FGLB`](FGLB.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 - -[`FModel`](FModel.md).[`position`](FModel.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotation`](FModel.md#rotation) - -#### Defined in - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotationDegree`](FModel.md#rotationdegree) - -#### Defined in - -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeX`](FModel.md#rotationdegreex) - -#### Defined in - -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) - -*** - -### rotationDegreeY +## Constructors -> `get` **rotationDegreeY**(): `number` +### new FGLTF() -> `set` **rotationDegreeY**(`y`): `void` +> **new FGLTF**(`scene`, `options`): [`FGLTF`](FGLTF.md) #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeY`](FModel.md#rotationdegreey) - -#### Defined in - -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters +• **scene**: [`FScene`](FScene.md) -• **z**: `number` +• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) #### Returns -`number` +[`FGLTF`](FGLTF.md) -#### Inherited from +#### Overrides -[`FModel`](FModel.md).[`rotationDegreeZ`](FModel.md#rotationdegreez) +[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) +[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FGLTF.ts#L37) -*** - -### rotationX +## Methods -> `get` **rotationX**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotationX**(`x`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **x**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationX`](FModel.md#rotationx) +[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationY - -> `get` **rotationY**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationY**(`y`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **y**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationY`](FModel.md#rotationy) +[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationZ - -> `get` **rotationZ**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationZ**(`z`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationZ`](FModel.md#rotationz) +[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### scale +### \_\_UPDATE\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` +• **initiator**: `boolean` = `false` -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FModel`](FModel.md).[`scale`](FModel.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scaleX`](FModel.md#scalex) +[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### scaleY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **scaleY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **scaleY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`scaleY`](FModel.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` +• **initiator**: `boolean` = `false` -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scaleZ`](FModel.md#scalez) +[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### x +### \_\_UPDATE\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`x`](FModel.md#x) - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`y`](FModel.md#y) +[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`z`](FModel.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FGLTF() - -> **new FGLTF**(`scene`, `options`): [`FGLTF`](FGLTF.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) - -#### Returns - -[`FGLTF`](FGLTF.md) - -#### Overrides - -[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) - -#### Defined in - -[3d/src/model/FGLTF.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FGLTF.ts#L37) - -## Methods - ### defineMeshTransforms() > **defineMeshTransforms**(): `void` @@ -525,7 +217,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:121](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L121) *** @@ -577,7 +269,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -586,6 +278,7 @@ core/dist/index.d.ts:118 > **emitOnLoaded**(): `void` Emit the onLoaded callbacks. +It was overridden to add shadow support. #### Returns @@ -597,37 +290,46 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:104](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L104) *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```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.CUBOID -}) -``` +[`FModel`](FModel.md).[`frame`](FModel.md#frame) + +#### Defined in + +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -635,7 +337,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -643,36 +345,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -680,37 +367,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -742,7 +413,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:147](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L147) *** @@ -796,21 +467,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns @@ -822,7 +493,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** @@ -830,7 +501,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the model is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -848,212 +519,52 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### 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` - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setPosition`](FModel.md#setposition) - -#### Defined in - -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### 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. +core/dist/index.d.ts:243 -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setRotation`](FModel.md#setrotation) - -#### Defined in - -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FModel`](FModel.md).[`setRotationDegree`](FModel.md#setrotationdegree) +[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the y-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setScale`](FModel.md#setscale) - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when a frame is rendered. #### Inherited from -[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) +[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:207 *** ### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Callbacks for when the model is loaded +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from @@ -1061,7 +572,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) +core/dist/index.d.ts:211 *** @@ -1078,7 +589,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1092,7 +603,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1108,72 +619,72 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Inherited from -[`FModel`](FModel.md).[`collider`](FModel.md#collider) +[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FModel`](FModel.md).[`controller`](FModel.md#controller) +[`FModel`](FModel.md).[`collider`](FModel.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### fileExtension +### controller? -> **fileExtension**: `string` +> `optional` **controller**: [`FController`](FController.md) -The file extension of the model. -Default is 'obj'. +The controller attached to the component. #### Inherited from -[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) +[`FModel`](FModel.md).[`controller`](FModel.md#controller) #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### mesh? +### fileExtension -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> **fileExtension**: `string` -Mesh +The file extension of the model. +Default is 'obj'. #### Inherited from -[`FModel`](FModel.md).[`mesh`](FModel.md#mesh) +[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L47) *** @@ -1190,7 +701,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L22) *** @@ -1209,13 +720,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L30) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1225,7 +736,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1241,13 +752,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1257,7 +768,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1281,7 +792,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L41) *** @@ -1297,4 +808,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FGameCamera.md b/docs/api/3d/classes/FGameCamera.md index a46a0a05..f3e1334c 100644 --- a/docs/api/3d/classes/FGameCamera.md +++ b/docs/api/3d/classes/FGameCamera.md @@ -21,85 +21,62 @@ scene.camera = new FGameCamera(cube) - [`FOrbitCamera`](FOrbitCamera.md) -## Constructors +## Accessors -### new FGameCamera() +### zoom -> **new FGameCamera**(`options`): [`FGameCamera`](FGameCamera.md) +> `get` **zoom**(): `number` -#### Parameters +> `set` **zoom**(`zoom`): `void` -• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) +#### Parameters -Options for the camera. +• **zoom**: `number` #### Returns -[`FGameCamera`](FGameCamera.md) +`number` -#### Overrides +#### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`constructor`](FOrbitCamera.md#constructors) +[`FOrbitCamera`](FOrbitCamera.md).[`zoom`](FOrbitCamera.md#zoom) #### Defined in -[3d/src/cameras/FGameCamera.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L31) - -## Methods +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -### add() +## Constructors -> **add**(...`object`): `this` +### new FGameCamera() -Adds another Object3D as child of this Object3D. +> **new FGameCamera**(`scene`, `options`): [`FGameCamera`](FGameCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` +• **scene**: [`FScene`](FScene.md) -#### Remarks - -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -#### See +#### Returns - - [attach](FGameCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FGameCamera`](FGameCamera.md) -#### Inherited from +#### Overrides -[`FOrbitCamera`](FOrbitCamera.md).[`add`](FOrbitCamera.md#add) +[`FOrbitCamera`](FOrbitCamera.md).[`constructor`](FOrbitCamera.md#constructors) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. +[3d/src/cameras/FGameCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FGameCamera.ts#L29) -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FGameCamera`](FGameCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -107,23 +84,20 @@ The function that gets called when the event is fired. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`addEventListener`](FOrbitCamera.md#addeventlistener) +[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_POSITION__`](FOrbitCamera.md#__update_position__) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() - -> **applyMatrix4**(`matrix`): `void` +### \_\_UPDATE\_ROTATION\_\_() -Applies the matrix transform to the object and updates the object's position, rotation and scale. - -#### Parameters +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -131,95 +105,93 @@ Applies the matrix transform to the object and updates the object's position, ro #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`applyMatrix4`](FOrbitCamera.md#applymatrix4) +[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_ROTATION__`](FOrbitCamera.md#__update_rotation__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() +### \_\_UPDATE\_SCALE\_\_() -> **applyQuaternion**(`quaternion`): `this` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Applies the rotation represented by the quaternion to the object. - -#### Parameters - -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` +`void` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`applyQuaternion`](FOrbitCamera.md#applyquaternion) +[`FOrbitCamera`](FOrbitCamera.md).[`__UPDATE_SCALE__`](FOrbitCamera.md#__update_scale__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` - -#### Remarks - -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). - -#### See +• **options** -[add](FGameCamera.md#add) +The options for the collision event. -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`attach`](FOrbitCamera.md#attach) +• **options.class?**: `any` -#### Defined in +The class to emit the collision event with. -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 +• **options.component?**: `FComponent` -*** +The component to emit the collision event with. -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`clear`](FOrbitCamera.md#clear) +[`FOrbitCamera`](FOrbitCamera.md).[`emitCollisionWith`](FOrbitCamera.md#emitcollisionwith) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -227,88 +199,73 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`clearViewOffset`](FOrbitCamera.md#clearviewoffset) +[`FOrbitCamera`](FOrbitCamera.md).[`emitOnLoaded`](FOrbitCamera.md#emitonloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` - -If true, descendants of the object are also cloned. Default `true` +• **delta**: `number` #### Returns -`this` +`void` -#### Inherited from +#### Overrides -[`FOrbitCamera`](FOrbitCamera.md).[`clone`](FOrbitCamera.md#clone) +[`FOrbitCamera`](FOrbitCamera.md).[`frame`](FOrbitCamera.md#frame) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +[3d/src/cameras/FGameCamera.ts:56](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FGameCamera.ts#L56) *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks +`Vector3` -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. +The direction of the camera. It is a normalized vector. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`copy`](FOrbitCamera.md#copy) +[`FOrbitCamera`](FOrbitCamera.md).[`getCameraDirection`](FOrbitCamera.md#getcameradirection) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns @@ -316,26 +273,38 @@ The event that gets fired. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`dispatchEvent`](FOrbitCamera.md#dispatchevent) +[`FOrbitCamera`](FOrbitCamera.md).[`lookAt`](FOrbitCamera.md#lookat) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -343,2954 +312,331 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`emitCollisionWith`](FOrbitCamera.md#emitcollisionwith) +[`FOrbitCamera`](FOrbitCamera.md).[`onCollisionWith`](FOrbitCamera.md#oncollisionwith) #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() +### onFrame() -> **getCameraDirection**(): `Vector3` +> **onFrame**(`callback`): `void` -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. +Add a callback to be called every frame. -#### Returns +#### Parameters -`Vector3` +• **callback** -The direction of the camera. It is a normalized vector. +The callback function. + +#### Returns + +`void` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getCameraDirection`](FOrbitCamera.md#getcameradirection) +[`FOrbitCamera`](FOrbitCamera.md).[`onFrame`](FOrbitCamera.md#onframe) #### Defined in -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +core/dist/index.d.ts:238 *** -### getEffectiveFOV() +### onLoaded() + +> **onLoaded**(`callback`): `void` + +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getEffectiveFOV`](FOrbitCamera.md#geteffectivefov) +[`FOrbitCamera`](FOrbitCamera.md).[`onLoaded`](FOrbitCamera.md#onloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:243 *** -### getFilmHeight() - -> **getFilmHeight**(): `number` +### setPosition() -Returns the height of the image on the film +> **setPosition**(`position`): `void` -#### Returns +#### Parameters -`number` +• **position**: [`FVector3`](../interfaces/FVector3.md) -#### Remarks +#### Returns -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getFilmHeight`](FOrbitCamera.md#getfilmheight) +[`FOrbitCamera`](FOrbitCamera.md).[`setPosition`](FOrbitCamera.md#setposition) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 +[3d/src/cameras/FOrbitCamera.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L47) *** -### getFilmWidth() - -> **getFilmWidth**(): `number` +### setZoom() -Returns the width of the image on the film +> **setZoom**(`zoom`): `void` -#### Returns +#### Parameters -`number` +• **zoom**: `number` -#### Remarks +#### Returns -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getFilmWidth`](FOrbitCamera.md#getfilmwidth) +[`FOrbitCamera`](FOrbitCamera.md).[`setZoom`](FOrbitCamera.md#setzoom) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +[3d/src/cameras/FOrbitCamera.ts:57](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L57) -*** +## Properties -### getFocalLength() +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -> **getFocalLength**(): `number` +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). +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. -#### Returns +#### Index Signature -`number` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getFocalLength`](FOrbitCamera.md#getfocallength) +[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_COLLISION__`](FOrbitCamera.md#__callbacks_on_collision__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +core/dist/index.d.ts:216 *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> +### \_\_CALLBACKS\_ON\_FRAME\_\_ -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Parameters +Callbacks for when a frame is rendered. -• **id**: `number` +#### Inherited from -Unique number of the object instance. Expects a `Integer` +[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_FRAME__`](FOrbitCamera.md#__callbacks_on_frame__) -#### Returns +#### Defined in -`undefined` \| `Object3D`\<`Object3DEventMap`\> +core/dist/index.d.ts:207 -#### Remarks +*** -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### See +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -id +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getObjectById`](FOrbitCamera.md#getobjectbyid) +[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_LOADED__`](FOrbitCamera.md#__callbacks_on_loaded__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 +core/dist/index.d.ts:211 *** -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. - -#### Parameters - -• **name**: `string` - -String to match to the children's Object3D.name property. - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> +### \_\_CAMERA\_\_ -#### Remarks +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. +Three.js camera object. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getObjectByName`](FOrbitCamera.md#getobjectbyname) +[`FOrbitCamera`](FOrbitCamera.md).[`__CAMERA__`](FOrbitCamera.md#__camera__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) *** -### getObjectByProperty() +### \_\_ID\_\_ -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> +> **\_\_ID\_\_**: `number` -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +Unique identifier for the component. +It is generated automatically. -#### Parameters +#### Inherited from -• **name**: `string` +[`FOrbitCamera`](FOrbitCamera.md).[`__ID__`](FOrbitCamera.md#__id__) -the property name to search for. +#### Defined in -• **value**: `any` +core/dist/index.d.ts:203 -value of the given property. +*** -#### Returns +### \_\_IS\_2D\_\_ -`undefined` \| `Object3D`\<`Object3DEventMap`\> +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getObjectByProperty`](FOrbitCamera.md#getobjectbyproperty) +[`FOrbitCamera`](FOrbitCamera.md).[`__IS_2D__`](FOrbitCamera.md#__is_2d__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +### \_\_IS\_3D\_\_ -#### Parameters +> **\_\_IS\_3D\_\_**: `boolean` = `true` -• **name**: `string` +Internal flags -The property name to search for. +#### Inherited from -• **value**: `any` +[`FOrbitCamera`](FOrbitCamera.md).[`__IS_3D__`](FOrbitCamera.md#__is_3d__) -Value of the given property. +#### Defined in -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). +*** -#### Returns +### attachedComponent -`Object3D`\<`Object3DEventMap`\>[] +> **attachedComponent**: [`FComponent`](FComponent.md) #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getObjectsByProperty`](FOrbitCamera.md#getobjectsbyproperty) +[`FOrbitCamera`](FOrbitCamera.md).[`attachedComponent`](FOrbitCamera.md#attachedcomponent) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +[3d/src/cameras/FOrbitCamera.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L26) *** -### getViewBounds() - -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` - -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. - -#### Parameters - -• **distance**: `number` - -• **minTarget**: `Vector2` - -• **maxTarget**: `Vector2` +### controller? -#### Returns +> `optional` **controller**: `FController` -`void` +The controller attached to the component. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getViewBounds`](FOrbitCamera.md#getviewbounds) +[`FOrbitCamera`](FOrbitCamera.md).[`controller`](FOrbitCamera.md#controller) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +core/dist/index.d.ts:226 *** -### getViewSize() - -> **getViewSize**(`distance`, `target`): `Vector2` +### controls -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. +> **controls**: `OrbitControls` -#### Parameters +#### Inherited from -• **distance**: `number` +[`FOrbitCamera`](FOrbitCamera.md).[`controls`](FOrbitCamera.md#controls) -• **target**: `Vector2` +#### Defined in -#### Returns +[3d/src/cameras/FOrbitCamera.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L28) -`Vector2` +*** -#### Inherited from +### isPointerLocked -[`FOrbitCamera`](FOrbitCamera.md).[`getViewSize`](FOrbitCamera.md#getviewsize) +> **isPointerLocked**: `boolean` = `false` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +[3d/src/cameras/FGameCamera.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FGameCamera.ts#L25) *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. +### lastMouseMoveEvent -#### Parameters +> **lastMouseMoveEvent**: `undefined` \| `MouseEvent` -• **target**: `Vector3` +#### Defined in -The result will be copied into this Vector3. +[3d/src/cameras/FGameCamera.ts:27](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FGameCamera.ts#L27) -#### Returns +*** -`Vector3` +### scene -#### Remarks +> **scene**: `FScene` -Note: A Camera looks down its local, negative z-axis. +The scene the component is attached to. #### Inherited from -[`FOrbitCamera`](FOrbitCamera.md).[`getWorldDirection`](FOrbitCamera.md#getworlddirection) +[`FOrbitCamera`](FOrbitCamera.md).[`scene`](FOrbitCamera.md#scene) #### Defined in -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 +core/dist/index.d.ts:222 *** -### getWorldPosition() - -> **getWorldPosition**(`target`): `Vector3` - -Returns a vector representing the position of the object in world space. - -#### Parameters +### transform -• **target**: `Vector3` +> **transform**: [`FTransform`](FTransform.md) -The result will be copied into this Vector3. +Transform of the camera. -#### Returns - -`Vector3` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`getWorldPosition`](FOrbitCamera.md#getworldposition) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`getWorldQuaternion`](FOrbitCamera.md#getworldquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`getWorldScale`](FOrbitCamera.md#getworldscale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FGameCamera`](FGameCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`hasEventListener`](FOrbitCamera.md#haseventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`localToWorld`](FOrbitCamera.md#localtoworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`lookAt`](FOrbitCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`lookAt`](FOrbitCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`onAfterRender`](FOrbitCamera.md#onafterrender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`onAfterShadow`](FOrbitCamera.md#onaftershadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`onBeforeRender`](FOrbitCamera.md#onbeforerender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`onBeforeShadow`](FOrbitCamera.md#onbeforeshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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 - -[`FOrbitCamera`](FOrbitCamera.md).[`onCollisionWith`](FOrbitCamera.md#oncollisionwith) - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> **onFrame**(`delta`): `void` - -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. - -#### Parameters - -• **delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FOrbitCamera`](FOrbitCamera.md).[`onFrame`](FOrbitCamera.md#onframe) - -#### Defined in - -[3d/src/cameras/FGameCamera.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L57) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`raycast`](FOrbitCamera.md#raycast) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`remove`](FOrbitCamera.md#remove) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FGameCamera`](FGameCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`removeEventListener`](FOrbitCamera.md#removeeventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`removeFromParent`](FOrbitCamera.md#removefromparent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotateOnAxis`](FOrbitCamera.md#rotateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotateOnWorldAxis`](FOrbitCamera.md#rotateonworldaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotateX`](FOrbitCamera.md#rotatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotateY`](FOrbitCamera.md#rotatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotateZ`](FOrbitCamera.md#rotatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setFocalLength`](FOrbitCamera.md#setfocallength) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setLens`](FOrbitCamera.md#setlens) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setPosition`](FOrbitCamera.md#setposition) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L46) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setRotation`](FOrbitCamera.md#setrotation) - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setRotationFromAxisAngle`](FOrbitCamera.md#setrotationfromaxisangle) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setRotationFromEuler`](FOrbitCamera.md#setrotationfromeuler) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setRotationFromMatrix`](FOrbitCamera.md#setrotationfrommatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setRotationFromQuaternion`](FOrbitCamera.md#setrotationfromquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setScale`](FOrbitCamera.md#setscale) - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setViewOffset`](FOrbitCamera.md#setviewoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`setZoom`](FOrbitCamera.md#setzoom) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L54) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`toJSON`](FOrbitCamera.md#tojson) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`translateOnAxis`](FOrbitCamera.md#translateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`translateX`](FOrbitCamera.md#translatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`translateY`](FOrbitCamera.md#translatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`translateZ`](FOrbitCamera.md#translatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`traverse`](FOrbitCamera.md#traverse) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`traverseAncestors`](FOrbitCamera.md#traverseancestors) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`traverseVisible`](FOrbitCamera.md#traversevisible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`updateMatrix`](FOrbitCamera.md#updatematrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`updateMatrixWorld`](FOrbitCamera.md#updatematrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`updateProjectionMatrix`](FOrbitCamera.md#updateprojectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`updateWorldMatrix`](FOrbitCamera.md#updateworldmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`worldToLocal`](FOrbitCamera.md#worldtolocal) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`__CALLBACKS_ON_COLLISION__`](FOrbitCamera.md#__callbacks_on_collision__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`__ID__`](FOrbitCamera.md#__id__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`__IS_2D__`](FOrbitCamera.md#__is_2d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`__IS_3D__`](FOrbitCamera.md#__is_3d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`animations`](FOrbitCamera.md#animations) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`aspect`](FOrbitCamera.md#aspect) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### attachedComponent - -> **attachedComponent**: [`FComponent`](FComponent.md) - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`attachedComponent`](FOrbitCamera.md#attachedcomponent) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L23) - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`castShadow`](FOrbitCamera.md#castshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`children`](FOrbitCamera.md#children) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### controls - -> **controls**: `OrbitControls` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`controls`](FOrbitCamera.md#controls) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L25) - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`coordinateSystem`](FOrbitCamera.md#coordinatesystem) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`customDepthMaterial`](FOrbitCamera.md#customdepthmaterial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`customDistanceMaterial`](FOrbitCamera.md#customdistancematerial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`far`](FOrbitCamera.md#far) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`filmGauge`](FOrbitCamera.md#filmgauge) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`filmOffset`](FOrbitCamera.md#filmoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`focus`](FOrbitCamera.md#focus) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`fov`](FOrbitCamera.md#fov) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`frustumCulled`](FOrbitCamera.md#frustumculled) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`id`](FOrbitCamera.md#id) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`isCamera`](FOrbitCamera.md#iscamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`isObject3D`](FOrbitCamera.md#isobject3d) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`isPerspectiveCamera`](FOrbitCamera.md#isperspectivecamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### isPointerLocked - -> **isPointerLocked**: `boolean` = `false` - -#### Defined in - -[3d/src/cameras/FGameCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L24) - -*** - -### lastMouseMoveEvent - -> **lastMouseMoveEvent**: `undefined` \| `MouseEvent` - -#### Defined in - -[3d/src/cameras/FGameCamera.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FGameCamera.ts#L26) - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`layers`](FOrbitCamera.md#layers) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrix`](FOrbitCamera.md#matrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrixAutoUpdate`](FOrbitCamera.md#matrixautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrixWorld`](FOrbitCamera.md#matrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrixWorldAutoUpdate`](FOrbitCamera.md#matrixworldautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrixWorldInverse`](FOrbitCamera.md#matrixworldinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`matrixWorldNeedsUpdate`](FOrbitCamera.md#matrixworldneedsupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`modelViewMatrix`](FOrbitCamera.md#modelviewmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`name`](FOrbitCamera.md#name) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`near`](FOrbitCamera.md#near) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`normalMatrix`](FOrbitCamera.md#normalmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`parent`](FOrbitCamera.md#parent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`position`](FOrbitCamera.md#position) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`projectionMatrix`](FOrbitCamera.md#projectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`projectionMatrixInverse`](FOrbitCamera.md#projectionmatrixinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`quaternion`](FOrbitCamera.md#quaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`receiveShadow`](FOrbitCamera.md#receiveshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`renderOrder`](FOrbitCamera.md#renderorder) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`rotation`](FOrbitCamera.md#rotation) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`scale`](FOrbitCamera.md#scale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transform of the camera. - -#### Inherited from +#### Inherited from [`FOrbitCamera`](FOrbitCamera.md).[`transform`](FOrbitCamera.md#transform) #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`type`](FOrbitCamera.md#type) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FGameCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`up`](FOrbitCamera.md#up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`userData`](FOrbitCamera.md#userdata) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`uuid`](FOrbitCamera.md#uuid) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`view`](FOrbitCamera.md#view) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`viewport`](FOrbitCamera.md#viewport) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`visible`](FOrbitCamera.md#visible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`zoom`](FOrbitCamera.md#zoom) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`DEFAULT_MATRIX_AUTO_UPDATE`](FOrbitCamera.md#default_matrix_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](FOrbitCamera.md#default_matrix_world_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -[`FOrbitCamera`](FOrbitCamera.md).[`DEFAULT_UP`](FOrbitCamera.md#default_up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FHemisphereLight.md b/docs/api/3d/classes/FHemisphereLight.md index 5bc10c69..7c2cdca2 100644 --- a/docs/api/3d/classes/FHemisphereLight.md +++ b/docs/api/3d/classes/FHemisphereLight.md @@ -30,7 +30,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -54,41 +54,23 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -96,7 +78,7 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -120,13 +102,16 @@ An hemisphere light in 3d space. #### Defined in -[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L16) +[3d/src/lights/FHemisphereLight.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FHemisphereLight.ts#L16) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -134,143 +119,120 @@ An hemisphere light in 3d space. #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FHemisphereLight.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L37) +core/dist/index.d.ts:50 ## Properties @@ -278,9 +240,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -291,114 +250,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -414,7 +358,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -430,4 +374,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FLight.md b/docs/api/3d/classes/FLight.md index 1efdd114..f078e336 100644 --- a/docs/api/3d/classes/FLight.md +++ b/docs/api/3d/classes/FLight.md @@ -35,7 +35,7 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -55,45 +55,27 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -117,13 +99,16 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L46) +[3d/src/lights/FLight.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L47) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -131,139 +116,104 @@ The base class for 3d lights in Fibbo. #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Defined in -• **options.class?**: `any` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) + +*** -The class to emit the collision event with. +### \_\_UPDATE\_ROTATION\_\_() -• **options.component?**: `FComponent` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -The component to emit the collision event with. +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - -#### Inherited from - -`FLightCore.emitCollisionWith` - #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **classOrObject**: `any` +`void` -The class or object to add the callback to. +#### Defined in -• **callback** +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -The callback to add. +*** -#### Returns +### emitOnLoaded() -`Function` +> **emitOnLoaded**(): `void` -A function to remove the callback. +Emit the onLoaded callbacks. -##### Returns +#### Returns `void` -#### 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 -`FLightCore.onCollisionWith` +`FLightCore.emitOnLoaded` #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> `abstract` **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -`FLightCore.onFrame` +`FLightCore.onLoaded` #### Defined in -[3d/src/lights/FLight.ts:74](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L74) +core/dist/index.d.ts:50 ## Properties @@ -271,119 +221,85 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] -#### Overrides - -`FLightCore.__CALLBACKS_ON_COLLISION__` - #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. -#### Overrides +#### Inherited from -`FLightCore.__ID__` +`FLightCore.__CALLBACKS_ON_LOADED__` #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Overrides +### \_\_ID\_\_ -`FLightCore.__IS_2D__` +> **\_\_ID\_\_**: `number` #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Overrides +### \_\_IS\_2D\_\_ -`FLightCore.__IS_3D__` +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. - -#### Inherited from - -`FLightCore.controller` +The original light object from Three.js. #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -393,9 +309,13 @@ The original light object from Three.js. Scene the light is in. +#### Overrides + +`FLightCore.scene` + #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -407,4 +327,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FLightProbe.md b/docs/api/3d/classes/FLightProbe.md index 57d1f932..6427c85f 100644 --- a/docs/api/3d/classes/FLightProbe.md +++ b/docs/api/3d/classes/FLightProbe.md @@ -33,7 +33,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -57,41 +57,23 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -99,7 +81,7 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -123,13 +105,16 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Defined in -[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L18) +[3d/src/lights/FLightProbe.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLightProbe.ts#L18) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -137,143 +122,120 @@ During rendering, the light that hits a 3D object is approximated by using the d #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FLightProbe.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L47) +core/dist/index.d.ts:50 ## Properties @@ -281,9 +243,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -294,114 +253,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -417,7 +361,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -433,4 +377,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FModel.md b/docs/api/3d/classes/FModel.md index bd240dfb..e596ca64 100644 --- a/docs/api/3d/classes/FModel.md +++ b/docs/api/3d/classes/FModel.md @@ -14,494 +14,186 @@ An abstract 3D Model base class. - [`FGLTF`](FGLTF.md) - [`FOBJ`](FOBJ.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 - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### 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 - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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 - -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeX`](FComponent.md#rotationdegreex) - -#### Defined in - -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) - -*** - -### rotationDegreeY +## Constructors -> `get` **rotationDegreeY**(): `number` +### new FModel() -> `set` **rotationDegreeY**(`y`): `void` +> **new FModel**(`scene`, `options`): [`FModel`](FModel.md) #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeY`](FComponent.md#rotationdegreey) - -#### Defined in - -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` +• **scene**: [`FScene`](FScene.md) -> `set` **rotationDegreeZ**(`z`): `void` +The 3D scene where the model will be added. -#### Parameters +• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) -• **z**: `number` +The options for the component (inherits from FComponent). #### Returns -`number` +[`FModel`](FModel.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`rotationDegreeZ`](FComponent.md#rotationdegreez) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** +[3d/src/model/FModel.ts:54](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L54) -### rotationX +## Methods -> `get` **rotationX**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotationX**(`x`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **x**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationX`](FComponent.md#rotationx) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationY +### \_\_SET\_ROTATION\_\_() -> `get` **rotationY**(): `number` - -> `set` **rotationY**(`y`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **y**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationY`](FComponent.md#rotationy) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationZ +### \_\_SET\_SCALE\_\_() -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationZ`](FComponent.md#rotationz) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### scale +### \_\_UPDATE\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` +• **initiator**: `boolean` = `false` -• **scale.y**: `number` - -• **scale.z**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### scaleX +### \_\_UPDATE\_ROTATION\_\_() -> `get` **scaleX**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **scaleX**(`x`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) - -#### Defined in - -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) - -*** - -### scaleY - -> `get` **scaleY**(): `number` +• **initiator**: `boolean` = `false` -> `set` **scaleY**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleZ`](FComponent.md#scalez) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### x +### \_\_UPDATE\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns +• **initiator**: `boolean` = `false` -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`z`](FComponent.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FModel() - -> **new FModel**(`scene`, `options`): [`FModel`](FModel.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -The 3D scene where the model will be added. - -• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) - -The options for the component (inherits from FComponent). - -#### Returns - -[`FModel`](FModel.md) - -#### Overrides - -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) - -#### Defined in - -[3d/src/model/FModel.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L59) - -## Methods - ### defineMeshTransforms() > **defineMeshTransforms**(): `void` @@ -514,7 +206,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:121](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L121) *** @@ -566,7 +258,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -575,44 +267,58 @@ core/dist/index.d.ts:118 > **emitOnLoaded**(): `void` Emit the onLoaded callbacks. +It was overridden to add shadow support. #### Returns `void` +#### Overrides + +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) + #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:104](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L104) *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```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.CUBOID -}) -``` +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) + +#### Defined in + +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -620,7 +326,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -628,36 +334,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -665,37 +356,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -723,7 +398,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:147](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L147) *** @@ -777,21 +452,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns @@ -803,7 +478,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** @@ -811,7 +486,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the model is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -823,218 +498,66 @@ The callback function. `void` -#### Defined in - -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### 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` - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation on the x-axis. +core/dist/index.d.ts:243 -• **options.y**: `number` - -The rotation on the y-axis. - -• **options.z**: `number` +## Properties -The rotation on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) +core/dist/index.d.ts:216 *** -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The rotation in degrees on the y-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.z**: `number` - -The rotation in degrees on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:207 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### 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` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -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. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) - -#### Defined in - -core/dist/index.d.ts:58 - -*** - -### \_\_CALLBACKS\_ON\_LOADED\_\_ - -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` - -Callbacks for when the model is loaded +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) +core/dist/index.d.ts:211 *** @@ -1051,7 +574,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1065,7 +588,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1081,13 +604,29 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? + +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> + +Mesh + +#### Inherited from + +[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__) + +#### Defined in + +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) + +*** -> **collider**: [`FCollider`](FCollider.md) +### collider? + +> `optional` **collider**: [`FCollider`](FCollider.md) Collider @@ -1097,7 +636,7 @@ Collider #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** @@ -1113,7 +652,7 @@ The controller attached to the component. #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** @@ -1126,23 +665,7 @@ Default is 'obj'. #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) - -*** - -### mesh? - -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> - -Mesh - -#### Inherited from - -[`FComponent`](FComponent.md).[`mesh`](FComponent.md#mesh) - -#### Defined in - -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L47) *** @@ -1155,7 +678,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L22) *** @@ -1170,13 +693,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L30) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1186,7 +709,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1202,13 +725,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1218,7 +741,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1238,7 +761,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L41) *** @@ -1254,4 +777,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FOBJ.md b/docs/api/3d/classes/FOBJ.md index 9f934946..21e40ce4 100644 --- a/docs/api/3d/classes/FOBJ.md +++ b/docs/api/3d/classes/FOBJ.md @@ -21,490 +21,182 @@ scene.addComponent(obj) - [`FModel`](FModel.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 - -[`FModel`](FModel.md).[`position`](FModel.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotation`](FModel.md#rotation) - -#### Defined in - -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** - -### 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 - -[`FModel`](FModel.md).[`rotationDegree`](FModel.md#rotationdegree) - -#### Defined in - -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) - -*** - -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` - -> `set` **rotationDegreeX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeX`](FModel.md#rotationdegreex) - -#### Defined in - -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) - -*** - -### rotationDegreeY +## Constructors -> `get` **rotationDegreeY**(): `number` +### new FOBJ() -> `set` **rotationDegreeY**(`y`): `void` +> **new FOBJ**(`scene`, `options`): [`FOBJ`](FOBJ.md) #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`rotationDegreeY`](FModel.md#rotationdegreey) - -#### Defined in - -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) - -*** - -### rotationDegreeZ - -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters +• **scene**: [`FScene`](FScene.md) -• **z**: `number` +• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) #### Returns -`number` +[`FOBJ`](FOBJ.md) -#### Inherited from +#### Overrides -[`FModel`](FModel.md).[`rotationDegreeZ`](FModel.md#rotationdegreez) +[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) +[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FOBJ.ts#L23) -*** - -### rotationX +## Methods -> `get` **rotationX**(): `number` +### \_\_SET\_POSITION\_\_() -> `set` **rotationX**(`x`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **x**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationX`](FModel.md#rotationx) +[`FModel`](FModel.md).[`__SET_POSITION__`](FModel.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationY - -> `get` **rotationY**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationY**(`y`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **y**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationY`](FModel.md#rotationy) +[`FModel`](FModel.md).[`__SET_ROTATION__`](FModel.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationZ - -> `get` **rotationZ**(): `number` +### \_\_SET\_SCALE\_\_() -> `set` **rotationZ**(`z`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **z**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`rotationZ`](FModel.md#rotationz) +[`FModel`](FModel.md).[`__SET_SCALE__`](FModel.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### scale +### \_\_UPDATE\_POSITION\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` +• **initiator**: `boolean` = `false` -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FModel`](FModel.md).[`scale`](FModel.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scaleX`](FModel.md#scalex) +[`FModel`](FModel.md).[`__UPDATE_POSITION__`](FModel.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### scaleY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **scaleY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **scaleY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`scaleY`](FModel.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` +• **initiator**: `boolean` = `false` -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`scaleZ`](FModel.md#scalez) +[`FModel`](FModel.md).[`__UPDATE_ROTATION__`](FModel.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### x +### \_\_UPDATE\_SCALE\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`x`](FModel.md#x) - -#### Defined in - -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FModel`](FModel.md).[`y`](FModel.md#y) +[`FModel`](FModel.md).[`__UPDATE_SCALE__`](FModel.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FModel`](FModel.md).[`z`](FModel.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FOBJ() - -> **new FOBJ**(`scene`, `options`): [`FOBJ`](FOBJ.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options**: [`FModelOptions`](../interfaces/FModelOptions.md) - -#### Returns - -[`FOBJ`](FOBJ.md) - -#### Overrides - -[`FModel`](FModel.md).[`constructor`](FModel.md#constructors) - -#### Defined in - -[3d/src/model/FOBJ.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FOBJ.ts#L23) - -## Methods - ### defineMeshTransforms() > **defineMeshTransforms**(): `void` @@ -521,7 +213,7 @@ Define mesh transforms (used after loading the model). #### Defined in -[3d/src/model/FModel.ts:133](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L133) +[3d/src/model/FModel.ts:121](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L121) *** @@ -573,7 +265,7 @@ player.emitCollisionWith({ #### Defined in -core/dist/index.d.ts:118 +core/dist/index.d.ts:293 *** @@ -582,6 +274,7 @@ core/dist/index.d.ts:118 > **emitOnLoaded**(): `void` Emit the onLoaded callbacks. +It was overridden to add shadow support. #### Returns @@ -593,37 +286,46 @@ Emit the onLoaded callbacks. #### Defined in -[3d/src/model/FModel.ts:116](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L116) +[3d/src/model/FModel.ts:104](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L104) *** -### initCollider() +### frame() -> **initCollider**(`options`?): `void` +> **frame**(`_delta`): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **\_delta**: `number` #### Returns `void` -#### Example +#### Inherited from -```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.CUBOID -}) -``` +[`FModel`](FModel.md).[`frame`](FModel.md#frame) + +#### Defined in + +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) + +*** + +### initCollider() + +> **initCollider**(`options`?): `void` + +#### Parameters + +• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) + +#### Returns + +`void` #### Inherited from @@ -631,7 +333,7 @@ component.initCollider({ #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -639,36 +341,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initRigidBody`](FModel.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -676,37 +363,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FModel`](FModel.md).[`initSensor`](FModel.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -738,7 +409,7 @@ model.loadTextureFor(material) #### Defined in -[3d/src/model/FModel.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L159) +[3d/src/model/FModel.ts:147](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L147) *** @@ -792,21 +463,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns @@ -818,7 +489,7 @@ Any changes on its transform should be done on the controller, not here. #### Defined in -[3d/src/core/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L108) +core/dist/index.d.ts:238 *** @@ -826,7 +497,7 @@ Any changes on its transform should be done on the controller, not here. > **onLoaded**(`callback`): `void` -Add a callback to be called when the model is loaded. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters @@ -844,212 +515,52 @@ The callback function. #### Defined in -[3d/src/model/FModel.ts:109](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L109) - -*** - -### setPosition() - -> **setPosition**(`options`): `void` - -Set the position of the component. - -#### 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` - -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setPosition`](FModel.md#setposition) - -#### Defined in - -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) - -*** - -### setRotation() - -> **setRotation**(`options`): `void` - -Set the rotation of the component from radians. - -#### 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. +core/dist/index.d.ts:243 -• **options.z**: `number` - -The rotation on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setRotation({ x: 0, y: 0, z: 0 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setRotation`](FModel.md#setrotation) - -#### Defined in - -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FModel`](FModel.md).[`setRotationDegree`](FModel.md#setrotationdegree) +[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` - -The scale on the x-axis. - -• **options.y**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the y-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` - -#### Inherited from - -[`FModel`](FModel.md).[`setScale`](FModel.md#setscale) - -#### Defined in - -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when a frame is rendered. #### Inherited from -[`FModel`](FModel.md).[`__CALLBACKS_ON_COLLISION__`](FModel.md#__callbacks_on_collision__) +[`FModel`](FModel.md).[`__CALLBACKS_ON_FRAME__`](FModel.md#__callbacks_on_frame__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:207 *** ### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Callbacks for when the model is loaded +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from @@ -1057,7 +568,7 @@ Callbacks for when the model is loaded #### Defined in -[3d/src/model/FModel.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L21) +core/dist/index.d.ts:211 *** @@ -1074,7 +585,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1088,7 +599,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1104,72 +615,72 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_? -> **collider**: [`FCollider`](FCollider.md) +> `optional` **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -Collider +Mesh #### Inherited from -[`FModel`](FModel.md).[`collider`](FModel.md#collider) +[`FModel`](FModel.md).[`__MESH__`](FModel.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/core/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L44) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FModel`](FModel.md).[`controller`](FModel.md#controller) +[`FModel`](FModel.md).[`collider`](FModel.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### fileExtension +### controller? -> **fileExtension**: `string` +> `optional` **controller**: [`FController`](FController.md) -The file extension of the model. -Default is 'obj'. +The controller attached to the component. #### Inherited from -[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) +[`FModel`](FModel.md).[`controller`](FModel.md#controller) #### Defined in -[3d/src/model/FModel.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L52) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### mesh? +### fileExtension -> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> +> **fileExtension**: `string` -Mesh +The file extension of the model. +Default is 'obj'. #### Inherited from -[`FModel`](FModel.md).[`mesh`](FModel.md#mesh) +[`FModel`](FModel.md).[`fileExtension`](FModel.md#fileextension) #### Defined in -[3d/src/core/FComponent.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L42) +[3d/src/model/FModel.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L47) *** @@ -1186,7 +697,7 @@ Shouldn't contain file extensions. #### Defined in -[3d/src/model/FModel.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L27) +[3d/src/model/FModel.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L22) *** @@ -1205,13 +716,13 @@ Otherwise, it will be treated as a relative path to the models folder. #### Defined in -[3d/src/model/FModel.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L35) +[3d/src/model/FModel.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L30) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1221,7 +732,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1237,13 +748,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1253,7 +764,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1277,7 +788,7 @@ A record containing texture path for each material. #### Defined in -[3d/src/model/FModel.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L46) +[3d/src/model/FModel.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L41) *** @@ -1293,4 +804,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FOrbitCamera.md b/docs/api/3d/classes/FOrbitCamera.md index 4c66597a..adbfb945 100644 --- a/docs/api/3d/classes/FOrbitCamera.md +++ b/docs/api/3d/classes/FOrbitCamera.md @@ -25,85 +25,62 @@ scene.camera = new FOrbitCamera(cube) - [`FGameCamera`](FGameCamera.md) -## Constructors +## Accessors -### new FOrbitCamera() +### zoom -> **new FOrbitCamera**(`options`): [`FOrbitCamera`](FOrbitCamera.md) +> `get` **zoom**(): `number` -#### Parameters +> `set` **zoom**(`zoom`): `void` -• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) +#### Parameters -Options for the camera. +• **zoom**: `number` #### Returns -[`FOrbitCamera`](FOrbitCamera.md) +`number` -#### Overrides +#### Inherited from -[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) +[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) #### Defined in -[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L30) - -## Methods +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -### add() +## Constructors -> **add**(...`object`): `this` +### new FOrbitCamera() -Adds another Object3D as child of this Object3D. +> **new FOrbitCamera**(`scene`, `options`): [`FOrbitCamera`](FOrbitCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` +• **scene**: [`FScene`](FScene.md) -#### Remarks - -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -#### See +#### Returns - - [attach](FOrbitCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FOrbitCamera`](FOrbitCamera.md) -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`add`](FCamera.md#add) +[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. +[3d/src/cameras/FOrbitCamera.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L30) -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FOrbitCamera`](FOrbitCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -111,23 +88,20 @@ The function that gets called when the event is fired. #### Inherited from -[`FCamera`](FCamera.md).[`addEventListener`](FCamera.md#addeventlistener) +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() - -> **applyMatrix4**(`matrix`): `void` +### \_\_UPDATE\_ROTATION\_\_() -Applies the matrix transform to the object and updates the object's position, rotation and scale. - -#### Parameters +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -135,95 +109,93 @@ Applies the matrix transform to the object and updates the object's position, ro #### Inherited from -[`FCamera`](FCamera.md).[`applyMatrix4`](FCamera.md#applymatrix4) +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() +### \_\_UPDATE\_SCALE\_\_() -> **applyQuaternion**(`quaternion`): `this` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Applies the rotation represented by the quaternion to the object. - -#### Parameters - -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`applyQuaternion`](FCamera.md#applyquaternion) +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` - -#### Remarks - -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). - -#### See +• **options** -[add](FOrbitCamera.md#add) +The options for the collision event. -#### Inherited from - -[`FCamera`](FCamera.md).[`attach`](FCamera.md#attach) +• **options.class?**: `any` -#### Defined in +The class to emit the collision event with. -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 +• **options.component?**: `FComponent` -*** +The component to emit the collision event with. -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FCamera`](FCamera.md).[`clear`](FCamera.md#clear) +[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -231,88 +203,73 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -[`FCamera`](FCamera.md).[`clearViewOffset`](FCamera.md#clearviewoffset) +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`_delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` - -If true, descendants of the object are also cloned. Default `true` +• **\_delta**: `number` #### Returns -`this` +`void` -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`clone`](FCamera.md#clone) +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L38) *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks +`Vector3` -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. +The direction of the camera. It is a normalized vector. #### Inherited from -[`FCamera`](FCamera.md).[`copy`](FCamera.md#copy) +[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns @@ -320,26 +277,38 @@ The event that gets fired. #### Inherited from -[`FCamera`](FCamera.md).[`dispatchEvent`](FCamera.md#dispatchevent) +[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -347,2926 +316,295 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` #### Inherited from -[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) +[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() - -> **getCameraDirection**(): `Vector3` - -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. - -#### Returns - -`Vector3` - -The direction of the camera. It is a normalized vector. - -#### Inherited from - -[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) - -#### Defined in +### onFrame() -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +> **onFrame**(`callback`): `void` -*** +Add a callback to be called every frame. -### getEffectiveFOV() +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getEffectiveFOV`](FCamera.md#geteffectivefov) +[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:238 *** -### getFilmHeight() - -> **getFilmHeight**(): `number` - -Returns the height of the image on the film - -#### Returns - -`number` - -#### Remarks - -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Inherited from - -[`FCamera`](FCamera.md).[`getFilmHeight`](FCamera.md#getfilmheight) - -#### Defined in +### onLoaded() -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 +> **onLoaded**(`callback`): `void` -*** +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). -### getFilmWidth() +#### Parameters -> **getFilmWidth**(): `number` +• **callback** -Returns the width of the image on the film +The callback function. #### Returns -`number` - -#### Remarks - -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getFilmWidth`](FCamera.md#getfilmwidth) +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +core/dist/index.d.ts:243 *** -### getFocalLength() - -> **getFocalLength**(): `number` +### setPosition() -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). +> **setPosition**(`position`): `void` -#### Returns +#### Parameters -`number` +• **position**: [`FVector3`](../interfaces/FVector3.md) -#### Inherited from +#### Returns -[`FCamera`](FCamera.md).[`getFocalLength`](FCamera.md#getfocallength) +`void` #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +[3d/src/cameras/FOrbitCamera.ts:47](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L47) *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> +### setZoom() -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. +> **setZoom**(`zoom`): `void` #### Parameters -• **id**: `number` - -Unique number of the object instance. Expects a `Integer` +• **zoom**: `number` #### Returns -`undefined` \| `Object3D`\<`Object3DEventMap`\> - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. - -#### See - -id - -#### Inherited from - -[`FCamera`](FCamera.md).[`getObjectById`](FCamera.md#getobjectbyid) +`void` #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 - -*** - -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. +[3d/src/cameras/FOrbitCamera.ts:57](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L57) -#### Parameters - -• **name**: `string` +## Properties -String to match to the children's Object3D.name property. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`undefined` \| `Object3D`\<`Object3DEventMap`\> +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. -#### Remarks +#### Index Signature -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByName`](FCamera.md#getobjectbyname) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +core/dist/index.d.ts:216 *** -### getObjectByProperty() +### \_\_CALLBACKS\_ON\_FRAME\_\_ -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +Callbacks for when a frame is rendered. -#### Parameters +#### Inherited from + +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) -• **name**: `string` +#### Defined in -the property name to search for. +core/dist/index.d.ts:207 -• **value**: `any` +*** -value of the given property. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -`undefined` \| `Object3D`\<`Object3DEventMap`\> +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByProperty`](FCamera.md#getobjectbyproperty) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +core/dist/index.d.ts:211 *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] +### \_\_CAMERA\_\_ -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -#### Parameters +Three.js camera object. -• **name**: `string` +#### Inherited from -The property name to search for. +[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__) -• **value**: `any` +#### Defined in -Value of the given property. +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] +*** -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). +### \_\_ID\_\_ -#### Returns +> **\_\_ID\_\_**: `number` -`Object3D`\<`Object3DEventMap`\>[] +Unique identifier for the component. +It is generated automatically. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectsByProperty`](FCamera.md#getobjectsbyproperty) +[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +core/dist/index.d.ts:203 *** -### getViewBounds() +### \_\_IS\_2D\_\_ + +> **\_\_IS\_2D\_\_**: `boolean` = `false` -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` +#### Inherited from -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. +[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) -#### Parameters +#### Defined in -• **distance**: `number` +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) -• **minTarget**: `Vector2` +*** -• **maxTarget**: `Vector2` +### \_\_IS\_3D\_\_ -#### Returns +> **\_\_IS\_3D\_\_**: `boolean` = `true` -`void` +Internal flags #### Inherited from -[`FCamera`](FCamera.md).[`getViewBounds`](FCamera.md#getviewbounds) +[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) *** -### getViewSize() +### attachedComponent -> **getViewSize**(`distance`, `target`): `Vector2` +> **attachedComponent**: [`FComponent`](FComponent.md) -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. +#### Defined in -#### Parameters +[3d/src/cameras/FOrbitCamera.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L26) -• **distance**: `number` +*** -• **target**: `Vector2` +### controller? -#### Returns +> `optional` **controller**: `FController` -`Vector2` +The controller attached to the component. #### Inherited from -[`FCamera`](FCamera.md).[`getViewSize`](FCamera.md#getviewsize) +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +core/dist/index.d.ts:226 *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. +### controls -#### Parameters +> **controls**: `OrbitControls` -• **target**: `Vector3` +#### Defined in -The result will be copied into this Vector3. +[3d/src/cameras/FOrbitCamera.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FOrbitCamera.ts#L28) -#### Returns +*** -`Vector3` +### scene -#### Remarks +> **scene**: `FScene` -Note: A Camera looks down its local, negative z-axis. +The scene the component is attached to. #### Inherited from -[`FCamera`](FCamera.md).[`getWorldDirection`](FCamera.md#getworlddirection) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 +core/dist/index.d.ts:222 *** -### getWorldPosition() +### transform -> **getWorldPosition**(`target`): `Vector3` +> **transform**: [`FTransform`](FTransform.md) -Returns a vector representing the position of the object in world space. +Transform of the camera. -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldPosition`](FCamera.md#getworldposition) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldQuaternion`](FCamera.md#getworldquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldScale`](FCamera.md#getworldscale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FOrbitCamera`](FOrbitCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -[`FCamera`](FCamera.md).[`hasEventListener`](FCamera.md#haseventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`localToWorld`](FCamera.md#localtoworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterRender`](FCamera.md#onafterrender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterShadow`](FCamera.md#onaftershadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeRender`](FCamera.md#onbeforerender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeShadow`](FCamera.md#onbeforeshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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 - -[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L38) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`raycast`](FCamera.md#raycast) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`remove`](FCamera.md#remove) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FOrbitCamera`](FOrbitCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeEventListener`](FCamera.md#removeeventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeFromParent`](FCamera.md#removefromparent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnAxis`](FCamera.md#rotateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnWorldAxis`](FCamera.md#rotateonworldaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateX`](FCamera.md#rotatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateY`](FCamera.md#rotatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateZ`](FCamera.md#rotatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setFocalLength`](FCamera.md#setfocallength) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setLens`](FCamera.md#setlens) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`setPosition`](FCamera.md#setposition) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L46) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotation`](FCamera.md#setrotation) - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromAxisAngle`](FCamera.md#setrotationfromaxisangle) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromEuler`](FCamera.md#setrotationfromeuler) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromMatrix`](FCamera.md#setrotationfrommatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromQuaternion`](FCamera.md#setrotationfromquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setScale`](FCamera.md#setscale) - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setViewOffset`](FCamera.md#setviewoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L54) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -[`FCamera`](FCamera.md).[`toJSON`](FCamera.md#tojson) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateOnAxis`](FCamera.md#translateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateX`](FCamera.md#translatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateY`](FCamera.md#translatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateZ`](FCamera.md#translatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverse`](FCamera.md#traverse) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseAncestors`](FCamera.md#traverseancestors) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseVisible`](FCamera.md#traversevisible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrix`](FCamera.md#updatematrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrixWorld`](FCamera.md#updatematrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateProjectionMatrix`](FCamera.md#updateprojectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateWorldMatrix`](FCamera.md#updateworldmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`worldToLocal`](FCamera.md#worldtolocal) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Inherited from - -[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`animations`](FCamera.md#animations) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`aspect`](FCamera.md#aspect) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### attachedComponent - -> **attachedComponent**: [`FComponent`](FComponent.md) - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L23) - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`castShadow`](FCamera.md#castshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`children`](FCamera.md#children) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### controls - -> **controls**: `OrbitControls` - -#### Defined in - -[3d/src/cameras/FOrbitCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FOrbitCamera.ts#L25) - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -[`FCamera`](FCamera.md).[`coordinateSystem`](FCamera.md#coordinatesystem) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDepthMaterial`](FCamera.md#customdepthmaterial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDistanceMaterial`](FCamera.md#customdistancematerial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -[`FCamera`](FCamera.md).[`far`](FCamera.md#far) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmGauge`](FCamera.md#filmgauge) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmOffset`](FCamera.md#filmoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -[`FCamera`](FCamera.md).[`focus`](FCamera.md#focus) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -[`FCamera`](FCamera.md).[`fov`](FCamera.md#fov) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`frustumCulled`](FCamera.md#frustumculled) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -[`FCamera`](FCamera.md).[`id`](FCamera.md#id) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isCamera`](FCamera.md#iscamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isObject3D`](FCamera.md#isobject3d) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isPerspectiveCamera`](FCamera.md#isperspectivecamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`layers`](FCamera.md#layers) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrix`](FCamera.md#matrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixAutoUpdate`](FCamera.md#matrixautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorld`](FCamera.md#matrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldAutoUpdate`](FCamera.md#matrixworldautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldInverse`](FCamera.md#matrixworldinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldNeedsUpdate`](FCamera.md#matrixworldneedsupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`modelViewMatrix`](FCamera.md#modelviewmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -[`FCamera`](FCamera.md).[`name`](FCamera.md#name) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`near`](FCamera.md#near) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`normalMatrix`](FCamera.md#normalmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`parent`](FCamera.md#parent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrix`](FCamera.md#projectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrixInverse`](FCamera.md#projectionmatrixinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`quaternion`](FCamera.md#quaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`receiveShadow`](FCamera.md#receiveshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`renderOrder`](FCamera.md#renderorder) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotation`](FCamera.md#rotation) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -[`FCamera`](FCamera.md).[`scale`](FCamera.md#scale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transform of the camera. - -#### Inherited from +#### Inherited from [`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -[`FCamera`](FCamera.md).[`type`](FCamera.md#type) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FOrbitCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`up`](FCamera.md#up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`userData`](FCamera.md#userdata) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -[`FCamera`](FCamera.md).[`uuid`](FCamera.md#uuid) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`view`](FCamera.md#view) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -[`FCamera`](FCamera.md).[`viewport`](FCamera.md#viewport) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`visible`](FCamera.md#visible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_AUTO_UPDATE`](FCamera.md#default_matrix_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](FCamera.md#default_matrix_world_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_UP`](FCamera.md#default_up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FPointLight.md b/docs/api/3d/classes/FPointLight.md index 17983459..629256c8 100644 --- a/docs/api/3d/classes/FPointLight.md +++ b/docs/api/3d/classes/FPointLight.md @@ -30,7 +30,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -54,41 +54,23 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -96,7 +78,7 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -120,13 +102,16 @@ A point light in 3d space. #### Defined in -[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FPointLight.ts#L11) +[3d/src/lights/FPointLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FPointLight.ts#L11) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -134,143 +119,120 @@ A point light in 3d space. #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FPointLight.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FPointLight.ts#L40) +core/dist/index.d.ts:50 ## Properties @@ -278,9 +240,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -291,114 +250,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -414,7 +358,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -430,4 +374,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FPointerLockCamera.md b/docs/api/3d/classes/FPointerLockCamera.md index 33537024..4e7a1872 100644 --- a/docs/api/3d/classes/FPointerLockCamera.md +++ b/docs/api/3d/classes/FPointerLockCamera.md @@ -21,85 +21,62 @@ scene.camera = new FPointerLockCamera(cube) - [`FCamera`](FCamera.md) -## Constructors +## Accessors -### new FPointerLockCamera() +### zoom -> **new FPointerLockCamera**(`options`): [`FPointerLockCamera`](FPointerLockCamera.md) +> `get` **zoom**(): `number` -#### Parameters +> `set` **zoom**(`zoom`): `void` -• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) +#### Parameters -Options for the camera. +• **zoom**: `number` #### Returns -[`FPointerLockCamera`](FPointerLockCamera.md) +`number` -#### Overrides +#### Inherited from -[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) +[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) #### Defined in -[3d/src/cameras/FPointerLockCamera.ts:30](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L30) - -## Methods +[3d/src/cameras/FCamera.ts:114](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L114) -### add() +## Constructors -> **add**(...`object`): `this` +### new FPointerLockCamera() -Adds another Object3D as child of this Object3D. +> **new FPointerLockCamera**(`scene`, `options`): [`FPointerLockCamera`](FPointerLockCamera.md) #### Parameters -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` +• **scene**: [`FScene`](FScene.md) -#### Remarks - -An arbitrary number of objects may be added -Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent. +• **options**: [`FAttachedCameraOptions`](../interfaces/FAttachedCameraOptions.md) -#### See +#### Returns - - [attach](FPointerLockCamera.md#attach) - - THREE.Group | Group for info on manually grouping objects. +[`FPointerLockCamera`](FPointerLockCamera.md) -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`add`](FCamera.md#add) +[`FCamera`](FCamera.md).[`constructor`](FCamera.md#constructors) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:515 - -*** - -### addEventListener() - -> **addEventListener**\<`T`\>(`type`, `listener`): `void` - -Adds a listener to an event type. +[3d/src/cameras/FPointerLockCamera.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FPointerLockCamera.ts#L28) -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` +## Methods -The type of event to listen to. +### \_\_UPDATE\_POSITION\_\_() -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FPointerLockCamera`](FPointerLockCamera.md)\> +> **\_\_UPDATE\_POSITION\_\_**(): `void` -The function that gets called when the event is fired. +Update the position of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -107,23 +84,20 @@ The function that gets called when the event is fired. #### Inherited from -[`FCamera`](FCamera.md).[`addEventListener`](FCamera.md#addeventlistener) +[`FCamera`](FCamera.md).[`__UPDATE_POSITION__`](FCamera.md#__update_position__) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:52 +[3d/src/cameras/FCamera.ts:68](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L68) *** -### applyMatrix4() - -> **applyMatrix4**(`matrix`): `void` +### \_\_UPDATE\_ROTATION\_\_() -Applies the matrix transform to the object and updates the object's position, rotation and scale. - -#### Parameters +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -• **matrix**: `Matrix4` +Update the rotation of the camera according to the transform. +This method should be called after updating the transform properties. #### Returns @@ -131,95 +105,93 @@ Applies the matrix transform to the object and updates the object's position, ro #### Inherited from -[`FCamera`](FCamera.md).[`applyMatrix4`](FCamera.md#applymatrix4) +[`FCamera`](FCamera.md).[`__UPDATE_ROTATION__`](FCamera.md#__update_rotation__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:385 +[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L76) *** -### applyQuaternion() +### \_\_UPDATE\_SCALE\_\_() -> **applyQuaternion**(`quaternion`): `this` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Applies the rotation represented by the quaternion to the object. - -#### Parameters - -• **quaternion**: `Quaternion` +Update the scale of the camera according to the transform. +This method should be called after updating the transform properties. +This method does not make sense for cameras, but it is implemented for consistency. #### Returns -`this` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`applyQuaternion`](FCamera.md#applyquaternion) +[`FCamera`](FCamera.md).[`__UPDATE_SCALE__`](FCamera.md#__update_scale__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:391 +[3d/src/cameras/FCamera.ts:85](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L85) *** -### attach() +### emitCollisionWith() -> **attach**(`object`): `this` +> **emitCollisionWith**(`options`): `void` -Adds a Object3D as a child of this, while maintaining the object's world transform. +Emit a collision event with a given class or object. #### Parameters -• **object**: `Object3D`\<`Object3DEventMap`\> - -#### Returns - -`this` - -#### Remarks - -Note: This method does not support scene graphs having non-uniformly-scaled nodes(s). - -#### See +• **options** -[add](FPointerLockCamera.md#add) +The options for the collision event. -#### Inherited from - -[`FCamera`](FCamera.md).[`attach`](FCamera.md#attach) +• **options.class?**: `any` -#### Defined in +The class to emit the collision event with. -3d/node\_modules/@types/three/src/core/Object3D.d.ts:541 +• **options.component?**: `FComponent` -*** +The component to emit the collision event with. -### clear() +#### Returns -> **clear**(): `this` +`void` -Removes all child objects. +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`this` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FCamera`](FCamera.md).[`clear`](FCamera.md#clear) +[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:533 +core/dist/index.d.ts:293 *** -### clearViewOffset() +### emitOnLoaded() -> **clearViewOffset**(): `void` +> **emitOnLoaded**(): `void` -Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) method. +Emit the onLoaded callbacks. #### Returns @@ -227,88 +199,73 @@ Removes any offset set by the [.setViewOffset](FAttachedCamera.md#setviewoffset) #### Inherited from -[`FCamera`](FCamera.md).[`clearViewOffset`](FCamera.md#clearviewoffset) +[`FCamera`](FCamera.md).[`emitOnLoaded`](FCamera.md#emitonloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:240 +core/dist/index.d.ts:247 *** -### clone() +### frame() -> **clone**(`recursive`?): `this` +> **frame**(`_delta`): `void` -Returns a clone of `this` object and optionally all descendants. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **recursive?**: `boolean` - -If true, descendants of the object are also cloned. Default `true` +• **\_delta**: `number` #### Returns -`this` +`void` -#### Inherited from +#### Overrides -[`FCamera`](FCamera.md).[`clone`](FCamera.md#clone) +[`FCamera`](FCamera.md).[`frame`](FCamera.md#frame) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:664 +[3d/src/cameras/FPointerLockCamera.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FPointerLockCamera.ts#L43) *** -### copy() - -> **copy**(`object`, `recursive`?): `this` - -Copies the given object into this object. - -#### Parameters - -• **object**: `Object3D`\<`Object3DEventMap`\> +### getCameraDirection() -• **recursive?**: `boolean` +> **getCameraDirection**(): `Vector3` -If set to `true`, descendants of the object are copied next to the existing ones. If set to -`false`, descendants are left unchanged. Default is `true`. +Get the direction of the camera. +This method is useful to get the direction of the camera to apply forces in the direction of the camera. #### Returns -`this` - -#### Remarks +`Vector3` -Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied. +The direction of the camera. It is a normalized vector. #### Inherited from -[`FCamera`](FCamera.md).[`copy`](FCamera.md#copy) +[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:673 +[3d/src/cameras/FCamera.ts:105](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L105) *** -### dispatchEvent() - -> **dispatchEvent**\<`T`\>(`event`): `void` - -Fire an event type. +### lookAt() -#### Type Parameters +> **lookAt**(`target`): `void` -• **T** *extends* keyof `Object3DEventMap` +Make the camera look at a target. #### Parameters -• **event**: `BaseEvent`\<`T`\> & `Object3DEventMap`\[`T`\] +• **target**: [`FVector3`](../interfaces/FVector3.md) -The event that gets fired. +The target to look at. #### Returns @@ -316,26 +273,38 @@ The event that gets fired. #### Inherited from -[`FCamera`](FCamera.md).[`dispatchEvent`](FCamera.md#dispatchevent) +[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) #### Defined in -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:81 +[3d/src/cameras/FCamera.ts:96](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L96) *** -### emitCollisionWith() +### onCollisionWith() -> **emitCollisionWith**(`classOrObject`): `void` +> **onCollisionWith**(`classOrObject`, `callback`): () => `void` -Emit a collision event with a given class or object. +Add a callback to be called when a collision occurs. #### Parameters • **classOrObject**: `any` +The class or object to add the callback to. + +• **callback** + +The callback to add. + #### Returns +`Function` + +A function to remove the callback. + +##### Returns + `void` #### Examples @@ -343,2926 +312,259 @@ Emit a collision event with a given class or object. ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy +player.onCollisionWith(Enemy, () => { + console.log('Player collided with an Enemy!') }) ``` ```typescript const player = new Player() const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy +player.onCollisionWith(enemy, () => { + console.log('Player collided with the enemy!') }) ``` #### Inherited from -[`FCamera`](FCamera.md).[`emitCollisionWith`](FCamera.md#emitcollisionwith) +[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) #### Defined in -[3d/src/cameras/FCamera.ts:88](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L88) +core/dist/index.d.ts:270 *** -### getCameraDirection() - -> **getCameraDirection**(): `Vector3` - -Get the direction of the camera. -This method is useful to get the direction of the camera to apply forces in the direction of the camera. - -#### Returns - -`Vector3` - -The direction of the camera. It is a normalized vector. - -#### Inherited from - -[`FCamera`](FCamera.md).[`getCameraDirection`](FCamera.md#getcameradirection) - -#### Defined in +### onFrame() -[3d/src/cameras/FCamera.ts:97](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L97) +> **onFrame**(`callback`): `void` -*** +Add a callback to be called every frame. -### getEffectiveFOV() +#### Parameters -> **getEffectiveFOV**(): `number` +• **callback** -Returns the current vertical field of view angle in degrees considering [.zoom](FAttachedCamera.md#zoom). +The callback function. #### Returns -`number` +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getEffectiveFOV`](FCamera.md#geteffectivefov) +[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:165 +core/dist/index.d.ts:238 *** -### getFilmHeight() +### onLoaded() -> **getFilmHeight**(): `number` +> **onLoaded**(`callback`): `void` -Returns the height of the image on the film +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). -#### Returns +#### Parameters -`number` +• **callback** -#### Remarks +The callback function. + +#### Returns -If [.aspect](FAttachedCamera.md#aspect). is less than or equal to one (portrait format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). +`void` #### Inherited from -[`FCamera`](FCamera.md).[`getFilmHeight`](FCamera.md#getfilmheight) +[`FCamera`](FCamera.md).[`onLoaded`](FCamera.md#onloaded) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:179 - -*** - -### getFilmWidth() +core/dist/index.d.ts:243 -> **getFilmWidth**(): `number` +## Properties -Returns the width of the image on the film +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`number` +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. -#### Remarks +#### Index Signature -If [.aspect](FAttachedCamera.md#aspect). is greater than or equal to one (landscape format), the result equals [.filmGauge](FAttachedCamera.md#filmgauge). + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FCamera`](FCamera.md).[`getFilmWidth`](FCamera.md#getfilmwidth) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:172 +core/dist/index.d.ts:216 *** -### getFocalLength() +### \_\_CALLBACKS\_ON\_FRAME\_\_ -> **getFocalLength**(): `number` +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -Returns the focal length of the current .fov | fov in respect to [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Returns - -`number` +Callbacks for when a frame is rendered. #### Inherited from -[`FCamera`](FCamera.md).[`getFocalLength`](FCamera.md#getfocallength) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_FRAME__`](FCamera.md#__callbacks_on_frame__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:153 +core/dist/index.d.ts:207 *** -### getObjectById() - -> **getObjectById**(`id`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching id. - -#### Parameters - -• **id**: `number` - -Unique number of the object instance. Expects a `Integer` - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> - -#### Remarks +### \_\_CALLBACKS\_ON\_LOADED\_\_ -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### See - -id +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FCamera`](FCamera.md).[`getObjectById`](FCamera.md#getobjectbyid) +[`FCamera`](FCamera.md).[`__CALLBACKS_ON_LOADED__`](FCamera.md#__callbacks_on_loaded__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:549 +core/dist/index.d.ts:211 *** -### getObjectByName() - -> **getObjectByName**(`name`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, and returns the first with a matching name. - -#### Parameters - -• **name**: `string` - -String to match to the children's Object3D.name property. - -#### Returns - -`undefined` \| `Object3D`\<`Object3DEventMap`\> +### \_\_CAMERA\_\_ -#### Remarks +> **\_\_CAMERA\_\_**: `PerspectiveCamera` -Note that for most objects the name is an empty string by default -You will have to set it manually to make use of this method. +Three.js camera object. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByName`](FCamera.md#getobjectbyname) +[`FCamera`](FCamera.md).[`__CAMERA__`](FCamera.md#__camera__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:557 +[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L24) *** -### getObjectByProperty() - -> **getObjectByProperty**(`name`, `value`): `undefined` \| `Object3D`\<`Object3DEventMap`\> - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -the property name to search for. - -• **value**: `any` - -value of the given property. +### \_\_ID\_\_ -#### Returns +> **\_\_ID\_\_**: `number` -`undefined` \| `Object3D`\<`Object3DEventMap`\> +Unique identifier for the component. +It is generated automatically. #### Inherited from -[`FCamera`](FCamera.md).[`getObjectByProperty`](FCamera.md#getobjectbyproperty) +[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:566 +core/dist/index.d.ts:203 *** -### getObjectsByProperty() - -> **getObjectsByProperty**(`name`, `value`, `optionalTarget`?): `Object3D`\<`Object3DEventMap`\>[] - -Searches through an object and its children, starting with the object itself, -and returns the first with a property that matches the value given. - -#### Parameters - -• **name**: `string` - -The property name to search for. - -• **value**: `any` - -Value of the given property. - -• **optionalTarget?**: `Object3D`\<`Object3DEventMap`\>[] - -target to set the result. Otherwise a new Array is instantiated. If set, you must clear -this array prior to each call (i.e., array.length = 0;). - -#### Returns +### \_\_IS\_2D\_\_ -`Object3D`\<`Object3DEventMap`\>[] +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FCamera`](FCamera.md).[`getObjectsByProperty`](FCamera.md#getobjectsbyproperty) +[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) #### Defined in -3d/node\_modules/@types/three/src/core/Object3D.d.ts:576 +[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L19) *** -### getViewBounds() - -> **getViewBounds**(`distance`, `minTarget`, `maxTarget`): `void` - -Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. -Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. - -#### Parameters - -• **distance**: `number` - -• **minTarget**: `Vector2` - -• **maxTarget**: `Vector2` +### \_\_IS\_3D\_\_ -#### Returns +> **\_\_IS\_3D\_\_**: `boolean` = `true` -`void` +Internal flags #### Inherited from -[`FCamera`](FCamera.md).[`getViewBounds`](FCamera.md#getviewbounds) +[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:185 +[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L18) *** -### getViewSize() +### attachedComponent -> **getViewSize**(`distance`, `target`): `Vector2` +> **attachedComponent**: [`FComponent`](FComponent.md) -Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. -Copies the result into the target Vector2, where x is width and y is height. +#### Defined in -#### Parameters +[3d/src/cameras/FPointerLockCamera.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FPointerLockCamera.ts#L24) -• **distance**: `number` +*** -• **target**: `Vector2` +### controller? -#### Returns +> `optional` **controller**: `FController` -`Vector2` +The controller attached to the component. #### Inherited from -[`FCamera`](FCamera.md).[`getViewSize`](FCamera.md#getviewsize) +[`FCamera`](FCamera.md).[`controller`](FCamera.md#controller) #### Defined in -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:191 +core/dist/index.d.ts:226 *** -### getWorldDirection() - -> **getWorldDirection**(`target`): `Vector3` - -Returns a THREE.Vector3 | Vector3 representing the world space direction in which the Camera is looking. +### controls -#### Parameters +> **controls**: `PointerLockControls` -• **target**: `Vector3` +#### Defined in -The result will be copied into this Vector3. +[3d/src/cameras/FPointerLockCamera.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FPointerLockCamera.ts#L26) -#### Returns +*** -`Vector3` +### scene -#### Remarks +> **scene**: `FScene` -Note: A Camera looks down its local, negative z-axis. +The scene the component is attached to. #### Inherited from -[`FCamera`](FCamera.md).[`getWorldDirection`](FCamera.md#getworlddirection) +[`FCamera`](FCamera.md).[`scene`](FCamera.md#scene) #### Defined in -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:73 +core/dist/index.d.ts:222 *** -### getWorldPosition() - -> **getWorldPosition**(`target`): `Vector3` - -Returns a vector representing the position of the object in world space. +### transform -#### Parameters +> **transform**: [`FTransform`](FTransform.md) -• **target**: `Vector3` +Transform of the camera. -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldPosition`](FCamera.md#getworldposition) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:582 - -*** - -### getWorldQuaternion() - -> **getWorldQuaternion**(`target`): `Quaternion` - -Returns a quaternion representing the rotation of the object in world space. - -#### Parameters - -• **target**: `Quaternion` - -The result will be copied into this Quaternion. - -#### Returns - -`Quaternion` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldQuaternion`](FCamera.md#getworldquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:588 - -*** - -### getWorldScale() - -> **getWorldScale**(`target`): `Vector3` - -Returns a vector of the scaling factors applied to the object for each axis in world space. - -#### Parameters - -• **target**: `Vector3` - -The result will be copied into this Vector3. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`getWorldScale`](FCamera.md#getworldscale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:594 - -*** - -### hasEventListener() - -> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean` - -Checks if listener is added to an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of event to listen to. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FPointerLockCamera`](FPointerLockCamera.md)\> - -The function that gets called when the event is fired. - -#### Returns - -`boolean` - -#### Inherited from - -[`FCamera`](FCamera.md).[`hasEventListener`](FCamera.md#haseventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:62 - -*** - -### localToWorld() - -> **localToWorld**(`vector`): `Vector3` - -Converts the vector from this object's local space to world space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in this object's local space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`localToWorld`](FCamera.md#localtoworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:484 - -*** - -### lookAt() - -#### lookAt(vector) - -> **lookAt**(`vector`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space to look at. - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:497 - -#### lookAt(x, y, z) - -> **lookAt**(`x`, `y`, `z`): `void` - -Rotates the object to face a point in world space. - -##### Parameters - -• **x**: `number` - -Expects a `Float` - -• **y**: `number` - -Expects a `Float` - -• **z**: `number` - -Expects a `Float` - -##### Returns - -`void` - -##### Remarks - -This method does not support objects having non-uniformly-scaled parent(s). - -##### Inherited from - -[`FCamera`](FCamera.md).[`lookAt`](FCamera.md#lookat) - -##### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:505 - -*** - -### onAfterRender() - -> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterRender`](FCamera.md#onafterrender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:353 - -*** - -### onAfterShadow() - -> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately after a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onAfterShadow`](FCamera.md#onaftershadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:318 - -*** - -### onBeforeRender() - -> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **material**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, geometry, material, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeRender`](FCamera.md#onbeforerender) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:336 - -*** - -### onBeforeShadow() - -> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void` - -An optional callback that is executed immediately before a 3D object is rendered to a shadow map. - -#### Parameters - -• **renderer**: `WebGLRenderer` - -• **scene**: `Scene` - -• **camera**: `Camera` - -• **shadowCamera**: `Camera` - -• **geometry**: `BufferGeometry`\<`NormalBufferAttributes`\> - -• **depthMaterial**: `Material` - -• **group**: `Group`\<`Object3DEventMap`\> - -#### Returns - -`void` - -#### Remarks - -This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, -depthMaterial, group. -Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which -define their visual appearance with geometries and materials like instances of Mesh, Line, -Points or Sprite. Instances of Object3D, Group or Bone are not renderable -and thus this callback is not executed for such objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`onBeforeShadow`](FCamera.md#onbeforeshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:299 - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` - -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` - -The class or object to add the callback to. - -• **callback** - -The callback to add. - -#### Returns - -`Function` - -A function to remove the callback. - -##### Returns - -`void` - -#### 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 - -[`FCamera`](FCamera.md).[`onCollisionWith`](FCamera.md#oncollisionwith) - -#### Defined in - -[3d/src/cameras/FCamera.ts:81](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L81) - -*** - -### onFrame() - -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FCamera`](FCamera.md).[`onFrame`](FCamera.md#onframe) - -#### Defined in - -[3d/src/cameras/FPointerLockCamera.ts:45](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L45) - -*** - -### raycast() - -> **raycast**(`raycaster`, `intersects`): `void` - -Abstract (empty) method to get intersections between a casted ray and this object - -#### Parameters - -• **raycaster**: `Raycaster` - -• **intersects**: `Intersection`\<`Object3D`\<`Object3DEventMap`\>\>[] - -#### Returns - -`void` - -#### Remarks - -Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting. - -#### See - -THREE.Raycaster | Raycaster - -#### Default Value - -`() => {}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`raycast`](FCamera.md#raycast) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:610 - -*** - -### remove() - -> **remove**(...`object`): `this` - -Removes a Object3D as child of this Object3D. - -#### Parameters - -• ...**object**: `Object3D`\<`Object3DEventMap`\>[] - -#### Returns - -`this` - -#### Remarks - -An arbitrary number of objects may be removed. - -#### See - -THREE.Group | Group for info on manually grouping objects. - -#### Inherited from - -[`FCamera`](FCamera.md).[`remove`](FCamera.md#remove) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:523 - -*** - -### removeEventListener() - -> **removeEventListener**\<`T`\>(`type`, `listener`): `void` - -Removes a listener from an event type. - -#### Type Parameters - -• **T** *extends* keyof `Object3DEventMap` - -#### Parameters - -• **type**: `T` - -The type of the listener that gets removed. - -• **listener**: `EventListener`\<`Object3DEventMap`\[`T`\], `T`, [`FPointerLockCamera`](FPointerLockCamera.md)\> - -The listener function that gets removed. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeEventListener`](FCamera.md#removeeventlistener) - -#### Defined in - -3d/node\_modules/@types/three/src/core/EventDispatcher.d.ts:72 - -*** - -### removeFromParent() - -> **removeFromParent**(): `this` - -Removes this object from its current parent. - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`removeFromParent`](FCamera.md#removefromparent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:528 - -*** - -### rotateOnAxis() - -> **rotateOnAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in object space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnAxis`](FCamera.md#rotateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:425 - -*** - -### rotateOnWorldAxis() - -> **rotateOnWorldAxis**(`axis`, `angle`): `this` - -Rotate an object along an axis in world space. - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in world space. - -• **angle**: `number` - -The angle in radians. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized -Method Assumes no rotated parent. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateOnWorldAxis`](FCamera.md#rotateonworldaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:434 - -*** - -### rotateX() - -> **rotateX**(`angle`): `this` - -Rotates the object around _x_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateX`](FCamera.md#rotatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:440 - -*** - -### rotateY() - -> **rotateY**(`angle`): `this` - -Rotates the object around _y_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateY`](FCamera.md#rotatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:446 - -*** - -### rotateZ() - -> **rotateZ**(`angle`): `this` - -Rotates the object around _z_ axis in local space. - -#### Parameters - -• **angle**: `number` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotateZ`](FCamera.md#rotatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:452 - -*** - -### setFocalLength() - -> **setFocalLength**(`focalLength`): `void` - -Sets the FOV by focal length in respect to the current [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Parameters - -• **focalLength**: `number` - -Expects a `Float` - -#### Returns - -`void` - -#### Remarks - -By default, the focal length is specified for a `35mm` (full frame) camera. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setFocalLength`](FCamera.md#setfocallength) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:160 - -*** - -### ~~setLens()~~ - -> **setLens**(`focalLength`, `frameHeight`?): `void` - -#### Parameters - -• **focalLength**: `number` - -• **frameHeight?**: `number` - -#### Returns - -`void` - -#### Deprecated - -Use [.setFocalLength()](FAttachedCamera.md#setfocallength) and [.filmGauge](FAttachedCamera.md#filmgauge) instead. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setLens`](FCamera.md#setlens) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:251 - -*** - -### setPosition() - -> **setPosition**(`x`, `y`, `z`): `void` - -Set the position of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setPosition`](FCamera.md#setposition) - -#### Defined in - -[3d/src/cameras/FCamera.ts:58](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L58) - -*** - -### setRotation() - -> **setRotation**(`x`, `y`, `z`): `void` - -Set the rotation of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotation`](FCamera.md#setrotation) - -#### Defined in - -[3d/src/cameras/FCamera.ts:72](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L72) - -*** - -### setRotationFromAxisAngle() - -> **setRotationFromAxisAngle**(`axis`, `angle`): `void` - -Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **angle**: `number` - -Angle in radians. Expects a `Float` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromAxisAngle`](FCamera.md#setrotationfromaxisangle) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:398 - -*** - -### setRotationFromEuler() - -> **setRotationFromEuler**(`euler`): `void` - -Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **euler**: `Euler` - -Euler angle specifying rotation amount. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromEuler`](FCamera.md#setrotationfromeuler) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:404 - -*** - -### setRotationFromMatrix() - -> **setRotationFromMatrix**(`m`): `void` - -Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **m**: `Matrix4` - -Rotate the quaternion by the rotation component of the matrix. - -#### Returns - -`void` - -#### Remarks - -Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled). - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromMatrix`](FCamera.md#setrotationfrommatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:411 - -*** - -### setRotationFromQuaternion() - -> **setRotationFromQuaternion**(`q`): `void` - -Copy the given THREE.Quaternion | Quaternion into [.quaternion](FAttachedCamera.md#quaternion). - -#### Parameters - -• **q**: `Quaternion` - -Normalized Quaternion. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setRotationFromQuaternion`](FCamera.md#setrotationfromquaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:417 - -*** - -### setScale() - -> **setScale**(`x`, `y`, `z`): `void` - -Set the scale of the camera. - -#### Parameters - -• **x**: `number` - -• **y**: `number` - -• **z**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setScale`](FCamera.md#setscale) - -#### Defined in - -[3d/src/cameras/FCamera.ts:65](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L65) - -*** - -### setViewOffset() - -> **setViewOffset**(`fullWidth`, `fullHeight`, `x`, `y`, `width`, `height`): `void` - -Sets an offset in a larger frustum. - -#### Parameters - -• **fullWidth**: `number` - -Full width of multiview setup Expects a `Float`. - -• **fullHeight**: `number` - -Full height of multiview setup Expects a `Float`. - -• **x**: `number` - -Horizontal offset of subcamera Expects a `Float`. - -• **y**: `number` - -Vertical offset of subcamera Expects a `Float`. - -• **width**: `number` - -Width of subcamera Expects a `Float`. - -• **height**: `number` - -Height of subcamera Expects a `Float`. - -#### Returns - -`void` - -#### Remarks - -This is useful for multi-window or multi-monitor/multi-machine setups. - -For example, if you have 3x2 monitors and each monitor is _1920x1080_ and -the monitors are in grid like this -``` -┌───┬───┬───┐ -│ A │ B │ C │ -├───┼───┼───┤ -│ D │ E │ F │ -└───┴───┴───┘ -``` -then for each monitor you would call it like this -```typescript -const w = 1920 -const h = 1080 -const fullWidth = w * 3 -const fullHeight = h * 2 - -// Monitor - A -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 0, w, h) -// Monitor - B -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 0, w, h) -// Monitor - C -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 0, w, h) -// Monitor - D -camera.setViewOffset(fullWidth, fullHeight, w * 0, h * 1, w, h) -// Monitor - E -camera.setViewOffset(fullWidth, fullHeight, w * 1, h * 1, w, h) -// Monitor - F -camera.setViewOffset(fullWidth, fullHeight, w * 2, h * 1, w, h) -``` -Note there is no reason monitors have to be the same size or in a grid. - -#### Inherited from - -[`FCamera`](FCamera.md).[`setViewOffset`](FCamera.md#setviewoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:235 - -*** - -### setZoom() - -> **setZoom**(`zoom`): `void` - -Set the zoom of the camera. - -#### Parameters - -• **zoom**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`setZoom`](FCamera.md#setzoom) - -#### Defined in - -[3d/src/cameras/FCamera.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L76) - -*** - -### toJSON() - -> **toJSON**(`meta`?): `PerspectiveCameraJSON` - -Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4). - -#### Parameters - -• **meta?**: `JSONMeta` - -Object containing metadata such as materials, textures or images for the object. - -#### Returns - -`PerspectiveCameraJSON` - -#### Inherited from - -[`FCamera`](FCamera.md).[`toJSON`](FCamera.md#tojson) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:253 - -*** - -### translateOnAxis() - -> **translateOnAxis**(`axis`, `distance`): `this` - -Translate an object by distance along an axis in object space - -#### Parameters - -• **axis**: `Vector3` - -A normalized vector in object space. - -• **distance**: `number` - -The distance to translate. Expects a `Float` - -#### Returns - -`this` - -#### Remarks - -The axis is assumed to be normalized. - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateOnAxis`](FCamera.md#translateonaxis) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:460 - -*** - -### translateX() - -> **translateX**(`distance`): `this` - -Translates object along x axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateX`](FCamera.md#translatex) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:466 - -*** - -### translateY() - -> **translateY**(`distance`): `this` - -Translates object along _y_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateY`](FCamera.md#translatey) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:472 - -*** - -### translateZ() - -> **translateZ**(`distance`): `this` - -Translates object along _z_ axis in object space by distance units. - -#### Parameters - -• **distance**: `number` - -Expects a `Float` - -#### Returns - -`this` - -#### Inherited from - -[`FCamera`](FCamera.md).[`translateZ`](FCamera.md#translatez) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:478 - -*** - -### traverse() - -> **traverse**(`callback`): `void` - -Executes the callback on this object and all descendants. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverse`](FCamera.md#traverse) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:617 - -*** - -### traverseAncestors() - -> **traverseAncestors**(`callback`): `void` - -Executes the callback on all ancestors. - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseAncestors`](FCamera.md#traverseancestors) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:632 - -*** - -### traverseVisible() - -> **traverseVisible**(`callback`): `void` - -Like traverse, but the callback will only be executed for visible objects - -#### Parameters - -• **callback** - -A function with as first argument an Object3D object. - -#### Returns - -`void` - -#### Remarks - -Descendants of invisible objects are not traversed. -Note: Modifying the scene graph inside the callback is discouraged. - -#### Inherited from - -[`FCamera`](FCamera.md).[`traverseVisible`](FCamera.md#traversevisible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:625 - -*** - -### updateMatrix() - -> **updateMatrix**(): `void` - -Updates local transform. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrix`](FCamera.md#updatematrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:637 - -*** - -### updateMatrixWorld() - -> **updateMatrixWorld**(`force`?): `void` - -Updates the global transform of the object. -And will update the object descendants if [.matrixWorldNeedsUpdate](FAttachedCamera.md#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`. - -#### Parameters - -• **force?**: `boolean` - -A boolean that can be used to bypass [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame. -Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) set to `true`. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateMatrixWorld`](FCamera.md#updatematrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:645 - -*** - -### updateProjectionMatrix() - -> **updateProjectionMatrix**(): `void` - -Updates the camera projection matrix - -#### Returns - -`void` - -#### Remarks - -Must be called after any change of parameters. - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateProjectionMatrix`](FCamera.md#updateprojectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:246 - -*** - -### updateWorldMatrix() - -> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void` - -Updates the global transform of the object. - -#### Parameters - -• **updateParents**: `boolean` - -Recursively updates global transform of ancestors. - -• **updateChildren**: `boolean` - -Recursively updates global transform of descendants. - -#### Returns - -`void` - -#### Inherited from - -[`FCamera`](FCamera.md).[`updateWorldMatrix`](FCamera.md#updateworldmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:652 - -*** - -### worldToLocal() - -> **worldToLocal**(`vector`): `Vector3` - -Converts the vector from world space to this object's local space. - -#### Parameters - -• **vector**: `Vector3` - -A vector representing a position in world space. - -#### Returns - -`Vector3` - -#### Inherited from - -[`FCamera`](FCamera.md).[`worldToLocal`](FCamera.md#worldtolocal) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:490 - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ - -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` - -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: () => `void`[] - -#### Inherited from - -[`FCamera`](FCamera.md).[`__CALLBACKS_ON_COLLISION__`](FCamera.md#__callbacks_on_collision__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L19) - -*** - -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FCamera`](FCamera.md).[`__ID__`](FCamera.md#__id__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L18) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_2D__`](FCamera.md#__is_2d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L17) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` - -Internal flags - -#### Inherited from - -[`FCamera`](FCamera.md).[`__IS_3D__`](FCamera.md#__is_3d__) - -#### Defined in - -[3d/src/cameras/FCamera.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L16) - -*** - -### animations - -> **animations**: `AnimationClip`[] - -Array with object's animation clips. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`animations`](FCamera.md#animations) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:266 - -*** - -### aspect - -> **aspect**: `number` - -Camera frustum aspect ratio, usually the canvas width / canvas height. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`1`, _(square canvas)_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`aspect`](FCamera.md#aspect) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:93 - -*** - -### attachedComponent - -> **attachedComponent**: [`FComponent`](FComponent.md) - -#### Defined in - -[3d/src/cameras/FPointerLockCamera.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L23) - -*** - -### castShadow - -> **castShadow**: `boolean` - -Whether the object gets rendered into shadow map. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`castShadow`](FCamera.md#castshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:238 - -*** - -### children - -> **children**: `Object3D`\<`Object3DEventMap`\>[] - -Array with object's children. - -#### See - -THREE.Object3DGroup | Group for info on manually grouping objects. - -#### Default Value - -`[]` - -#### Inherited from - -[`FCamera`](FCamera.md).[`children`](FCamera.md#children) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:145 - -*** - -### controls - -> **controls**: `PointerLockControls` - -#### Defined in - -[3d/src/cameras/FPointerLockCamera.ts:25](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FPointerLockCamera.ts#L25) - -*** - -### coordinateSystem - -> **coordinateSystem**: `CoordinateSystem` - -#### Inherited from - -[`FCamera`](FCamera.md).[`coordinateSystem`](FCamera.md#coordinatesystem) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:64 - -*** - -### customDepthMaterial? - -> `optional` **customDepthMaterial**: `Material` - -Custom depth material to be used when rendering to the depth map. - -#### Remarks - -Can only be used in context of meshes. -When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, -if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDepthMaterial`](FCamera.md#customdepthmaterial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:282 - -*** - -### customDistanceMaterial? - -> `optional` **customDistanceMaterial**: `Material` - -Same as [customDepthMaterial](FAttachedCamera.md#customdepthmaterial), but used with THREE.Object3DPointLight | PointLight. - -#### Default Value - -`undefined` - -#### Inherited from - -[`FCamera`](FCamera.md).[`customDistanceMaterial`](FCamera.md#customdistancematerial) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:288 - -*** - -### far - -> **far**: `number` - -Camera frustum far plane. - -#### Remarks - -Must be greater than the current value of [.near](FAttachedCamera.md#near) plane. - -#### Default Value - -`2000` - -#### Inherited from - -[`FCamera`](FCamera.md).[`far`](FCamera.md#far) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:110 - -*** - -### filmGauge - -> **filmGauge**: `number` - -Film size used for the larger axis. -This parameter does not influence the projection matrix unless [.filmOffset](FAttachedCamera.md#filmoffset) is set to a nonzero value. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`35`, _millimeters_. - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmGauge`](FCamera.md#filmgauge) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:141 - -*** - -### filmOffset - -> **filmOffset**: `number` - -Horizontal off-center offset in the same unit as [.filmGauge](FAttachedCamera.md#filmgauge). - -#### Remarks - -Expects a `Float` - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`filmOffset`](FCamera.md#filmoffset) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:148 - -*** - -### focus - -> **focus**: `number` - -Object distance used for stereoscopy and depth-of-field effects. - -#### Remarks - -This parameter does not influence the projection matrix unless a THREE.StereoCamera | StereoCamera is being used. - -#### Default Value - -`10` - -#### Inherited from - -[`FCamera`](FCamera.md).[`focus`](FCamera.md#focus) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:118 - -*** - -### fov - -> **fov**: `number` - -Camera frustum vertical field of view, from bottom to top of view, in degrees. - -#### Remarks - -Expects a `Float` - -#### Default Value - -`50` - -#### Inherited from - -[`FCamera`](FCamera.md).[`fov`](FCamera.md#fov) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:86 - -*** - -### frustumCulled - -> **frustumCulled**: `boolean` - -When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. -If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`frustumCulled`](FCamera.md#frustumculled) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:251 - -*** - -### id - -> `readonly` **id**: `number` - -Unique number for this Object3D instance. - -#### Remarks - -Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. -Expects a `Integer` - -#### Inherited from - -[`FCamera`](FCamera.md).[`id`](FCamera.md#id) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:109 - -*** - -### isCamera - -> `readonly` **isCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isCamera`](FCamera.md#iscamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:29 - -*** - -### isObject3D - -> `readonly` **isObject3D**: `true` - -Flag to check if a given object is of type Object3D. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isObject3D`](FCamera.md#isobject3d) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:102 - -*** - -### isPerspectiveCamera - -> `readonly` **isPerspectiveCamera**: `true` - -Read-only flag to check if a given object is of type Camera. - -#### Remarks - -This is a _constant_ value - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`isPerspectiveCamera`](FCamera.md#isperspectivecamera) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:67 - -*** - -### layers - -> **layers**: `Layers` - -The THREE.Layers | layers that the Camera is a member of. - -#### Remarks - -Objects must share at least one layer with the Camera to be n when the camera's viewpoint is rendered. - -#### Default Value - -`new THREE.Layers()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`layers`](FCamera.md#layers) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:43 - -*** - -### matrix - -> **matrix**: `Matrix4` - -The local transform matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrix`](FCamera.md#matrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:191 - -*** - -### matrixAutoUpdate - -> **matrixAutoUpdate**: `boolean` - -When this is set, it calculates the matrix of position, (rotation or quaternion) and -scale every frame and also recalculates the matrixWorld property. - -#### Default Value - -[DEFAULT_MATRIX_AUTO_UPDATE](FAttachedCamera.md#default_matrix_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixAutoUpdate`](FCamera.md#matrixautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:205 - -*** - -### matrixWorld - -> **matrixWorld**: `Matrix4` - -The global transform of the object. - -#### Remarks - -If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix. - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorld`](FCamera.md#matrixworld) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:198 - -*** - -### matrixWorldAutoUpdate - -> **matrixWorldAutoUpdate**: `boolean` - -If set, then the renderer checks every frame if the object and its children need matrix updates. -When it isn't, then you have to maintain all matrices in the object and its children yourself. - -#### Default Value - -[DEFAULT_MATRIX_WORLD_AUTO_UPDATE](FAttachedCamera.md#default_matrix_world_auto_update) - that is `(true)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldAutoUpdate`](FCamera.md#matrixworldautoupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:212 - -*** - -### matrixWorldInverse - -> **matrixWorldInverse**: `Matrix4` - -This is the inverse of matrixWorld. - -#### Remarks - -MatrixWorld contains the Matrix which has the world transform of the Camera . - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldInverse`](FCamera.md#matrixworldinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:50 - -*** - -### matrixWorldNeedsUpdate - -> **matrixWorldNeedsUpdate**: `boolean` - -When this is set, it calculates the matrixWorld in that frame and resets this property to false. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`matrixWorldNeedsUpdate`](FCamera.md#matrixworldneedsupdate) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:218 - -*** - -### modelViewMatrix - -> `readonly` **modelViewMatrix**: `Matrix4` - -#### Default Value - -`new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`modelViewMatrix`](FCamera.md#modelviewmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:180 - -*** - -### name - -> **name**: `string` - -Optional name of the object - -#### Remarks - -_(doesn't need to be unique)_. - -#### Default Value - -`""` - -#### Inherited from - -[`FCamera`](FCamera.md).[`name`](FCamera.md#name) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:122 - -*** - -### near - -> **near**: `number` - -Camera frustum near plane. - -#### Remarks - -The valid range is greater than `0` and less than the current value of the [.far](FAttachedCamera.md#far) plane. - -#### Default Value - -`0.1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`near`](FCamera.md#near) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:102 - -*** - -### normalMatrix - -> `readonly` **normalMatrix**: `Matrix3` - -#### Default Value - -`new THREE.Matrix3()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`normalMatrix`](FCamera.md#normalmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:185 - -*** - -### parent - -> **parent**: `null` \| `Object3D`\<`Object3DEventMap`\> - -Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). - -#### Remarks - -An object can have at most one parent. - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`parent`](FCamera.md#parent) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:137 - -*** - -### position - -> `readonly` **position**: `Vector3` - -Object's local position. - -#### Default Value - -`new THREE.Vector3()` - that is `(0, 0, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`position`](FCamera.md#position) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:157 - -*** - -### projectionMatrix - -> **projectionMatrix**: `Matrix4` - -This is the matrix which contains the projection. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrix`](FCamera.md#projectionmatrix) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:56 - -*** - -### projectionMatrixInverse - -> **projectionMatrixInverse**: `Matrix4` - -This is the inverse of projectionMatrix. - -#### Default Value - -THREE.Matrix4 | `new THREE.Matrix4()` - -#### Inherited from - -[`FCamera`](FCamera.md).[`projectionMatrixInverse`](FCamera.md#projectionmatrixinverse) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:62 - -*** - -### quaternion - -> `readonly` **quaternion**: `Quaternion` - -Object's local rotation as a THREE.Quaternion | Quaternion. - -#### Default Value - -`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`quaternion`](FCamera.md#quaternion) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:169 - -*** - -### receiveShadow - -> **receiveShadow**: `boolean` - -Whether the material receives shadows. - -#### Default Value - -`false` - -#### Inherited from - -[`FCamera`](FCamera.md).[`receiveShadow`](FCamera.md#receiveshadow) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:244 - -*** - -### renderOrder - -> **renderOrder**: `number` - -This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) -objects to be overridden although opaque and transparent objects remain sorted independently. - -#### Remarks - -When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. -Sorting is from lowest to highest renderOrder. - -#### Default Value - -`0` - -#### Inherited from - -[`FCamera`](FCamera.md).[`renderOrder`](FCamera.md#renderorder) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:260 - -*** - -### rotation - -> `readonly` **rotation**: `Euler` - -Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians. - -#### Default Value - -`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`rotation`](FCamera.md#rotation) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:163 - -*** - -### scale - -> `readonly` **scale**: `Vector3` - -The object's local scale. - -#### Default Value - -`new THREE.Vector3( 1, 1, 1 )` - -#### Inherited from - -[`FCamera`](FCamera.md).[`scale`](FCamera.md#scale) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:175 - -*** - -### transform - -> **transform**: [`FTransform`](FTransform.md) - -Transform of the camera. - -#### Inherited from +#### Inherited from [`FCamera`](FCamera.md).[`transform`](FCamera.md#transform) #### Defined in -[3d/src/cameras/FCamera.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FCamera.ts#L24) - -*** - -### type - -> `readonly` **type**: `string` - -#### Default Value - -`PerspectiveCamera` - -#### Inherited from - -[`FCamera`](FCamera.md).[`type`](FCamera.md#type) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:73 - -*** - -### up - -> **up**: `Vector3` - -This is used by the [lookAt](FPointerLockCamera.md#lookat) method, for example, to determine the orientation of the result. - -#### Default Value - -[Object3D.DEFAULT_UP](FAttachedCamera.md#default_up) - that is `(0, 1, 0)`. - -#### Inherited from - -[`FCamera`](FCamera.md).[`up`](FCamera.md#up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:151 - -*** - -### userData - -> **userData**: `Record`\<`string`, `any`\> - -An object that can be used to store custom data about the Object3D. - -#### Remarks - -It should not hold references to _functions_ as these **will not** be cloned. - -#### Default - -`{}` - -#### Inherited from - -[`FCamera`](FCamera.md).[`userData`](FCamera.md#userdata) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:273 - -*** - -### uuid - -> **uuid**: `string` - -[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. - -#### Remarks - -This gets automatically assigned and shouldn't be edited. - -#### Inherited from - -[`FCamera`](FCamera.md).[`uuid`](FCamera.md#uuid) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:115 - -*** - -### view - -> **view**: `null` \| `object` - -Frustum window specification or null. -This is set using the [.setViewOffset](FAttachedCamera.md#setviewoffset) method and cleared using [.clearViewOffset](FAttachedCamera.md#clearviewoffset). - -#### Default Value - -`null` - -#### Inherited from - -[`FCamera`](FCamera.md).[`view`](FCamera.md#view) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:125 - -*** - -### viewport? - -> `optional` **viewport**: `Vector4` - -#### Inherited from - -[`FCamera`](FCamera.md).[`viewport`](FCamera.md#viewport) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/Camera.d.ts:66 - -*** - -### visible - -> **visible**: `boolean` - -Object gets rendered if `true`. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`visible`](FCamera.md#visible) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:232 - -*** - -### zoom - -> **zoom**: `number` - -Gets or sets the zoom factor of the camera. - -#### Default Value - -`1` - -#### Inherited from - -[`FCamera`](FCamera.md).[`zoom`](FCamera.md#zoom) - -#### Defined in - -3d/node\_modules/@types/three/src/cameras/PerspectiveCamera.d.ts:79 - -*** - -### DEFAULT\_MATRIX\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixAutoUpdate](FAttachedCamera.md#matrixautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_AUTO_UPDATE`](FCamera.md#default_matrix_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:373 - -*** - -### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE - -> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean` - -The default setting for [matrixWorldAutoUpdate](FAttachedCamera.md#matrixworldautoupdate) for newly created Object3Ds. - -#### Default Value - -`true` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](FCamera.md#default_matrix_world_auto_update) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:379 - -*** - -### DEFAULT\_UP - -> `static` **DEFAULT\_UP**: `Vector3` - -The default [up](FAttachedCamera.md#up) direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, -THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down). - -#### Default Value - -`new THREE.Vector3( 0, 1, 0)` - -#### Inherited from - -[`FCamera`](FCamera.md).[`DEFAULT_UP`](FCamera.md#default_up) - -#### Defined in - -3d/node\_modules/@types/three/src/core/Object3D.d.ts:367 +[3d/src/cameras/FCamera.ts:29](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FCamera.ts#L29) diff --git a/docs/api/3d/classes/FPolyhedron.md b/docs/api/3d/classes/FPolyhedron.md index fd4eb14b..0937f0ff 100644 --- a/docs/api/3d/classes/FPolyhedron.md +++ b/docs/api/3d/classes/FPolyhedron.md @@ -15,539 +15,276 @@ Defaults to a cube. - [`FCuboid`](FCuboid.md) - [`FSphere`](FSphere.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 - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### rotation +## Constructors -> `get` **rotation**(): `object` +### new FPolyhedron() -> `set` **rotation**(`rotation`): `void` +> **new FPolyhedron**(`scene`, `options`?): [`FPolyhedron`](FPolyhedron.md) #### Parameters -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` +• **scene**: [`FScene`](FScene.md) -• **rotation.z**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +[`FPolyhedron`](FPolyhedron.md) -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`rotation`](FComponent.md#rotation) +[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** +[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) -### rotationDegree +## Methods -> `get` **rotationDegree**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotationDegree**(`rotationDegree`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegree`](FComponent.md#rotationdegree) +[`FComponent`](FComponent.md).[`__SET_POSITION__`](FComponent.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegreeX`](FComponent.md#rotationdegreex) +[`FComponent`](FComponent.md).[`__SET_ROTATION__`](FComponent.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY +### \_\_SET\_SCALE\_\_() -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationDegreeY`](FComponent.md#rotationdegreey) +[`FComponent`](FComponent.md).[`__SET_SCALE__`](FComponent.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationDegreeZ`](FComponent.md#rotationdegreez) - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** +• **initiator**: `boolean` = `false` -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationX`](FComponent.md#rotationx) +[`FComponent`](FComponent.md).[`__UPDATE_POSITION__`](FComponent.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`rotationY`](FComponent.md#rotationy) - -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`rotationZ`](FComponent.md#rotationz) +[`FComponent`](FComponent.md).[`__UPDATE_ROTATION__`](FComponent.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y +• **initiator**: `boolean` = `false` -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scale`](FComponent.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`scaleX`](FComponent.md#scalex) +[`FComponent`](FComponent.md).[`__UPDATE_SCALE__`](FComponent.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleY +### emitCollisionWith() -> `get` **scaleY**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleY**(`y`): `void` +Emit a collision event with a given class or object. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleY`](FComponent.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** +• **options** -### scaleZ +The options for the collision event. -> `get` **scaleZ**(): `number` +• **options.class?**: `any` -> `set` **scaleZ**(`z`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **z**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`scaleZ`](FComponent.md#scalez) - -#### Defined in - -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters +`void` -• **x**: `number` +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FComponent`](FComponent.md).[`x`](FComponent.md#x) +[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) #### Defined in -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) +core/dist/index.d.ts:293 *** -### y +### emitOnLoaded() -> `get` **y**(): `number` +> **emitOnLoaded**(): `void` -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +Emit the onLoaded callbacks. #### Returns -`number` +`void` #### Inherited from -[`FComponent`](FComponent.md).[`y`](FComponent.md#y) +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FComponent`](FComponent.md).[`z`](FComponent.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FPolyhedron() - -> **new FPolyhedron**(`scene`, `options`?): [`FPolyhedron`](FPolyhedron.md) - -#### Parameters +### frame() -• **scene**: [`FScene`](FScene.md) +> **frame**(`_delta`): `void` -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FPolyhedron`](FPolyhedron.md) - -#### Overrides - -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) - -#### Defined in - -[3d/src/polyhedrons/FPolyhedron.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L18) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -555,37 +292,21 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initCollider`](FComponent.md#initcollider) #### Defined in -[3d/src/core/FComponent.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L362) +[3d/src/core/FComponent.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L286) *** @@ -593,36 +314,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initRigidBody`](FComponent.md#initrigidbody) #### Defined in -[3d/src/core/FComponent.ts:333](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L333) +[3d/src/core/FComponent.ts:295](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L295) *** @@ -630,37 +336,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - #### Inherited from [`FComponent`](FComponent.md).[`initSensor`](FComponent.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/core/FComponent.ts:304](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L304) *** @@ -714,131 +404,73 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) - -#### Defined in - -[3d/src/polyhedrons/FPolyhedron.ts:35](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L35) - -*** - -### setColor() - -> **setColor**(`color`): `void` +> **onFrame**(`callback`): `void` -Change the color of the polyhedron. +Add a callback to be called every frame. #### Parameters -• **color**: `number` +• **callback** -The color of the polyhedron. +The callback function. #### Returns `void` -#### Example +#### Inherited from -```ts -cube.setColor(0xFF0000) -``` +[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FComponent`](FComponent.md).[`setPosition`](FComponent.md#setposition) +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:243 *** -### setRotation() +### setColor() -> **setRotation**(`options`): `void` +> **setColor**(`color`): `void` -Set the rotation of the component from radians. +Change the color of the polyhedron. #### 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` +• **color**: `number` -The rotation on the z-axis. +The color of the polyhedron. #### Returns @@ -847,125 +479,65 @@ The rotation on the z-axis. #### Example ```ts -component.setRotation({ x: 0, y: 0, z: 0 }) +cube.setColor(0xFF0000) ``` -#### Inherited from - -[`FComponent`](FComponent.md).[`setRotation`](FComponent.md#setrotation) - #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) +[3d/src/polyhedrons/FPolyhedron.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L43) -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### 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` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FComponent`](FComponent.md).[`setRotationDegree`](FComponent.md#setrotationdegree) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### 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` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the z-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FComponent`](FComponent.md).[`setScale`](FComponent.md#setscale) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties - -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +core/dist/index.d.ts:207 -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +*** -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. +### \_\_CALLBACKS\_ON\_LOADED\_\_ -#### Index Signature +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -982,7 +554,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -996,7 +568,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1012,62 +584,62 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_ -> **collider**: [`FCollider`](FCollider.md) +> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> -Collider +mesh is redefined from FComponent without the ? because it is +directly available after the constructor, as a polyhedron is created synchronously. -#### Inherited from +#### Overrides -[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) +[`FComponent`](FComponent.md).[`__MESH__`](FComponent.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) +[`FComponent`](FComponent.md).[`collider`](FComponent.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh +### controller? -> **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -mesh is redefined from FComponent without the ? because it is -directly available after the constructor, as a polyhedron is created synchronously. +The controller attached to the component. -#### Overrides +#### Inherited from -[`FComponent`](FComponent.md).[`mesh`](FComponent.md#mesh) +[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1077,7 +649,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1093,13 +665,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1109,7 +681,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1125,4 +697,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FRigidBody.md b/docs/api/3d/classes/FRigidBody.md index 6958cc32..a07f2722 100644 --- a/docs/api/3d/classes/FRigidBody.md +++ b/docs/api/3d/classes/FRigidBody.md @@ -4,460 +4,174 @@ A 3d rigidBody that can be attached to a component. -## Accessors - -### position - -> `get` **position**(): `object` - -> `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` - -#### Defined in - -[3d/src/core/FRigidBody.ts:264](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L264) - -*** - -### 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 +## Extended by -> **y**: `number` +- [`FSensor`](FSensor.md) -##### z - -> **z**: `number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:296](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L296) - -*** - -### rotationDegree - -> `get` **rotationDegree**(): `object` - -> `set` **rotationDegree**(`rotation`): `void` - -#### Parameters - -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` - -• **rotation.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:337](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L337) - -*** +## Accessors -### rotationDegreeX +### component -> `get` **rotationDegreeX**(): `number` +> `get` **component**(): `undefined` \| [`FComponent`](FComponent.md) -> `set` **rotationDegreeX**(`x`): `void` +> `set` **component**(`component`): `void` #### Parameters -• **x**: `number` +• **component**: `undefined` \| [`FComponent`](FComponent.md) #### Returns -`number` +`undefined` \| [`FComponent`](FComponent.md) #### Defined in -[3d/src/core/FRigidBody.ts:346](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L346) +[3d/src/core/FRigidBody.ts:357](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L357) -*** +## Constructors -### rotationDegreeY +### new FRigidBody() -> `get` **rotationDegreeY**(): `number` +> **new FRigidBody**(`scene`, `options`?): [`FRigidBody`](FRigidBody.md) -> `set` **rotationDegreeY**(`y`): `void` +Creates a rigidBody for the given component. #### Parameters -• **y**: `number` - -#### Returns - -`number` +• **scene**: [`FScene`](FScene.md) -#### Defined in - -[3d/src/core/FRigidBody.ts:354](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L354) - -*** - -### rotationDegreeZ +The scene the rigidBody belongs to. -> `get` **rotationDegreeZ**(): `number` - -> `set` **rotationDegreeZ**(`z`): `void` - -#### Parameters +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -• **z**: `number` +The options for the rigidBody. #### Returns -`number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:362](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L362) - -*** - -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` +[`FRigidBody`](FRigidBody.md) -#### Returns +#### Example -`number` +```ts +const rigidBody = new FRigidBody(scene, { + position: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + rotation: { x: 0, y: 0, z: 0 }, + shape: FShapes.CUBOID +}) +``` #### Defined in -[3d/src/core/FRigidBody.ts:313](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L313) +[3d/src/core/FRigidBody.ts:98](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L98) -*** +## Methods -### rotationY +### \_\_SET\_POSITION\_\_() -> `get` **rotationY**(): `number` +> **\_\_SET\_POSITION\_\_**(`position`): `void` -> `set` **rotationY**(`y`): `void` +Set the position of the rigidBody. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Defined in +• **position**: [`FVector3`](../interfaces/FVector3.md) -[3d/src/core/FRigidBody.ts:321](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L321) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +The new position of the rigidBody. #### Returns -`number` +`void` #### Defined in -[3d/src/core/FRigidBody.ts:329](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L329) +[3d/src/core/FRigidBody.ts:319](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L319) *** -### scale +### \_\_SET\_ROTATION\_\_() -> `get` **scale**(): `object` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` -> `set` **scale**(`scale`): `void` +Set the rotation of the rigidBody. #### Parameters -• **scale** - -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` - -#### Returns - -`object` - -##### x - -> **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:370](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L370) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` +The new rotation of the rigidBody. #### Returns -`number` +`void` #### Defined in -[3d/src/core/FRigidBody.ts:378](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L378) +[3d/src/core/FRigidBody.ts:329](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L329) *** -### scaleY +### \_\_SET\_SCALE\_\_() -> `get` **scaleY**(): `number` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` -> `set` **scaleY**(`y`): `void` +Set the scale of the rigidBody. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L386) - -*** - -### scaleZ - -> `get` **scaleZ**(): `number` - -> `set` **scaleZ**(`z`): `void` - -#### Parameters +• **scale**: [`FVector3`](../interfaces/FVector3.md) -• **z**: `number` +The new scale of the rigidBody. #### Returns -`number` +`void` #### Defined in -[3d/src/core/FRigidBody.ts:394](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L394) +[3d/src/core/FRigidBody.ts:339](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L339) *** -### x +### \_\_UPDATE\_POSITION\_\_() -> `get` **x**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **x**(`x`): `void` +Update the position of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **x**: `number` - -#### Returns - -`number` - -#### Defined in +• **initiator**: `boolean` = `false` -[3d/src/core/FRigidBody.ts:272](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L272) - -*** - -### y - -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters - -• **y**: `number` +By default (false), the rigidBody won't be considered as the initiator of the position update. +This means the new position will be the position of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns -`number` +`void` #### Defined in -[3d/src/core/FRigidBody.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L280) +[3d/src/core/FRigidBody.ts:232](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L232) *** -### z +### \_\_UPDATE\_ROTATION\_\_() -> `get` **z**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **z**(`z`): `void` +Update the rotation of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Defined in - -[3d/src/core/FRigidBody.ts:288](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L288) - -## Constructors - -### new FRigidBody() - -> **new FRigidBody**(`component`, `options`?): [`FRigidBody`](FRigidBody.md) - -Creates a rigidBody for the given component. - -#### Parameters - -• **component**: [`FComponent`](FComponent.md) - -The component which the collider will be attached to. - -• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) - -The options for the rigidBody. - -#### Returns - -[`FRigidBody`](FRigidBody.md) - -#### Example - -```ts -const rigidBody = new FRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - shape: FShapes.CUBOID -}) -``` - -#### Defined in - -[3d/src/core/FRigidBody.ts:86](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L86) - -## Methods - -### setPosition() - -> **setPosition**(`position`): `void` - -Set the position of the rigidBody. - -#### Parameters - -• **position** - -The new position of the rigidBody. - -• **position.x**: `number` +• **initiator**: `boolean` = `false` -The new x position of the rigidBody. - -• **position.y**: `number` - -The new y position of the rigidBody. - -• **position.z**: `number` - -The new z position of the rigidBody. +By default (false), the rigidBody won't be considered as the initiator of the rotation update. +This means the new rotation will be the rotation of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -465,33 +179,24 @@ The new z position of the rigidBody. #### Defined in -[3d/src/core/FRigidBody.ts:182](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L182) +[3d/src/core/FRigidBody.ts:262](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L262) *** -### setRotation() +### \_\_UPDATE\_SCALE\_\_() -> **setRotation**(`rotation`): `void` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -Set the rotation of the rigidBody. +Update the scale of the rigidBody according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **rotation** - -The new rotation of the rigidBody. - -• **rotation.x**: `number` - -The new x rotation of the rigidBody. - -• **rotation.y**: `number` +• **initiator**: `boolean` = `false` -The new y rotation of the rigidBody. - -• **rotation.z**: `number` - -The new z rotation of the rigidBody. +By default (false), the rigidBody won't be considered as the initiator of the scale update. +This means the new scale will be the scale of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). #### Returns @@ -499,33 +204,17 @@ The new z rotation of the rigidBody. #### Defined in -[3d/src/core/FRigidBody.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L194) +[3d/src/core/FRigidBody.ts:292](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L292) *** -### setRotationDegree() - -> **setRotationDegree**(`rotation`): `void` +### frame() -Set the rotation of the rigidBody in degrees. +> **frame**(`_delta`): `void` #### Parameters -• **rotation** - -The new rotation of the rigidBody in degrees. - -• **rotation.x**: `number` - -The new x rotation of the rigidBody in degrees. - -• **rotation.y**: `number` - -The new y rotation of the rigidBody in degrees. - -• **rotation.z**: `number` - -The new z rotation of the rigidBody in degrees. +• **\_delta**: `number` #### Returns @@ -533,33 +222,21 @@ The new z rotation of the rigidBody in degrees. #### Defined in -[3d/src/core/FRigidBody.ts:206](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L206) +[3d/src/core/FRigidBody.ts:203](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L203) *** -### setScale() +### setAngvel() -> **setScale**(`scale`): `void` +> **setAngvel**(`velocity`): `void` -Set the scale of the rigidBody. +Set the angular velocity of the rigidBody. #### Parameters -• **scale** - -The new scale of the rigidBody. - -• **scale.x**: `number` - -The new x scale of the rigidBody. +• **velocity**: [`FVector3`](../interfaces/FVector3.md) -• **scale.y**: `number` - -The new y scale of the rigidBody. - -• **scale.z**: `number` - -The new z scale of the rigidBody. +The new angular velocity of the rigidBody. #### Returns @@ -567,51 +244,21 @@ The new z scale of the rigidBody. #### Defined in -[3d/src/core/FRigidBody.ts:221](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L221) +[3d/src/core/FRigidBody.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L221) *** -### updatePosition() - -> **updatePosition**(): `void` - -Update the position of the rigidBody according to its component's position. -This takes into account the position offset. - -#### Returns - -`void` - -#### Defined in - -[3d/src/core/FRigidBody.ts:229](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L229) - -*** +### setLinvel() -### updateRotation() +> **setLinvel**(`velocity`): `void` -> **updateRotation**(): `void` +Set the linear velocity of the rigidBody. -Update the rotation of the rigidBody according to its component's rotation. -This takes into account the rotation offset. - -#### Returns - -`void` - -#### Defined in - -[3d/src/core/FRigidBody.ts:243](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L243) - -*** - -### updateScale() +#### Parameters -> **updateScale**(): `void` +• **velocity**: [`FVector3`](../interfaces/FVector3.md) -Update the scale of the rigidBody according to its component's scale. -This takes into account the scale offset. -As a rigidBody does not have a scale, this will only update the attached collider's scale. +The new linear velocity of the rigidBody. #### Returns @@ -619,90 +266,64 @@ As a rigidBody does not have a scale, this will only update the attached collide #### Defined in -[3d/src/core/FRigidBody.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L258) +[3d/src/core/FRigidBody.ts:213](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L213) ## Properties -### \_\_RIGIDBODY\_POSITION\_OFFSET\_\_ - -> **\_\_RIGIDBODY\_POSITION\_OFFSET\_\_**: `object` - -Position Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the component. - -#### x - -> **x**: `number` +### \_\_COMPONENT\_\_? -#### y +> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md) -> **y**: `number` - -#### z - -> **z**: `number` +The component the rigidBody is attached to. #### Defined in -[3d/src/core/FRigidBody.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L46) +[3d/src/core/FRigidBody.ts:54](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L54) *** -### \_\_RIGIDBODY\_ROTATION\_OFFSET\_\_ - -> **\_\_RIGIDBODY\_ROTATION\_OFFSET\_\_**: `object` - -Rotation Offset for the rigidBody. -This is used to adjust the rigidBody position relative to the component. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_RIGIDBODY\_\_ -#### z +> **\_\_RIGIDBODY\_\_**: `RigidBody` -> **z**: `number` +RAPIER RigidBody #### Defined in -[3d/src/core/FRigidBody.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L51) +[3d/src/core/FRigidBody.ts:46](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L46) *** -### \_\_RIGIDBODY\_\_ +### collider -> **\_\_RIGIDBODY\_\_**: `RigidBody` +> **collider**: [`FCollider`](FCollider.md) -RAPIER RigidBody +Fibbo Collider #### Defined in -[3d/src/core/FRigidBody.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L37) +[3d/src/core/FRigidBody.ts:50](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L50) *** -### collider +### offset -> **collider**: [`FCollider`](FCollider.md) +> **offset**: [`FTransform`](FTransform.md) -Fibbo Collider +The transform offset of the rigidBody. #### Defined in -[3d/src/core/FRigidBody.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L41) +[3d/src/core/FRigidBody.ts:62](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L62) *** -### component +### transform -> **component**: [`FComponent`](FComponent.md) +> **transform**: [`FTransform`](FTransform.md) -The component the rigidBody is attached to. +The transform of the rigidBody. #### Defined in -[3d/src/core/FRigidBody.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L55) +[3d/src/core/FRigidBody.ts:58](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L58) diff --git a/docs/api/3d/classes/FScene.md b/docs/api/3d/classes/FScene.md index d2a8e239..95fdfaa5 100644 --- a/docs/api/3d/classes/FScene.md +++ b/docs/api/3d/classes/FScene.md @@ -2,7 +2,7 @@ # Class: FScene -A scene which contains the models, the Three.js scene and the Rapier world. +A scene which contains the components, the Three.js scene and the Rapier world. ## Example @@ -17,19 +17,17 @@ import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d' // Create a ground const ground = new FCuboid(scene) - ground.setScale(15, 0.1, 15) - ground.setPosition(0, -0.1, 0) + ground.transform.setScale(15, 0.1, 15) + ground.transform.setPosition(0, -0.1, 0) ground.initCollider() ground.setColor(0x1F1F1F) - scene.addComponent(ground) // Create a cube const cube = new FCuboid(scene) cube.initRigidBody() - scene.addComponent(cube) // Attach a camera to the cube - scene.camera = new FGameCamera(cube) + scene.camera = new FGameCamera(scene, { target: cube }) })() ``` @@ -57,10 +55,28 @@ import { FCuboid, FGameCamera, FScene } from '@fibbojs/3d' #### Defined in -[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L71) +[3d/src/core/FScene.ts:74](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L74) ## Methods +### addCollider() + +> **addCollider**(`collider`): `void` + +#### Parameters + +• **collider**: [`FCollider`](FCollider.md) + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L251) + +*** + ### addComponent() > **addComponent**(`component`): `void` @@ -81,7 +97,27 @@ Add a component to the scene. #### Defined in -[3d/src/core/FScene.ts:183](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L183) +[3d/src/core/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L202) + +*** + +### addHandle() + +> **addHandle**(`handle`, `component`): `void` + +#### Parameters + +• **handle**: `number` + +• **component**: [`FComponent`](FComponent.md) + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:194](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L194) *** @@ -105,7 +141,52 @@ Add a light to the scene. #### Defined in -[3d/src/core/FScene.ts:236](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L236) +[3d/src/core/FScene.ts:239](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L239) + +*** + +### addRigidBody() + +> **addRigidBody**(`rigidBody`): `void` + +#### Parameters + +• **rigidBody**: [`FRigidBody`](FRigidBody.md) + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:262](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L262) + +*** + +### frame() + +> **frame**(`delta`): `void` + +Compute a frame with the given delta time. +By default, it is called every frame, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene. + +#### Parameters + +• **delta**: `number` + +The time in seconds since the last frame. + +#### Returns + +`void` + +#### Inherited from + +`FSceneCore.frame` + +#### Defined in + +core/dist/index.d.ts:149 *** @@ -135,7 +216,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:159](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L159) +[3d/src/core/FScene.ts:170](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L170) *** @@ -149,7 +230,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:95](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L95) +[3d/src/core/FScene.ts:102](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L102) *** @@ -163,7 +244,7 @@ If the collision has started or ended #### Defined in -[3d/src/core/FScene.ts:130](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L130) +[3d/src/core/FScene.ts:137](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L137) *** @@ -187,7 +268,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -core/dist/index.d.ts:275 +core/dist/index.d.ts:157 *** @@ -211,7 +292,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -core/dist/index.d.ts:279 +core/dist/index.d.ts:161 *** @@ -235,7 +316,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -core/dist/index.d.ts:271 +core/dist/index.d.ts:153 *** @@ -259,7 +340,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -core/dist/index.d.ts:288 +core/dist/index.d.ts:170 *** @@ -283,7 +364,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -core/dist/index.d.ts:292 +core/dist/index.d.ts:174 *** @@ -308,7 +389,25 @@ The scene is ready when the `init` method has finished. #### Defined in -core/dist/index.d.ts:284 +core/dist/index.d.ts:166 + +*** + +### removeCollider() + +> **removeCollider**(`collider`): `void` + +#### Parameters + +• **collider**: [`FCollider`](FCollider.md) + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:255](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L255) *** @@ -332,7 +431,25 @@ Remove a component from the scene. #### Defined in -[3d/src/core/FScene.ts:214](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L214) +[3d/src/core/FScene.ts:217](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L217) + +*** + +### removeHandle() + +> **removeHandle**(`handle`): `void` + +#### Parameters + +• **handle**: `number` + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:198](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L198) *** @@ -356,7 +473,25 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:243](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L243) +[3d/src/core/FScene.ts:245](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L245) + +*** + +### removeRigidBody() + +> **removeRigidBody**(`rigidBody`): `void` + +#### Parameters + +• **rigidBody**: [`FRigidBody`](FRigidBody.md) + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FScene.ts:266](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L266) ## Properties @@ -366,7 +501,7 @@ Remove a light from the scene. #### Defined in -[3d/src/core/FScene.ts:60](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L60) +[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L63) *** @@ -375,7 +510,6 @@ Remove a light from the scene. > **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[] Callbacks for when a component is added to the scene. -It is an array of functions that take the component as an argument. #### Inherited from @@ -383,7 +517,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:231 +core/dist/index.d.ts:110 *** @@ -392,7 +526,6 @@ core/dist/index.d.ts:231 > **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[] Callbacks for when a component is remove from the scene. -It is an array of functions that take the component as an argument. #### Inherited from @@ -400,7 +533,7 @@ It is an array of functions that take the component as an argument. #### Defined in -core/dist/index.d.ts:236 +core/dist/index.d.ts:114 *** @@ -409,7 +542,6 @@ core/dist/index.d.ts:236 > **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[] Callbacks for when a frame is rendered. -It is an array of functions that take the delta time as an argument. #### Inherited from @@ -417,7 +549,7 @@ It is an array of functions that take the delta time as an argument. #### Defined in -core/dist/index.d.ts:226 +core/dist/index.d.ts:106 *** @@ -426,7 +558,6 @@ core/dist/index.d.ts:226 > **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[] Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Inherited from @@ -434,7 +565,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:245 +core/dist/index.d.ts:122 *** @@ -443,7 +574,6 @@ core/dist/index.d.ts:245 > **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[] Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Inherited from @@ -451,7 +581,7 @@ It is an array of functions that take the light as an argument. #### Defined in -core/dist/index.d.ts:250 +core/dist/index.d.ts:126 *** @@ -467,7 +597,7 @@ Callbacks for when the scene is ready. #### Defined in -core/dist/index.d.ts:240 +core/dist/index.d.ts:118 *** @@ -483,7 +613,7 @@ DOM element that the renderer will be appended to #### Defined in -core/dist/index.d.ts:202 +core/dist/index.d.ts:83 *** @@ -493,7 +623,7 @@ core/dist/index.d.ts:202 #### Defined in -[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L52) +[3d/src/core/FScene.ts:52](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L52) *** @@ -507,7 +637,7 @@ core/dist/index.d.ts:202 #### Defined in -core/dist/index.d.ts:198 +core/dist/index.d.ts:79 *** @@ -523,7 +653,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L51) +[3d/src/core/FScene.ts:51](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L51) *** @@ -537,7 +667,7 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L69) +[3d/src/core/FScene.ts:72](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L72) *** @@ -547,7 +677,17 @@ Internal flags #### Defined in -[3d/src/core/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L63) +[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L66) + +*** + +### colliders + +> **colliders**: [`FCollider`](FCollider.md)[] + +#### Defined in + +[3d/src/core/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L59) *** @@ -563,7 +703,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L55) +[3d/src/core/FScene.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L55) *** @@ -577,25 +717,13 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L68) +[3d/src/core/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L71) *** ### gravity -> **gravity**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> **gravity**: [`FVector3`](../interfaces/FVector3.md) #### Overrides @@ -603,7 +731,7 @@ The components in the scene. #### Defined in -[3d/src/core/FScene.ts:66](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L66) +[3d/src/core/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L69) *** @@ -619,7 +747,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L57) +[3d/src/core/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L57) *** @@ -629,7 +757,17 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:62](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L62) +[3d/src/core/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L65) + +*** + +### rigidBodies + +> **rigidBodies**: [`FRigidBody`](FRigidBody.md)[] + +#### Defined in + +[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L61) *** @@ -639,7 +777,7 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L61) +[3d/src/core/FScene.ts:64](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L64) *** @@ -653,4 +791,4 @@ The lights in the scene. #### Defined in -[3d/src/core/FScene.ts:67](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L67) +[3d/src/core/FScene.ts:70](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L70) diff --git a/docs/api/3d/classes/FSensor.md b/docs/api/3d/classes/FSensor.md new file mode 100644 index 00000000..55f8fed1 --- /dev/null +++ b/docs/api/3d/classes/FSensor.md @@ -0,0 +1,393 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FSensor + +# Class: FSensor + +A 3d sensor that can be attached to a component. + +## Extends + +- [`FRigidBody`](FRigidBody.md) + +## Accessors + +### component + +> `get` **component**(): `undefined` \| [`FComponent`](FComponent.md) + +> `set` **component**(`component`): `void` + +#### Parameters + +• **component**: `undefined` \| [`FComponent`](FComponent.md) + +#### Returns + +`undefined` \| [`FComponent`](FComponent.md) + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`component`](FRigidBody.md#component) + +#### Defined in + +[3d/src/core/FRigidBody.ts:357](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L357) + +## Constructors + +### new FSensor() + +> **new FSensor**(`scene`, `options`?): [`FSensor`](FSensor.md) + +Creates a rigidBody for the given component. + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +The scene the rigidBody belongs to. + +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) + +The options for the rigidBody. + +#### Returns + +[`FSensor`](FSensor.md) + +#### Example + +```ts +const sensor = new FSensor(scene, { + position: { x: 0, y: 0, z: 0 }, + scale: { x: 1, y: 1, z: 1 }, + rotation: { x: 0, y: 0, z: 0 }, + shape: FShapes.CUBOID +}) +``` + +#### Overrides + +[`FRigidBody`](FRigidBody.md).[`constructor`](FRigidBody.md#constructors) + +#### Defined in + +[3d/src/core/FSensor.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FSensor.ts#L40) + +## Methods + +### \_\_SET\_POSITION\_\_() + +> **\_\_SET\_POSITION\_\_**(`position`): `void` + +Set the position of the rigidBody. + +#### Parameters + +• **position**: [`FVector3`](../interfaces/FVector3.md) + +The new position of the rigidBody. + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__SET_POSITION__`](FRigidBody.md#__set_position__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:319](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L319) + +*** + +### \_\_SET\_ROTATION\_\_() + +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` + +Set the rotation of the rigidBody. + +#### Parameters + +• **rotation**: [`FVector3`](../interfaces/FVector3.md) + +The new rotation of the rigidBody. + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__SET_ROTATION__`](FRigidBody.md#__set_rotation__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:329](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L329) + +*** + +### \_\_SET\_SCALE\_\_() + +> **\_\_SET\_SCALE\_\_**(`scale`): `void` + +Set the scale of the rigidBody. + +#### Parameters + +• **scale**: [`FVector3`](../interfaces/FVector3.md) + +The new scale of the rigidBody. + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__SET_SCALE__`](FRigidBody.md#__set_scale__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:339](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L339) + +*** + +### \_\_UPDATE\_POSITION\_\_() + +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` + +Update the position of the rigidBody according to the transform. +This method should be called after updating the transform properties. + +#### Parameters + +• **initiator**: `boolean` = `false` + +By default (false), the rigidBody won't be considered as the initiator of the position update. +This means the new position will be the position of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__UPDATE_POSITION__`](FRigidBody.md#__update_position__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:232](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L232) + +*** + +### \_\_UPDATE\_ROTATION\_\_() + +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` + +Update the rotation of the rigidBody according to the transform. +This method should be called after updating the transform properties. + +#### Parameters + +• **initiator**: `boolean` = `false` + +By default (false), the rigidBody won't be considered as the initiator of the rotation update. +This means the new rotation will be the rotation of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__UPDATE_ROTATION__`](FRigidBody.md#__update_rotation__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:262](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L262) + +*** + +### \_\_UPDATE\_SCALE\_\_() + +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` + +Update the scale of the rigidBody according to the transform. +This method should be called after updating the transform properties. + +#### Parameters + +• **initiator**: `boolean` = `false` + +By default (false), the rigidBody won't be considered as the initiator of the scale update. +This means the new scale will be the scale of the attached component, plus the offset. +Setting this to true will propagate the event to other objects (component, sensor,...). + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__UPDATE_SCALE__`](FRigidBody.md#__update_scale__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:292](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L292) + +*** + +### frame() + +> **frame**(`_delta`): `void` + +#### Parameters + +• **\_delta**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`frame`](FRigidBody.md#frame) + +#### Defined in + +[3d/src/core/FRigidBody.ts:203](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L203) + +*** + +### setAngvel() + +> **setAngvel**(`velocity`): `void` + +Set the angular velocity of the rigidBody. + +#### Parameters + +• **velocity**: [`FVector3`](../interfaces/FVector3.md) + +The new angular velocity of the rigidBody. + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`setAngvel`](FRigidBody.md#setangvel) + +#### Defined in + +[3d/src/core/FRigidBody.ts:221](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L221) + +*** + +### setLinvel() + +> **setLinvel**(`velocity`): `void` + +Set the linear velocity of the rigidBody. + +#### Parameters + +• **velocity**: [`FVector3`](../interfaces/FVector3.md) + +The new linear velocity of the rigidBody. + +#### Returns + +`void` + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`setLinvel`](FRigidBody.md#setlinvel) + +#### Defined in + +[3d/src/core/FRigidBody.ts:213](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L213) + +## Properties + +### \_\_COMPONENT\_\_? + +> `optional` **\_\_COMPONENT\_\_**: [`FComponent`](FComponent.md) + +The component the rigidBody is attached to. + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__COMPONENT__`](FRigidBody.md#__component__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:54](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L54) + +*** + +### \_\_RIGIDBODY\_\_ + +> **\_\_RIGIDBODY\_\_**: `RigidBody` + +RAPIER RigidBody + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`__RIGIDBODY__`](FRigidBody.md#__rigidbody__) + +#### Defined in + +[3d/src/core/FRigidBody.ts:46](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L46) + +*** + +### collider + +> **collider**: [`FCollider`](FCollider.md) + +Fibbo Collider + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`collider`](FRigidBody.md#collider) + +#### Defined in + +[3d/src/core/FRigidBody.ts:50](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L50) + +*** + +### offset + +> **offset**: [`FTransform`](FTransform.md) + +The transform offset of the rigidBody. + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`offset`](FRigidBody.md#offset) + +#### Defined in + +[3d/src/core/FRigidBody.ts:62](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L62) + +*** + +### transform + +> **transform**: [`FTransform`](FTransform.md) + +The transform of the rigidBody. + +#### Inherited from + +[`FRigidBody`](FRigidBody.md).[`transform`](FRigidBody.md#transform) + +#### Defined in + +[3d/src/core/FRigidBody.ts:58](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L58) diff --git a/docs/api/3d/classes/FSphere.md b/docs/api/3d/classes/FSphere.md index 687af127..d9b95c70 100644 --- a/docs/api/3d/classes/FSphere.md +++ b/docs/api/3d/classes/FSphere.md @@ -19,539 +19,276 @@ scene.addComponent(sphere) - [`FPolyhedron`](FPolyhedron.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 - -[`FPolyhedron`](FPolyhedron.md).[`position`](FPolyhedron.md#position) - -#### Defined in - -[3d/src/core/FComponent.ts:408](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L408) - -*** - -### rotation +## Constructors -> `get` **rotation**(): `object` +### new FSphere() -> `set` **rotation**(`rotation`): `void` +> **new FSphere**(`scene`, `options`?): [`FSphere`](FSphere.md) #### Parameters -• **rotation** - -• **rotation.x**: `number` - -• **rotation.y**: `number` +• **scene**: [`FScene`](FScene.md) -• **rotation.z**: `number` +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +[`FSphere`](FSphere.md) -#### Inherited from +#### Overrides -[`FPolyhedron`](FPolyhedron.md).[`rotation`](FPolyhedron.md#rotation) +[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) #### Defined in -[3d/src/core/FComponent.ts:440](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L440) - -*** +[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FSphere.ts#L23) -### rotationDegree +## Methods -> `get` **rotationDegree**(): `object` +### \_\_SET\_POSITION\_\_() -> `set` **rotationDegree**(`rotationDegree`): `void` +> **\_\_SET\_POSITION\_\_**(`position`): `void` #### Parameters -• **rotationDegree** - -• **rotationDegree.x**: `number` - -• **rotationDegree.y**: `number` - -• **rotationDegree.z**: `number` +• **position**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegree`](FPolyhedron.md#rotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__SET_POSITION__`](FPolyhedron.md#__set_position__) #### Defined in -[3d/src/core/FComponent.ts:472](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L472) +[3d/src/core/FComponent.ts:243](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L243) *** -### rotationDegreeX - -> `get` **rotationDegreeX**(): `number` +### \_\_SET\_ROTATION\_\_() -> `set` **rotationDegreeX**(`x`): `void` +> **\_\_SET\_ROTATION\_\_**(`rotation`): `void` #### Parameters -• **x**: `number` +• **rotation**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeX`](FPolyhedron.md#rotationdegreex) +[`FPolyhedron`](FPolyhedron.md).[`__SET_ROTATION__`](FPolyhedron.md#__set_rotation__) #### Defined in -[3d/src/core/FComponent.ts:484](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L484) +[3d/src/core/FComponent.ts:251](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L251) *** -### rotationDegreeY +### \_\_SET\_SCALE\_\_() -> `get` **rotationDegreeY**(): `number` - -> `set` **rotationDegreeY**(`y`): `void` +> **\_\_SET\_SCALE\_\_**(`scale`): `void` #### Parameters -• **y**: `number` +• **scale**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeY`](FPolyhedron.md#rotationdegreey) +[`FPolyhedron`](FPolyhedron.md).[`__SET_SCALE__`](FPolyhedron.md#__set_scale__) #### Defined in -[3d/src/core/FComponent.ts:492](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L492) +[3d/src/core/FComponent.ts:259](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L259) *** -### rotationDegreeZ +### \_\_UPDATE\_POSITION\_\_() -> `get` **rotationDegreeZ**(): `number` +> **\_\_UPDATE\_POSITION\_\_**(`initiator`): `void` -> `set` **rotationDegreeZ**(`z`): `void` +Update the position of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **z**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationDegreeZ`](FPolyhedron.md#rotationdegreez) - -#### Defined in - -[3d/src/core/FComponent.ts:500](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L500) - -*** +• **initiator**: `boolean` = `false` -### rotationX - -> `get` **rotationX**(): `number` - -> `set` **rotationX**(`x`): `void` - -#### Parameters - -• **x**: `number` +By default (false), the component won't be considered as the initiator of the position update. +Set this to true to propagate the position update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationX`](FPolyhedron.md#rotationx) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_POSITION__`](FPolyhedron.md#__update_position__) #### Defined in -[3d/src/core/FComponent.ts:448](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L448) +[3d/src/core/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L123) *** -### rotationY +### \_\_UPDATE\_ROTATION\_\_() -> `get` **rotationY**(): `number` +> **\_\_UPDATE\_ROTATION\_\_**(`initiator`): `void` -> `set` **rotationY**(`y`): `void` +Update the rotation of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **y**: `number` +• **initiator**: `boolean` = `false` -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`rotationY`](FPolyhedron.md#rotationy) - -#### Defined in - -[3d/src/core/FComponent.ts:456](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L456) - -*** - -### rotationZ - -> `get` **rotationZ**(): `number` - -> `set` **rotationZ**(`z`): `void` - -#### Parameters - -• **z**: `number` +By default (false), the component won't be considered as the initiator of the rotation update. +Set this to true to propagate the rotation update to the rigidBody, collider and sensor. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`rotationZ`](FPolyhedron.md#rotationz) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_ROTATION__`](FPolyhedron.md#__update_rotation__) #### Defined in -[3d/src/core/FComponent.ts:464](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L464) +[3d/src/core/FComponent.ts:165](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L165) *** -### scale +### \_\_UPDATE\_SCALE\_\_() -> `get` **scale**(): `object` +> **\_\_UPDATE\_SCALE\_\_**(`initiator`): `void` -> `set` **scale**(`scale`): `void` +Update the scale of the component according to the transform. +This method should be called after updating the transform properties. #### Parameters -• **scale** +• **initiator**: `boolean` = `false` -• **scale.x**: `number` - -• **scale.y**: `number` - -• **scale.z**: `number` +By default (false), the component won't be considered as the initiator of the scale update. +Set this to true to propagate the scale update to the rigidBody, collider and sensor. #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scale`](FPolyhedron.md#scale) - -#### Defined in - -[3d/src/core/FComponent.ts:508](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L508) - -*** - -### scaleX - -> `get` **scaleX**(): `number` - -> `set` **scaleX**(`x`): `void` - -#### Parameters - -• **x**: `number` - -#### Returns - -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`scaleX`](FPolyhedron.md#scalex) +[`FPolyhedron`](FPolyhedron.md).[`__UPDATE_SCALE__`](FPolyhedron.md#__update_scale__) #### Defined in -[3d/src/core/FComponent.ts:516](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L516) +[3d/src/core/FComponent.ts:207](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L207) *** -### scaleY +### emitCollisionWith() -> `get` **scaleY**(): `number` +> **emitCollisionWith**(`options`): `void` -> `set` **scaleY**(`y`): `void` +Emit a collision event with a given class or object. #### Parameters -• **y**: `number` - -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleY`](FPolyhedron.md#scaley) - -#### Defined in - -[3d/src/core/FComponent.ts:524](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L524) - -*** +• **options** -### scaleZ +The options for the collision event. -> `get` **scaleZ**(): `number` +• **options.class?**: `any` -> `set` **scaleZ**(`z`): `void` +The class to emit the collision event with. -#### Parameters +• **options.component?**: `FComponent` -• **z**: `number` +The component to emit the collision event with. #### Returns -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`scaleZ`](FPolyhedron.md#scalez) - -#### Defined in - -[3d/src/core/FComponent.ts:532](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L532) - -*** - -### x - -> `get` **x**(): `number` - -> `set` **x**(`x`): `void` - -#### Parameters +`void` -• **x**: `number` +#### Examples -#### Returns +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + class: Enemy +}) +``` -`number` +```typescript +const player = new Player() +const enemy = new Enemy() +player.emitCollisionWith({ + object: enemy +}) +``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`x`](FPolyhedron.md#x) +[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) #### Defined in -[3d/src/core/FComponent.ts:416](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L416) +core/dist/index.d.ts:293 *** -### y +### emitOnLoaded() -> `get` **y**(): `number` - -> `set` **y**(`y`): `void` - -#### Parameters +> **emitOnLoaded**(): `void` -• **y**: `number` +Emit the onLoaded callbacks. #### Returns -`number` +`void` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`y`](FPolyhedron.md#y) +[`FPolyhedron`](FPolyhedron.md).[`emitOnLoaded`](FPolyhedron.md#emitonloaded) #### Defined in -[3d/src/core/FComponent.ts:424](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L424) +core/dist/index.d.ts:247 *** -### z - -> `get` **z**(): `number` - -> `set` **z**(`z`): `void` - -#### Parameters - -• **z**: `number` +### frame() -#### Returns - -`number` - -#### Inherited from - -[`FPolyhedron`](FPolyhedron.md).[`z`](FPolyhedron.md#z) - -#### Defined in - -[3d/src/core/FComponent.ts:432](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L432) - -## Constructors - -### new FSphere() - -> **new FSphere**(`scene`, `options`?): [`FSphere`](FSphere.md) - -#### Parameters - -• **scene**: [`FScene`](FScene.md) - -• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) - -#### Returns - -[`FSphere`](FSphere.md) - -#### Overrides +> **frame**(`_delta`): `void` -[`FPolyhedron`](FPolyhedron.md).[`constructor`](FPolyhedron.md#constructors) - -#### Defined in - -[3d/src/polyhedrons/FSphere.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L23) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. #### Parameters -• **options** - -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: `FComponent` - -The component to emit the collision event with. +• **\_delta**: `number` #### Returns `void` -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`emitCollisionWith`](FPolyhedron.md#emitcollisionwith) +[`FPolyhedron`](FPolyhedron.md).[`frame`](FPolyhedron.md#frame) #### Defined in -core/dist/index.d.ts:118 +[3d/src/core/FComponent.ts:113](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L113) *** @@ -559,37 +296,21 @@ core/dist/index.d.ts:118 > **initCollider**(`options`?): `void` -Only init a collider for the component, without a rigidBody. -This is useful for static objects. - #### Parameters • **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) -The options for the collider. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Overrides [`FPolyhedron`](FPolyhedron.md).[`initCollider`](FPolyhedron.md#initcollider) #### Defined in -[3d/src/polyhedrons/FSphere.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L47) +[3d/src/polyhedrons/FSphere.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FSphere.ts#L38) *** @@ -597,36 +318,21 @@ component.initCollider({ > **initRigidBody**(`options`?): `void` -Init a rigidBody for the component. - #### Parameters • **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) -The options for the rigidBody. - #### Returns `void` -#### 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.CUBOID -}) -``` - #### Overrides [`FPolyhedron`](FPolyhedron.md).[`initRigidBody`](FPolyhedron.md#initrigidbody) #### Defined in -[3d/src/polyhedrons/FSphere.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L40) +[3d/src/polyhedrons/FSphere.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FSphere.ts#L45) *** @@ -634,37 +340,21 @@ component.initRigidBody({ > **initSensor**(`options`?): `void` -Init a sensor for the component. -This is useful for triggerings events when the component collides with other components. - #### Parameters -• **options?**: [`FColliderOptions`](../interfaces/FColliderOptions.md) - -The options for the collider. +• **options?**: [`FRigidBodyOptions`](../interfaces/FRigidBodyOptions.md) #### Returns `void` -#### 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.CUBOID -}) -``` - -#### Inherited from +#### Overrides [`FPolyhedron`](FPolyhedron.md).[`initSensor`](FPolyhedron.md#initsensor) #### Defined in -[3d/src/core/FComponent.ts:386](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L386) +[3d/src/polyhedrons/FSphere.ts:52](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FSphere.ts#L52) *** @@ -718,135 +408,73 @@ player.onCollisionWith(enemy, () => { #### Defined in -[3d/src/core/FComponent.ts:395](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L395) +[3d/src/core/FComponent.ts:276](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L276) *** ### onFrame() -> **onFrame**(`_delta`): `void` - -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. - -#### Parameters - -• **\_delta**: `number` - -#### Returns - -`void` - -#### Overrides - -[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) - -#### Defined in - -[3d/src/polyhedrons/FSphere.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FSphere.ts#L36) - -*** - -### setColor() +> **onFrame**(`callback`): `void` -> **setColor**(`color`): `void` - -Change the color of the polyhedron. +Add a callback to be called every frame. #### Parameters -• **color**: `number` +• **callback** -The color of the polyhedron. +The callback function. #### Returns `void` -#### Example - -```ts -cube.setColor(0xFF0000) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) +[`FPolyhedron`](FPolyhedron.md).[`onFrame`](FPolyhedron.md#onframe) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L47) +core/dist/index.d.ts:238 *** -### setPosition() +### onLoaded() -> **setPosition**(`options`): `void` +> **onLoaded**(`callback`): `void` -Set the position of the component. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### 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` +• **callback** -The position on the z-axis. +The callback function. #### Returns `void` -#### Example - -```ts -component.setPosition({ x: 0, y: 1, z: 0 }) -``` - #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setPosition`](FPolyhedron.md#setposition) +[`FPolyhedron`](FPolyhedron.md).[`onLoaded`](FPolyhedron.md#onloaded) #### Defined in -[3d/src/core/FComponent.ts:204](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L204) +core/dist/index.d.ts:243 *** -### setRotation() +### setColor() -> **setRotation**(`options`): `void` +> **setColor**(`color`): `void` -Set the rotation of the component from radians. +Change the color of the polyhedron. #### 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` +• **color**: `number` -The rotation on the z-axis. +The color of the polyhedron. #### Returns @@ -855,125 +483,69 @@ The rotation on the z-axis. #### Example ```ts -component.setRotation({ x: 0, y: 0, z: 0 }) +cube.setColor(0xFF0000) ``` #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotation`](FPolyhedron.md#setrotation) +[`FPolyhedron`](FPolyhedron.md).[`setColor`](FPolyhedron.md#setcolor) #### Defined in -[3d/src/core/FComponent.ts:231](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L231) - -*** - -### setRotationDegree() - -> **setRotationDegree**(`options`): `void` - -Set the rotation of the component from degrees. - -#### Parameters - -• **options** - -The options for the rotation. - -• **options.x**: `number` - -The rotation in degrees on the x-axis. - -• **options.y**: `number` +[3d/src/polyhedrons/FPolyhedron.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L43) -The rotation in degrees on the y-axis. - -• **options.z**: `number` +## Properties -The rotation in degrees on the z-axis. +### \_\_CALLBACKS\_ON\_COLLISION\_\_ -#### Returns +> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` -`void` +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. -#### Example +#### Index Signature -```ts -component.setRotationDegree({ x: 0, y: 90, z: 0 }) -``` + \[`key`: `string`\]: (`data`) => `void`[] #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setRotationDegree`](FPolyhedron.md#setrotationdegree) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) #### Defined in -[3d/src/core/FComponent.ts:258](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L258) +core/dist/index.d.ts:216 *** -### setScale() - -> **setScale**(`options`): `void` - -Set the scale of the component. - -#### Parameters - -• **options** - -The options for the scale. - -• **options.x**: `number` +### \_\_CALLBACKS\_ON\_FRAME\_\_ -The scale on the x-axis. +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] -• **options.y**: `number` - -The scale on the y-axis. - -• **options.z**: `number` - -The scale on the z-axis. - -#### Returns - -`void` - -#### Example - -```ts -component.setScale({ x: 1, y: 1, z: 1 }) -``` +Callbacks for when a frame is rendered. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`setScale`](FPolyhedron.md#setscale) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_FRAME__`](FPolyhedron.md#__callbacks_on_frame__) #### Defined in -[3d/src/core/FComponent.ts:280](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L280) - -## Properties +core/dist/index.d.ts:207 -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +*** -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` +### \_\_CALLBACKS\_ON\_LOADED\_\_ -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. +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_COLLISION__`](FPolyhedron.md#__callbacks_on_collision__) +[`FPolyhedron`](FPolyhedron.md).[`__CALLBACKS_ON_LOADED__`](FPolyhedron.md#__callbacks_on_loaded__) #### Defined in -core/dist/index.d.ts:58 +core/dist/index.d.ts:211 *** @@ -990,7 +562,7 @@ It is generated automatically. #### Defined in -core/dist/index.d.ts:53 +core/dist/index.d.ts:203 *** @@ -1004,7 +576,7 @@ core/dist/index.d.ts:53 #### Defined in -core/dist/index.d.ts:48 +core/dist/index.d.ts:198 *** @@ -1020,62 +592,62 @@ Internal flags #### Defined in -[3d/src/core/FComponent.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L28) +[3d/src/core/FComponent.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L30) *** -### collider +### \_\_MESH\_\_ -> **collider**: [`FCollider`](FCollider.md) +> **\_\_MESH\_\_**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> -Collider +mesh is redefined from FComponent without the ? because it is +directly available after the constructor, as a polyhedron is created synchronously. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) +[`FPolyhedron`](FPolyhedron.md).[`__MESH__`](FPolyhedron.md#__mesh__) #### Defined in -[3d/src/core/FComponent.ts:57](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L57) +[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) *** -### controller? +### collider? -> `optional` **controller**: [`FController`](FController.md) +> `optional` **collider**: [`FCollider`](FCollider.md) -The controller attached to the component. +Collider #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) +[`FPolyhedron`](FPolyhedron.md).[`collider`](FPolyhedron.md#collider) #### Defined in -[3d/src/core/FComponent.ts:37](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L37) +[3d/src/core/FComponent.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L59) *** -### mesh +### controller? -> **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> +> `optional` **controller**: [`FController`](FController.md) -mesh is redefined from FComponent without the ? because it is -directly available after the constructor, as a polyhedron is created synchronously. +The controller attached to the component. #### Inherited from -[`FPolyhedron`](FPolyhedron.md).[`mesh`](FPolyhedron.md#mesh) +[`FPolyhedron`](FPolyhedron.md).[`controller`](FPolyhedron.md#controller) #### Defined in -[3d/src/polyhedrons/FPolyhedron.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/polyhedrons/FPolyhedron.ts#L16) +[3d/src/core/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L39) *** -### rigidBody +### rigidBody? -> **rigidBody**: [`FRigidBody`](FRigidBody.md) +> `optional` **rigidBody**: [`FRigidBody`](FRigidBody.md) RigidBody @@ -1085,7 +657,7 @@ RigidBody #### Defined in -[3d/src/core/FComponent.ts:53](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L53) +[3d/src/core/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L55) *** @@ -1101,13 +673,13 @@ The scene which the component is in. #### Defined in -[3d/src/core/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L33) +[3d/src/core/FComponent.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L35) *** -### sensor +### sensor? -> **sensor**: [`FRigidBody`](FRigidBody.md) +> `optional` **sensor**: [`FRigidBody`](FRigidBody.md) Sensor (a collider that doesn't collide with other colliders, but still triggers events) @@ -1117,7 +689,7 @@ Sensor (a collider that doesn't collide with other colliders, but still triggers #### Defined in -[3d/src/core/FComponent.ts:61](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L61) +[3d/src/core/FComponent.ts:63](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L63) *** @@ -1133,4 +705,4 @@ Transforms #### Defined in -[3d/src/core/FComponent.ts:47](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L47) +[3d/src/core/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L49) diff --git a/docs/api/3d/classes/FSpotLight.md b/docs/api/3d/classes/FSpotLight.md index 9348e257..31ef91e2 100644 --- a/docs/api/3d/classes/FSpotLight.md +++ b/docs/api/3d/classes/FSpotLight.md @@ -30,7 +30,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:93](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L93) +[3d/src/lights/FLight.ts:115](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L115) *** @@ -54,41 +54,23 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:101](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L101) +[3d/src/lights/FLight.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L123) *** ### lookAt -> `get` **lookAt**(): `object` +> `get` **lookAt**(): `undefined` \| [`FVector3`](../interfaces/FVector3.md) > `set` **lookAt**(`lookAt`): `void` #### Parameters -• **lookAt** - -• **lookAt.x**: `number` - -• **lookAt.y**: `number` - -• **lookAt.z**: `number` +• **lookAt**: [`FVector3`](../interfaces/FVector3.md) #### Returns -`object` - -##### x - -> **x**: `number` - -##### y - -> **y**: `number` - -##### z - -> **z**: `number` +`undefined` \| [`FVector3`](../interfaces/FVector3.md) #### Inherited from @@ -96,7 +78,7 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FLight.ts:105](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L105) +[3d/src/lights/FLight.ts:131](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L131) ## Constructors @@ -124,13 +106,16 @@ A spot light in 3d space. #### Defined in -[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L26) +[3d/src/lights/FSpotLight.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FSpotLight.ts#L26) ## Methods -### applyTransform() +### \_\_UPDATE\_LOOK\_AT\_\_() -> **applyTransform**(): `void` +> **\_\_UPDATE\_LOOK\_AT\_\_**(): `void` + +Update the look at target of the light. +This method should be called after updating the position, so the light can look at the target. #### Returns @@ -138,143 +123,120 @@ A spot light in 3d space. #### Inherited from -[`FLight`](FLight.md).[`applyTransform`](FLight.md#applytransform) +[`FLight`](FLight.md).[`__UPDATE_LOOK_AT__`](FLight.md#__update_look_at__) #### Defined in -[3d/src/lights/FLight.ts:76](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L76) +[3d/src/lights/FLight.ts:107](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L107) *** -### emitCollisionWith() +### \_\_UPDATE\_POSITION\_\_() -> **emitCollisionWith**(`options`): `void` +> **\_\_UPDATE\_POSITION\_\_**(): `void` -Emit a collision event with a given class or object. +Update the position of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters +#### Returns -• **options** +`void` -The options for the collision event. +#### Inherited from -• **options.class?**: `any` +[`FLight`](FLight.md).[`__UPDATE_POSITION__`](FLight.md#__update_position__) -The class to emit the collision event with. +#### Defined in -• **options.component?**: `FComponent` +[3d/src/lights/FLight.ts:82](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L82) -The component to emit the collision event with. +*** -#### Returns +### \_\_UPDATE\_ROTATION\_\_() -`void` +> **\_\_UPDATE\_ROTATION\_\_**(): `void` -#### Examples +Update the rotation of the light according to the transform. +This method should be called after updating the transform properties. -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`emitCollisionWith`](FLight.md#emitcollisionwith) +[`FLight`](FLight.md).[`__UPDATE_ROTATION__`](FLight.md#__update_rotation__) #### Defined in -core/dist/index.d.ts:118 +[3d/src/lights/FLight.ts:91](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L91) *** -### onCollisionWith() +### \_\_UPDATE\_SCALE\_\_() -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +> **\_\_UPDATE\_SCALE\_\_**(): `void` -Add a callback to be called when a collision occurs. +Update the scale of the light according to the transform. +This method should be called after updating the transform properties. -#### Parameters - -• **classOrObject**: `any` +#### Returns -The class or object to add the callback to. +`void` -• **callback** +#### Inherited from -The callback to add. +[`FLight`](FLight.md).[`__UPDATE_SCALE__`](FLight.md#__update_scale__) -#### Returns +#### Defined in -`Function` +[3d/src/lights/FLight.ts:99](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L99) -A function to remove the callback. +*** -##### Returns +### emitOnLoaded() -`void` +> **emitOnLoaded**(): `void` -#### Examples +Emit the onLoaded callbacks. -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(Enemy, () => { - console.log('Player collided with an Enemy!') -}) -``` +#### Returns -```typescript -const player = new Player() -const enemy = new Enemy() -player.onCollisionWith(enemy, () => { - console.log('Player collided with the enemy!') -}) -``` +`void` #### Inherited from -[`FLight`](FLight.md).[`onCollisionWith`](FLight.md#oncollisionwith) +[`FLight`](FLight.md).[`emitOnLoaded`](FLight.md#emitonloaded) #### Defined in -core/dist/index.d.ts:95 +core/dist/index.d.ts:54 *** -### onFrame() +### onLoaded() -> **onFrame**(`_delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **\_delta**: `number` +• **callback** + +The callback function. #### Returns `void` -#### Overrides +#### Inherited from -[`FLight`](FLight.md).[`onFrame`](FLight.md#onframe) +[`FLight`](FLight.md).[`onLoaded`](FLight.md#onloaded) #### Defined in -[3d/src/lights/FSpotLight.ts:62](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L62) +core/dist/index.d.ts:50 ## Properties @@ -282,9 +244,6 @@ Any changes on its transform should be done on the controller, not here. > **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - #### Index Signature \[`key`: `string`\]: () => `void`[] @@ -295,114 +254,99 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L24) +[3d/src/lights/FLight.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L25) *** -### \_\_ID\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_ID\_\_**: `number` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] -Unique identifier for the component. -It is generated automatically. +Callbacks for when the light is loaded. #### Inherited from -[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) +[`FLight`](FLight.md).[`__CALLBACKS_ON_LOADED__`](FLight.md#__callbacks_on_loaded__) #### Defined in -[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L23) +core/dist/index.d.ts:40 *** -### \_\_IS\_2D\_\_ +### \_\_ID\_\_ -> **\_\_IS\_2D\_\_**: `boolean` = `false` +> **\_\_ID\_\_**: `number` #### Inherited from -[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) +[`FLight`](FLight.md).[`__ID__`](FLight.md#__id__) #### Defined in -[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L22) +[3d/src/lights/FLight.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L24) *** -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `true` +### \_\_IS\_2D\_\_ -Internal flags +> **\_\_IS\_2D\_\_**: `boolean` = `false` #### Inherited from -[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) +[`FLight`](FLight.md).[`__IS_2D__`](FLight.md#__is_2d__) #### Defined in -[3d/src/lights/FLight.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L21) +[3d/src/lights/FLight.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L23) *** -### \_\_LOOK\_AT\_\_ - -> **\_\_LOOK\_AT\_\_**: `object` - -Look at target of the light. - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` +### \_\_IS\_3D\_\_ -#### z +> **\_\_IS\_3D\_\_**: `boolean` = `true` -> **z**: `number` +Internal flags #### Inherited from -[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) +[`FLight`](FLight.md).[`__IS_3D__`](FLight.md#__is_3d__) #### Defined in -[3d/src/lights/FLight.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L44) +[3d/src/lights/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L22) *** -### controller? +### \_\_LIGHT\_\_ -> `optional` **controller**: `FController` +> **\_\_LIGHT\_\_**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> -The controller attached to the component. +The original light object from Three.js. #### Inherited from -[`FLight`](FLight.md).[`controller`](FLight.md#controller) +[`FLight`](FLight.md).[`__LIGHT__`](FLight.md#__light__) #### Defined in -core/dist/index.d.ts:64 +[3d/src/lights/FLight.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L30) *** -### light +### \_\_LOOK\_AT\_\_ -> **light**: `Light`\<`undefined` \| `LightShadow`\<`Camera`\>\> +> **\_\_LOOK\_AT\_\_**: `undefined` \| [`FVector3`](../interfaces/FVector3.md) -The original light object from Three.js. +Look at target of the light. #### Inherited from -[`FLight`](FLight.md).[`light`](FLight.md#light) +[`FLight`](FLight.md).[`__LOOK_AT__`](FLight.md#__look_at__) #### Defined in -[3d/src/lights/FLight.ts:29](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L29) +[3d/src/lights/FLight.ts:45](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L45) *** @@ -418,7 +362,7 @@ Scene the light is in. #### Defined in -[3d/src/lights/FLight.ts:34](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L34) +[3d/src/lights/FLight.ts:35](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L35) *** @@ -434,4 +378,4 @@ Transform of the light. #### Defined in -[3d/src/lights/FLight.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L39) +[3d/src/lights/FLight.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L40) diff --git a/docs/api/3d/classes/FTransform.md b/docs/api/3d/classes/FTransform.md index 01dbf384..225b40e3 100644 --- a/docs/api/3d/classes/FTransform.md +++ b/docs/api/3d/classes/FTransform.md @@ -2,7 +2,423 @@ # Class: FTransform -3D Transforms for a component. +3D Transform + +## Accessors + +### position + +> `get` **position**(): [`FVector3`](../interfaces/FVector3.md) + +Get the position. + +> `set` **position**(`position`): `void` + +Set the position. + +#### Parameters + +• **position**: [`FVector3`](../interfaces/FVector3.md) + +The new position. + +#### Returns + +[`FVector3`](../interfaces/FVector3.md) + +#### Defined in + +[3d/src/core/FTransform.ts:160](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L160) + +*** + +### rotation + +> `get` **rotation**(): [`FVector3`](../interfaces/FVector3.md) + +Get the rotation. + +> `set` **rotation**(`rotation`): `void` + +Set the rotation. + +#### Parameters + +• **rotation**: [`FVector3`](../interfaces/FVector3.md) + +The new rotation. + +#### Returns + +[`FVector3`](../interfaces/FVector3.md) + +#### Defined in + +[3d/src/core/FTransform.ts:223](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L223) + +*** + +### rotationDegree + +> `get` **rotationDegree**(): [`FVector3`](../interfaces/FVector3.md) + +Get the rotation in degrees. + +> `set` **rotationDegree**(`rotationDegree`): `void` + +Set the rotation in degrees. + +#### Parameters + +• **rotationDegree**: [`FVector3`](../interfaces/FVector3.md) + +The new rotation in degrees. + +#### Returns + +[`FVector3`](../interfaces/FVector3.md) + +#### Defined in + +[3d/src/core/FTransform.ts:286](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L286) + +*** + +### rotationDegreeX + +> `get` **rotationDegreeX**(): `number` + +Get the rotation in degrees on the x axis. + +> `set` **rotationDegreeX**(`x`): `void` + +Set the x rotation in degrees. + +#### Parameters + +• **x**: `number` + +The new rotation on the x axis in degrees. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:308](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L308) + +*** + +### rotationDegreeY + +> `get` **rotationDegreeY**(): `number` + +Get the rotation in degrees on the y axis. + +> `set` **rotationDegreeY**(`y`): `void` + +Set the y rotation in degrees. + +#### Parameters + +• **y**: `number` + +The new rotation on the y axis in degrees. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:323](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L323) + +*** + +### rotationDegreeZ + +> `get` **rotationDegreeZ**(): `number` + +Get the rotation in degrees on the z axis. + +> `set` **rotationDegreeZ**(`z`): `void` + +Set the z rotation in degrees. + +#### Parameters + +• **z**: `number` + +The new rotation on the z axis in degrees. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:338](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L338) + +*** + +### rotationX + +> `get` **rotationX**(): `number` + +Get the rotation on the x axis. + +> `set` **rotationX**(`x`): `void` + +Set the x rotation. + +#### Parameters + +• **x**: `number` + +The new rotation on the x axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:241](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L241) + +*** + +### rotationY + +> `get` **rotationY**(): `number` + +Get the rotation on the y axis. + +> `set` **rotationY**(`y`): `void` + +Set the y rotation. + +#### Parameters + +• **y**: `number` + +The new rotation on the y axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:256](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L256) + +*** + +### rotationZ + +> `get` **rotationZ**(): `number` + +Get the rotation on the z axis. + +> `set` **rotationZ**(`z`): `void` + +Set the z rotation. + +#### Parameters + +• **z**: `number` + +The new rotation on the z axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:271](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L271) + +*** + +### scale + +> `get` **scale**(): [`FVector3`](../interfaces/FVector3.md) + +Get the scale. + +> `set` **scale**(`scale`): `void` + +Set the scale. + +#### Parameters + +• **scale**: [`FVector3`](../interfaces/FVector3.md) + +The new scale. + +#### Returns + +[`FVector3`](../interfaces/FVector3.md) + +#### Defined in + +[3d/src/core/FTransform.ts:353](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L353) + +*** + +### scaleX + +> `get` **scaleX**(): `number` + +Get the scale on the x axis. + +> `set` **scaleX**(`x`): `void` + +Set the x scale. + +#### Parameters + +• **x**: `number` + +The new scale on the x axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:371](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L371) + +*** + +### scaleY + +> `get` **scaleY**(): `number` + +Get the scale on the y axis. + +> `set` **scaleY**(`y`): `void` + +Set the y scale. + +#### Parameters + +• **y**: `number` + +The new scale on the y axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:386](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L386) + +*** + +### scaleZ + +> `get` **scaleZ**(): `number` + +Get the scale on the z axis. + +> `set` **scaleZ**(`z`): `void` + +Set the z scale. + +#### Parameters + +• **z**: `number` + +The new scale on the z axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:401](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L401) + +*** + +### x + +> `get` **x**(): `number` + +Get the position on the x axis. + +> `set` **x**(`x`): `void` + +Set the x position. + +#### Parameters + +• **x**: `number` + +The new position on the x axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:178](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L178) + +*** + +### y + +> `get` **y**(): `number` + +Get the position on the y axis. + +> `set` **y**(`y`): `void` + +Set the y position. + +#### Parameters + +• **y**: `number` + +The new position on the y axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:193](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L193) + +*** + +### z + +> `get` **z**(): `number` + +Get the position on the z axis. + +> `set` **z**(`z`): `void` + +Set the z position. + +#### Parameters + +• **z**: `number` + +The new position on the z axis. + +#### Returns + +`number` + +#### Defined in + +[3d/src/core/FTransform.ts:208](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L208) ## Constructors @@ -16,7 +432,7 @@ Create a new FTransform. • **options?**: [`FTransformOptions`](../interfaces/FTransformOptions.md) -The options for the collider. +The options for the transform. #### Returns @@ -25,7 +441,7 @@ The options for the collider. #### Example ```ts -const collider = new FTransform({ +const transform = new FTransform({ position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, @@ -34,40 +450,230 @@ const collider = new FTransform({ #### Defined in -[3d/src/core/FTransform.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L44) +[3d/src/core/FTransform.ts:59](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L59) + +## Methods + +### onPositionUpdated() + +> **onPositionUpdated**(`callback`): `void` + +Add a callback for when the position is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:84](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L84) + +*** + +### onRotationUpdated() + +> **onRotationUpdated**(`callback`): `void` + +Add a callback for when the rotation is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:92](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L92) + +*** + +### onScaleUpdated() + +> **onScaleUpdated**(`callback`): `void` + +Add a callback for when the scale is updated. + +#### Parameters + +• **callback** + +The callback to add. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:100](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L100) + +*** + +### setPosition() + +> **setPosition**(`position`): `void` + +Set a new position. + +#### Parameters + +• **position**: [`FVector3`](../interfaces/FVector3.md) + +The new position. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:111](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L111) + +*** + +### setRotation() + +> **setRotation**(`rotation`): `void` + +Set a new rotation. + +#### Parameters + +• **rotation**: [`FVector3`](../interfaces/FVector3.md) + +The new rotation. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L123) + +*** + +### setRotationDegree() + +> **setRotationDegree**(`rotationDegree`): `void` + +Set a new rotation in degrees. + +#### Parameters + +• **rotationDegree**: [`FVector3`](../interfaces/FVector3.md) + +The new rotation in degrees. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:135](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L135) + +*** + +### setScale() + +> **setScale**(`scale`): `void` + +Set a new scale. + +#### Parameters + +• **scale**: [`FVector3`](../interfaces/FVector3.md) + +The new scale. + +#### Returns + +`void` + +#### Defined in + +[3d/src/core/FTransform.ts:150](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L150) ## Properties -### position +### \_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_ -> **position**: `Vector3` +> **\_\_CALLBACKS\_ON\_POSITION\_UPDATED\_\_**: () => `void`[] = `[]` -The position of the component. +Callback for when the position is updated. #### Defined in -[3d/src/core/FTransform.ts:18](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L18) +[3d/src/core/FTransform.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L20) *** -### rotation +### \_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_ -> **rotation**: `Vector3` +> **\_\_CALLBACKS\_ON\_ROTATION\_UPDATED\_\_**: () => `void`[] = `[]` -The rotation of the component. +Callback for when the rotation is updated. #### Defined in -[3d/src/core/FTransform.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L26) +[3d/src/core/FTransform.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L24) *** -### scale +### \_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_ + +> **\_\_CALLBACKS\_ON\_SCALE\_UPDATED\_\_**: () => `void`[] = `[]` + +Callback for when the scale is updated. + +#### Defined in + +[3d/src/core/FTransform.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L28) + +*** + +### \_\_POSITION\_\_ + +> **\_\_POSITION\_\_**: [`FVector3`](../interfaces/FVector3.md) + +The position of the transform. + +#### Defined in + +[3d/src/core/FTransform.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L33) + +*** + +### \_\_ROTATION\_\_ + +> **\_\_ROTATION\_\_**: [`FVector3`](../interfaces/FVector3.md) + +The rotation of the transform. + +#### Defined in + +[3d/src/core/FTransform.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L41) + +*** + +### \_\_SCALE\_\_ -> **scale**: `Vector3` +> **\_\_SCALE\_\_**: [`FVector3`](../interfaces/FVector3.md) -The scale of the component. +The scale of the transform. #### Defined in -[3d/src/core/FTransform.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L22) +[3d/src/core/FTransform.ts:37](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L37) diff --git a/docs/api/3d/enumerations/FRigidBodyType.md b/docs/api/3d/enumerations/FRigidBodyType.md new file mode 100644 index 00000000..848b8711 --- /dev/null +++ b/docs/api/3d/enumerations/FRigidBodyType.md @@ -0,0 +1,43 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FRigidBodyType + +# Enumeration: FRigidBodyType + +## Enumeration Members + +### DYNAMIC + +> **DYNAMIC**: `"Dynamic"` + +#### Defined in + +[3d/src/types/FRigidBodyType.ts:3](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FRigidBodyType.ts#L3) + +*** + +### FIXED + +> **FIXED**: `"Fixed"` + +#### Defined in + +[3d/src/types/FRigidBodyType.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FRigidBodyType.ts#L6) + +*** + +### KINEMATIC\_POSITION\_BASED + +> **KINEMATIC\_POSITION\_BASED**: `"KinematicPositionBased"` + +#### Defined in + +[3d/src/types/FRigidBodyType.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FRigidBodyType.ts#L4) + +*** + +### KINEMATIC\_VELOCITY\_BASED + +> **KINEMATIC\_VELOCITY\_BASED**: `"KinematicVelocityBased"` + +#### Defined in + +[3d/src/types/FRigidBodyType.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FRigidBodyType.ts#L5) diff --git a/docs/api/3d/enumerations/FShapes.md b/docs/api/3d/enumerations/FShapes.md index 2f4944df..eea00c40 100644 --- a/docs/api/3d/enumerations/FShapes.md +++ b/docs/api/3d/enumerations/FShapes.md @@ -10,7 +10,7 @@ #### Defined in -[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L5) +[3d/src/types/FShapes.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FShapes.ts#L5) *** @@ -20,7 +20,7 @@ #### Defined in -[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L3) +[3d/src/types/FShapes.ts:3](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FShapes.ts#L3) *** @@ -30,7 +30,7 @@ #### Defined in -[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L6) +[3d/src/types/FShapes.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FShapes.ts#L6) *** @@ -40,4 +40,4 @@ #### Defined in -[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/types/FShapes.ts#L4) +[3d/src/types/FShapes.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FShapes.ts#L4) diff --git a/docs/api/3d/index.md b/docs/api/3d/index.md index 20b79c40..b099c3d0 100644 --- a/docs/api/3d/index.md +++ b/docs/api/3d/index.md @@ -30,6 +30,7 @@ - [FComponentEmpty](classes/FComponentEmpty.md) - [FRigidBody](classes/FRigidBody.md) - [FScene](classes/FScene.md) +- [FSensor](classes/FSensor.md) - [FTransform](classes/FTransform.md) #### Light @@ -63,6 +64,7 @@ ### Enumerations +- [FRigidBodyType](enumerations/FRigidBodyType.md) - [FShapes](enumerations/FShapes.md) ### Interfaces @@ -81,3 +83,4 @@ - [FSceneOptions](interfaces/FSceneOptions.md) - [FSpotLightOptions](interfaces/FSpotLightOptions.md) - [FTransformOptions](interfaces/FTransformOptions.md) +- [FVector3](interfaces/FVector3.md) diff --git a/docs/api/3d/interfaces/FAttachedCameraOptions.md b/docs/api/3d/interfaces/FAttachedCameraOptions.md index d307280d..da6a96ac 100644 --- a/docs/api/3d/interfaces/FAttachedCameraOptions.md +++ b/docs/api/3d/interfaces/FAttachedCameraOptions.md @@ -10,19 +10,7 @@ ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -30,25 +18,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -56,25 +32,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -82,25 +46,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -108,7 +60,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) *** @@ -118,4 +70,4 @@ #### Defined in -[3d/src/cameras/FAttachedCamera.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/cameras/FAttachedCamera.ts#L7) +[3d/src/cameras/FAttachedCamera.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/cameras/FAttachedCamera.ts#L8) diff --git a/docs/api/3d/interfaces/FCameraOptions.md b/docs/api/3d/interfaces/FCameraOptions.md index 1c32900a..1e2ef0c5 100644 --- a/docs/api/3d/interfaces/FCameraOptions.md +++ b/docs/api/3d/interfaces/FCameraOptions.md @@ -14,19 +14,7 @@ ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -34,25 +22,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -60,25 +36,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -86,25 +50,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -112,4 +64,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) diff --git a/docs/api/3d/interfaces/FCharacterControllerOptions.md b/docs/api/3d/interfaces/FCharacterControllerOptions.md index f6f4a168..e4ecf4df 100644 --- a/docs/api/3d/interfaces/FCharacterControllerOptions.md +++ b/docs/api/3d/interfaces/FCharacterControllerOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L6) *** @@ -30,4 +30,4 @@ The speed of the character. #### Defined in -[3d/src/controllers/FCharacterController.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FCharacterController.ts#L13) +[3d/src/controllers/FCharacterController.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FCharacterController.ts#L14) diff --git a/docs/api/3d/interfaces/FColliderOptions.md b/docs/api/3d/interfaces/FColliderOptions.md index 0a4095e7..ff74e541 100644 --- a/docs/api/3d/interfaces/FColliderOptions.md +++ b/docs/api/3d/interfaces/FColliderOptions.md @@ -4,25 +4,33 @@ ## Properties -### position? +### mesh? + +> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -> `optional` **position**: `object` +#### Defined in -#### x +[3d/src/core/FCollider.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L20) -> **x**: `number` +*** -#### y +### position? -> **y**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) -#### z +#### Defined in -> **z**: `number` +[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L11) + +*** + +### positionOffset? + +> `optional` **positionOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FCollider.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L8) +[3d/src/core/FCollider.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L15) *** @@ -32,73 +40,67 @@ #### Defined in -[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L13) +[3d/src/core/FCollider.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L21) *** ### rotation? -> `optional` **rotation**: `object` - -#### x +> `optional` **rotation**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L12) -> **y**: `number` +*** -#### z +### rotationDegree? -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FCollider.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L10) +[3d/src/core/FCollider.ts:13](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L13) *** -### rotationDegree? - -> `optional` **rotationDegree**: `object` +### rotationDegreeOffset? -#### x +> `optional` **rotationDegreeOffset**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FCollider.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L17) -> **y**: `number` +*** -#### z +### rotationOffset? -> **z**: `number` +> `optional` **rotationOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FCollider.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L11) +[3d/src/core/FCollider.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L16) *** ### scale? -> `optional` **scale**: `object` - -#### x +> `optional` **scale**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L14) -> **y**: `number` +*** -#### z +### scaleOffset? -> **z**: `number` +> `optional` **scaleOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FCollider.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L9) +[3d/src/core/FCollider.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L18) *** @@ -108,7 +110,7 @@ #### Defined in -[3d/src/core/FCollider.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L14) +[3d/src/core/FCollider.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L22) *** @@ -118,4 +120,4 @@ #### Defined in -[3d/src/core/FCollider.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FCollider.ts#L12) +[3d/src/core/FCollider.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FCollider.ts#L19) diff --git a/docs/api/3d/interfaces/FComponentOptions.md b/docs/api/3d/interfaces/FComponentOptions.md index 93f70ded..118bad5c 100644 --- a/docs/api/3d/interfaces/FComponentOptions.md +++ b/docs/api/3d/interfaces/FComponentOptions.md @@ -10,86 +10,38 @@ ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L16) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L17) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L18) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L19) diff --git a/docs/api/3d/interfaces/FControllerOptions.md b/docs/api/3d/interfaces/FControllerOptions.md index 1693835b..4ad733a6 100644 --- a/docs/api/3d/interfaces/FControllerOptions.md +++ b/docs/api/3d/interfaces/FControllerOptions.md @@ -22,4 +22,4 @@ #### Defined in -[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/controllers/FController.ts#L6) +[3d/src/controllers/FController.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/controllers/FController.ts#L6) diff --git a/docs/api/3d/interfaces/FHemisphereLightOptions.md b/docs/api/3d/interfaces/FHemisphereLightOptions.md index de946d86..e4ef0d5d 100644 --- a/docs/api/3d/interfaces/FHemisphereLightOptions.md +++ b/docs/api/3d/interfaces/FHemisphereLightOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L9) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L8) +[3d/src/lights/FHemisphereLight.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FHemisphereLight.ts#L8) *** @@ -42,25 +42,13 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L10) *** ### lookAt? -> `optional` **lookAt**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **lookAt**: [`FVector3`](FVector3.md) #### Inherited from @@ -68,25 +56,13 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L11) *** ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -94,25 +70,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -120,25 +84,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -146,25 +98,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -172,7 +112,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) *** @@ -182,4 +122,4 @@ #### Defined in -[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FHemisphereLight.ts#L7) +[3d/src/lights/FHemisphereLight.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FHemisphereLight.ts#L7) diff --git a/docs/api/3d/interfaces/FLightOptions.md b/docs/api/3d/interfaces/FLightOptions.md index 0ea9e51d..d9cc9eb2 100644 --- a/docs/api/3d/interfaces/FLightOptions.md +++ b/docs/api/3d/interfaces/FLightOptions.md @@ -20,7 +20,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L9) *** @@ -30,47 +30,23 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L10) *** ### lookAt? -> `optional` **lookAt**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **lookAt**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L11) *** ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -78,25 +54,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -104,25 +68,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -130,25 +82,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -156,4 +96,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) diff --git a/docs/api/3d/interfaces/FLightProbeOptions.md b/docs/api/3d/interfaces/FLightProbeOptions.md index 1d1a0f47..ad568a36 100644 --- a/docs/api/3d/interfaces/FLightProbeOptions.md +++ b/docs/api/3d/interfaces/FLightProbeOptions.md @@ -18,7 +18,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L9) *** @@ -32,25 +32,13 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L10) *** ### lookAt? -> `optional` **lookAt**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **lookAt**: [`FVector3`](FVector3.md) #### Inherited from @@ -58,25 +46,13 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L11) *** ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -84,25 +60,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -110,25 +74,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -136,25 +88,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -162,7 +102,7 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) *** @@ -172,4 +112,4 @@ #### Defined in -[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLightProbe.ts#L7) +[3d/src/lights/FLightProbe.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLightProbe.ts#L7) diff --git a/docs/api/3d/interfaces/FModelOptions.md b/docs/api/3d/interfaces/FModelOptions.md index 3e608ab9..843d1276 100644 --- a/docs/api/3d/interfaces/FModelOptions.md +++ b/docs/api/3d/interfaces/FModelOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L10) +[3d/src/model/FModel.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L10) *** @@ -24,7 +24,7 @@ #### Defined in -[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L7) +[3d/src/model/FModel.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L7) *** @@ -34,25 +34,13 @@ #### Defined in -[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L8) +[3d/src/model/FModel.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L8) *** ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -60,25 +48,13 @@ #### Defined in -[3d/src/core/FComponent.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L14) +[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L16) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -86,25 +62,13 @@ #### Defined in -[3d/src/core/FComponent.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L16) +[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L17) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -112,25 +76,13 @@ #### Defined in -[3d/src/core/FComponent.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L17) +[3d/src/core/FComponent.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L18) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -138,7 +90,7 @@ #### Defined in -[3d/src/core/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FComponent.ts#L15) +[3d/src/core/FComponent.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FComponent.ts#L19) *** @@ -148,4 +100,4 @@ #### Defined in -[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/model/FModel.ts#L9) +[3d/src/model/FModel.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/model/FModel.ts#L9) diff --git a/docs/api/3d/interfaces/FRigidBodyOptions.md b/docs/api/3d/interfaces/FRigidBodyOptions.md index d97e3634..d1018b38 100644 --- a/docs/api/3d/interfaces/FRigidBodyOptions.md +++ b/docs/api/3d/interfaces/FRigidBodyOptions.md @@ -22,7 +22,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L22) +[3d/src/core/FRigidBody.ts:31](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L31) *** @@ -44,7 +44,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L17) +[3d/src/core/FRigidBody.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L26) *** @@ -54,7 +54,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L16) +[3d/src/core/FRigidBody.ts:25](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L25) *** @@ -64,105 +64,107 @@ #### Defined in -[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L15) +[3d/src/core/FRigidBody.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L24) *** -### position? +### mesh? + +> `optional` **mesh**: `Mesh`\<`BufferGeometry`\<`NormalBufferAttributes`\>, `Material` \| `Material`[], `Object3DEventMap`\> \| `Group`\<`Object3DEventMap`\> -> `optional` **position**: `object` +#### Defined in -#### x +[3d/src/core/FRigidBody.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L21) -> **x**: `number` +*** -#### y +### position? -> **y**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) -#### z +#### Defined in -> **z**: `number` +[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L12) + +*** + +### positionOffset? + +> `optional` **positionOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FRigidBody.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L8) +[3d/src/core/FRigidBody.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L16) *** ### rigidBodyType? -> `optional` **rigidBodyType**: `RigidBodyType` +> `optional` **rigidBodyType**: [`FRigidBodyType`](../enumerations/FRigidBodyType.md) #### Defined in -[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L13) +[3d/src/core/FRigidBody.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L22) *** ### rotation? -> `optional` **rotation**: `object` - -#### x +> `optional` **rotation**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FRigidBody.ts:13](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L13) -> **y**: `number` +*** -#### z +### rotationDegree? -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FRigidBody.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L10) +[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L14) *** -### rotationDegree? - -> `optional` **rotationDegree**: `object` +### rotationDegreeOffset? -#### x +> `optional` **rotationDegreeOffset**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FRigidBody.ts:18](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L18) -> **y**: `number` +*** -#### z +### rotationOffset? -> **z**: `number` +> `optional` **rotationOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FRigidBody.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L11) +[3d/src/core/FRigidBody.ts:17](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L17) *** ### scale? -> `optional` **scale**: `object` - -#### x +> `optional` **scale**: [`FVector3`](FVector3.md) -> **x**: `number` +#### Defined in -#### y +[3d/src/core/FRigidBody.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L15) -> **y**: `number` +*** -#### z +### scaleOffset? -> **z**: `number` +> `optional` **scaleOffset**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FRigidBody.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L9) +[3d/src/core/FRigidBody.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L19) *** @@ -172,7 +174,7 @@ #### Defined in -[3d/src/core/FRigidBody.ts:14](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L14) +[3d/src/core/FRigidBody.ts:23](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L23) *** @@ -182,4 +184,4 @@ #### Defined in -[3d/src/core/FRigidBody.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FRigidBody.ts#L12) +[3d/src/core/FRigidBody.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FRigidBody.ts#L20) diff --git a/docs/api/3d/interfaces/FSceneOptions.md b/docs/api/3d/interfaces/FSceneOptions.md index 9ef4036e..f0305813 100644 --- a/docs/api/3d/interfaces/FSceneOptions.md +++ b/docs/api/3d/interfaces/FSceneOptions.md @@ -8,35 +8,37 @@ ## Properties -### domNode? +### autoLoop? -> `optional` **domNode**: `HTMLElement` +> `optional` **autoLoop**: `boolean` #### Inherited from -`FSceneOptionsCore.domNode` +`FSceneOptionsCore.autoLoop` #### Defined in -core/dist/index.d.ts:186 +core/dist/index.d.ts:67 *** -### gravity? +### domNode? + +> `optional` **domNode**: `HTMLElement` -> `optional` **gravity**: `object` +#### Inherited from -#### x +`FSceneOptionsCore.domNode` -> **x**: `number` +#### Defined in -#### y +core/dist/index.d.ts:66 -> **y**: `number` +*** -#### z +### gravity? -> **z**: `number` +> `optional` **gravity**: [`FVector3`](FVector3.md) #### Overrides @@ -44,7 +46,7 @@ core/dist/index.d.ts:186 #### Defined in -[3d/src/core/FScene.ts:12](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L12) +[3d/src/core/FScene.ts:14](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L14) *** @@ -54,4 +56,4 @@ core/dist/index.d.ts:186 #### Defined in -[3d/src/core/FScene.ts:13](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FScene.ts#L13) +[3d/src/core/FScene.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FScene.ts#L15) diff --git a/docs/api/3d/interfaces/FSpotLightOptions.md b/docs/api/3d/interfaces/FSpotLightOptions.md index 5fb186d5..f6574592 100644 --- a/docs/api/3d/interfaces/FSpotLightOptions.md +++ b/docs/api/3d/interfaces/FSpotLightOptions.md @@ -14,7 +14,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L8) +[3d/src/lights/FSpotLight.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FSpotLight.ts#L8) *** @@ -28,7 +28,7 @@ #### Defined in -[3d/src/lights/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L8) +[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L9) *** @@ -38,7 +38,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L10) +[3d/src/lights/FSpotLight.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FSpotLight.ts#L10) *** @@ -48,7 +48,7 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L7) +[3d/src/lights/FSpotLight.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FSpotLight.ts#L7) *** @@ -62,25 +62,13 @@ #### Defined in -[3d/src/lights/FLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L9) +[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L10) *** ### lookAt? -> `optional` **lookAt**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **lookAt**: [`FVector3`](FVector3.md) #### Inherited from @@ -88,7 +76,7 @@ #### Defined in -[3d/src/lights/FLight.ts:10](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FLight.ts#L10) +[3d/src/lights/FLight.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FLight.ts#L11) *** @@ -98,25 +86,13 @@ #### Defined in -[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/lights/FSpotLight.ts#L9) +[3d/src/lights/FSpotLight.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/lights/FSpotLight.ts#L9) *** ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Inherited from @@ -124,25 +100,13 @@ #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Inherited from @@ -150,25 +114,13 @@ #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Inherited from @@ -176,25 +128,13 @@ #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Inherited from @@ -202,4 +142,4 @@ #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) diff --git a/docs/api/3d/interfaces/FTransformOptions.md b/docs/api/3d/interfaces/FTransformOptions.md index 874facae..d71ae7d2 100644 --- a/docs/api/3d/interfaces/FTransformOptions.md +++ b/docs/api/3d/interfaces/FTransformOptions.md @@ -11,86 +11,38 @@ ### position? -> `optional` **position**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **position**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FTransform.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L4) +[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L5) *** ### rotation? -> `optional` **rotation**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotation**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L6) +[3d/src/core/FTransform.ts:6](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L6) *** ### rotationDegree? -> `optional` **rotationDegree**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **rotationDegree**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L7) +[3d/src/core/FTransform.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L7) *** ### scale? -> `optional` **scale**: `object` - -#### x - -> **x**: `number` - -#### y - -> **y**: `number` - -#### z - -> **z**: `number` +> `optional` **scale**: [`FVector3`](FVector3.md) #### Defined in -[3d/src/core/FTransform.ts:5](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/3d/src/core/FTransform.ts#L5) +[3d/src/core/FTransform.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/core/FTransform.ts#L8) diff --git a/docs/api/3d/interfaces/FVector3.md b/docs/api/3d/interfaces/FVector3.md new file mode 100644 index 00000000..dcce444e --- /dev/null +++ b/docs/api/3d/interfaces/FVector3.md @@ -0,0 +1,41 @@ +[@fibbojs](/api/index) / [3d](/api/3d) / FVector3 + +# Interface: FVector3 + +A 3d vector with x, y and z coordinates. + +## Properties + +### x + +> **x**: `number` + +The x coordinate of the vector. + +#### Defined in + +[3d/src/types/FVector3.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FVector3.ts#L8) + +*** + +### y + +> **y**: `number` + +The y coordinate of the vector. + +#### Defined in + +[3d/src/types/FVector3.ts:12](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FVector3.ts#L12) + +*** + +### z + +> **z**: `number` + +The z coordinate of the vector. + +#### Defined in + +[3d/src/types/FVector3.ts:16](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/3d/src/types/FVector3.ts#L16) diff --git a/docs/api/core/classes/FCamera.md b/docs/api/core/classes/FCamera.md index 5587fbe5..2213a613 100644 --- a/docs/api/core/classes/FCamera.md +++ b/docs/api/core/classes/FCamera.md @@ -12,7 +12,11 @@ The base class for cameras in Fibbo. ### new FCamera() -> **new FCamera**(): [`FCamera`](FCamera.md) +> **new FCamera**(`scene`): [`FCamera`](FCamera.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) #### Returns @@ -24,7 +28,7 @@ The base class for cameras in Fibbo. #### Defined in -[core/src/FCamera.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FCamera.ts#L8) +[core/src/FCamera.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FCamera.ts#L9) ## Methods @@ -76,7 +80,54 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:201](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L201) + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Inherited from + +[`FComponent`](FComponent.md).[`emitOnLoaded`](FComponent.md#emitonloaded) + +#### Defined in + +[core/src/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L123) + +*** + +### frame() + +> **frame**(`delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Inherited from + +[`FComponent`](FComponent.md).[`frame`](FComponent.md#frame) + +#### Defined in + +[core/src/FComponent.ts:97](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L97) *** @@ -130,23 +181,21 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:151](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L151) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** -The time since the last frame. +The callback function. #### Returns @@ -158,27 +207,33 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L108) *** -### setZoom() +### onLoaded() -> `abstract` **setZoom**(`zoom`): `void` +> **onLoaded**(`callback`): `void` -Set the zoom of the camera. +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). #### Parameters -• **zoom**: `number` +• **callback** + +The callback function. #### Returns `void` +#### Inherited from + +[`FComponent`](FComponent.md).[`onLoaded`](FComponent.md#onloaded) + #### Defined in -[core/src/FCamera.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FCamera.ts#L15) +[core/src/FComponent.ts:116](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L116) ## Properties @@ -199,7 +254,39 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L55) + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] = `[]` + +Callbacks for when a frame is rendered. + +#### Inherited from + +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_FRAME__`](FComponent.md#__callbacks_on_frame__) + +#### Defined in + +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L44) + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Inherited from + +[`FComponent`](FComponent.md).[`__CALLBACKS_ON_LOADED__`](FComponent.md#__callbacks_on_loaded__) + +#### Defined in + +[core/src/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L49) *** @@ -216,7 +303,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L39) *** @@ -230,7 +317,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L33) *** @@ -246,7 +333,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L32) *** @@ -262,4 +349,20 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:65](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L65) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene the component is attached to. + +#### Inherited from + +[`FComponent`](FComponent.md).[`scene`](FComponent.md#scene) + +#### Defined in + +[core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L60) diff --git a/docs/api/core/classes/FComponent.md b/docs/api/core/classes/FComponent.md index 38a9bb64..f8c951d0 100644 --- a/docs/api/core/classes/FComponent.md +++ b/docs/api/core/classes/FComponent.md @@ -7,13 +7,18 @@ The base class for all 2D and 3D components in Fibbo. ## Extended by - [`FCamera`](FCamera.md) -- [`FLight`](FLight.md) ## Constructors ### new FComponent() -> **new FComponent**(): [`FComponent`](FComponent.md) +> **new FComponent**(`scene`, `options`?): [`FComponent`](FComponent.md) + +#### Parameters + +• **scene**: [`FScene`](FScene.md) + +• **options?**: [`FComponentOptions`](../interfaces/FComponentOptions.md) #### Returns @@ -21,7 +26,7 @@ The base class for all 2D and 3D components in Fibbo. #### Defined in -[core/src/FComponent.ts:46](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L46) +[core/src/FComponent.ts:67](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L67) ## Methods @@ -69,7 +74,46 @@ player.emitCollisionWith({ #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) +[core/src/FComponent.ts:201](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L201) + +*** + +### emitOnLoaded() + +> **emitOnLoaded**(): `void` + +Emit the onLoaded callbacks. + +#### Returns + +`void` + +#### Defined in + +[core/src/FComponent.ts:123](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L123) + +*** + +### frame() + +> **frame**(`delta`): `void` + +Update the component. Should be called every frame. +The purpose of this method is to render the component, its mesh/sprite, and its properties. + +#### Parameters + +• **delta**: `number` + +The time since the last frame. + +#### Returns + +`void` + +#### Defined in + +[core/src/FComponent.ts:97](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L97) *** @@ -119,23 +163,43 @@ player.onCollisionWith(enemy, () => { #### Defined in -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) +[core/src/FComponent.ts:151](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L151) *** ### onFrame() -> **onFrame**(`delta`): `void` +> **onFrame**(`callback`): `void` -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. +Add a callback to be called every frame. #### Parameters -• **delta**: `number` +• **callback** -The time since the last frame. +The callback function. + +#### Returns + +`void` + +#### Defined in + +[core/src/FComponent.ts:108](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L108) + +*** + +### onLoaded() + +> **onLoaded**(`callback`): `void` + +Add a callback to be called when the component is loaded (could be a texture, a 3D model, etc). + +#### Parameters + +• **callback** + +The callback function. #### Returns @@ -143,7 +207,7 @@ The time since the last frame. #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) +[core/src/FComponent.ts:116](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L116) ## Properties @@ -160,7 +224,31 @@ It is a dictionary where the key is the class name or object id and the value is #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) +[core/src/FComponent.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L55) + +*** + +### \_\_CALLBACKS\_ON\_FRAME\_\_ + +> **\_\_CALLBACKS\_ON\_FRAME\_\_**: () => `void`[] = `[]` + +Callbacks for when a frame is rendered. + +#### Defined in + +[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L44) + +*** + +### \_\_CALLBACKS\_ON\_LOADED\_\_ + +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` + +Callbacks for when the component is loaded (could be a texture, a 3D model, etc). + +#### Defined in + +[core/src/FComponent.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L49) *** @@ -173,7 +261,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) +[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L39) *** @@ -183,7 +271,7 @@ It is generated automatically. #### Defined in -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) +[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L33) *** @@ -195,7 +283,7 @@ Internal flags #### Defined in -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) +[core/src/FComponent.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L32) *** @@ -207,4 +295,16 @@ The controller attached to the component. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) +[core/src/FComponent.ts:65](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L65) + +*** + +### scene + +> **scene**: [`FScene`](FScene.md) + +The scene the component is attached to. + +#### Defined in + +[core/src/FComponent.ts:60](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L60) diff --git a/docs/api/core/classes/FController.md b/docs/api/core/classes/FController.md index 7df64557..163b09a4 100644 --- a/docs/api/core/classes/FController.md +++ b/docs/api/core/classes/FController.md @@ -22,17 +22,16 @@ The options for the controller. #### Defined in -[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L21) +[core/src/FController.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FController.ts#L21) ## Methods -### onFrame() +### frame() -> `abstract` **onFrame**(`delta`): `void` +> `abstract` **frame**(`delta`): `void` 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. +The purpose of this method is to update the component transform based on the controller logic. #### Parameters @@ -46,7 +45,7 @@ The time since the last frame. #### Defined in -[core/src/FController.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L31) +[core/src/FController.ts:30](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FController.ts#L30) ## Properties @@ -58,4 +57,4 @@ The component attached to the controller. #### Defined in -[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L15) +[core/src/FController.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FController.ts#L15) diff --git a/docs/api/core/classes/FGroup.md b/docs/api/core/classes/FGroup.md index 391a9273..ac61c82b 100644 --- a/docs/api/core/classes/FGroup.md +++ b/docs/api/core/classes/FGroup.md @@ -29,7 +29,7 @@ The components to add to the group. #### Defined in -[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L19) +[core/src/FGroup.ts:19](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FGroup.ts#L19) ## Methods @@ -49,13 +49,13 @@ Add a component to the group. #### Defined in -[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L26) +[core/src/FGroup.ts:26](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FGroup.ts#L26) *** -### onFrame() +### frame() -> **onFrame**(`delta`): `void` +> **frame**(`delta`): `void` Update all components in the group. @@ -71,7 +71,7 @@ The time since the last frame. #### Defined in -[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L41) +[core/src/FGroup.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FGroup.ts#L41) *** @@ -91,7 +91,7 @@ Remove a component from the group. #### Defined in -[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L33) +[core/src/FGroup.ts:33](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FGroup.ts#L33) ## Properties @@ -103,4 +103,4 @@ The components in the group. #### Defined in -[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FGroup.ts#L11) +[core/src/FGroup.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FGroup.ts#L11) diff --git a/docs/api/core/classes/FLight.md b/docs/api/core/classes/FLight.md index c7bf7fa6..7054bc94 100644 --- a/docs/api/core/classes/FLight.md +++ b/docs/api/core/classes/FLight.md @@ -4,242 +4,84 @@ The base class for lights in Fibbo. -## Extends - -- [`FComponent`](FComponent.md) - ## Constructors ### new FLight() -> **new FLight**(): [`FLight`](FLight.md) - -#### Returns - -[`FLight`](FLight.md) - -#### Overrides - -[`FComponent`](FComponent.md).[`constructor`](FComponent.md#constructors) - -#### Defined in - -[core/src/FLight.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FLight.ts#L8) - -## Methods - -### emitCollisionWith() - -> **emitCollisionWith**(`options`): `void` - -Emit a collision event with a given class or object. +> **new FLight**(`scene`, `options`): [`FLight`](FLight.md) #### Parameters -• **options** +• **scene**: [`FScene`](FScene.md) -The options for the collision event. - -• **options.class?**: `any` - -The class to emit the collision event with. - -• **options.component?**: [`FComponent`](FComponent.md) - -The component to emit the collision event with. +• **options**: [`FLightOptions`](../interfaces/FLightOptions.md) = `{}` #### Returns -`void` - -#### Examples - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - class: Enemy -}) -``` - -```typescript -const player = new Player() -const enemy = new Enemy() -player.emitCollisionWith({ - object: enemy -}) -``` - -#### Inherited from - -[`FComponent`](FComponent.md).[`emitCollisionWith`](FComponent.md#emitcollisionwith) +[`FLight`](FLight.md) #### Defined in -[core/src/FComponent.ts:135](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L135) - -*** - -### onCollisionWith() - -> **onCollisionWith**(`classOrObject`, `callback`): () => `void` +[core/src/FLight.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L22) -Add a callback to be called when a collision occurs. - -#### Parameters - -• **classOrObject**: `any` +## Methods -The class or object to add the callback to. +### emitOnLoaded() -• **callback** +> **emitOnLoaded**(): `void` -The callback to add. +Emit the onLoaded callbacks. #### Returns -`Function` - -A function to remove the callback. - -##### Returns - `void` -#### 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 -[core/src/FComponent.ts:85](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L85) +[core/src/FLight.ts:55](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L55) *** -### onFrame() +### onLoaded() -> **onFrame**(`delta`): `void` +> **onLoaded**(`callback`): `void` -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. +Add a callback to be called when the light is loaded. #### Parameters -• **delta**: `number` +• **callback** -The time since the last frame. +The callback function. #### Returns `void` -#### Inherited from - -[`FComponent`](FComponent.md).[`onFrame`](FComponent.md#onframe) - #### Defined in -[core/src/FComponent.ts:56](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L56) +[core/src/FLight.ts:48](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L48) ## Properties -### \_\_CALLBACKS\_ON\_COLLISION\_\_ +### \_\_CALLBACKS\_ON\_LOADED\_\_ -> **\_\_CALLBACKS\_ON\_COLLISION\_\_**: `object` = `{}` +> **\_\_CALLBACKS\_ON\_LOADED\_\_**: () => `void`[] = `[]` -Callbacks for when a collision occurs with a given class or object. -It is a dictionary where the key is the class name or object id and the value is an array of callbacks. - -#### Index Signature - - \[`key`: `string`\]: (`data`) => `void`[] - -#### Inherited from - -[`FComponent`](FComponent.md).[`__CALLBACKS_ON_COLLISION__`](FComponent.md#__callbacks_on_collision__) +Callbacks for when the light is loaded. #### Defined in -[core/src/FComponent.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L39) +[core/src/FLight.ts:15](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L15) *** -### \_\_ID\_\_ - -> **\_\_ID\_\_**: `number` - -Unique identifier for the component. -It is generated automatically. - -#### Inherited from - -[`FComponent`](FComponent.md).[`__ID__`](FComponent.md#__id__) - -#### Defined in - -[core/src/FComponent.ts:33](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L33) - -*** - -### \_\_IS\_2D\_\_ - -> **\_\_IS\_2D\_\_**: `boolean` = `false` - -#### Inherited from - -[`FComponent`](FComponent.md).[`__IS_2D__`](FComponent.md#__is_2d__) - -#### Defined in - -[core/src/FComponent.ts:27](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L27) - -*** - -### \_\_IS\_3D\_\_ - -> **\_\_IS\_3D\_\_**: `boolean` = `false` - -Internal flags - -#### Inherited from - -[`FComponent`](FComponent.md).[`__IS_3D__`](FComponent.md#__is_3d__) - -#### Defined in - -[core/src/FComponent.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L26) - -*** - -### controller? - -> `optional` **controller**: [`FController`](FController.md) - -The controller attached to the component. +### scene -#### Inherited from +> **scene**: [`FScene`](FScene.md) -[`FComponent`](FComponent.md).[`controller`](FComponent.md#controller) +The scene the light is attached to. #### Defined in -[core/src/FComponent.ts:44](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L44) +[core/src/FLight.ts:20](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L20) diff --git a/docs/api/core/classes/FScene.md b/docs/api/core/classes/FScene.md index 789eb618..2f7adb4e 100644 --- a/docs/api/core/classes/FScene.md +++ b/docs/api/core/classes/FScene.md @@ -21,7 +21,7 @@ Also contains the Rapier world if physics is enabled. #### Defined in -[core/src/FScene.ts:75](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L75) +[core/src/FScene.ts:71](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L71) ## Methods @@ -41,7 +41,7 @@ Add a component to the scene. #### Defined in -[core/src/FScene.ts:128](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L128) +[core/src/FScene.ts:126](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L126) *** @@ -61,7 +61,30 @@ Add a light to the scene. #### Defined in -[core/src/FScene.ts:147](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L147) +[core/src/FScene.ts:145](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L145) + +*** + +### frame() + +> **frame**(`delta`): `void` + +Compute a frame with the given delta time. +By default, it is called every frame, but this behavior can be changed by giving the `autoLoop` option as `false` when creating the scene. + +#### Parameters + +• **delta**: `number` + +The time in seconds since the last frame. + +#### Returns + +`void` + +#### Defined in + +[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L166) *** @@ -81,7 +104,7 @@ Add a callback to be called when a component is added to the scene. #### Defined in -[core/src/FScene.ts:173](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L173) +[core/src/FScene.ts:181](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L181) *** @@ -101,7 +124,7 @@ Add a callback to be called when a component is removed from the scene. #### Defined in -[core/src/FScene.ts:180](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L180) +[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L188) *** @@ -121,7 +144,7 @@ Add a callback to be called when a frame is rendered. #### Defined in -[core/src/FScene.ts:166](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L166) +[core/src/FScene.ts:174](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L174) *** @@ -141,7 +164,7 @@ Add a callback to be called when a light is added to the scene. #### Defined in -[core/src/FScene.ts:195](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L195) +[core/src/FScene.ts:203](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L203) *** @@ -161,7 +184,7 @@ Add a callback to be called when a light is removed from the scene. #### Defined in -[core/src/FScene.ts:202](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L202) +[core/src/FScene.ts:210](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L210) *** @@ -182,7 +205,7 @@ The scene is ready when the `init` method has finished. #### Defined in -[core/src/FScene.ts:188](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L188) +[core/src/FScene.ts:196](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L196) *** @@ -202,7 +225,7 @@ Remove a component from the scene. #### Defined in -[core/src/FScene.ts:136](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L136) +[core/src/FScene.ts:134](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L134) *** @@ -222,7 +245,7 @@ Remove a light from the scene. #### Defined in -[core/src/FScene.ts:155](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L155) +[core/src/FScene.ts:153](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L153) ## Properties @@ -231,11 +254,10 @@ Remove a light from the scene. > **\_\_CALLBACKS\_ON\_COMPONENT\_ADDED\_\_**: (`component`) => `void`[] = `[]` Callbacks for when a component is added to the scene. -It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:54](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L54) +[core/src/FScene.ts:53](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L53) *** @@ -244,11 +266,10 @@ It is an array of functions that take the component as an argument. > **\_\_CALLBACKS\_ON\_COMPONENT\_REMOVED\_\_**: (`component`) => `void`[] = `[]` Callbacks for when a component is remove from the scene. -It is an array of functions that take the component as an argument. #### Defined in -[core/src/FScene.ts:59](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L59) +[core/src/FScene.ts:57](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L57) *** @@ -257,11 +278,10 @@ It is an array of functions that take the component as an argument. > **\_\_CALLBACKS\_ON\_FRAME\_\_**: (`delta`) => `void`[] = `[]` Callbacks for when a frame is rendered. -It is an array of functions that take the delta time as an argument. #### Defined in -[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L49) +[core/src/FScene.ts:49](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L49) *** @@ -270,11 +290,10 @@ It is an array of functions that take the delta time as an argument. > **\_\_CALLBACKS\_ON\_LIGHT\_ADDED\_\_**: (`light`) => `void`[] = `[]` Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:68](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L68) +[core/src/FScene.ts:65](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L65) *** @@ -283,11 +302,10 @@ It is an array of functions that take the light as an argument. > **\_\_CALLBACKS\_ON\_LIGHT\_REMOVED\_\_**: (`light`) => `void`[] = `[]` Callbacks for when a light is added to the scene. -It is an array of functions that take the light as an argument. #### Defined in -[core/src/FScene.ts:73](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L73) +[core/src/FScene.ts:69](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L69) *** @@ -299,7 +317,7 @@ Callbacks for when the scene is ready. #### Defined in -[core/src/FScene.ts:63](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L63) +[core/src/FScene.ts:61](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L61) *** @@ -311,7 +329,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:26](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L26) +[core/src/FScene.ts:27](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L27) *** @@ -321,7 +339,7 @@ DOM element that the renderer will be appended to #### Defined in -[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L21) +[core/src/FScene.ts:22](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L22) *** @@ -333,7 +351,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:20](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L20) +[core/src/FScene.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L21) *** @@ -343,7 +361,7 @@ Internal flags #### Defined in -[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L42) +[core/src/FScene.ts:43](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L43) *** @@ -355,7 +373,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:31](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L31) +[core/src/FScene.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L32) *** @@ -365,7 +383,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L41) +[core/src/FScene.ts:42](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L42) *** @@ -375,7 +393,7 @@ The components in the scene. #### Defined in -[core/src/FScene.ts:39](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L39) +[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L40) *** @@ -387,7 +405,7 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L36) +[core/src/FScene.ts:37](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L37) *** @@ -397,4 +415,4 @@ The lights in the scene. #### Defined in -[core/src/FScene.ts:40](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L40) +[core/src/FScene.ts:41](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L41) diff --git a/docs/api/core/index.md b/docs/api/core/index.md index 3b6562f4..8029963f 100644 --- a/docs/api/core/index.md +++ b/docs/api/core/index.md @@ -17,6 +17,8 @@ ### Interfaces +- [FComponentOptions](interfaces/FComponentOptions.md) - [FControllerOptions](interfaces/FControllerOptions.md) +- [FLightOptions](interfaces/FLightOptions.md) - [FSceneOptions](interfaces/FSceneOptions.md) - [OnCollisionWithData](interfaces/OnCollisionWithData.md) diff --git a/docs/api/core/interfaces/FComponentOptions.md b/docs/api/core/interfaces/FComponentOptions.md new file mode 100644 index 00000000..072fb2d9 --- /dev/null +++ b/docs/api/core/interfaces/FComponentOptions.md @@ -0,0 +1,13 @@ +[@fibbojs](/api/index) / [core](/api/core) / FComponentOptions + +# Interface: FComponentOptions + +## Properties + +### addToScene? + +> `optional` **addToScene**: `boolean` + +#### Defined in + +[core/src/FComponent.ts:11](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L11) diff --git a/docs/api/core/interfaces/FControllerOptions.md b/docs/api/core/interfaces/FControllerOptions.md index 41c2bae1..e27cd7db 100644 --- a/docs/api/core/interfaces/FControllerOptions.md +++ b/docs/api/core/interfaces/FControllerOptions.md @@ -10,4 +10,4 @@ #### Defined in -[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FController.ts#L4) +[core/src/FController.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FController.ts#L4) diff --git a/docs/api/core/interfaces/FLightOptions.md b/docs/api/core/interfaces/FLightOptions.md new file mode 100644 index 00000000..06c993cc --- /dev/null +++ b/docs/api/core/interfaces/FLightOptions.md @@ -0,0 +1,13 @@ +[@fibbojs](/api/index) / [core](/api/core) / FLightOptions + +# Interface: FLightOptions + +## Properties + +### addToScene? + +> `optional` **addToScene**: `boolean` + +#### Defined in + +[core/src/FLight.ts:4](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FLight.ts#L4) diff --git a/docs/api/core/interfaces/FSceneOptions.md b/docs/api/core/interfaces/FSceneOptions.md index e79a7282..14acf4c2 100644 --- a/docs/api/core/interfaces/FSceneOptions.md +++ b/docs/api/core/interfaces/FSceneOptions.md @@ -4,13 +4,23 @@ ## Properties +### autoLoop? + +> `optional` **autoLoop**: `boolean` + +#### Defined in + +[core/src/FScene.ts:9](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L9) + +*** + ### domNode? > `optional` **domNode**: `HTMLElement` #### Defined in -[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L8) +[core/src/FScene.ts:8](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L8) *** @@ -20,4 +30,4 @@ #### Defined in -[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FScene.ts#L7) +[core/src/FScene.ts:7](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FScene.ts#L7) diff --git a/docs/api/core/interfaces/OnCollisionWithData.md b/docs/api/core/interfaces/OnCollisionWithData.md index 6a2a303d..fb002e2d 100644 --- a/docs/api/core/interfaces/OnCollisionWithData.md +++ b/docs/api/core/interfaces/OnCollisionWithData.md @@ -14,4 +14,4 @@ The component that collided with the component. #### Defined in -[core/src/FComponent.ts:15](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/core/src/FComponent.ts#L15) +[core/src/FComponent.ts:21](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/core/src/FComponent.ts#L21) diff --git a/docs/api/event/classes/FKeyboard.md b/docs/api/event/classes/FKeyboard.md index 40650c62..42f5c2eb 100644 --- a/docs/api/event/classes/FKeyboard.md +++ b/docs/api/event/classes/FKeyboard.md @@ -35,7 +35,7 @@ keyboard.on('ArrowUp', () => { #### Defined in -[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L38) +[event/src/FKeyboard.ts:38](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L38) ## Methods @@ -61,7 +61,7 @@ keyboard.clear() #### Defined in -[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L194) +[event/src/FKeyboard.ts:194](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L194) *** @@ -112,7 +112,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L102) +[event/src/FKeyboard.ts:102](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L102) *** @@ -161,7 +161,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L136) +[event/src/FKeyboard.ts:136](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L136) *** @@ -210,7 +210,7 @@ removeListener() #### Defined in -[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L170) +[event/src/FKeyboard.ts:170](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L170) ## Properties @@ -222,7 +222,7 @@ An map of all the callbacks for each key being pressed #### Defined in -[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L28) +[event/src/FKeyboard.ts:28](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L28) *** @@ -234,7 +234,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L32) +[event/src/FKeyboard.ts:32](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L32) *** @@ -246,7 +246,7 @@ An map of all the callbacks for each key being released #### Defined in -[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L36) +[event/src/FKeyboard.ts:36](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L36) *** @@ -258,4 +258,4 @@ A map of all the keys being pressed #### Defined in -[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/c8bca4c6d190e0a6b19c44fcd12f335601e086d6/packages/event/src/FKeyboard.ts#L24) +[event/src/FKeyboard.ts:24](https://github.com/fibbojs/fibbo/blob/31a9adc82b7f9e94d4aaa254912cda4482699c0d/packages/event/src/FKeyboard.ts#L24) diff --git a/packages/2d/src/sprite/FSprite.ts b/packages/2d/src/sprite/FSprite.ts index bdb932e0..1e2d9973 100644 --- a/packages/2d/src/sprite/FSprite.ts +++ b/packages/2d/src/sprite/FSprite.ts @@ -2,7 +2,6 @@ import * as PIXI from 'pixi.js' import type { FComponentOptions } from '../core/FComponent' import { FComponent } from '../core/FComponent' import type { FScene } from '../core/FScene' -import type { FVector2 } from '../types/FVector2' export interface FSpriteOptions extends FComponentOptions { texture: string diff --git a/packages/3d/src/controllers/FCharacterController.ts b/packages/3d/src/controllers/FCharacterController.ts index a6d9d1b0..c1dcc39b 100644 --- a/packages/3d/src/controllers/FCharacterController.ts +++ b/packages/3d/src/controllers/FCharacterController.ts @@ -3,7 +3,6 @@ import RAPIER from '@dimforge/rapier3d' import * as THREE from 'three' import type { FScene } from '../core/FScene' import { FShapes } from '../types/FShapes' -import { FSensor } from '../core/FSensor' import type { FControllerOptions } from './FController' import { FController } from './FController' diff --git a/packages/3d/src/controllers/FCharacterControllerD.ts b/packages/3d/src/controllers/FCharacterControllerD.ts index 7a038518..e045d5fd 100644 --- a/packages/3d/src/controllers/FCharacterControllerD.ts +++ b/packages/3d/src/controllers/FCharacterControllerD.ts @@ -1,7 +1,6 @@ import * as THREE from 'three' import { FKeyboard } from '@fibbojs/event' import type { FScene } from '../core/FScene' -import { FRigidBody } from '../core/FRigidBody' import { FRigidBodyType } from '../types/FRigidBodyType' import type { FCharacterControllerOptions } from './FCharacterController' import { FCharacterController } from './FCharacterController' diff --git a/packages/3d/src/controllers/FCharacterControllerKP.ts b/packages/3d/src/controllers/FCharacterControllerKP.ts index f14752b6..69b7934d 100644 --- a/packages/3d/src/controllers/FCharacterControllerKP.ts +++ b/packages/3d/src/controllers/FCharacterControllerKP.ts @@ -1,5 +1,4 @@ import type { FScene } from '../core/FScene' -import { FRigidBody } from '../core/FRigidBody' import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' diff --git a/packages/3d/src/controllers/FCharacterControllerKV.ts b/packages/3d/src/controllers/FCharacterControllerKV.ts index ebfe00cb..9277998a 100644 --- a/packages/3d/src/controllers/FCharacterControllerKV.ts +++ b/packages/3d/src/controllers/FCharacterControllerKV.ts @@ -1,5 +1,4 @@ import type { FScene } from '../core/FScene' -import { FRigidBody } from '../core/FRigidBody' import { FRigidBodyType } from '../types/FRigidBodyType' import { FCharacterControllerK } from './FCharacterControllerK' import type { FCharacterControllerOptions } from './FCharacterController' diff --git a/packages/core/src/FComponent.ts b/packages/core/src/FComponent.ts index df3fa062..57be7e43 100644 --- a/packages/core/src/FComponent.ts +++ b/packages/core/src/FComponent.ts @@ -1,5 +1,4 @@ import type { FController } from './FController' -import { FLight } from './FLight' import type { FScene } from './FScene' /** From df5f16d3568b30d19842600bbe9a46c213ace160 Mon Sep 17 00:00:00 2001 From: Gugustinette Date: Tue, 22 Oct 2024 22:00:29 +0200 Subject: [PATCH 36/36] docs: update documentation --- docs/guide/2d/polygons.md | 4 +- docs/guide/2d/sprites.md | 2 +- docs/guide/3d/models.md | 8 +-- docs/guide/3d/polyhedrons.md | 6 +- docs/guide/core/components.md | 85 ++++++++++------------ docs/guide/core/controllers.md | 37 ++++++++-- docs/guide/core/scene.md | 17 ----- docs/guide/core/transforms.md | 124 +++++++++++++++++++++++--------- docs/guide/events/collisions.md | 90 +++++++++++------------ docs/guide/physics/colliders.md | 54 ++++++++------ docs/guide/physics/rigidbody.md | 87 ++++++++++++---------- 11 files changed, 296 insertions(+), 218 deletions(-) diff --git a/docs/guide/2d/polygons.md b/docs/guide/2d/polygons.md index b105a103..2bf75690 100644 --- a/docs/guide/2d/polygons.md +++ b/docs/guide/2d/polygons.md @@ -15,7 +15,7 @@ To create a rectangle, you can use the `FRectangle` class. Here is an example: ```typescript import { FRectangle } from '@fibbojs/2d' -const square = new FRectangle({ +const square = new FRectangle(scene, { position: { x: 0, y: 5 }, scale: { x: 1, y: 1 }, }) @@ -30,7 +30,7 @@ To create a circle, you can use the `FCircle` class. Here is an example: ```typescript import { FCircle } from '@fibbojs/2d' -const circle = new FCircle({ +const circle = new FCircle(scene, { position: { x: 0, y: 5 }, scale: { x: 1, y: 1 }, }) diff --git a/docs/guide/2d/sprites.md b/docs/guide/2d/sprites.md index c26afafe..a2f2b181 100644 --- a/docs/guide/2d/sprites.md +++ b/docs/guide/2d/sprites.md @@ -9,7 +9,7 @@ To create a sprite, you can use the `FSprite` class. Here is an example: ```typescript import { FSprite } from '@fibbojs/2d' -const sprite = new FSprite({ +const sprite = new FSprite(scene, { texture: 'path/to/texture.png', position: { x: 0, y: 5 }, scale: { x: 1, y: 1 }, diff --git a/docs/guide/3d/models.md b/docs/guide/3d/models.md index 564044d3..43a2d734 100644 --- a/docs/guide/3d/models.md +++ b/docs/guide/3d/models.md @@ -35,7 +35,7 @@ To load a `.fbx` model, you can use the `FFBX` class. Here is an example : ```typescript import { FFBX } from '@fibbojs/3d' -const fbx = new FFBX({ +const fbx = new FFBX(scene, { path: 'path/to/your/model.fbx', position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, @@ -49,7 +49,7 @@ To load a `.obj` model, you can use the `FOBJ` class. Here is an example : ```typescript import { FOBJ } from '@fibbojs/3d' -const obj = new FOBJ({ +const obj = new FOBJ(scene, { path: 'path/to/your/model.obj', position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, @@ -63,7 +63,7 @@ To load a `.glb` model, you can use the `FGLB` class. Here is an example : ```typescript import { FGLB } from '@fibbojs/3d' -const glb = new FGLB({ +const glb = new FGLB(scene, { path: 'path/to/your/model.glb', position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, @@ -81,7 +81,7 @@ To load a `.gltf` model, you can use the `FGLTF` class. Here is an example : ```typescript import { FGLTF } from '@fibbojs/3d' -const gltf = new FGLTF({ +const gltf = new FGLTF(scene, { path: 'path/to/your/model.gltf', position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, diff --git a/docs/guide/3d/polyhedrons.md b/docs/guide/3d/polyhedrons.md index 72d0d260..a5f708ba 100644 --- a/docs/guide/3d/polyhedrons.md +++ b/docs/guide/3d/polyhedrons.md @@ -17,7 +17,7 @@ To create a cuboid, you can use the `FCuboid` class. Here is an example: ```typescript import { FCuboid } from '@fibbojs/3d' -const cube = new FCuboid({ +const cube = new FCuboid(scene, { position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, }) @@ -32,7 +32,7 @@ To create a sphere, you can use the `FSphere` class. Here is an example: ```typescript import { FSphere } from '@fibbojs/3d' -const sphere = new FSphere({ +const sphere = new FSphere(scene, { position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, }) @@ -47,7 +47,7 @@ To create a capsule, you can use the `FCapsule` class. Here is an example: ```typescript import { FCapsule } from '@fibbojs/3d' -const capsule = new FCapsule({ +const capsule = new FCapsule(scene, { position: { x: 0, y: 5, z: 0 }, scale: { x: 1, y: 1, z: 1 }, }) diff --git a/docs/guide/core/components.md b/docs/guide/core/components.md index 393def4e..c2d3a3d2 100644 --- a/docs/guide/core/components.md +++ b/docs/guide/core/components.md @@ -7,71 +7,64 @@ Components are the main building blocks of Fibbo. They are the objects that you A component is a class that extends the [`FComponent`](/api/core/classes/FComponent) class. It represents an object in a scene, will be rendered, updated, and interacted with. It is mainly composed of the following attributes : -- [`transform`](/guide/transforms) : The position, rotation, and scale of the object. -- `collider` : (optional) The collider of the object, used for physics interactions. -- `rigidBody` : (optional) The rigidBody of the object, used for physics interactions. -- `sensor` : (optional) The sensor of the object, used for detecting and emitting collisions events. +- [`transform`](/guide/core/transforms) : The position, rotation, and scale of the component. It can be accessed and modified using getters and setters. +- [`collider`](/guide/physics/colliders) : (optional) The collider of the component, used for physics interactions. +- [`rigidBody`](/guide/physics/rigidbody) : (optional) The rigidBody of the component, used for physics interactions. +- [`sensor`](/guide/events/collisions) : (optional) The sensor of the component, used for detecting and emitting collisions events. And the following methods : -- `onFrame` : Called every frame by the [Scene](/guide/scene) to update the component. -- `initCollider` : Initialize the collider of the object. -- `initRigidBody` : Initialize the rigidBody of the object. -- `initSensor` : Initialize the sensor of the object. -- Various methods to modify the transform of the object. - - `setPosition` : Set the position of the object. - - `setRotation` : Set the rotation of the object. - - `setScale` : Set the scale of the object. +- `frame` : Called every frame by the [Scene](/guide/scene) to update the component. +- `onFrame` : A method that takes a callback to be called every frame. +- `initCollider` : Initialize the collider of the component. +- `initRigidBody` : Initialize the rigidBody of the component. +- `initSensor` : Initialize the sensor of the component. ## Creating a component To create a component, you can just import it and create a new instance : -```typescript -import { FCuboid } from '@fibbojs/3d' - -const cube = new FCuboid() -``` +::: code-group -This will create a new cuboid component, that can be added to a [Scene](/guide/scene). +```typescript [2d] +import { FRectangle } from '@fibbojs/2d' -Options can be passed to the constructor : +const rectangle = new FRectangle(scene) +``` -```typescript +```typescript [3d] import { FCuboid } from '@fibbojs/3d' -const cube = new FCuboid({ - position: { x: 1, y: 2, z: 3 }, - scale: { x: 2, y: 2, z: 2 }, - rotation: { x: 0, y: 0, z: 0 } - // also available as rotationDegree: { x: 0, y: 0, z: 0 } -}) +const cube = new FCuboid(scene) ``` -## Getters and setters +::: -For convenience, components expose getters and setters for interacting with their [transform](/guide/transforms). +This will create a new component, that will automatically be added to the scene you passed as an argument. -```typescript -const cube = new FCuboid() +Various options can be passed to the constructor : -// Get the position of the cube -const position = cube.x +::: code-group -// Set the position of the cube -cube.x = 1 +```typescript [2d] +import { FRectangle } from '@fibbojs/2d' + +const cube = new FRectangle(scene, { + position: { x: 1, y: 2 }, + rotation: 0, + rotationDegree: 0, + scale: { x: 2, y: 2 }, +}) ``` -This is especially useful when you want to use things like [2-way data binding](https://en.wikipedia.org/wiki/Data_binding#Two-way_data_binding) in modern UI libraries (e.g. React, Vue, Angular,...). - -For example, in Vue, you could bind the position of a cube to a `v-model` : -```vue - +```typescript [3d] +import { FCuboid } from '@fibbojs/3d' + +const cube = new FCuboid(scene, { + position: { x: 1, y: 2, z: 3 }, + rotation: { x: 0, y: 0, z: 0 }, + rotationDegree: { x: 0, y: 0, z: 0 }, + scale: { x: 2, y: 2, z: 2 }, +}) ``` -You can check the [API documentation](/api) for more information on the available getters and setters : [here for a 3D component](/api/3d/classes/FComponent) or [here for a 2D component](/api/2d/classes/FComponent). +::: diff --git a/docs/guide/core/controllers.md b/docs/guide/core/controllers.md index 7cd77d0c..1986a943 100644 --- a/docs/guide/core/controllers.md +++ b/docs/guide/core/controllers.md @@ -2,18 +2,41 @@ 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 : +A controller's [`frame`](/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, FCuboid } from '@fibbojs/core' -import type { FControllerOptions } from '@fibbojs/core' +::: code-group + +```typescript [2d] +import { FController, FRectangle } from '@fibbojs/2d' +import type { FControllerOptions } from '@fibbojs/2d' + +export class MyRotateController extends FController { + constructor(options?: FControllerOptions) { + super(options) + } + + frame() { + this.component.rotation += 0.01 + } +} + +// Usage +const rectangle = new FRectangle() +rectangle.controller = new MyRotateController({ + component: cube +}) +``` + +```typescript [3d] +import { FController, FCuboid } from '@fibbojs/3d' +import type { FControllerOptions } from '@fibbojs/3d' export class MyRotateController extends FController { constructor(options?: FControllerOptions) { super(options) } - onFrame() { + frame() { this.component.rotation.y += 0.01 } } @@ -25,5 +48,7 @@ cube.controller = new MyRotateController({ }) ``` -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. +::: + +In this example, the `frame` method adds `0.01` to the component's rotation each frame. If you want to learn more about controllers, Fibbo provides a default [character controller](/more/recipes/character-controller) and you can also create your own [custom controller](/more/recipes/custom-controller). diff --git a/docs/guide/core/scene.md b/docs/guide/core/scene.md index 0a33e1c8..989b995d 100644 --- a/docs/guide/core/scene.md +++ b/docs/guide/core/scene.md @@ -31,17 +31,6 @@ import { FScene } from '@fibbojs/3d' })() ``` -## Adding components to the scene - -Once the scene is created, you can add components to it using the `addComponent` method. - -```typescript -const cube = new FCuboid() -scene.addComponent(cube) -``` - -As soon as you add a component to the scene, it will be rendered on the screen each frame. - ## Removing components from the scene You can remove a component from the scene using the `removeComponent` method. @@ -74,9 +63,3 @@ scene.onComponentRemoved((component: FComponent) => { // Do something on a component removed from the scene }) ``` - -::: warning -The `onFrame` method on a scene is used to add a callback that will be called every frame by the scene itself. You can add as many callbacks as you want, and they will be called in the order they were added. - -The `onFrame` method on a component is a method that will be called every frame by the scene, to update its components. You should not call this method directly : if you want to change the behavior of a component, you should extend it and override the `onFrame` method. -::: diff --git a/docs/guide/core/transforms.md b/docs/guide/core/transforms.md index a49da801..f84f765a 100644 --- a/docs/guide/core/transforms.md +++ b/docs/guide/core/transforms.md @@ -2,73 +2,129 @@ In most game engines, a transform is an object responsible for handling the position, rotation, and scale of a component in the scene. -In Fibbo, each component has a `transform` property that exposes these attributes. +In Fibbo, each component (sprites, lights, cameras, ...) or physic object (colliders, rigidbodies, ...) has a `transform` property that exposes these attributes. -However you should not modify the transform directly, but use the provided methods instead. +The transform is meant to be accessed and modified using getters and setters. You can find the API reference for a [2d transform here](/api/2d/classes/FTransform) and for a [3d transform here](/api/3d/classes/FTransform). +::: warning +For now, transforms are not deeply reactive, so you need to use the provided setters to update the values. For example : +- `transform.position = { x: 1, y: 2 }` is reactive +- `transform.x = 1` is reactive +- `transform.position.x = 1` is **NOT** reactive +::: + ## Position The position of an object is a 2D/3D vector that represents its location in the scene. For more information on the unit system, see the [fundamentals](/guide/fundamentals#unit-system) section. You can set the position as follows : -```typescript -const cube = new FCuboid() -cube.setPosition({ x: 1, y: 2, z: 3 }) -// Or using the setter : -cube.position = { x: 1, y: 2, z: 3 } -``` +::: code-group -You can also get the position of an object using the `position` property : +```typescript [2d] +const rectangle = new FRectangle(scene) +rectangle.transform.position = { x: 1, y: 2 } +// Or using the function directly : +rectangle.transform.setPosition({ x: 1, y: 2 }) +// Accessing a specific axis : +rectangle.transform.x = 1 +rectangle.transform.y = 2 +``` -```typescript -const position = cube.position +```typescript [3d] +const cube = new FCuboid(scene) +cube.transform.position = { x: 1, y: 2, z: 3 } +// Or using the function directly : +cube.transform.setPosition({ x: 1, y: 2, z: 3 }) +// Accessing a specific axis : +cube.transform.x = 1 +cube.transform.y = 2 +cube.transform.z = 3 ``` +::: + ## Rotation The rotation of an object is a either a number (in 2D scenes) or a 3D vector (in 3D scenes) that represents its orientation in the scene. The rotation is expressed in [radians](https://en.wikipedia.org/wiki/Radian). You can set the rotation as follows : -```typescript -const cube = new FCuboid() -cube.setRotation({ x: 0, y: 0.7853981634, z: 0 }) -// Or using the setter : -cube.rotation = { x: 0, y: 0.7853981634, z: 0 } -``` +::: code-group -You can also get the rotation of an object using the `rotation` property : +```typescript [2d] +const rectangle = new FRectangle(scene) +rectangle.transform.rotation = Math.PI / 2 +// Or using the function directly : +rectangle.transform.setRotation(Math.PI / 2) +``` -```typescript -const rotation = cube.rotation +```typescript [3d] +const cube = new FCuboid(scene) +cube.transform.rotation = { x: Math.PI / 2, y: Math.PI / 2, z: Math.PI / 2 } +// Or using the function directly : +cube.transform.setRotation({ x: Math.PI / 2, y: Math.PI / 2, z: Math.PI / 2 }) +// Accessing a specific axis : +cube.transform.rotationX = Math.PI / 2 +cube.transform.rotationY = Math.PI / 2 +cube.transform.rotationZ = Math.PI / 2 ``` -In most cases, you'll want to use the `rotationDegree` alternative, which helps you set the rotation in degrees : +::: + +Alternatively, you can use the `rotationDegree` property to set the rotation in degrees : -```typescript -cube.setRotationDegree({ x: 0, y: 45, z: 0 }) -cube.rotationDegree = { x: 0, y: 45, z: 0 } -const rotationDegree = cube.rotationDegree +::: code-group + +```typescript [2d] +const rectangle = new FRectangle(scene) +rectangle.transform.rotationDegree = 90 +// Or using the function directly : +rectangle.transform.setRotationDegree(90) +``` + +```typescript [3d] +const cube = new FCuboid(scene) +cube.transform.rotationDegree = { x: 90, y: 90, z: 90 } +// Or using the function directly : +cube.transform.setRotationDegree({ x: 90, y: 90, z: 90 }) +// Accessing a specific axis : +cube.transform.rotationDegreeX = 90 +cube.transform.rotationDegreeY = 90 +cube.transform.rotationDegreeZ = 90 ``` +::: + ## Scale The scale of an object is a 2D/3D vector that represents its size in the scene. For more information on the units system, see the [fundamentals](/guide/fundamentals#unit-system) section. You can set the scale as follows : -```typescript -const cube = new FCuboid() -cube.setScale({ x: 2, y: 2, z: 2 }) -// Or using the setter : -cube.scale = { x: 2, y: 2, z: 2 } -``` +::: code-group -You can also get the scale of an object using the `scale` property : +```typescript [2d] +const rectangle = new FRectangle(scene) +rectangle.transform.scale = { x: 2, y: 2 } +// Or using the function directly : +rectangle.transform.setScale({ x: 2, y: 2 }) +// Accessing a specific axis : +rectangle.transform.scaleX = 2 +rectangle.transform.scaleY = 2 +``` -```typescript -const scale = cube.scale +```typescript [3d] +const cube = new FCuboid(scene) +cube.transform.scale = { x: 2, y: 2, z: 2 } +// Or using the function directly : +cube.transform.setScale({ x: 2, y: 2, z: 2 }) +// Accessing a specific axis : +cube.transform.scaleX = 2 +cube.transform.scaleY = 2 +cube.transform.scaleZ = 2 ``` + +::: diff --git a/docs/guide/events/collisions.md b/docs/guide/events/collisions.md index f3eb028f..5c99c891 100644 --- a/docs/guide/events/collisions.md +++ b/docs/guide/events/collisions.md @@ -4,79 +4,81 @@ Collisions events are triggered when two objects collide with each other. This c ## Initialization -To enable collisions events to be emitted on a component, you need to initialize a sensor collider on it. A sensor collider is a collider that does not affect the physics simulation, but only emits events when it collides with another collider. +To enable collisions events to be emitted on a component, you need to initialize a sensor on it. A sensor is a essentially a [rigidBody](/guide/physics/rigidbody) with the sensor flag (which mean it does not affect the physics simulation). It only emits events when it collides with another collider. -The available parameters are the same as for a [collider](/guide/physics/colliders). +The available parameters are the same as for a [rigidBody](/guide/physics/rigidbody). -```typescript -import { FCuboid, FShape } from '@fibbojs/3d' +::: code-group + +```typescript [2d] +import { FRectangle, FShapes } from '@fibbojs/2d' + +const rectangle = new FRectangle() +rectangle.initSensor({ + position: { x: 0, y: 0 }, + rotation: 0, + rotationDegree: 0, + scale: { x: 1, y: 1 }, + shape: FShapes.RECTANGLE +}) +``` + +```typescript [3d] +import { FCuboid, FShapes } from '@fibbojs/3d' const cube = new FCuboid() cube.initSensor({ position: { x: 0, y: 0, z: 0 }, scale: { x: 1, y: 1, z: 1 }, rotationDegree: { x: 0, y: 0, z: 0 }, - shape: FShape.CUBE + shape: FShapes.CUBOID }) ``` +::: + ## Listening to collisions Every [`FComponent`](/api/core/classes/FComponent) has a [`onCollisionWith`](/api/core/classes/FComponent#oncollisionwith) method that allows you to listen to collisions events. -```typescript -import { FCuboid, FSphere } from '@fibbojs/3d' +::: code-group -const cube = new FCuboid() -const sphere = new FSphere() +```typescript [2d] +import { FCircle, FRectangle } from '@fibbojs/2d' + +const rectangle = new FRectangle(scene) +const circle = new FCircle(scene) -cube.onCollisionWith((FCuboid) => { - console.log('Collision with a cuboid') +// Detect collisions with all rectangles +rectangle.onCollisionWith(FRectangle, ({ component }) => { + console.log('Collision with a rectangle :', component) }) -cube.onCollisionWith((sphere) => { - console.log('Collision with the sphere') +// Detect collisions with the circle +rectangle.onCollisionWith(circle, () => { + console.log('Collision with the circle') }) ``` -You can either listen to collisions with a specific component type, or with any component class. - -Note that if you give a class and the component collide with a component extending this class, the event will be triggered. - -For example : - -```typescript -import { FCuboid } from '@fibbojs/3d' -import type { FComponentOptions } from '@fibbojs/3d' - -class MyCuboid extends FCuboid { - constructor(options?: FComponentOptions) { - super(options) - } -} +```typescript [3d] +import { FCuboid, FSphere } from '@fibbojs/3d' -const cube = new FCuboid() -const myCube = new MyCuboid() +const cube = new FCuboid(scene) +const sphere = new FSphere(scene) -cube.onCollisionWith((FCuboid) => { - console.log('Collision with a cuboid') +// Detect collisions with all cuboids +cube.onCollisionWith(FCuboid, ({ component }) => { + console.log('Collision with a cuboid :', component) +}) +// Detect collisions with the sphere +cube.onCollisionWith(sphere, () => { + console.log('Collision with the sphere') }) ``` -In this example, the event will be triggered when the `cube` collides with the `myCube` because `MyCuboid` extends `FCuboid`. +::: ## Getting data about the collision When a collision event is triggered, you can get [data about the collision](/api/core/interfaces/OnCollisionWithData). For now, the only data available is the component that the collision event is triggered on. - -```typescript -import { FCuboid, FSphere } from '@fibbojs/3d' - -const cube = new FCuboid() - -cube.onCollisionWith(FSphere, ({ component }) => { - console.log('Collision with the sphere') - console.log('The sphere component is', component) -}) -``` diff --git a/docs/guide/physics/colliders.md b/docs/guide/physics/colliders.md index d6b5435c..00e925f8 100644 --- a/docs/guide/physics/colliders.md +++ b/docs/guide/physics/colliders.md @@ -8,40 +8,48 @@ Any other use case might require attaching the collider to a rigidBody. ## Adding a collider to a component -Every [`FComponent`](/api/core/classes/FComponent) has a [`initCollider`](/api/3d/classes/FComponent#initcollider) method that allows you to create a collider and attach it to the component directly. +Every [`FComponent`](/api/core/classes/FComponent) has an `initCollider` method that allows you to create a collider and attach it to the component directly. + +::: code-group + +```typescript [2d] +import { FRectangle, FShapes } from '@fibbojs/3d' + +const rectangle = new FRectangle() +rectangle.initCollider({ + position: { x: 0, y: 0 }, + rotation: 0, + rotationDegree: 0, + scale: { x: 1, y: 1 }, + positionOffset: { x: 0, y: 0 }, + rotationOffset: 0, + rotationDegreeOffset: 0, + scaleOffset: { x: 1, y: 1 }, + shape: FShapes.RECTANGLE +}) +``` -```typescript -import { FCuboid, FShape } from '@fibbojs/3d' +```typescript [3d] +import { FCuboid, FShapes } from '@fibbojs/3d' const cube = new FCuboid() cube.initCollider({ position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, rotation: { x: 0, y: 0, z: 0 }, rotationDegree: { x: 0, y: 0, z: 0 }, - shape: FShape.CUBE + scale: { x: 1, y: 1, z: 1 }, + positionOffset: { x: 0, y: 0, z: 0 }, + rotationOffset: { x: 0, y: 0, z: 0 }, + rotationDegreeOffset: { x: 0, y: 0, z: 0 }, + scaleOffset: { x: 1, y: 1, z: 1 }, + shape: FShapes.CUBOID }) ``` -The [transform](/guide/core/transforms) of the component will be interpreted as relative to the collider. This means that if you set the position of the component to `{ x: 1, y: 1, z: 1 }` and the position of the collider to `{ x: 2, y: 0, z: 0 }`, the collider will be placed at `{ x: 3, y: 1, z: 1 }` in the scene. - -This is particularly useful as it allows to position the collider by defining offsets from the component's origin. - -## Creating a collider by hand - -You can also directly use the [`FCollider`](/api/3d/classes/FCollider) class to create a collider and attach it to a component. +::: -```typescript -import { FCollider, FCuboid, FShape } from '@fibbojs/3d' +As soon as a collider is attached to a component, the component's transform will be updated relatively to the collider's transform. -const cube = new FCuboid() -cube.collider = new FCollider({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - rotationDegree: { x: 0, y: 0, z: 0 }, - shape: FShape.CUBE -}) -``` +An offset can be applied to the collider's transform so it can be placed relatively to the component's transform. To learn more about colliders, you can refer to the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/colliders). diff --git a/docs/guide/physics/rigidbody.md b/docs/guide/physics/rigidbody.md index 03477968..164b61c0 100644 --- a/docs/guide/physics/rigidbody.md +++ b/docs/guide/physics/rigidbody.md @@ -1,10 +1,10 @@ # RigidBody -The real-time simulation of rigid-bodies subjected to forces and contacts is the main feature of a physics engine. Rigid-bodies are responsible for the dynamics and kinematics of a solid. +The real-time simulation of rigidBodies subjected to forces and contacts is the main feature of a physics engine. rigidBodies are responsible for the dynamics and kinematics of a solid. -Rigid-bodies are typically used to simulate the dynamics of non-deformable solids as well as to integrate the trajectory of solids which velocities are controlled by the user (e.g. moving platforms). +rigidBodies are typically used to simulate the dynamics of non-deformable solids as well as to integrate the trajectory of solids which velocities are controlled by the user (e.g. moving platforms). -On the other hand, rigid-bodies are not enough to simulate, e.g., cars, ragdolls, or robotic systems, as those use-cases require adding restrictions on the relative motion between their parts using [joints](/guide/physics/joints). +On the other hand, rigidBodies are not enough to simulate, e.g., cars, ragdolls, or robotic systems, as those use-cases require adding restrictions on the relative motion between their parts using [joints](/guide/physics/joints). ## Relation with colliders @@ -16,64 +16,75 @@ A rigidBody without collider attached to it will not be affected by contacts (be By default, Fibbo always create a collider when a rigidBody is created. ::: -## Types of rigid-bodies +## Types of RigidBody -There are 4 types of rigid-bodies : -There are four types of rigid-bodies, identified by the RigidBodyType enumeration: +There are 4 types of rigidbody : -- Dynamic (`RAPIER.RigidBodyType.Dynamic`) : Indicates that the body is affected by external forces and contacts. This is the one used for objects affeted by gravity, forces, etc. -- Fixed (`RAPIER.RigidBodyType.Fixed`) : Indicates the body cannot move. It acts as if it has an infinite mass and will not be affected by any force. It will continue to collide with dynamic bodies but not with fixed nor with kinematic bodies. This is typically used for the ground or for temporarily freezing a body. -- Kinematic Position Based (`RAPIER.RigidBodyType.KinematicPositionBased`): Indicates that the body position must not be altered by the physics engine. The user is free to set its next position and the body velocity will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. -- Kinematic Velocity Based (`RAPIER.RigidBodyType.KinematicVelocityBased`): Indicates that the body velocity must not be altered by the physics engine. The user is free to set its velocity and the next body position will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. +- Dynamic (`FRigidBodyType.DYNAMIC`) : Indicates that the body is affected by external forces and contacts. This is the one used for objects affeted by gravity, forces, etc. +- Fixed (`FRigidBodyType.FIXED`) : Indicates the body cannot move. It acts as if it has an infinite mass and will not be affected by any force. It will continue to collide with dynamic bodies but not with fixed nor with kinematic bodies. This is typically used for the ground or for temporarily freezing a body. +- Kinematic Position Based (`FRigidBodyType.KINEMATIC_POSITION_BASED`): Indicates that the body position must not be altered by the physics engine. The user is free to set its next position and the body velocity will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. +- Kinematic Velocity Based (`FRigidBodyType.KINEMATIC_VELOCITY_BASED`): Indicates that the body velocity must not be altered by the physics engine. The user is free to set its velocity and the next body position will be deduced at each update accordingly to ensure a realistic behavior of dynamic bodies in contact with it. This is typically used for moving characters, platforms, elevators, etc. ## Adding a rigidBody to a component Every [`FComponent`](/api/core/classes/FComponent) has a [`initRigidBody`](/api/3d/classes/FComponent#initrigidbody) method that allows you to create a rigidBody and attach it to the component directly. -```typescript -import { FCuboid, FShape } from '@fibbojs/3d' +::: code-group -const cube = new FCuboid() +```typescript [2d] +import { FRectangle, FShapes } from '@fibbojs/2d' + +const rectangle = new FRectangle(scene) +rectangle.initRigidBody({ + positionOffset: { x: 0, y: 0 }, + rotationOffset: 0, + rotationDegreeOffset: 0, + scaleOffset: { x: 1, y: 1 }, + shape: FShapes.CUBE, + rigidBodyType: FRigidBodyType.DYNAMIC +}) +``` + +```typescript [3d] +import { FCuboid, FShapes } from '@fibbojs/3d' + +const cube = new FCuboid(scene) cube.initRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - rotationDegree: { x: 0, y: 0, z: 0 }, - shape: FShape.CUBE, - rigidBodyType: RAPIER.RigidBodyType.Dynamic + positionOffset: { x: 0, y: 0, z: 0 }, + rotationOffset: { x: 0, y: 0, z: 0 }, + rotationDegreeOffset: { x: 0, y: 0, z: 0 }, + scaleOffset: { x: 1, y: 1, z: 1 }, + shape: FShapes.CUBE, + rigidBodyType: FRigidBodyType.DYNAMIC }) ``` +::: + Apart from the classic [transform](/guide/core/transforms) properties, the `initRigidBody` method accepts the following parameters : +- `position` : The position of the rigidBody. +- `rotation` : The rotation of the rigidBody. +- `rotationDegree` : The rotation of the rigidBody in degrees. +- `scale` : The scale of the rigidBody. +- `positionOffset` : The offset of the position of the rigidBody. +- `rotationOffset` : The offset of the rotation of the rigidBody. +- `rotationDegreeOffset` : The offset of the rotation of the rigidBody in degrees. +- `scaleOffset` : The offset of the scale of the rigidBody. - `shape` : The shape of the collider attached to the rigidBody. This is required to compute contacts. - `rigidBodyType` : The type of the rigidBody. - `lockTranslations` : A boolean indicating if the translations of the rigidBody should be locked. - `enabledTranslations` : An object containing the enabled translations of the rigidBody. - `enableX` : A boolean indicating if the translation along the x-axis is enabled. - `enableY` : A boolean indicating if the translation along the y-axis is enabled. - - `enableZ` : A boolean indicating if the translation along the z-axis is enabled. (only exist on 3d rigid-bodies) + - `enableZ` : A boolean indicating if the translation along the z-axis is enabled. (only exist on 3d rigidBodies) - `lockRotations` : A boolean indicating if the rotations of the rigidBody should be locked. -- `enabledRotations` : An object containing the enabled rotations of the rigidBody. (only exist on 3d rigid-bodies) +- `enabledRotations` : An object containing the enabled rotations of the rigidBody. (only exist on 3d rigidBodies) - `enableX` : A boolean indicating if the rotation around the x-axis is enabled. - `enableY` : A boolean indicating if the rotation around the y-axis is enabled. - `enableZ` : A boolean indicating if the rotation around the z-axis is enabled. -## Creating a rigidBody by hand - -You can also directly use the [`FRigidBody`](/api/3d/classes/FRigidBody) class to create a rigidBody and attach it to a component. - -```typescript -import { FCuboid, FRigidBody, FShape } from '@fibbojs/3d' +As soon as a rigidBody is attached to a component, the component's transform will be updated relatively to the rigidBody's transform. -const cube = new FCuboid() -cube.rigidBody = new FRigidBody({ - position: { x: 0, y: 0, z: 0 }, - scale: { x: 1, y: 1, z: 1 }, - rotation: { x: 0, y: 0, z: 0 }, - rotationDegree: { x: 0, y: 0, z: 0 }, - shape: FShape.CUBE, - rigidBodyType: RAPIER.RigidBodyType.Dynamic -}) -``` +An offset can be applied to the rigidBody's transform so it can be placed relatively to the component's transform. -To learn more about rigid-bodies, you can refer to the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/rigid_bodies). +To learn more about rigidBodies, you can refer to the [Rapier documentation](https://rapier.rs/docs/user_guides/javascript/rigid_bodies).