[SOLVED]Linear & Angular Damping For Multiple Axes/Rotations
Posted: Wed Nov 16, 2016 8:44 pm
Hi,
Bullet's btRigidBody::setDamping function takes two scalars... the first specifying a linear damping coefficient and the second specifying an angular damping coefficient.
There is a single linear damping coefficient for each of the axes (surge, sway, heave) and a single angular damping coefficient for each of the rotations (yaw, pitch, roll)
Is there a method that enables one to specify separate linear damping coefficients for surge, sway, heave (body coordinate frame) and separate angular damping coefficients for yaw, pitch, roll (body coordinate frame)?
If there is no such method would it be ok to multiply the linear velocity by the surge, sway, and heave damping coefficients and the angular velocity (body coordinate frame) by the yaw, pitch, and roll damping coefficients?
For example
*** sway is along x axis, heave is along y axis, and surge is along z axis (y axis points up)
linear_damping_vector = ((1.0 - sway_damping) ^ timeStep, (1.0 - heave_damping) ^ timeStep, (1.0 - surge_damping) ^ timeStep)
linear_velocity *= linear_damping_vector
angular_damping_vector * = ((1.0 - pitch_damping) ^ timeStep, (1.0 - yaw_damping) ^ timeStep, (1.0 - roll_damping) ^ timeStep)
angular_damping = center_of_mass_transform * (inverse center_of_mass_transform * angular_velocity) * angular_damping_vector - center_of_mass_transform_origin
Thanks
Bullet's btRigidBody::setDamping function takes two scalars... the first specifying a linear damping coefficient and the second specifying an angular damping coefficient.
There is a single linear damping coefficient for each of the axes (surge, sway, heave) and a single angular damping coefficient for each of the rotations (yaw, pitch, roll)
Is there a method that enables one to specify separate linear damping coefficients for surge, sway, heave (body coordinate frame) and separate angular damping coefficients for yaw, pitch, roll (body coordinate frame)?
If there is no such method would it be ok to multiply the linear velocity by the surge, sway, and heave damping coefficients and the angular velocity (body coordinate frame) by the yaw, pitch, and roll damping coefficients?
For example
*** sway is along x axis, heave is along y axis, and surge is along z axis (y axis points up)
linear_damping_vector = ((1.0 - sway_damping) ^ timeStep, (1.0 - heave_damping) ^ timeStep, (1.0 - surge_damping) ^ timeStep)
linear_velocity *= linear_damping_vector
angular_damping_vector * = ((1.0 - pitch_damping) ^ timeStep, (1.0 - yaw_damping) ^ timeStep, (1.0 - roll_damping) ^ timeStep)
angular_damping = center_of_mass_transform * (inverse center_of_mass_transform * angular_velocity) * angular_damping_vector - center_of_mass_transform_origin
Thanks