vehicle_creator.html 4.6 KB

12345678910111213141516171819202122
  1. <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="keywords" content="documentation, sdk, tool, asset, editor, physics"><title>jMonkeyEngine SDK: Vehicle Creator</title><link rel="stylesheet" href="./asciidoctor.css">
  2. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  3. <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/sdk/vehicle_creator.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/sdk/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>jMonkeyEngine SDK: Vehicle Creator</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#usage">Usage</a></li><li><a href="#known-issues">Known Issues</a></li><li><a href="#code-sample">Code Sample</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>Best results when car is facing in z direction (towards you).</p></div></div></div>
  4. <div class="sect1"><h2 id="usage">Usage</h2><div class="sectionbody"><div class="olist arabic"><ol class="arabic"><li><p>Select a j3o that contains a vehicle model and press the vehicle button (or right-click → edit vehicle)</p></li><li><p>The VehicleCreator automatically adds a PhysicsVehicleControl to the rootNode of the model if there is none</p></li><li><p>Select the Geometry or Node that contains the chassis in the SceneExplorer and press “create hull shape from selected</p></li><li><p>Select a Geometry that contains a wheel and press “make selected spatial wheel, select the “front wheel checkboxes for front wheels</p></li><li><p>Do so for all wheels</p></li></ol></div>
  5. <div class="paragraph"><p>New wheels will get the current suspension settings, you can edit single wheels via the SceneExplorer (update VehicleControl if wheels dont show up) or apply settings created with the settings generator to wheel groups.</p></div>
  6. <div class="paragraph"><p>Press the “test vehicle button to drive the vehicle, use WASD to control, Enter to reset.</p></div></div></div>
  7. <div class="sect1"><h2 id="known-issues">Known Issues</h2><div class="sectionbody"><div class="paragraph"><p>Don&#8217;t save while testing the vehicle, you will save the location and acceleration info in the j3o.</p></div></div></div>
  8. <div class="sect1"><h2 id="code-sample">Code Sample</h2><div class="sectionbody"><div class="paragraph"><p>Code Example to load vehicle:</p></div>
  9. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"><span class="comment">//load vehicle and access VehicleControl</span>
  10. Spatial car=assetManager.loadModel(<span class="string"><span class="delimiter">&quot;</span><span class="content">Models/MyCar.j3o</span><span class="delimiter">&quot;</span></span>);
  11. VehicleControl control=car.getControl(VehicleControl.class);
  12. rootNode.attachChild(car);
  13. physicsSpace.add(control);
  14. <span class="error"> </span>
  15. <span class="comment">//then use the control to control the vehicle:</span>
  16. control.setPhysicsLocation(<span class="keyword">new</span> Vector3f(<span class="integer">10</span>,<span class="integer">2</span>,<span class="integer">10</span>));
  17. control.accelerate(<span class="integer">100</span>);</code></pre></div></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2018-02-28 16:23:40 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  18. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  19. indexName: 'jmonkeyengine',
  20. inputSelector: '#doc-search',
  21. debug: false // Set debug to true if you want to inspect the dropdown
  22. });</script></body></html>