本文整理汇总了Java中org.rajawali3d.math.Quaternion.conjugate方法的典型用法代码示例。如果您正苦于以下问题:Java Quaternion.conjugate方法的具体用法?Java Quaternion.conjugate怎么用?Java Quaternion.conjugate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rajawali3d.math.Quaternion
的用法示例。
在下文中一共展示了Quaternion.conjugate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matrixToTangoPose
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Converts a transform in Matrix4 format to TangoPoseData.
*/
public static TangoPoseData matrixToTangoPose(Matrix4 transform) {
// Get translation and rotation components from the transformation matrix
Vector3 p = transform.getTranslation();
Quaternion q = new Quaternion();
q.fromMatrix(transform);
// NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention
q.conjugate();
TangoPoseData tangoPose = new TangoPoseData();
double[] t = tangoPose.translation = new double[3];
t[0] = p.x;
t[1] = p.y;
t[2] = p.z;
double[] r = tangoPose.rotation = new double[4];
r[0] = q.x;
r[1] = q.y;
r[2] = q.z;
r[3] = q.w;
return tangoPose;
}
示例2: transform
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Transforms this {@link Vector3} using the given {@link Quaternion}.
*
* @param quat {@link Vector3} The {@link Vector3} to transform.
*
* @return {@link Vector3} The transformed {@link Vector3}. This is the same as the parameter quat.
*/
public Vector3 transform(Quaternion quat) {
Quaternion tmp = new Quaternion(quat);
Quaternion tmp2 = new Quaternion(0, x, y, z);
tmp.conjugate();
tmp.multiplyLeft(tmp2.multiplyLeft(quat));
return setAll(tmp.x, tmp.y, tmp.z);
}
示例3: tangoPoseToMatrix
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Converts from TangoPoseData to a Matrix4 for transformations.
*/
public static Matrix4 tangoPoseToMatrix(TangoPoseData tangoPose) {
Vector3 v = new Vector3(tangoPose.translation[0],
tangoPose.translation[1], tangoPose.translation[2]);
Quaternion q = new Quaternion(tangoPose.rotation[3], tangoPose.rotation[0],
tangoPose.rotation[1], tangoPose.rotation[2]);
// NOTE: Rajawali quaternions use a left-hand rotation around the axis convention.
q.conjugate();
Matrix4 m = new Matrix4();
m.setAll(v, new Vector3(1, 1, 1), q);
return m;
}
示例4: matrixToPose
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Helper method to extract a Pose object from a transformation matrix taking into account
* Rajawali conventions.
*/
public static Pose matrixToPose(Matrix4 m) {
// Get translation and rotation components from the transformation matrix.
Vector3 p = m.getTranslation();
Quaternion q = new Quaternion();
q.fromMatrix(m);
// NOTE: Rajawali quaternions use a left-hand rotation around the axis convention.
q.conjugate();
return new Pose(p, q);
}
示例5: tangoPoseToMatrix
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Converts from TangoPoseData to a Matrix4 for transformations.
*/
public static Matrix4 tangoPoseToMatrix(TangoPoseData tangoPose) {
Vector3 v = new Vector3(tangoPose.translation[0],
tangoPose.translation[1], tangoPose.translation[2]);
Quaternion q = new Quaternion(tangoPose.rotation[3], tangoPose.rotation[0],
tangoPose.rotation[1], tangoPose.rotation[2]);
// NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention
q.conjugate();
Matrix4 m = new Matrix4();
m.setAll(v, new Vector3(1, 1, 1), q);
return m;
}
示例6: matrixToPose
import org.rajawali3d.math.Quaternion; //导入方法依赖的package包/类
/**
* Helper method to extract a Pose object from a transformation matrix taking into account
* Rajawali conventions.
*/
public static Pose matrixToPose(Matrix4 m) {
// Get translation and rotation components from the transformation matrix
Vector3 p = m.getTranslation();
Quaternion q = new Quaternion();
q.fromMatrix(m);
// NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention
q.conjugate();
return new Pose(p, q);
}