No more ecs
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { Entity } from "./entity/entity.ts";
|
||||
|
||||
// where the world is drawn from. like minecraft's Camera it isn't an entity, it's moved to one's eyes every frame
|
||||
export class Camera {
|
||||
x = 0;
|
||||
y = 0;
|
||||
z = 3;
|
||||
|
||||
pitch = 0;
|
||||
yaw = 0;
|
||||
roll = 0;
|
||||
|
||||
fov = Math.PI / 3;
|
||||
near = 0.1;
|
||||
far = 1000;
|
||||
|
||||
setup(entity: Entity) {
|
||||
this.x = entity.x;
|
||||
this.y = entity.y + entity.eye_height;
|
||||
this.z = entity.z;
|
||||
this.yaw = entity.yaw;
|
||||
this.pitch = entity.pitch;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user