Skip to content

Commit

Permalink
rename Camera to Camera2d
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffomatic committed Dec 21, 2020
1 parent 1233304 commit 784922e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mat2d } from 'gl-matrix'

import { Renderer2d } from './renderer/Renderer2d'

import { Camera } from '~/Camera'
import { Camera2d } from '~/camera/Camera2d'
import {
MAX_PREDICTED_FRAMES,
SIMULATION_PERIOD_S,
Expand Down Expand Up @@ -44,7 +44,7 @@ export class Client {
simulationFrame: number
waitingForServer: boolean

camera: Camera
camera: Camera2d
debugDraw2dRenderables: Renderable2d[]
emitters: ParticleEmitter[]
emitterHistory: Set<string>
Expand Down Expand Up @@ -95,7 +95,7 @@ export class Client {
this.simulationFrame = 0
this.waitingForServer = false

this.camera = new Camera(
this.camera = new Camera2d(
vec2.fromValues(config.canvas3d.width, config.canvas3d.height),
vec2.create(),
vec2.create(),
Expand Down
2 changes: 1 addition & 1 deletion src/Camera.ts → src/camera/Camera2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sample } from 'lodash'

import { Immutable } from '~/types/immutable'

export class Camera {
export class Camera2d {
private position: vec2
private viewportDimensions: vec2
minWorldPos: vec2
Expand Down
6 changes: 3 additions & 3 deletions src/tools/map/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EventEmitter } from 'events'
import { mat2d, vec2 } from 'gl-matrix'
import * as _ from 'lodash'

import { Camera } from '~/Camera'
import { Camera2d } from '~/camera/Camera2d'
import { TILE_SIZE } from '~/constants'
import * as entities from '~/entities'
import { IKeyboard } from '~/input/interfaces'
Expand Down Expand Up @@ -50,7 +50,7 @@ export class Editor {
map: Map
terrain: terrain.Layer

camera: Camera
camera: Camera2d
keyboard: IKeyboard
mouse: IMouse

Expand Down Expand Up @@ -85,7 +85,7 @@ export class Editor {
terrain: this.map.terrain,
})

this.camera = new Camera(
this.camera = new Camera2d(
this.viewportDimensions,
vec2.scale(vec2.create(), this.map.origin, TILE_SIZE),
vec2.scale(vec2.create(), this.map.dimensions, TILE_SIZE),
Expand Down

0 comments on commit 784922e

Please sign in to comment.