-1
このコードから、私はsqrtに関するいくつかの問題があります。& cosはメソッドを解決できず、EPSILONはシンボルを解決できません。私はsinコサスのために数学ライブラリ& 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定数でも同様です)と思われます。 –
私は、静的java.lang.Math.sqrtをインポートしようとしました。 float omegaMagnitude = sqrt(axisX * axisX + axisY * axisY + axisZ * axisZ)です。赤で下線が引かれています。 EPSILONのために、それを二重として定義する方法は本当にわかりません。 – MdZain