Rotating Colliders using Motors
Q: Rotating colliders in MASH Dynamics. How does that work?
A: There's more than one way to tackle this but one of the most stable techniques is to use motors.
- Create a large(ish) Sphere. This is your collider.
- With that Sphere selected, create a MASH network with a Point Count of 1.
- Add Dynamics node.
- Set Collision Shape to Mesh.
- Set Mass to something very high (we've used 1000)
- On your Dynamics node, scroll down to the Constraints section.
- Right click in the window and choose Create.
- Double click the Constraint you've just created.
- Set Type to Custom
- Set Connection Mode to Connect to Point
- Open the Motor rolldown
- Under Rotational Motor check Enable and set a Target Speed for one (or more) axis.
- Open the Limits rolldown
- Set all Positional Limits to Fixed and set the Rotational Limits you are not animating (from step 11) to Fixed.
- Press play. You should see your Sphere rotating in place.
- Create a smaller Sphere
- With that Sphere selected, create a MASH network with a Point Count of 10.
- On the Distribute node set Distribution Type to Volume
- Add a Dynamics node
- Press play.
Tip - if you have a lot of objects inside your Sphere then, in a Dynamic sense, they're heavy (depending on your Mass settings). If your collider is struggling to turn due to that weight you might need to increase Maximum Force under the Rotational Motor rolldown. Think of this as torque. The higher it is the more power your motor has and so will reach its Target Speed more quickly (and be able to maintain it).
Download an example file here (requires Maya 2018)