10.08.2013 Views

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.3. COMPONENTS 97<br />

Lower-level collision detection involving bodies in the simulation group is performed. Penetrations<br />

indicate that the current state is invalid and the ODE solver should rollback<br />

and locate the latest valid state (the evaluation of the ODE state derivative ends with<br />

an indication that the current state is invalid). Otherwise, contacts among bodies in the<br />

simulation group are computed and temporary contact joints, represented by the instances<br />

of classContactJoint, created to handle contact.<br />

• External forces and torques are computed<br />

Force and torque accumulators of the bodies in the group are cleared, the list of force objects<br />

assigned to the simulation group and the list of global forces traversed to accumulate the<br />

force and torque contributions.<br />

If we are in the middle of an ODE step (the derivative is evaluated for an intermediate<br />

state), impulses are ignored.<br />

• Constraints are processed<br />

Dynamics constraints represented by the instances of Joint class assigned to this simulation<br />

group (including the implicit joints due to contacts) are traversed to determine what constraints<br />

are to be maintained on the velocity and acceleration levels and constraint impulses<br />

and forces are computed and applied.<br />

Non-penetration is enforced by stopping bodies at critical contacts. Contact joints are<br />

finally removed.<br />

• The equation right-hand side is returned<br />

Force and torque accumulators and the rigid body states are used to fill the right-hand<br />

sides of (5.18) due to individual bodies in the group.<br />

If impulses were applied at this invocation of the function, the ODE solver is notified that<br />

the ODE state has changed.<br />

7.3.5 Constraint Solver<br />

Constraints on the acceleration and velocity levels are represented by a special kind of binary<br />

forces called joints (instances of Joint class). Joints provide functions to describe the constraints<br />

in the form of (6.17) and (6.26) and their corresponding soft variants. Constraint solver traverses<br />

the list of joints and invokes these functions to retrieve the velocity level or acceleration level<br />

formulations of the constraints, described in terms of the instances of Joint::BasicInformation<br />

(providing the information on the constraint DOFs, the dimensionality mi of the constraint) and<br />

Joint::ExtendedInformation (providing the values of the Jacobian blocks Ji,Ai and Ji,Bi ,<br />

constraint right-hand side vector ci or ki, Lagrange multiplier limits λ lo<br />

i and λ hi<br />

i and softness<br />

constants si). The formulations are in turn used to develop conditions on the multipliers λ, the multipliers are computed and constraint force (impulse) exerted on the bodies in the group.<br />

Velocity level constraints are solved first, yielding a change of the ODE state. Acceleration level<br />

constraints are then computed with respect to the new ODE state. We will now describe this<br />

process more thoroughly.<br />

There are some differences from the outline we have just presented. First, bodies in the<br />

simulation group are further partitioned to so called islands defined as the groups of bodies<br />

(subsets of the bodies in the simulation group) that are currently connected by a joint, [22]. If<br />

we have two islands A and B, then the constraint force due to constraints in the island A can not

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!