Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Latest commit

 

History

History
72 lines (63 loc) · 3.71 KB

vehicle_creator.md

File metadata and controls

72 lines (63 loc) · 3.71 KB
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 25
---
title: jMonkeyEngine SDK: Vehicle Creator
---

jMonkeyEngine SDK: Vehicle Creator

Best results when car is facing in z direction (towards you).

Usage

  1. Select a j3o that contains a vehicle model and press the vehicle button (or right-click → edit vehicle)
  2. The VehicleCreator automatically adds a PhysicsVehicleControl to the rootNode of the model if there is none
  3. Select the Geometry or Node that contains the chassis in the SceneExplorer and press “create hull shape from selected”
  4. Select a Geometry that contains a wheel and press “make selected spatial wheel”, select the “front wheel” checkboxes for front wheels
  5. Do so for all wheels

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.

Press the “test vehicle” button to drive the vehicle, use WASD to control, Enter to reset.

Known Issues

Don't save while testing the vehicle, you will save the location and acceleration info in the j3o.

Code Sample

Code Example to load vehicle:

//load vehicle and access VehicleControl
Spatial car=assetManager.loadModel("Models/MyCar.j3o");
VehicleControl control=car.getControl(VehicleControl.class);
rootNode.attachChild(car);
physicsSpace.add(control);
 
//then use the control to control the vehicle:
control.setPhysicsLocation(new Vector3f(10,2,10));
control.accelerate(100);