Из этого кода у меня есть несколько вопросов с sqrt, sin & cos не может решить метод, и EPSILON не может разрешить символ. Нужно ли добавлять в математическую библиотеку для sin cos & sqrt? Если да, вы можете дать мне ссылку, чтобы загрузить банку?Проблема с не может разрешить метод & символ
float omegaMagnitude = sqrt(axisX*axisX + axisY*axisY + axisZ*axisZ);
// Normalize the rotation vector if it's big enough to get the axis
// (that is, EPSILON should represent your maximum allowable margin of error)
if (omegaMagnitude > EPSILON) {
axisX /= omegaMagnitude;
axisY /= omegaMagnitude;
axisZ /= omegaMagnitude;
}
// Integrate around this axis with the angular speed by the timestep
// in order to get a delta rotation from this sample over the timestep
// We will convert this axis-angle representation of the delta rotation
// into a quaternion before turning it into the rotation matrix.
float thetaOverTwo = omegaMagnitude * dT/2.0f;
float sinThetaOverTwo = sin(thetaOverTwo);
float cosThetaOverTwo = cos(thetaOverTwo);
JAR? Это Java? Это должны быть Math.sqrt, Math.sin и Math.cos. EPSILON должен быть определен как двойной вами. Никаких библиотек не требуется. – duffymo
Я подозреваю, что код, который вы скопировали и вставил, имеет 'import static java.lang.Math.sqrt;' (и то же самое для других функций и аналогично для константы EPSILON). –
Я попытался использовать импорт static java.lang.Math.sqrt; но float omegaMagnitude = sqrt (осьX * осьX + осьY * осьY + осьZ * ось Z); подчеркивается красным цветом. Для EPSILON im не совсем уверен, как определить его как двойное. – MdZain