diff options
Diffstat (limited to 'lib/factories/global.js')
| -rw-r--r-- | lib/factories/global.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/factories/global.js b/lib/factories/global.js new file mode 100644 index 0000000..c601bdb --- /dev/null +++ b/lib/factories/global.js @@ -0,0 +1,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; +} |