void TransformManipulator::attachTo(BaseTransform * subject) { m_subject = subject; setTranslation(subject->translation()); setRotationAngles(subject->rotationAngles()); setParent(subject->parent()); }
void TransformManipulator::spin(const Vector3F & d) { Matrix44F ps; parentSpace(ps); Matrix44F invps = ps; invps.inverse(); const Vector3F worldP = ps.transform(translation()); const Vector3F rotUp = ps.transformAsNormal(hitPlaneNormal()); Vector3F toa = m_currentPoint - worldP; Vector3F tob = toa + d; toa.normalize(); tob.normalize(); float ang = toa.angleBetween(tob, toa.cross(rotUp).reversed()); Vector3F angles; if(m_rotateAxis == AY) angles.set(0.f, ang, 0.f); else if(m_rotateAxis == AZ) angles.set(0.f, 0.f, ang); else angles.set(ang, 0.f, 0.f); m_subject->rotate(angles); setRotationAngles(m_subject->rotationAngles()); }
void ModelQuadruped::render(float f, float f1, float f2, float f3, float f4, float f5) { setRotationAngles(f, f1, f2, f3, f4, f5); head.render(f5); body.render(f5); leg1.render(f5); leg2.render(f5); leg3.render(f5); leg4.render(f5); }
void BaseTransform::rotate(const Vector3F & v) { Vector3F v1 = m_angles + v * m_rotateDOF; setRotationAngles(v1); }