aboutsummaryrefslogtreecommitdiff
path: root/lib/factories/global.js
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-05-07 22:37:27 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2024-05-07 22:37:27 +0200
commit362f91160b243453578633e3f9af67ce40179d8c (patch)
treea9ee95e2f8a9c59189ea904ce87bfe54ed5be107 /lib/factories/global.js
parent5f6ef99eae91f53239f08143cead1249893fef81 (diff)
Make 3D
Diffstat (limited to 'lib/factories/global.js')
-rw-r--r--lib/factories/global.js33
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;
+}