<commit_before>/* viewport.js */
define ([
	'three',
], function ( 
	THREE
) {

/****************************************************************************\

	VIEWPORT is our "fixed-size pixel space", which matches the
	resolution of the WebGLRenderer. This resolution is also the
	base resolution for bitmapped images used as backgrounds and
	sprites. 

\****************************************************************************/

///	PRIVATE VARIABLES ////////////////////////////////////////////////////////

	var instance;
	var viewport_count = 0;

///	OBJECT DECLARATIONS //////////////////////////////////////////////////////

	/* constructor */
	function Viewport ( name ) {
		this.name = name || "viewport"+(viewport_count++);
		// viewport 
		this.width 			= null;		// pixels
		this.height 		= null;		// pixels
		this.aspect 		= null;
		this.containerId 	= null;
		this.webGL 			= null;
		// world
		this.worldOrigin 	= null;		// where world cams are looking
		this.worldWidth		= null;		// x-range of world values to frame in camera
		this.worldDepth 	= null;		// y-range of world values to frame in camera
		this.worldAspect	= null;		// computed world aspect ratio for 3d cams
		this.worldUp	 	= null;		// up-vector for orienting world cams
		// cameras
		this.camBG 			= null;		// background image (pixel coords)
		this.camWORLD 		= null;		// pieces (world coords) set to...
		this.cam2D			= null;		// ...2d orthographic (world coords)
		this.cam3D			= null;		// ...3d perspective (world coords)
		this.camSCREEN 		= null;		// screen (pixel coords)
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Step 1. Initialize the WebGL surface and size containers exactly
	Viewport.method('InitializeRenderer', function ( width, height, containerId ) {
		if (this.webGL) {
			console.error("Renderer already initialized");
			return;
		}
		if (!(width && height && containerId)) {
			console.error("Call InitializeRenderer() with cwidth, cheight, containerId");
			return;
		}
		if (typeof containerId !== 'string') {
			console.error("Provide a valid selector");
			return;
		}
		var $container = $(containerId);
		if (!$container) {
			console.error("container",containerId,"does not exist");
			return;
		}<commit_msg>fix worldUnit, worldScale property declaration<commit_after>/* viewport.js */
define ([
	'three',
], function ( 
	THREE
) {

/****************************************************************************\

	VIEWPORT is our "fixed-size pixel space", which matches the
	resolution of the WebGLRenderer. This resolution is also the
	base resolution for bitmapped images used as backgrounds and
	sprites. 

\****************************************************************************/

///	PRIVATE VARIABLES ////////////////////////////////////////////////////////

	var instance;
	var viewport_count = 0;

///	OBJECT DECLARATIONS //////////////////////////////////////////////////////

	/* constructor */
	function Viewport ( name ) {
		this.name = name || "viewport"+(viewport_count++);
		// viewport 
		this.width 			= null;		// pixels
		this.height 		= null;		// pixels
		this.aspect 		= null;
		this.containerId 	= null;
		this.webGL 			= null;
		// world
		this.worldOrigin 	= null;		// where world cams are looking
		this.worldUnits		= null;		// number of visible world units in frame
		this.worldScale 	= null;		// scale factor for world cams to fit world units
		this.worldAspect	= null;		// computed world aspect ratio for 3d cams
		this.worldUp	 	= null;		// up-vector for orienting world cams
		// cameras
		this.camBG 			= null;		// background image (pixel coords)
		this.camWORLD 		= null;		// pieces (world coords) set to...
		this.cam2D			= null;		// ...2d orthographic (world coords)
		this.cam3D			= null;		// ...3d perspective (world coords)
		this.camSCREEN 		= null;		// screen (pixel coords)
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Step 1. Initialize the WebGL surface and size containers exactly
	Viewport.method('InitializeRenderer', function ( width, height, containerId ) {
		if (this.webGL) {
			console.error("Renderer already initialized");
			return;
		}
		if (!(width && height && containerId)) {
			console.error("Call InitializeRenderer() with cwidth, cheight, containerId");
			return;
		}
		if (typeof containerId !== 'string') {
			console.error("Provide a valid selector");
			return;
		}
		var $container = $(containerId);
		if (!$container) {
			console.error("container",containerId,"does not exist");
			return;
		}
{'fraction_non_alphanumeric': 0.2367785824007022, 'fraction_numerical': 0.0030721966205837174, 'mean_word_length': 2.4091249065071056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7313913', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1372, 'n_words': 380}