16#ifndef BT_MOUSE_PICKING_FORCE_H
17#define BT_MOUSE_PICKING_FORCE_H
49 for (
int i = 0; i < 3; ++i)
65 for (
int i = 0; i < 3; ++i)
68 btVector3 scaled_force = scaled_stiffness * dir;
81 for (
int i = 0; i < 3; ++i)
87 local_scaled_df = scaled_k_damp * dv[
m_face.
m_n[i]->
index].dot(dir) * dir;
98 for (
int i = 0; i < 3; ++i)
107 energy += 0.5 * scaled_force.
dot(dir);
115 for (
int i = 0; i < 3; ++i)
132 for (
int i = 0; i < 3; ++i)
143 scaled_df -= scaled_stiffness * dir_normalized.
dot(dx_diff) * dir_normalized;
144 scaled_df += scaled_stiffness * dir_normalized.
dot(dx_diff) * ((dir_norm - r) / dir_norm) * dir_normalized;
145 scaled_df -= scaled_stiffness * ((dir_norm - r) / dir_norm) * dx_diff;
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btVector3 can be used to represent 3D points and vectors.
btScalar safeNorm() const
Return the norm (length) of the vector.
btVector3 & safeNormalize()
btScalar dot(const btVector3 &v) const
Return the dot product.
btScalar norm() const
Return the norm (length) of the vector.
btVector3 normalized() const
Return a normalized version of this vector.