For any object in a scene that has a collision volume, you may choose one of three motion types. A motion type defines how an object moves in the scene and how it acts when it collides with other objects. An object's motion type can be set using the Motion Type dropdown in the object's Properties panel.
At this time, the three motion types are Static, Keyframed, and Dynamic.
|Note: Objects must have a collision volume in order to set a motion type. See Object editing to find out how to add a collision volume to an object that does not already have one.|
While editing a scene, you can set an object's motion type by doing the following:
- Select the object, either by clicking it in the scene or by selecting it from the Scene Objects panel.
- Click the Properties button that appears on the object.
- In the Properties window that appears, click the dropdown next to Motion Type and select from Static, Keyframed, or Dynamic.
|This object's Motion Type is set to Dynamic.|
The following additional properties are associated with objects that have a movement type selected:
- Density (Dynamic only) - Adjusts the mass of the object by increasing or decreasing its density. Higher density objects are harder to move and are more affected by gravity.
- Friction - Set the amount of friction the object exerts on other objects that touch it.
- Bounce - Set the amount of energy absorbed by the object when another object or avatar collides with it. The higher the setting, the more force the object "pushes back" with when something collides with it.
- Audio Material - Set the sound the object makes when something collides with it or an avatar walks on it. For more information, see Using audio materials.
- Can Grab (Dynamic only) - Set whether or not an avatar can grab the dynamic object with the mouse or VR motion controllers.
|Motion type properties for a Dynamic object. Density and Can Grab are exclusive to dynamic objects and do not appear for static or keyframed objects.|
This section describes the differences between static, keyframed, and dynamic objects.
Static objects are completely immobile and cannot be moved under any circumstances while visiting a scene. Avatars and other mobile objects may still collide with static objects. Static is the default motion type for all objects.
Keyframed objects are almost exactly like static objects, except that they can be moved by object animations and certain script API functions. This means that, while they are capable of movement, they are unaffected by gravity, cannot collide with static or keyframed objects, and can collide with dynamic objects and avatars, but are not moved by them.
Keyframed objects are useful for creating moving parts of a scene, such as doors, that need to perform a specific motion reliably without adding unnecessary strain to the physics simulation.
|Note: Animated objects that have been incorrectly set to Static are automatically converted to keyframed objects when visiting the scene. However, scripted objects are not converted in this way and may fail to move if they are not properly set to the Keyframed motion type.|
|Note: Keyframed and dynamic objects do not have separate script API functions for movement. Keyframed objects can be moved using the same script API functions as dynamic objects, such as those used in Example Script: Random Movement.|
Dynamic objects in Sansar can be affected by physics; this means they can fall, roll, bounce, and slide within a scene according to their density, friction, and bounce settings.
When visiting a scene in VR, you can grab and toss dynamic objects using Vive or Oculus VR controllers or the left mouse button. You can easily play with these interactions in the Toppleton Toy Town experience provided by Sansar Studios.
For performance reasons, the mesh collision shapes of dynamic objects are converted to a simplified convex hull when visiting the scene. If you need a moving object with a more precise collision shape, try using a keyframed object instead.