Skip to content

Commit a0c7055

Browse files
committed
v0.18.0
1 parent 89fd3ba commit a0c7055

File tree

84 files changed

+4082
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4082
-2
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

components/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
has_children: true
3+
nav_order: 3
4+
---
5+
6+
# Components (API)

components/cameras/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
parent: Components (API)
3+
has_children: true
4+
nav_order: 0
5+
---
6+
7+
# Cameras

components/cameras/vgl-camera.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
parent: Cameras
3+
grand_parent: Components (API)
4+
nav_order: 0
5+
---
6+
# VglCamera
7+
8+
This is abstract base component for cameras,
9+
corresponding [THREE.Camera](https://threejs.org/docs/index.html#api/cameras/Camera).
10+
This component should always be mixined (inherited).
11+
You probably want a [VglPerspectiveCamera](vgl-perspective-camera)
12+
and [VglOrthographicCamera](vgl-orthographic-camera).
13+
14+
Properties of [VglObject3d](../core/vgl-object3d) are also available as mixin.
15+
16+
## props
17+
18+
- `orbit-target` ***vector3*** (*optional*)
19+
20+
Position in 3D space for the camera to point towards.
21+
This property overwrite rotation property when both defined.
22+
23+
- `orbit-position` ***spherical*** (*optional*)
24+
25+
Spherical position around orbitTarget.
26+
This property overwrite position and rotation properties.
27+
If orbitTarget is not defined, automatically set to (0, 0, 0).
28+
29+
## computed properties
30+
31+
- `inst`
32+
33+
The THREE.Camera instance.
34+
35+
## methods
36+
37+
- `emitAsCamera()`
38+
39+
Emit an event in the `cameras` namespace.
40+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
parent: Cameras
3+
grand_parent: Components (API)
4+
nav_order: 1
5+
---
6+
# VglOrthographicCamera
7+
8+
Camera that uses orthographic projection,
9+
corresponding [THREE.OrthographicCamera](https://threejs.org/docs/index.html#api/cameras/OrthographicCamera).
10+
Camera frustum top, bottom, left, and right planes are automatically set to the renderer size.
11+
12+
Properties of [VglCamera](vgl-camera) are also available as mixin.
13+
14+
## props
15+
16+
- `zoom` ***number*** (*optional*) `default: 1`
17+
18+
Zoom factor of the camera.
19+
20+
- `near` ***number*** (*optional*) `default: 0.1`
21+
22+
Camera frustum near plane.
23+
24+
- `far` ***number*** (*optional*) `default: 2000`
25+
26+
Camera frustum far plane.
27+
28+
## computed properties
29+
30+
- `inst`
31+
32+
The THREE.OrthographicCamera instance.
33+
34+
35+
## Example
36+
37+
{% include example.html url='/examples/cameras/vgl-orthographic-camera.html' %}
38+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
parent: Cameras
3+
grand_parent: Components (API)
4+
nav_order: 2
5+
---
6+
# VglPerspectiveCamera
7+
8+
Camera that uses perspective projection,
9+
corresponding [THREE.PerspectiveCamera](https://threejs.org/docs/index.html#api/cameras/PerspectiveCamera).
10+
Camera frustum aspect ratio is automatically set to the renderer aspect ratio.
11+
12+
Properties of [VglCamera](vgl-camera) are also available as mixin.
13+
14+
## props
15+
16+
- `zoom` ***number*** (*optional*) `default: 1`
17+
18+
Zoom factor of the camera.
19+
20+
- `near` ***number*** (*optional*) `default: 0.1`
21+
22+
Camera frustum near plane.
23+
24+
- `far` ***number*** (*optional*) `default: 2000`
25+
26+
Camera frustum far plane.
27+
28+
- `fov` ***number*** (*optional*) `default: 50`
29+
30+
Camera frustum vertical field of view, from bottom to top of view, in degrees.
31+
32+
## computed properties
33+
34+
- `inst`
35+
36+
The THREE.PerspectiveCamera instance.
37+
38+
39+
## Example
40+
41+
{% include example.html url='/examples/cameras/vgl-perspective-camera.html' %}
42+

components/core/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
parent: Components (API)
3+
has_children: true
4+
nav_order: 1
5+
---
6+
7+
# Core

components/core/vgl-geometry.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
parent: Core
3+
grand_parent: Components (API)
4+
nav_order: 0
5+
---
6+
# VglGeometry
7+
8+
This is the base mixin component for all geometry components,
9+
corresponding [THREE.Geometry](https://threejs.org/docs/index.html#api/core/Geometry).
10+
This can also be used directly for building custom geometries.
11+
12+
## props
13+
14+
- `name` ***name*** (*optional*)
15+
16+
Name of the component.
17+
18+
- `position-attribute` ***floatArray*** (*optional*)
19+
20+
The x, y, and z coordinates of each vertex in this geometry.
21+
22+
- `color-attribute` ***floatArray*** (*optional*)
23+
24+
The red, green, and blue channels of vertex color of each vertex in this geometry.
25+
26+
- `normal-attribute` ***floatArray*** (*optional*)
27+
28+
The x, y, and z components of the vertex normal vector of each vertex in this geometry.
29+
30+
## computed properties
31+
32+
- `inst`
33+
34+
The THREE.BufferGeometry instance.
35+
36+
## methods
37+
38+
- `update()`
39+
40+
Emit an event in `geometries` namespace. Call this method after editing instance's
41+
properties.
42+
43+
44+
## Example
45+
46+
{% include example.html url='/examples/core/vgl-geometry.html' %}
47+

components/core/vgl-namespace.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
parent: Core
3+
grand_parent: Components (API)
4+
nav_order: 1
5+
---
6+
# VglNamespace
7+
8+
This component provides maps for managing objects by name (string), and also provides utility
9+
methods. `vglNamespace` object can be injected to descendant components for using it.
10+
It has following namespaces:
11+
12+
- `vglNamespace.cameras`
13+
- `vglNamespace.scenes`
14+
- `vglNamespace.geometries`
15+
- `vglNamespace.materials`
16+
- `vglNamespace.textures`
17+
- `vglNamespace.curves`
18+
- `vglNamespace.object3ds`
19+
20+
Each namespace internally has a map of strings and objects, and has methods to access them.
21+
Each namespace has following methods:
22+
23+
- `Namespace.prototype.get(key: string)`
24+
Get an instance corresponding passed `key`.
25+
- `Namespace.prototype.set(key: string, inst: any)`
26+
Set an instance corresponding passed `key`.
27+
- `Namespace.prototype.delete(key: string, inst: any)`
28+
Delete an instance corresponding passed `key`, only if the instance exactly equals passed
29+
`inst`.
30+
- `Namespace.prototype.listen(key: string, callback: func)`
31+
Add a listener function that will be called when the instance corresponding passed key changes.
32+
- `Namespace.prototype.unlisten(key: string, callback: func)`
33+
Remove a listener function registered to passed key.
34+
35+
When `VglNamespace` components are nested, they create nested namespaces except for `cameras` and
36+
`scenes`. Since a nested namespace search instances only in its ancestors, you can use same key
37+
string in sibling namespaces.
38+

components/core/vgl-object3d.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
parent: Core
3+
grand_parent: Components (API)
4+
nav_order: 2
5+
---
6+
# VglObject3d
7+
8+
This is the base mixin component for most object components in VueGL,
9+
corresponding [THREE.Object3D](https://threejs.org/docs/index.html#api/core/Object3D).
10+
Object3d components inside a object3d component are added
11+
as children via THREE.Object3D.prototype.add() method.
12+
13+
VglObject3d components inside default slots are added as children.
14+
15+
## props
16+
17+
- `position` ***vector3*** (*optional*)
18+
19+
The object's local position as a 3D vector.
20+
21+
- `rotation` ***euler*** (*optional*)
22+
23+
The object's local rotation as a euler angle.
24+
25+
- `rotation-quaternion` ***quaternion*** (*optional*)
26+
27+
The object's local rotation as a quaternion (specified in x, y, z, w order).
28+
Do not use in conjunction with the rotation prop, since they both control the same property
29+
of the underlying THREE.Object3D object.
30+
31+
- `scale` ***vector3*** (*optional*)
32+
33+
The object's local scale as a 3D vector.
34+
35+
- `cast-shadow` ***boolean*** (*optional*)
36+
37+
Whether the object gets rendered into shadow map.
38+
39+
- `receive-shadow` ***boolean*** (*optional*)
40+
41+
Whether the material receives shadows.
42+
43+
- `name` ***name*** (*optional*)
44+
45+
Optional name of the object.
46+
47+
- `hidden` ***boolean*** (*optional*)
48+
49+
Whether the object is visible.
50+
51+
## computed properties
52+
53+
- `inst`
54+
55+
The THREE.Object3D instance.
56+
- `parent`
57+
58+
The parent THREE.Object3D instance.
59+
60+
**dependencies:** `vglObject3d`
61+
62+
63+
## methods
64+
65+
- `emitAsObject3d()`
66+
67+
Emit an event in the `object3ds` namespace.
68+

0 commit comments

Comments
 (0)