本文整理了Java中com.jogamp.opengl.math.Quaternion.set
方法的一些代码示例,展示了Quaternion.set
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quaternion.set
方法的具体详情如下:
包路径:com.jogamp.opengl.math.Quaternion
类名称:Quaternion
方法名:set
[英]Set all values of this quaternion using the given components.
[中]
代码示例来源:origin: net.clearvolume/cleargl
public void setCurrent(Quaternion pQuaternion) {
mCurrentQuaternion.set(pQuaternion);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
public Quaternion(final Quaternion q) {
set(q);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
public Quaternion(final float x, final float y, final float z, final float w) {
set(x, y, z, w);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/**
* Multiply this quaternion by the param quaternion
*
* @param q a quaternion to multiply with
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q53">Matrix-FAQ Q53</a>
* @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#mul">euclideanspace.com-QuaternionMul</a>
*/
public final Quaternion mult(final Quaternion q) {
return set( w * q.x + x * q.w + y * q.z - z * q.y,
w * q.y - x * q.z + y * q.w + z * q.x,
w * q.z + x * q.y - y * q.x + z * q.w,
w * q.w - x * q.x - y * q.y - z * q.z );
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
public Quaternion(final float x, final float y, final float z, final float w) {
set(x, y, z, w);
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
public Quaternion(final Quaternion q) {
set(q);
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Multiply this quaternion by the param quaternion
*
* @param q a quaternion to multiply with
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q53">Matrix-FAQ Q53</a>
* @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#mul">euclideanspace.com-QuaternionMul</a>
*/
public final Quaternion mult(final Quaternion q) {
return set( w * q.x + x * q.w + y * q.z - z * q.y,
w * q.y - x * q.z + y * q.w + z * q.x,
w * q.z + x * q.y - y * q.x + z * q.w,
w * q.w - x * q.x - y * q.y - z * q.z );
}
代码示例来源:origin: org.jogamp.jogl/jogl
public Quaternion(final float x, final float y, final float z, final float w) {
set(x, y, z, w);
}
代码示例来源:origin: org.jogamp.jogl/jogl
public Quaternion(final Quaternion q) {
set(q);
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Multiply this quaternion by the param quaternion
*
* @param q a quaternion to multiply with
* @return this quaternion for chaining.
* @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q53">Matrix-FAQ Q53</a>
* @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#mul">euclideanspace.com-QuaternionMul</a>
*/
public final Quaternion mult(final Quaternion q) {
return set( w * q.x + x * q.w + y * q.z - z * q.y,
w * q.y - x * q.z + y * q.w + z * q.x,
w * q.z + x * q.y - y * q.x + z * q.w,
w * q.w - x * q.x - y * q.y - z * q.z );
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/** Set position and orientation of this instance. */
public final void set(final float[] position, final Quaternion orientation) {
System.arraycopy(position, 0, this.position, 0, 3);
this.orientation.set(orientation);
}
/** Set position and orientation of this instance. */
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/** Set {@link #position} and {@link #orientation}. */
public final void set(final float[] position, final Quaternion orientation) {
System.arraycopy(position, 0, this.position, 0, 3);
this.orientation.set(orientation);
}
/** Set position and orientation of this instance. */
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Rotate this quaternion around Y axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleY(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos - z * sin,
y * cos + w * sin,
x * sin + z * cos,
-y * sin + w * cos);
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Rotate this quaternion around Z axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleZ(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + y * sin,
-x * sin + y * cos,
z * cos + w * sin,
-z * sin + w * cos);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/**
* Rotate this quaternion around Z axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleZ(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + y * sin,
-x * sin + y * cos,
z * cos + w * sin,
-z * sin + w * cos);
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Rotate this quaternion around X axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleX(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + w * sin,
y * cos + z * sin,
-y * sin + z * cos,
-x * sin + w * cos);
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
/**
* Rotate this quaternion around Z axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleZ(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + y * sin,
-x * sin + y * cos,
z * cos + w * sin,
-z * sin + w * cos);
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Rotate this quaternion around X axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleX(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + w * sin,
y * cos + z * sin,
-y * sin + z * cos,
-x * sin + w * cos);
}
代码示例来源:origin: org.jogamp.jogl/jogl
/**
* Rotate this quaternion around Y axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleY(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos - z * sin,
y * cos + w * sin,
x * sin + z * cos,
-y * sin + w * cos);
}
代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt
/**
* Rotate this quaternion around X axis with the given angle in radians
*
* @param angle in radians
* @return this quaternion for chaining.
*/
public Quaternion rotateByAngleX(final float angle) {
final float halfAngle = 0.5f * angle;
final float sin = FloatUtil.sin(halfAngle);
final float cos = FloatUtil.cos(halfAngle);
return set( x * cos + w * sin,
y * cos + z * sin,
-y * sin + z * cos,
-x * sin + w * cos);
}
内容来源于网络,如有侵权,请联系作者删除!