-
Notifications
You must be signed in to change notification settings - Fork 43
World Builder
- In Gears, click "Worlds -> World Builder" (...or use this link)
- If you have an existing world that you'll like to modify, click "File -> Load world from file".
- You can find editable versions of the built-in worlds from the GearsBot github page
- There are also some editable worlds on here
- Every world MUST have a ground image.
- You can select one of the built-in image or provide your own via a URL.
- Images must be hosted on a CORS enable web-host. Imgur and Github will work. Most others will not.
- If hosting the image on Github, be sure to provide the URL to the file itself (aka "raw"), and not the Github page for the file.
- The ground image will determine the dimension of your ground, but you can scale it using imageScale, uScale, and vScale.
- Friction determines how slippery the ground is, while restitution affects how things bounces off the ground.
- This only works with a box ground. With other types of ground, it will be disabled.
- Used to set a timer for your world. Timer only starts when the user clicks the "Play" button in GearsBot.
- When the timer ends, you can choose to stop the robot. If enabled, this will stop the running program and send a stop command to the robot.
- Used to set the starting position and rotation.
- If restartAnimationOnRun is enabled, any animated object will return to their starting position when the player clicks the "Play" button in GearsBot.
This is where objects are added to the world.
These create the objects that you'll expect.
- Cylinder. Only the first two size parameter are used (...for length and diameter respectively)
- Sphere. Only the first size parameter is used (...for diameter)
- This starts with a default ! (Exclamation mark) model. Select a different built-in model or provide a model URL to change it.
- If providing a model URL, only gltf and glb format are currently supported. You can create your model in Blender, Tinkercad, OnShape, as well as many other 3D modeling software.
- Model files must be hosted on a CORS enable web-host. Github will work. Most others will not.
- Model files may contain built-in animation. If available, these will be listed under modelAnimation.
- Physics for models are based on their bounding box (...the flashing box around the model when it is selected). This is often much larger than desired. To work around this, make the model a child in a compound, and set it to physicsless. Set the parent object to the desired physics type (...fixed, moveable, or custom), and set its opacity to zero to hide it.
The compound object starts empty, but you can add other objects to it. All objects added to a compound will behave as a single object. This allows you to create moveable shapes such as a dumbbell (...two spheres connected by a cylinder), using multiple basic objects.
- To add objects to a compound, select the compound first then click Add.
- The first object in a compound is the parent all other objects are children.
- The center of gravity and physics settings are based on the parent only. Example; If the parent's mass is set to 100, and the child mass is set to 200, the total mass of the compound object will be 100 (...child's settings are ignored).
- If a child's physicsOptions is set to Physicsless, the child will move with the parent, but will not interact with other object.
- Position and rotation of children object are relative to the parent. So if you move the parent, the children will move with it.
The hinge object starts empty, but is visible as a transparent red cylinder (...this is visible in the World Builder, but hidden by default in the simulator). The hinge object allows you to connect two objects using a hinge (ie. can rotate about the hinge axis, but cannot translate or rotate about other axes).
- To add object to a hinge, select the hinge first then click Add.
- You can only add a single object to a hinge. If you need multiple objects, first add a compound to the hinge, then add objects to the compound instead.
- At least one side of the hinge must be Moveable. If both sides are Fixed, then no rotation is possible.
- Objects on the two side of the hinge will not interact with each other. If you need to work around this, create a third object, place it where you want to block the hinge movement, and hide it. This won't work if both sides of the hinge needs to be moveable.
- The size of the hinge has no impact on its behavior. It's purely cosmetic.
- The hinge object does not need to be touching the objects it is connecting.
- To make a hinge rotate on its own, you can set a speed (...in radians per second) and maxForce.
- If the maxForce is too low, it may be insufficient for the hinge to rotate. This is especially so when the hinge needs to overcome gravity to turn. 1,000 is often a good starting value to start testing.
- If you set the speed to zero, and give it a non-zero maxForce, you will create a hinge that tends to slow down and stop. This is useful for...
- Making a pendulum slow down and stop. Without this, the pendulum may swing forever once disturbed.
- Making a wheeled vehicle slow down and stop. Without this, the vehicle may start rolling on its own even without a robot pushing it, and it may roll forever once pushed.
- Any image texture can be used for any object shape, but if you were to choose an image from the cylinder category for a box object, it probably won't look right.
- For cylinder images, the first 25% of the width is for the bottom, the last 25% of the width is for the top, and the middle 50% is for the side. See the built-in images on Github for samples.
- As always, images must be hosted on a CORS enable web-host. Imgur and Github will work. Most others will not.
- Fixed objects cannot move. You can create a fixed object by either selecting the Fixed physicsOption, or selecting Custom and setting the mass to 0.
- Moveable objects can be moved. Any object set to Moveable or Custom with a non-zero mass will be moveable.
- Physicsless objects do not interact with others (ie. your robot can pass through it).
- Allow the object to be picked up by the robot magnet.
- Invisible. The object will be undetectable by laser / ultrasonic. The object will not block detection of objects behind it.
- Absorb with no reflection. The object will be undetectable by laser / ultrasonic. The object will not allow laser / ultrasonic rays from passing through it, so other objects behind it will be hidden as well.
- By default, objects do not cast shadows and shadows cannot be casted on them.
- The ground always receives shadows and the robot always cast shadows.
- receiveShadows allows shadows to be casted on an object.
- castShadows allows the object to cast shadows on others.
- Casting and receiving shadows can have a significant performance impact.
- To enable animation, the animationMode must be set to either Loop or Alternate.
- With Loop, the animation will restart from the beginning when it reaches its last position.
- With Alternate, the animation will reverse when it reaches its last position.
- While it's possible to animate an object with Moveable physics, this can cause glitches and should be avoided.
- Each key consists of a time (...in seconds), position, and rotation.
- Place the object at its starting position then add the first key by clicking "Add Key".
- Move the object to its next position, set the time you want it to arrive at that position, then set the second key by clicking "Add Key".
- Repeat as many times as required, setting a different time for each key.
- If you made a mistake, you can click "Edit" and delete the erroneous key from there.
- To view the animation, from the menu bar, click "World -> Animate".
It's possible to create randomization in the created world, but this will require you to edit the generated json file. See this page for documentations and samples on how to do this.
Python References