16 std::shared_ptr<TransformController>
const& controller0,
17 std::shared_ptr<TransformController>
const& controller1,
18 bool geometricRotation,
bool geometricScale)
21 mController0(controller0),
22 mController1(controller1),
24 mGeometricRotation(geometricRotation),
25 mGeometricScale(geometricScale)
41 float oneMinusWeight = 1.0f -
mWeight;
55 if (
Dot(quat0, quat1) < 0.0f)
67 blendQuat = oneMinusWeight * quat0 +
mWeight * quat1;
80 for (
int i = 0; i < 3; ++i)
82 float s0 = sca0[i],
s1 = sca1[i];
83 if (s0 != 0.0
f && s1 != 0.0
f)
85 float sign0 = (s0 > 0.0f ? 1.0f : -1.0f);
86 float sign1 = (s1 > 0.0f ? 1.0f : -1.0f);
89 float pow0 = pow(s0, oneMinusWeight);
91 blendSca[i] = sign0 * sign1 * pow0 * pow1;
101 blendSca = oneMinusWeight * sca0 +
mWeight * sca1;
ControlledObject * mObject
Quaternion< Real > Slerp(Real t, Quaternion< Real > const &q0, Quaternion< Real > const &q1)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
virtual bool Update(double applicationTime)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Real Normalize(GVector< Real > &v, bool robust=false)
virtual void SetObject(ControlledObject *object)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1