<commit_before>"use strict"

import * as THREE from "three"
import { SettingsServiceSubscriber, SettingsService } from "../../../state/settings.service"
import { PerspectiveCamera, Vector3 } from "three"
import { IAngularEvent, IRootScopeService } from "angular"
import {Settings} from "../../../codeCharta.model"
import _ from "lodash"
import { CameraChangeSubscriber, ThreeOrbitControlsService } from "./threeOrbitControlsService"

class ThreeCameraService implements SettingsServiceSubscriber, CameraChangeSubscriber {
	public static SELECTOR = "threeCameraService"

	public static VIEW_ANGLE = 45
	public static NEAR = 100
	public static FAR = 200000 //TODO optimize renderer for far objects

	public camera: PerspectiveCamera
	private lastCameraVector: Vector3 = new Vector3(0,0 ,0)

	private throttledCameraChange = _.throttle(() => {
		this.settingsService.updateSettings({appSettings: {camera: new Vector3(this.camera.position.x, this.camera.position.y, this.camera.position.z) }})
	}, 2000)<commit_msg>reduced throttle timer to 400ms #178<commit_after>"use strict"

import * as THREE from "three"
import { SettingsServiceSubscriber, SettingsService } from "../../../state/settings.service"
import { PerspectiveCamera, Vector3 } from "three"
import { IAngularEvent, IRootScopeService } from "angular"
import {Settings} from "../../../codeCharta.model"
import _ from "lodash"
import { CameraChangeSubscriber, ThreeOrbitControlsService } from "./threeOrbitControlsService"

class ThreeCameraService implements SettingsServiceSubscriber, CameraChangeSubscriber {
	public static SELECTOR = "threeCameraService"

	public static VIEW_ANGLE = 45
	public static NEAR = 100
	public static FAR = 200000 //TODO optimize renderer for far objects

	public camera: PerspectiveCamera
	private lastCameraVector: Vector3 = new Vector3(0,0 ,0)

	private throttledCameraChange = _.throttle(() => {
		this.settingsService.updateSettings({appSettings: {camera: new Vector3(this.camera.position.x, this.camera.position.y, this.camera.position.z) }})
	}, 400)
{'fraction_non_alphanumeric': 0.10616438356164383, 'fraction_numerical': 0.023972602739726026, 'mean_word_length': 5.596774193548387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4443595', 'n_tokens_mistral': 613, 'n_tokens_neox': 562, 'n_words': 164}