The physics engine passed to the world
The renderer engine of the world. See createRenderer
The x position of the cuboid
The y position of the cuboid
The z position of the cuboid
The width of the cuboid in meters
The length of the cuboid in meters
The height of the cuboid in meters
The mass of the cuboid in kg
The color of the cuboid. Can be a hex code or a string. {@see https://threejs.org/docs/#api/en/math/Color}
"rigid" or "dynamic". Determines if the cuboid is fixed or can move.
Cuboid
init_simulation(() => {
const physics = createPhysics();
const renderer = createRenderer();
const timer = createTimer();
const robot_console = createRobotConsole();
const world = createWorld(physics, renderer, timer, robot_console);
const cuboid = createCuboid(...);
addControllerToWorld(cuboid, world);
return world;
});
Creates a cuboid. joel-todo: The dynamic version wont work
This function is used to create the floor and wall controllers.
The returned Cuboid object is designed to be added to the world using addControllerToWorld.
This is a Controller function and should be called within init_simulation.