Skip to content

Commit

Permalink
Merge pull request #20 from MageStudio/TASK/temp
Browse files Browse the repository at this point in the history
Task/temp
  • Loading branch information
Marco Stagni authored Aug 12, 2022
2 parents d7af204 + a76d603 commit d6a33e5
Show file tree
Hide file tree
Showing 20 changed files with 18,272 additions and 7,646 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion docs/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
/* --accent: #f1c40f; */
--h2-color: #ffbe76;
/* --h4-color: #badc58; */
--h4-color: #fa983a;
/* --h4-color: #fa983a; */
/* --h4-color: #82ccdd; */
--h4-color: #3498db;
--faint-orange-color: rgba(255,190,118, .2);
/* --codeBackgroundColor: rgba(44,58,71,.2); */
/* --textColor: white; */
Expand Down
2 changes: 1 addition & 1 deletion docs/engine/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- [1. Level](/engine/advanced/core/level.md)
- [2. Entity](/engine/advanced/core/entity.md)
- [3. Element](/engine/advanced/core/element.md)
- [4. Constants](/engine/advanced/core/constants.md)
- [4. Stats](/engine/advanced/core/stats.md)
- Base Elements
- [1. Cube](/engine/advanced/core/base/cube.md)
- [2. Box](/engine/advanced/core/base/box.md)
Expand Down
1 change: 0 additions & 1 deletion docs/engine/advanced/core/constants.md

This file was deleted.

39 changes: 6 additions & 33 deletions docs/engine/advanced/core/element.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ By "physical object", we mean Models and each of the Base Elements. Each base el

## Methods

#### constructor(geometry: ThreeGeometry, material: ThreeMaterial, options: Object)
#### constructor({ geometry: ThreeGeometry, material: ThreeMaterial, body: ThreeMesh, ...options: Object })

The Element constructor will set the body if both geometry and material are provided.
The Element constructor will set the body if:
- either both geometry and material are provided.
- or a body is provided.

?> Element extends Entity, so refer to the the Entity constructor for additional information ([here](/engine/advanced/core/entity.md?id=constructor)).

Expand All @@ -34,42 +36,13 @@ The Element constructor will set the body if both geometry and material are prov

?> For more information about tags, please refer to the Entity document page [here](/engine/advanced/core/entity.md).

#### hasBody(): boolean

Checks if this element has an attached mesh. Returns `true` if the mesh is present, `false` otherwise.

#### getBody(): ThreeMesh

This method will return the ThreeMesh attached to this element if present.

#### getBodyByName(name: string): ThreeMesh

This method will search for the ThreeMesh with the required name inside this element. If found, it will be returned. If not found, `undefined` will be returned.

#### setBody({ body?: ThreeMesh, geometry?: ThreeGeometry, material?: ThreeMaterial })

This method sets the ThreeMesh attached to this element. You have three options:

- `mesh`: an already existing ThreeMesh, will be attached to the element.
- `geometry` and `material`: these need to be instances of a ThreeGeometry and a ThreeMaterial. A ThreeMesh will be created and attached to the element.

> This method is used internally inside the constructor.
#### setName(name: string, options?: object)

This method sets the name of this element.

- `options` is optional, and only supports one value:
- `replace` (default: `false`): if this value is set to `true`, the current ThreeMesh will be disposed and replaced.

#### add(element: Element)

This will add the received `element` to this element.

#### remove(element: Element)

This will remove a previously added `element` from this element.

#### setColor(color: string|number)

- `color` can be a string representation of a color (e.g. 'black', '#fefefe'), or its hex value (e.g. 0x000000 for black).
Expand Down Expand Up @@ -115,7 +88,7 @@ This will return a JSON representation of this element.

---

## Animations
### Animations

#### playAnimation(id: string, options: Object)

Expand All @@ -129,7 +102,7 @@ If this element has animations, this methods will return a list of them.

---

## Physics
### Physics

#### enablePhysics(options: object)

Expand Down
Loading

0 comments on commit d6a33e5

Please sign in to comment.