Skip to content

Commit

Permalink
Add FibboSphere, usePosition, useScale, useRotation & useRotationDegree
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugustinette committed May 2, 2024
1 parent b9b9001 commit 6584552
Show file tree
Hide file tree
Showing 34 changed files with 1,246 additions and 244 deletions.
18 changes: 13 additions & 5 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,24 @@ export default defineConfig({
items: [
{ text: 'Index', link: '/api/index.md' },
{ text: 'Classes', items: [
{ text: 'FibboScene', link: '/api/classes/FibboScene' },
{ text: 'FibboModel', link: '/api/classes/FibboModel' },
{ text: 'FibboCube', link: '/api/classes/FibboCube' },
{ text: 'FibboGLTF', link: '/api/classes/FibboGLTF' },
] },
{ text: 'Interfaces', items: [
{ text: 'Fibbo3DVector', link: '/api/interfaces/Fibbo3DVector' },
{ text: 'FibboModel', link: '/api/classes/FibboModel' },
{ text: 'FibboScene', link: '/api/classes/FibboScene' },
{ text: 'FibboSphere', link: '/api/classes/FibboSphere' },
] },
{ text: 'Functions', items: [
{ text: 'usePosition', link: '/api/functions/usePosition' },
{ text: 'useRigidBody', link: '/api/functions/useRigidBody' },
{ text: 'useRotation', link: '/api/functions/useRotation' },
{ text: 'useRotationDegree', link: '/api/functions/useRotationDegree' },
{ text: 'useScale', link: '/api/functions/useScale' },
] },
{ text: 'Enumerations', items: [
{ text: 'Fibbo3dShapes', link: '/api/enums/Fibbo3dShapes' },
] },
{ text: 'Interfaces', items: [
{ text: 'FibboVector3', link: '/api/interfaces/FibboVector3' },
] },
],
},
Expand Down
122 changes: 92 additions & 30 deletions docs/api/classes/FibboCube.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@

A simple cube model in FibboJS.

**`Example`**

```ts
import { FibboCube } from './FibboCube'
import type { FibboScene } from '../FibboScene'

export class MyCube extends FibboCube {
constructor(scene: FibboScene) {
super(scene)
}

onFrame(delta: number) {
super.onFrame(delta)
}
}
```

## Hierarchy

- [`FibboModel`](FibboModel.md)
Expand All @@ -18,17 +35,20 @@ A simple cube model in FibboJS.

- [constructor](FibboCube.md#constructor)

### Methods

- [onFrame](FibboCube.md#onframe)

### Properties

- [collider](FibboCube.md#collider)
- [object3D](FibboCube.md#object3d)
- [position](FibboCube.md#position)
- [rigidBody](FibboCube.md#rigidbody)
- [rotation](FibboCube.md#rotation)
- [scale](FibboCube.md#scale)
- [scene](FibboCube.md#scene)

### Methods

- [onFrame](FibboCube.md#onframe)

## Constructors

### constructor
Expand All @@ -51,87 +71,129 @@ A simple cube model in FibboJS.

#### Defined in

[core/model/FibboCube.ts:21](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboCube.ts#L21)
[core/model/FibboCube.ts:30](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboCube.ts#L30)

## Methods

### onFrame

**onFrame**(`_delta`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `_delta` | `number` |

#### Returns

`void`

#### Overrides

[FibboModel](FibboModel.md).[onFrame](FibboModel.md#onframe)

#### Defined in

[core/model/FibboCube.ts:38](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboCube.ts#L38)

## Properties

### collider

**collider**: `Collider`
`Optional` **collider**: `Collider`

#### Overrides
#### Inherited from

[FibboModel](FibboModel.md).[collider](FibboModel.md#collider)

#### Defined in

[core/model/FibboCube.ts:19](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboCube.ts#L19)
[core/model/FibboModel.ts:18](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L18)

___

### object3D

**object3D**: `Object3D`\<`Object3DEventMap`\>

Object3D, RigidBody and Collider are redefined from FibboModel without the ? because
they're directly available after the constructor, as the cube is created synchronously.
Object3D is redefined from FibboModel without the ? because it is
directly available after the constructor, as the cube is created synchronously.

#### Overrides

[FibboModel](FibboModel.md).[object3D](FibboModel.md#object3d)

#### Defined in

[core/model/FibboCube.ts:15](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboCube.ts#L15)
[core/model/FibboCube.ts:28](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboCube.ts#L28)

___

### position

**position**: `Vector3`

#### Inherited from

[FibboModel](FibboModel.md).[position](FibboModel.md#position)

#### Defined in

[core/model/FibboModel.ts:11](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L11)

___

### rigidBody

**rigidBody**: `RigidBody`
`Optional` **rigidBody**: `RigidBody`

#### Overrides
#### Inherited from

[FibboModel](FibboModel.md).[rigidBody](FibboModel.md#rigidbody)

#### Defined in

[core/model/FibboCube.ts:17](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboCube.ts#L17)
[core/model/FibboModel.ts:17](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L17)

___

### scene
### rotation

**scene**: [`FibboScene`](FibboScene.md)
**rotation**: `Vector3`

#### Inherited from

[FibboModel](FibboModel.md).[scene](FibboModel.md#scene)
[FibboModel](FibboModel.md).[rotation](FibboModel.md#rotation)

#### Defined in

[core/model/FibboModel.ts:10](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboModel.ts#L10)
[core/model/FibboModel.ts:13](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L13)

## Methods
___

### onFrame
### scale

**onFrame**(`_delta`): `void`
**scale**: `Vector3`

#### Parameters
#### Inherited from

| Name | Type |
| :------ | :------ |
| `_delta` | `number` |
[FibboModel](FibboModel.md).[scale](FibboModel.md#scale)

#### Returns
#### Defined in

`void`
[core/model/FibboModel.ts:12](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L12)

#### Overrides
___

[FibboModel](FibboModel.md).[onFrame](FibboModel.md#onframe)
### scene

**scene**: [`FibboScene`](FibboScene.md)

#### Inherited from

[FibboModel](FibboModel.md).[scene](FibboModel.md#scene)

#### Defined in

[core/model/FibboCube.ts:39](https://github.com/fibbojs/fibbo/blob/b30ea0e5c1962f99e47c4a8ee65926227b100fe9/src/core/model/FibboCube.ts#L39)
[core/model/FibboModel.ts:10](https://github.com/fibbojs/fibbo/blob/b9b900181d67ac688b761b1972f316cdd1f56ef2/src/core/model/FibboModel.ts#L10)
Loading

0 comments on commit 6584552

Please sign in to comment.