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.

5.3. ABSTRACTION 47<br />

the same scheme like the simulation of particles and the only thing which makes it harder are<br />

the extra dimensions due to body orientations.<br />

We will use the momentum-based formulation of the equation of motion (5.18) to simulate<br />

the bodies. This decision dictates what the layout of the body state vector y(t) is and what<br />

properties are recorded in the body state (equation (5.17)). Obviously, vector y(t) will be a part<br />

of our rigid body representation. The right-hand side of (5.18) tells us what quantities have to be<br />

processed when the body state derivative is requested to be evaluated by the ODE solver. Since<br />

the quantities are defined in terms of auxiliary quantities v(t), ω(t), I(t) and I −1 (t), derived from<br />

the rigid body state, constant quantities Ibody, I −1<br />

body , M and M −1 , characterizing the rigid body<br />

mass properties, and computed quantities Ftotal(t), τtotal(t), storing the total external force and<br />

torque acting on the body at time t, all these quantities should be represented as well.<br />

Let us focus at Ftotal(t) and τtotal(t) quantities. When these quantities were defined (equations<br />

(5.7), (5.9)), we were conceptually working with a rigid body made of particles, correlated the<br />

positions where the forces were exerted with the positions of particles and defined a torque<br />

according to the position of the particle. Since we can imagine that there happens to be a<br />

particle at any world space position we are interested in, we can interpret τi(t) from (5.7) as a<br />

torque due to an external force Fi(t) exerted on the body at the world space position ri(t) and<br />

hence can write<br />

n<br />

Ftotal(t) = Fi(t)<br />

n<br />

n<br />

τtotal(t) = τi(t) = (ri(t) − x(t)) ×<br />

i=1<br />

i=1 i=1<br />

Fi(t),<br />

where Fi(t) is an external force exerted at point ri(t) on the body.<br />

This allows to implement Ftotal(t) and τtotal(t) as a force and torque accumulators and handle<br />

the contributions to the accumulators in terms of apply force(r, F ) function that adds the<br />

exerted force F to the body’s Ftotal(t) accumulator and the corresponding torque (r − x(t)) × F<br />

due to F exerted at r to the τtotal(t) accumulator. The contributions are represented by force<br />

objects that provide functions to exert the represented forces and torques in terms of apply force<br />

function called on affected bodies.

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

Saved successfully!

Ooh no, something went wrong!