aboutsummaryrefslogtreecommitdiff
path: root/lib/factories/global.js
blob: c601bdbfdd2c1f399980df2b241b3616fe535709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Entity } from '@serpentity/serpentity';
import Position from '@serpentity/components.position';
import EulerAngle from '@serpentity/components.euler_angle';
import Velocity from '@serpentity/components.velocity';
import Radius from '../components/radius';
import Up from '../components/up';
import Configuration from '../components/configuration';

export function configuration() {

  const entity = new Entity();
  entity.addComponent(new Configuration());

  return entity;
}

export function camera() {

  const entity = new Entity();
  entity.addComponent(new Position());
  entity.addComponent(new EulerAngle());
  entity.addComponent(new Velocity({
    x: 0,
    y: Math.PI / 180,
    z: 0,
  }));
  entity.addComponent(new Radius({
    radius: 5
  }));
  entity.addComponent(new Up());

  return entity;
}