<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Simulation - Documentation</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script>
        function saveVerticalScrollPosition(evt){
            window.localStorage.setItem('navscrollpos', evt.target.scrollTop);
        }
        function loadVerticalScrollPosition(){
            var nav = document.querySelector('nav');
            nav.scrollTop = window.localStorage.getItem('navscrollpos');
        }
    </script>
    <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav onscroll='saveVerticalScrollPosition(event)'>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-altspace.html">altspace</a><ul class='methods'><li data-type='method'><a href="module-altspace.html#.getDocument">getDocument</a></li><li data-type='method'><a href="module-altspace.html#.getEnclosure">getEnclosure</a></li><li data-type='method'><a href="module-altspace.html#.getGamepads">getGamepads</a></li><li data-type='method'><a href="module-altspace.html#.getSpace">getSpace</a></li><li data-type='method'><a href="module-altspace.html#.getThreeJSDebugInfo">getThreeJSDebugInfo</a></li><li data-type='method'><a href="module-altspace.html#.getThreeJSRenderer">getThreeJSRenderer</a></li><li data-type='method'><a href="module-altspace.html#.getThreeJSTrackingSkeleton">getThreeJSTrackingSkeleton</a></li><li data-type='method'><a href="module-altspace.html#.getUser">getUser</a></li><li data-type='method'><a href="module-altspace.html#.open">open</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.html">altspace/utilities/behaviors</a></li><li><a href="module-altspace_utilities_codePen.html">altspace/utilities/codePen</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_codePen.html#.ensureInVR">ensureInVR</a></li><li data-type='method'><a href="module-altspace_utilities_codePen.html#.getAuthorId">getAuthorId</a></li><li data-type='method'><a href="module-altspace_utilities_codePen.html#.getPenId">getPenId</a></li><li data-type='method'><a href="module-altspace_utilities_codePen.html#.setName">setName</a></li></ul></li><li><a href="module-altspace_utilities_shims.html">altspace/utilities/shims</a></li><li><a href="module-altspace_utilities_shims_bubbling.html">altspace/utilities/shims/bubbling</a></li><li><a href="module-altspace_utilities_shims_cursor.html">altspace/utilities/shims/cursor</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_shims_cursor.html#.init">init</a></li></ul></li><li><a href="module-altspace_utilities_sync.html">altspace/utilities/sync</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_sync.html#.connect">connect</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="THREE.html">THREE</a></li></ul><h3>Classes</h3><ul><li><a href="module-altspace-AltRenderer.html">AltRenderer</a><ul class='methods'><li data-type='method'><a href="module-altspace-AltRenderer.html#render">render</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.Behavior.html">Behavior</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_behaviors.Behavior.html#awake">awake</a></li><li data-type='method'><a href="module-altspace_utilities_behaviors.Behavior.html#dispose">dispose</a></li><li data-type='method'><a href="module-altspace_utilities_behaviors.Behavior.html#start">start</a></li><li data-type='method'><a href="module-altspace_utilities_behaviors.Behavior.html#update">update</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.Bob.html">Bob</a></li><li><a href="module-altspace_utilities_behaviors.ButtonStateStyle.html">ButtonStateStyle</a></li><li><a href="module-altspace_utilities_sync-Connection.html">Connection</a></li><li><a href="module-altspace-Document.html">Document</a><ul class='methods'><li data-type='method'><a href="module-altspace-Document.html#reset">reset</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.Drag.html">Drag</a></li><li><a href="module-altspace-Enclosure.html">Enclosure</a><ul class='methods'><li data-type='method'><a href="module-altspace-Enclosure.html#exitFullspace">exitFullspace</a></li><li data-type='method'><a href="module-altspace-Enclosure.html#requestFullspace">requestFullspace</a></li></ul></li><li><a href="module-altspace-Gamepad.html">Gamepad</a><ul class='methods'><li data-type='method'><a href="module-altspace-Gamepad.html#preventDefault">preventDefault</a></li></ul></li><li><a href="module-altspace-GamepadButton.html">GamepadButton</a></li><li><a href="module-altspace_utilities_behaviors.GamepadControls.html">GamepadControls</a></li><li><a href="module-altspace_utilities_behaviors.HoverColor.html">HoverColor</a></li><li><a href="module-altspace_utilities_behaviors.HoverScale.html">HoverScale</a></li><li><a href="module-altspace_utilities_behaviors.JointCollisionEvents.html">JointCollisionEvents</a></li><li><a href="module-altspace_utilities_behaviors.Layout.html">Layout</a></li><li><a href="THREE.Object3D.html">Object3D</a><ul class='methods'><li data-type='method'><a href="THREE.Object3D.html#addBehavior">addBehavior</a></li><li data-type='method'><a href="THREE.Object3D.html#addBehaviors">addBehaviors</a></li><li data-type='method'><a href="THREE.Object3D.html#getBehaviorByType">getBehaviorByType</a></li><li data-type='method'><a href="THREE.Object3D.html#removeAllBehaviors">removeAllBehaviors</a></li><li data-type='method'><a href="THREE.Object3D.html#removeBehavior">removeBehavior</a></li><li data-type='method'><a href="THREE.Object3D.html#updateBehaviors">updateBehaviors</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.Object3DSync.html">Object3DSync</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_behaviors.Object3DSync.html#takeOwnership">takeOwnership</a></li></ul></li><li><a href="module-altspace_utilities_shims.OBJMTLLoader.html">OBJMTLLoader</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_shims.OBJMTLLoader.html#.load">load</a></li></ul></li><li><a href="module-altspace-Popup.html">Popup</a><ul class='methods'><li data-type='method'><a href="module-altspace-Popup.html#hide">hide</a></li><li data-type='method'><a href="module-altspace-Popup.html#show">show</a></li></ul></li><li><a href="THREE.Scene.html">Scene</a><ul class='methods'><li data-type='method'><a href="THREE.Scene.html#updateAllBehaviors">updateAllBehaviors</a></li></ul></li><li><a href="module-altspace_utilities_behaviors.SceneSync.html">SceneSync</a><ul class='methods'><li data-type='method'><a href="module-altspace_utilities_behaviors.SceneSync.html#destroy">destroy</a></li><li data-type='method'><a href="module-altspace_utilities_behaviors.SceneSync.html#instantiate">instantiate</a></li></ul></li><li><a href="module-altspace_utilities.Simulation.html">Simulation</a></li><li><a href="module-altspace_utilities_behaviors.Spin.html">Spin</a></li><li><a href="module-altspace_utilities_behaviors.SteamVRInput.html">SteamVRInput</a></li><li><a href="module-altspace_utilities_behaviors.SteamVRTrackedObject.html">SteamVRTrackedObject</a></li><li><a href="module-altspace_utilities_behaviors.TouchpadRotate.html">TouchpadRotate</a></li><li><a href="module-altspace-TrackingJoint.html">TrackingJoint</a></li><li><a href="module-altspace-TrackingSkeleton.html">TrackingSkeleton</a><ul class='methods'><li data-type='method'><a href="module-altspace-TrackingSkeleton.html#getJoint">getJoint</a></li></ul></li><li><a href="module-altspace-User.html">User</a></li><li><a href="Window.html">Window</a></li></ul><h3>Events</h3><ul><li><a href="module-altspace-User.html#.event:avatarchange">avatarchange</a></li><li><a href="Window.html#event:blur">blur</a></li><li><a href="THREE.Object3D.html#.event:cursordown">cursordown</a></li><li><a href="THREE.Object3D.html#.event:cursorenter">cursorenter</a></li><li><a href="THREE.Object3D.html#.event:cursorleave">cursorleave</a></li><li><a href="THREE.Scene.html#event:cursormove">cursormove</a></li><li><a href="THREE.Object3D.html#.event:cursorup">cursorup</a></li><li><a href="module-altspace_utilities_behaviors.Drag.html#.event:dragstart">dragstart</a></li><li><a href="module-altspace_utilities_behaviors.Drag.html#.event:dragstop">dragstop</a></li><li><a href="Window.html#event:focus">focus</a></li><li><a href="module-altspace.Enclosure.html#event:fullspacechange">fullspacechange</a></li><li><a href="module-altspace_utilities_behaviors.JointCollisionEvents.html#.event:jointcollision">jointcollision</a></li><li><a href="module-altspace_utilities_behaviors.JointCollisionEvents.html#.event:jointcollisionenter">jointcollisionenter</a></li><li><a href="module-altspace_utilities_behaviors.JointCollisionEvents.html#.event:jointcollisionleave">jointcollisionleave</a></li><li><a href="module-altspace_utilities_behaviors.Object3DSync.html#.event:ownershipgained">ownershipgained</a></li><li><a href="module-altspace_utilities_behaviors.Object3DSync.html#.event:ownershiplost">ownershiplost</a></li><li><a href="module-altspace.html#event:touchpaddown">touchpaddown</a></li><li><a href="module-altspace.html#event:touchpadgesture">touchpadgesture</a></li><li><a href="module-altspace.html#event:touchpadmove">touchpadmove</a></li><li><a href="module-altspace.html#event:touchpadup">touchpadup</a></li></ul>
