// TODO: Check if transform is right, or lefthanded and transform it accordingly, to match imported scene and scene display in FUSEE private static TransformComponent GetXForm(Matrix4x4 transform) { Vector3D scaling, translation; AsQuaternion rotation; transform.Decompose(out scaling, out rotation, out translation); FuQuaternion fuRot = new FuQuaternion(rotation.X, rotation.Y, rotation.Z, rotation.W); float3 ypr = FuQuaternion.QuaternionToEuler(fuRot); return(new TransformComponent { Translation = new float3(translation.X, translation.Y, translation.Z), Rotation = ypr, Scale = new float3(scaling.X, scaling.Y, scaling.Z) }); }
/// <summary> /// Sets the motor target. /// </summary> /// <param name="qAinB">The q ain b.</param> /// <param name="dt">The dt.</param> public void SetMotorTarget(Quaternion qAinB, float dt) { var o = (HingeConstraintImp)_hci.UserObject; o._hci.SetMotorTarget(Translator.QuaternionToBtQuaternion(qAinB), dt); }
/// <summary> /// Sets the motor target in constraint space. /// </summary> /// <param name="q">The q.</param> public void SetMotorTargetInConstraintSpace(Quaternion q) { _cti.SetMotorTargetInConstraintSpace(Translator.QuaternionToBtQuaternion(q)); }
/// <summary> /// Sets the motor target. /// </summary> /// <param name="q">The q.</param> public void SetMotorTarget(Quaternion q) { _cti.SetMotorTarget(Translator.QuaternionToBtQuaternion(q)); }