本文整理了Java中com.jogamp.opengl.math.Quaternion.magnitudeSquared
方法的一些代码示例,展示了Quaternion.magnitudeSquared
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quaternion.magnitudeSquared
方法的具体详情如下:
包路径:com.jogamp.opengl.math.Quaternion
类名称:Quaternion
方法名:magnitudeSquared
[英]See #magnitude() for special handling of FloatUtil#EPSILON, which is not applied here.
[中]有关FloatUtil#EPSILON的特殊处理,请参见#magnity(),这里不应用它。
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/**
* Invert the quaternion If rotational, will produce a the inverse rotation
* <p>
* Implementation Details:
* <ul>
* <li> {@link #conjugate() conjugates} if {@link #magnitudeSquared()} is is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q50">Matrix-FAQ Q50</a>
*/
public final Quaternion invert() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isEqual(1.0f, magnitudeSQ, FloatUtil.EPSILON) ) {
conjugate();
} else {
final float invmsq = 1f/magnitudeSQ;
w *= invmsq;
x = -x * invmsq;
y = -y * invmsq;
z = -z * invmsq;
}
return this;
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Invert the quaternion If rotational, will produce a the inverse rotation
* <p>
* Implementation Details:
* <ul>
* <li> {@link #conjugate() conjugates} if {@link #magnitudeSquared()} is is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q50">Matrix-FAQ Q50</a>
*/
public final Quaternion invert() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isEqual(1.0f, magnitudeSQ, FloatUtil.EPSILON) ) {
conjugate();
} else {
final float invmsq = 1f/magnitudeSQ;
w *= invmsq;
x = -x * invmsq;
y = -y * invmsq;
z = -z * invmsq;
}
return this;
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Invert the quaternion If rotational, will produce a the inverse rotation
* <p>
* Implementation Details:
* <ul>
* <li> {@link #conjugate() conjugates} if {@link #magnitudeSquared()} is is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q50">Matrix-FAQ Q50</a>
*/
public final Quaternion invert() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isEqual(1.0f, magnitudeSQ, FloatUtil.EPSILON) ) {
conjugate();
} else {
final float invmsq = 1f/magnitudeSQ;
w *= invmsq;
x = -x * invmsq;
y = -y * invmsq;
z = -z * invmsq;
}
return this;
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
final float norm = magnitudeSquared();
final float srecip;
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
代码示例来源:origin: org.jogamp.jogl/jogl
final float norm = magnitudeSquared();
final float srecip;
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
final float norm = magnitudeSquared();
final float srecip;
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Return the magnitude of this quaternion, i.e. sqrt({@link #magnitude()})
* <p>
* A magnitude of zero shall equal {@link #isIdentity() identity},
* as performed by {@link #normalize()}.
* </p>
* <p>
* Implementation Details:
* <ul>
* <li> returns 0f if {@link #magnitudeSquared()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
* <li> returns 1f if {@link #magnitudeSquared()} is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
*/
public final float magnitude() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isZero(magnitudeSQ, FloatUtil.EPSILON) ) {
return 0f;
}
if ( FloatUtil.isEqual(1f, magnitudeSQ, FloatUtil.EPSILON) ) {
return 1f;
}
return FloatUtil.sqrt(magnitudeSQ);
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Return the magnitude of this quaternion, i.e. sqrt({@link #magnitude()})
* <p>
* A magnitude of zero shall equal {@link #isIdentity() identity},
* as performed by {@link #normalize()}.
* </p>
* <p>
* Implementation Details:
* <ul>
* <li> returns 0f if {@link #magnitudeSquared()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
* <li> returns 1f if {@link #magnitudeSquared()} is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
*/
public final float magnitude() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isZero(magnitudeSQ, FloatUtil.EPSILON) ) {
return 0f;
}
if ( FloatUtil.isEqual(1f, magnitudeSQ, FloatUtil.EPSILON) ) {
return 1f;
}
return FloatUtil.sqrt(magnitudeSQ);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/**
* Return the magnitude of this quaternion, i.e. sqrt({@link #magnitude()})
* <p>
* A magnitude of zero shall equal {@link #isIdentity() identity},
* as performed by {@link #normalize()}.
* </p>
* <p>
* Implementation Details:
* <ul>
* <li> returns 0f if {@link #magnitudeSquared()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
* <li> returns 1f if {@link #magnitudeSquared()} is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
* </ul>
* </p>
*/
public final float magnitude() {
final float magnitudeSQ = magnitudeSquared();
if ( FloatUtil.isZero(magnitudeSQ, FloatUtil.EPSILON) ) {
return 0f;
}
if ( FloatUtil.isEqual(1f, magnitudeSQ, FloatUtil.EPSILON) ) {
return 1f;
}
return FloatUtil.sqrt(magnitudeSQ);
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
final float norm = magnitudeSquared();
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
代码示例来源:origin: org.jogamp.jogl/jogl
final float norm = magnitudeSquared();
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
final float norm = magnitudeSquared();
if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
内容来源于网络,如有侵权,请联系作者删除!