]> git.r.bdr.sh - rbdr/lissajous/blob - lib/factories/global.js
c601bdbfdd2c1f399980df2b241b3616fe535709
[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 / 180,
25 z: 0,
26 }));
27 entity.addComponent(new Radius({
28 radius: 5
29 }));
30 entity.addComponent(new Up());
31
32 return entity;
33 }