Rag Doll Constraint



Your Ad Here


Create panel > Helpers > reactor > Ragdoll

Menu bar > reactor > Create Object > Rag Doll Constraint

reactor toolbar > Create Rag Doll Constraint button

The Rag Doll constraint lets you realistically simulate the behavior of body joints, such as hips, shoulders, and ankles. Once you decide the degree of movement a joint should have, you can model it by specifying limiting values for the Rag Doll constraint.

The Rag Doll constraint uses the parent body as a reference when defining the limits for the motion of the child body. For example, when your torso moves, your arm always moves with it. So when modeling a shoulder joint, you would usually designate the torso as the parent body and the upper arm as the child body. You can then specify limits on the arm's movement relative to the torso, as in the above illustration: The arm is allowed to rotate relative to the torso within the grey limited cone. You can also limit the child body's ability to twist.

You restrict how a Rag Doll constraint’s child can move relative to the parent using the constraint’s Twist, Cone, and Plane limits. As with the other constraints, the constraint space for the Rag Doll joint is defined in each body's local space; you use this constraint space to define your limits. The constraint space is defined as follows:

reactor provides special limit visualizations to help you choose appropriate values for the Rag Doll.

For a detailed explanation of how to define those limits, see Defining Rag Doll Limits.

reactor simulates a Rag Doll constraint if it has the correct number of rigid bodies attached and is included in a valid Constraint Solver. When not selected, invalid rag dolls are red in the viewport.

To find out how to create an example character quickly using the Rag Doll constraint, see Scripts.

Procedures

To create a Rag Doll constraint:

  • Choose one of the above options, and then click in any viewport to add the Rag Doll.

    Note: For a two-bodied Rag Doll, the icon’s initial position has no effect on the Rag Doll's behavior. For a single-bodied Rag Doll, it defines the initial position of the world attachment point. You can change this afterwards.

To attach objects to the Rag Doll:

  1. Create the rag doll and the objects to connect using it.

  2. In the rag doll’s Properties rollout, click the Child pick button. Now, in one of the viewports, select the object to use as the child object. This attaches the constraint to the selected body at the body’s pivot point. The twist axis for the constraint in the child's space is aligned to the x-axis of the child object and initially, the plane normal will be aligned to the y-axis.

    This constraint is more intuitive to use if the child and parent bodies are attached correctly. For example, if connecting an upper arm to a shoulder, the shoulder should be the parent and the upper arm the child.

  3. If you do not want to assign a parent to the constraint, turn off the Parent check box.

  4. If the constraint is two bodied, repeat Step 2, using the Parent pick button to set the parent body for the constraint. By default, the constraint space in the parent's local space is also aligned with the child body.

To create the constraint and attach objects in a single step:

To change the Rag Doll positions and orientations for the bodies:

  1. With the Rag Doll selected, open the Modify panel.

  2. In the modifier stack open the sub-object list.

  3. Access the sub-object level corresponding to the object whose constraint representation is to be altered: Parent Space or Child Space. If the rag doll is single-bodied, Parent Space represents the world attachment position and rotation of the rag doll’s axes.

  4. The space, represented by just the twist axis for the child and by the twist axis, plane normal and limit visualization for the parent, becomes active in the viewport and can be moved and rotated using the Move and Rotate tools respectively. The space maintains its position and rotation relative to its corresponding object. For example, if you move or rotate the child, Child Space moves relative to it.

  5. To reset the space for an object to its default, reattach the object to the rag doll or use the Align To Child Body button.

  6. You can also rotate the plane normal independent of the twist axis. To do this, set the sub-object level to Plane Rotation and you will be able to rotate the plane normal with respect to the parent’s twist axis.

To change the Cone and Plane limits:

  1. Ensure that you can see the limit visualization for the Rag Doll; this helps you to choose appropriate limits for your desired behavior. Visual representation of the limits is displayed at the location of the parent’s sub-object. This provides you with a graphical representation of the limited area of movement for the child relative to the parent.

  2. With the rag doll selected, open the Properties rollout.

    Note: You can use this rollout to specify how the limits are represented in the visualization, as well as changing the limits.

  3. Change the Cone > Min and Max settings.

    When displayed, the cone remains symmetrical and is rotated about the plane normal by the average offset of Min and Max. For example, if Min=-10.0 and Max=20.0, the average offset is (-10+20)*0.5=5 with a cone angle of 15. In effect, we have a 15-degree symmetrical cone [-15, 15] rotated by 5 degrees, resulting in limits of [–10, 20]. If the plane normal is not at 90 degrees to the twist axis, non-intuitive cone rotations can result. The rotation of the twist axis for the attached object is limited to the volume of this cone. You can view the cone on its own by ensuring that only the Show Cone option in the Properties rollout > Display group is on.

  4. You can also try changing the Plane > Min and Max settings. These are limited between [-90, 0] and [0,90] respectively. Taking the Min and Max limits and sweeping those angles around the plane normal creates cones. The rotation of the attached object is then limited to within the region between the plane and these cones.

    You can also rotate the plane independent of the twist axis. To display the plane limits, turn on Display rollout Show Plane Limits.

  5. By combining Cone and Plane limits you generate valid rotational regions for the child object relative to the parent object. This is the region represented by the Show Volume option.

    Note: Cone and plane limits limit the movement independently. As a result, it is possible to have ineffective plane limits, where the cones generated by the plane limits do not intersect the cone generated by the cone limits. Use the plane limits to reduce the level of movement provided by the cone.

