dist/altspace.js
function Simulation(config)
{
	if ( config === void 0 ) config = {auto: true};

	this._scene = null;
	this._renderer = null;
	this._camera = null;

	var usingAFrame = window.AFRAME && document.querySelector('a-scene');

	if(usingAFrame)
	{
		var ascene = document.querySelector('a-scene');
		this._scene = ascene.object3D;
		this._renderer = ascene.renderer;

		var acamera = document.querySelector('a-camera');
		if(acamera)
			{ this._camera = acamera.object3D; }
	}
	else if (window.altspace && altspace.inClient)
	{
		this._scene = new THREE.Scene();
		this._renderer = altspace.getThreeJSRenderer();
		this._camera = new THREE.PerspectiveCamera(); // TODO: change from shim to symbolic
	}
	else {
		this._setupWebGL();
	}

	if(config.auto && !usingAFrame)
		{ this.loop(); }
}
function Simulation(config)
{
	if ( config === void 0 ) config = {auto: true};

	this._scene = null;
	this._renderer = null;
	this._camera = null;

	var usingAFrame = window.AFRAME && document.querySelector('a-scene');

	if(usingAFrame)
	{
		var ascene = document.querySelector('a-scene');
		this._scene = ascene.object3D;
		this._renderer = ascene.renderer;

		var acamera = document.querySelector('a-camera');
		if(acamera)
			{ this._camera = acamera.object3D; }
	}
	else if (window.altspace && altspace.inClient)
	{
		this._scene = new THREE.Scene();
		this._renderer = altspace.getThreeJSRenderer();
		this._camera = new THREE.PerspectiveCamera(); // TODO: change from shim to symbolic
	}
	else {
		this._setupWebGL();
	}

	if(config.auto && !usingAFrame)
		{ this.loop(); }
}
function Simulation ( config ) { if ( config === void 0 ) config = { auto : true } ; this . _scene = null ; this . _renderer = null ; this . _camera = null ; var usingAFrame = window . AFRAME && document . querySelector ( 'a-scene' ) ; if ( usingAFrame ) { var ascene = document . querySelector ( 'a-scene' ) ; this . _scene = ascene . object3D ; this . _renderer = ascene . renderer ; var acamera = document . querySelector ( 'a-camera' ) ; if ( acamera ) { this . _camera = acamera . object3D ; } } else if ( window . altspace && altspace . inClient ) { this . _scene = new THREE . Scene ( ) ; this . _renderer = altspace . getThreeJSRenderer ( ) ; this . _camera = new THREE . PerspectiveCamera ( ) ; // TODO: change from shim to symbolic } else { this . _setupWebGL ( ) ; } if ( config . auto && ! usingAFrame ) { this . loop ( ) ; } }
Simulation is a helper class that lets you quickly setup a three.js app with support for AltspaceVR. It creates a basic scene for you and starts the render and behavior loop.

If all of your application logic is in behaviors, you do not need to create any additional requestAnimationFrame loops.

It also automatically uses the WebGL renderer when running in a
desktop browser and emulates cursor events with mouse clicks.
@class Simulation
@param {Object} [config] Optional parameters.
@param {Boolean} [config.auto=true] Automatically start the render loop.
@memberof module:altspace/utilities
Simulation is a helper class that lets you quickly setup a three . js app with support for AltspaceVR . It creates a basic scene for you and starts the render and behavior loop .