]> git.r.bdr.sh - rbdr/lissajous/blob - lib/factories/global.js
bf0360df980e7e604f3b3936f723290f63c6edfc
[rbdr/lissajous] / lib / factories / global.js
1 import { Entity } from '@serpentity/serpentity';
2 import Position from '@serpentity/components.position';
3 import EulerAngle from '@serpentity/components.euler_angle';
4 import Velocity from '@serpentity/components.velocity';
5 import Radius from '../components/radius';
6 import Up from '../components/up';
7 import Configuration from '../components/configuration';
8
9 export function configuration() {
10
11 const entity = new Entity();
12 entity.addComponent(new Configuration());
13
14 return entity;
15 }
16
17 export function camera() {
18
19 const entity = new Entity();
20 entity.addComponent(new Position());
21 entity.addComponent(new EulerAngle());
22 entity.addComponent(new Velocity({
23 x: 0,
24 y: Math.PI / 30,
25 z: 0,
26 }));
27 entity.addComponent(new Radius({
28 radius: 5
29 }));
30 entity.addComponent(new Up());
31
32 return entity;
33 }