</nav>
<script>loadVerticalScrollPosition()</script>

<div id="main">
    
    <h1 class="page-title">Simulation</h1>
    

    




<section>

<header>
    
        <h2>
        Simulation
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="Simulation"><span class="type-signature"></span>new Simulation<span class="signature">(config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>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.</p>
<p>If all of your application logic is in behaviors, you do not need to create any additional requestAnimationFrame loops.</p>
<p>It also automatically uses the WebGL renderer when running in a
desktop browser and emulates cursor events with mouse clicks.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Optional parameters.</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>auto</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last"><p>Automatically start the render loop.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>
















    
    </div>

    

    

    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="camera"><span class="type-signature">(readonly) </span>camera<span class="type-signature"> :Three.Camera</span></h4>




<div class="description">
    <p>The camera being used by the WebGL renderer.</p>
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>






        
            
<h4 class="name" id="renderer"><span class="type-signature">(readonly) </span>renderer<span class="type-signature"> :THREE.WebGLRenderer|AltRenderer</span></h4>




<div class="description">
    <p>The renderer being used.</p>
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>






        
            
<h4 class="name" id="scene"><span class="type-signature">(readonly) </span>scene<span class="type-signature"> :<a href="THREE.Scene.html">THREE.Scene</a></span></h4>




<div class="description">
    <p>The simulation scene.</p>
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>






        
    

    

    

    
</article>

</section>




</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> using the Minami theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>