本文整理汇总了Java中com.google.atap.tangoservice.TangoPoseData.getTranslationAsFloats方法的典型用法代码示例。如果您正苦于以下问题:Java TangoPoseData.getTranslationAsFloats方法的具体用法?Java TangoPoseData.getTranslationAsFloats怎么用?Java TangoPoseData.getTranslationAsFloats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.atap.tangoservice.TangoPoseData
的用法示例。
在下文中一共展示了TangoPoseData.getTranslationAsFloats方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRenderCameraPose
import com.google.atap.tangoservice.TangoPoseData; //导入方法依赖的package包/类
/**
* Update the scene camera based on the provided pose in Tango start of service frame.
* The camera pose should match the pose of the camera color at the time the last rendered RGB
* frame, which can be retrieved with this.getTimestamp();
* <p/>
* NOTE: This must be called from the OpenGL render thread - it is not thread safe.
*/
public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
// Conjugating the Quaternion is need because Rajawali uses left handed convention for
// quaternions.
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
}
示例2: logPose
import com.google.atap.tangoservice.TangoPoseData; //导入方法依赖的package包/类
/**
* Log the Position and Orientation of the given pose in the Logcat as information.
*
* @param pose the pose to log.
*/
private void logPose(TangoPoseData pose) {
StringBuilder stringBuilder = new StringBuilder();
float translation[] = pose.getTranslationAsFloats();
stringBuilder.append("Position: " +
translation[0] + ", " + translation[1] + ", " + translation[2]);
float orientation[] = pose.getRotationAsFloats();
stringBuilder.append(". Orientation: " +
orientation[0] + ", " + orientation[1] + ", " +
orientation[2] + ", " + orientation[3]);
Log.i(TAG, stringBuilder.toString());
}
示例3: coordinate
import com.google.atap.tangoservice.TangoPoseData; //导入方法依赖的package包/类
/**
*
* @param translation
* @return
*/
public static Coordinate coordinate(TangoPoseData tangoPoseData) {
float[] translation = tangoPoseData.getTranslationAsFloats();
return new Coordinate(translation[TangoPoseData.INDEX_TRANSLATION_X],
translation[TangoPoseData.INDEX_TRANSLATION_Y],
translation[TangoPoseData.INDEX_TRANSLATION_Z]);
}