To change the Twist limits:

  1. Select the Rag Doll helper object and open the Properties rollout.

  2. The Twist settings limit the rotation of the child object about the twist axis relative to the parent object. To fix the twist of one object relative to the other, set the twist limits to [0,0].

  3. Display the Twist limits by turning on Display rollout > Show Twist.

For a detailed explanation of how to define these limits, see Defining Rag Doll Limits.

Interface

Modifier Stack

Parent Space—At this sub-object level, you can move and rotate the representation of the Rag Doll for the parent body. The constraint axes are defined in the parent body's space, which means that if you alter the position or rotation of the parent, the space moves as well and maintain its offset rotation and translation with respect to the parent. When you assign a parent body to the Rag Doll, Parent Space is also aligned with the child body's local space, with the attachment point at the child body's pivot point, the twist axis aligned with the child's X axis, and the plane normal aligned to the child’s Y axis. If the Rag Doll is single-bodied, then Parent Space represents the world orientation and position of the constraint.

Child Space—At this sub-object level, you can move and rotate the representation of the Rag Doll for the child body. The constraint axes are defined in the child body's space, which means that if you alter the position or rotation of the child, the space moves as well and maintain its offset rotation and translation with respect to the child. When you assign a child body to the Rag Doll, the Child Space is positioned so that the attachment point coincides with the child body pivot point, and the twist axis is aligned with the child's X axis.

Note: While the Child Space sub-object has its own representation of the plane and plane normal, these are not displayed at this sub-object level, as the plane normal can be edited only in the parent body's space.

Plane Rotation—This sub-object level allows independent rotation of the plane normal with respect to the Parent Space. This means that your plane normal doesn’t have to be perpendicular to your twist axis, allowing for a greater ranger of constraint setups. However, it should be noted that non-orthogonal systems affect the way reactor handles non-symmetrical cone limits.

Properties rollout

Parent—When on, the Rag Doll has two bodies and you can designate an object to be the parent body. When off, the Spring is single-bodied and the point occupied by the Parent Space sub-object is the parent.

You assign the parent object by clicking this button and then selecting a rigid body from any viewport. Thereafter the button displays the name of the parent body.

Child—Displays the name of the second rigid body attached to the Rag Doll. You assign the child object by clicking this button and then selecting a rigid body from any viewport.

Align Spaces To—Use these options to align the bodies' local constraint spaces. You can find out more about each option in Working With Constraint Spaces.

Lock Relative Transform—When on, the relative transform between the child and parent constraint spaces is locked: If you move either space in the viewport, the other space moves along with it.

Strength group

Strength/Tau—Govern the impulses applied to the constraint's bodies in order to maintain the constraint, and so how strongly the constraint works to restrict their movement. You can find out more about these parameters in Strength and Tau.

Limits group

Twist Min—The minimum rotation about the twist axis the constraint allows between the reference and attached objects' constraint spaces. For example, if Min=–5 then, with respect to the constraint spaces, the child cannot rotate more than 5 degrees counterclockwise about the twist axis.

Twist Max—The maximum rotation about the twist axis the constraint allows between the reference and attached objects' constraint spaces. For example, if Max=5 then, with respect to the constraint spaces, the child cannot rotate more than 5 degrees clockwise about the twist axis.

Cone Min—The minimum value, in degrees, used to specify the limit cone. This value combines with the Cone Max value to generate a symmetrical cone. This cone is rotated about the plane normal by an offset calculated by combining these limits. The rotation of the child’s twist axis is then limited to the volume of this cone with respect to the parent.

For example, if the Min=–10 and Max=20, the range is 30 degrees. A 30-degree cone [–15,15] is created about the twist axis and is then rotated by the offset between the limits (–10+20 )*0.5=5. This results in the effective limits being [–15,15] rotated by 5 degrees, thus final limits of [–10, 20].

Cone Max—The maximum value, in degrees, used to specify the limit cone. This is combined with the Cone Min value to generate a symmetrical cone. This cone is rotated about the plane normal by an offset calculated by combining these limits. The rotation of the child’s twist axis is then limited to being within this cone with respect to the parent.

Plane Min—The angle between the plane and a reference line in the range [-90,0]. This line is swept about the plane normal to create a cone. The child’s twist axis is then restricted from entering this cone. If this cone intersects the cone produced by the cone limits, it further inhibits the motion of the child with respect to the parent.

Plane Max—The angle between the plane and a reference line in the range [0,90]. This line is swept about the plane normal to create a cone. The child’s twist axis is then restricted from entering this cone. If this cone intersects the cone produced by the cone limits, it further inhibits the motion of the child with respect to the parent.

Breakable group

Breakable—When on, the constraint is breakable. If its breakable limits are exceeded during simulation it will cease to exert impulses on the attached objects. You can find out more about breakable constraints in Breakable Constraints.

Display group

Show Twist—When on, Twist limits display as part of the Parent Space visualization. The representation is a cylinder section showing the restricted motion of the attached object with respect to rotation about the twist axis.

Show Cone—When on, the entire symmetrical cone produced by the Cone > Min and Max limits displays as part of the Parent Space visualization.

Show Plane—When on, representations of the plane and plane normal display as part of the Parent Space visualization.

Show Plane Limits—When on, the cones formed by the plane limits display as part of the Parent Space visualization.

Show Volume—If true, a representation of the allowed region of movement based on a combination of the plane and cone values will be calculated and displayed as part of the Parent Space visualization.

Size—Allows you to change the size of the limit visualization in the viewport.

 

Reset Default Values—Resets the parameters for this constraint to their default values.


Comments

Return to Autodesk Index


Your Ad Here