<commit_before>E2.plugins["convert_camera_matrices"] = function(core, node) {
	var self = this;
	var gl = core.renderer.context;
	
	this.desc = 'Extract the projection and view matrices from a camera.';
	this.input_slots = [ 
		{ name: 'camera', dt: core.datatypes.CAMERA, desc: 'The input camera to be split into constituent matrices.', def: 'Screenspace camera' },
	];
	this.output_slots = [ 
		{ name: 'projection', dt: core.datatypes.MATRIX, desc: 'The camera projection matrix.', def: 'Identity' },
		{ name: 'view', dt: core.datatypes.MATRIX, desc: 'The camera view matrix.', def: 'Identity' }
	];
	
	this.reset = function()
	{
		self.camera = new Camera(gl);
	};
	
	this.update_input = function(slot, data)
	{
		self.camera = data;
	};	

	this.update_output = function(slot)
	{
		if(slot.index === 0)
			return self.camera.projection;
		else
			return self.camera.view;
	};	
};
<commit_msg>Refactored the convert camera to matrices to use prototype.<commit_after>E2.p = E2.plugins["convert_camera_matrices"] = function(core, node)
{
	this.desc = 'Extract the projection and view matrices from a camera.';
	
	this.input_slots = [ 
		{ name: 'camera', dt: core.datatypes.CAMERA, desc: 'The input camera to be split into constituent matrices.', def: 'Screenspace camera' },
	];
	
	this.output_slots = [ 
		{ name: 'projection', dt: core.datatypes.MATRIX, desc: 'The camera projection matrix.', def: 'Identity' },
		{ name: 'view', dt: core.datatypes.MATRIX, desc: 'The camera view matrix.', def: 'Identity' }
	];
	
	this.gl = core.renderer.context;
};

E2.p.prototype.reset = function()
{
	this.camera = new Camera(this.gl);
};

E2.p.prototype.update_input = function(slot, data)
{
	this.camera = data;
};	

E2.p.prototype.update_output = function(slot)
{
	if(slot.index === 0)
		return this.camera.projection;
	else
		return this.camera.view;
};

{'fraction_non_alphanumeric': 0.1507293354943274, 'fraction_numerical': 0.004321988114532685, 'mean_word_length': 4.073972602739726, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4727504', 'n_tokens_mistral': 678, 'n_tokens_neox': 648, 'n_words': 163}