Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
As with objects in the real world, objects in a MassFX simulation are subject to the laws of physics, in particular gravity. In order to remain in a fixed position once a simulations start, they need to either be standing firmly on another static rigid body, such as the MassFX ground plane for instance, or be fixed somehow to another object in the scene. In this video, we will walk through accomplishing the latter in MassFX by making use of its constraint tools.
A constraint is a MassFX helper object that can be thought of as a joint or a connector between two objects in the simulation. In terms of real-world examples of constraints, we might think of a nail pinning a wanted poster to a tree or a hinge connecting a door to a door frame. Now, there is one extremely important piece of information regarding constraints in MassFX that we need to understand right at the start of our working with them. Constraints use the pivot points of the objects we are constraining together; they use them as the point of connection, so to speak.
It is therefore absolutely critical that our object's transforms have not been messed up in any way, such as can occur if we scale geometry when not in a subobject mode or if we mirror objects using the 3ds Max Mirror tool. This also means that the placement or the location of pivots on objects will itself play a critical role in many situations. To get started then, as you can see in this particular version of our start scene, we have a number of target objects that we will be wanting to hit with the spheres coming from our launchers.
They are all made up of three distinct paths. We have a target body, or frame; we have a gray hinge object; and we have the central target panel itself. Of course at this moment in time, applying a dynamic rigid body modifier to any of these parts and then running a simulation would see them fall to the floor. Let's see though if can change that particular behavior by using a rigid constraint. There are of course, as we may expect by now, a number of ways that we can approach setting up our constraints in MassFX.
For demonstration purposes though, let's see what happens if we simply select one of our target panels and then try to apply a rigid constraint from the MassFX toolbar. What we get is a MAXScript message dialog giving us a critical piece of constraint use information, namely objects connected by a constraint must be rigid bodies. The nice thing here is that the system is offering to apply the required modifiers for us rather than making us go away, take care of it, and then come back.
If I click Yes to accept the offer, we are taken straight into creating the rigid constraint we originally wanted. The first thing we see is a constraint gizmo that could be sized by simply moving our mouse either left and right or up and down. Actually, what is really happening is the closer we move our mouse to our parent object, the smaller the constraint becomes, and of course the opposite is also true. As this helper object houses a number of important options, and because we are going to want to easily select them in the scene, we can set this to be fairly big.
All we need to do then is left-mouse-click to exit Creation mode. Now if we come and run our simulation, we may be a little surprised at the results. Why, you may ask, isn't our dynamic rigid body object dropping to the floor under the influence of gravity, as we have come to expect? And why aren't our dynamic rigid body spheres that are clearly colliding with this panel having any effect on it either? We have, after all, only applied our constraint to this one single object.
With the Constraint helper selected, let's come over to the Command panel. If we take a look in the General options for our constraint, we can see that the panel object has been set as a child in this relationship. But our parent is saying that it is as of yet undefined. With no parent object explicitly specified, the MassFX system constrains a child object to the world itself, essentially pinning it in place in 3D space. Our geometry now acts much like a static rigid body. As we've seen, neither the projectiles nor gravity have any effect on it at all.
In fact if we take a look at the default transform limits that have been set up for our rigid constraint preset, you can see that everything is completely locked. In our particular case, this functionality actually works quite well for us. So let's apply a rigid constraint to our other panel objects. This time we will use a slightly different workflow. So I am just going to use the Ctrl key and then left-mouse-click to select all of the remaining panel objects, and then we can apply a MassFX dynamic rigid body modifier to them from the MassFX toolbar.
If I run the simulation now, as you can see, we get a very expected result: our panels fall to the floor being affected by gravity. What we can do now is again select our target, this time one at a time, and apply a rigid constraint to them. We can do that from the MassFX toolbar. As we go, we do of course want to leave our gizmos quite large so that we can easily select them in the viewport. Once all of our setup is in place, we can again come and run the simulation, and this time we can see that our constraints are working perfect. All of the panels are firmly locked in place, which actually means we can now go and make use of a constraint option that can add a very specific effect to our simulation-- namely the ability to make our constraints breakable.
To do this, all we need to do is, again, use the Ctrl key to select all of our constraint helpers and then we can come across to the Multi-Object Editor. If we just scroll down to the Advanced rollout, we can enable this breakable option by simply putting a check in the box. The Break Force and Break Torque settings control how much force needs to be applied before the constraint will break or turn off. The Break Force controls direct impacts, and Break Torque determines how much twist or rotational force would need to be applied, again, before the break would occur.
Now if I just right-click on both of these spinners for a moment to set them to their minimum values and then if I come and run the simulation again, you can see that there is a danger in setting these values too low. Even a slight shift in the object as the simulation starts applies in a force to turn our constraint off and drop the object to the floor. If we wanted to fix this and yet still keep our values very low, if we just set these two a value of 1 each, you can see that that is enough to keep them fixed in place as the simulation starts.
On the other hand of course, if we set these values to high, we might not get our constraints to break at all, so we do need to set these options with care. In our case, if we set them to, say, 5 and 60 respectively and then come and run the simulation, you can see the constraints are clearly strong enough to hold the objects in place, but only until they are struck with enough force to switch the constraint off. For simply pinning an object or objects in place then, or indeed for creating a locked relationship between two dynamic rigid bodies, the rigid constraint is the perfect tool. But what if we wanted to create something a little more interesting than static or fixed target? Could constraints help us create something a little more challenging, such as a dynamic moving target? We will answer that question in our next video.
Get unlimited access to all courses for just $25/month.Become a member
107 Video lessons · 31805 Viewers
90 Video lessons · 22001 Viewers
78 Video lessons · 8120 Viewers
83 Video lessons · 7779 Viewers