本文整理汇总了Java中com.flowpowered.math.imaginary.Quaternionf类的典型用法代码示例。如果您正苦于以下问题:Java Quaternionf类的具体用法?Java Quaternionf怎么用?Java Quaternionf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Quaternionf类属于com.flowpowered.math.imaginary包,在下文中一共展示了Quaternionf类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerSerializers
import com.flowpowered.math.imaginary.Quaternionf; //导入依赖的package包/类
public static void registerSerializers(DataManager dataManager) {
dataManager.registerTranslator(UUID.class, UUID_DATA_SERIALIZER);
dataManager.registerTranslator(Vector2d.class, VECTOR_2_D_DATA_SERIALIZER);
dataManager.registerTranslator(Vector2f.class, VECTOR_2_F_DATA_SERIALIZER);
dataManager.registerTranslator(Vector2i.class, VECTOR_2_I_DATA_SERIALIZER);
dataManager.registerTranslator(Vector2l.class, VECTOR_2_L_DATA_SERIALIZER);
dataManager.registerTranslator(Vector3d.class, VECTOR_3_D_DATA_SERIALIZER);
dataManager.registerTranslator(Vector3f.class, VECTOR_3_F_DATA_SERIALIZER);
dataManager.registerTranslator(Vector3i.class, VECTOR_3_I_DATA_SERIALIZER);
dataManager.registerTranslator(Vector3l.class, VECTOR_3_L_DATA_SERIALIZER);
dataManager.registerTranslator(Vector4d.class, VECTOR_4_D_DATA_SERIALIZER);
dataManager.registerTranslator(Vector4f.class, VECTOR_4_F_DATA_SERIALIZER);
dataManager.registerTranslator(Vector4i.class, VECTOR_4_I_DATA_SERIALIZER);
dataManager.registerTranslator(Vector4l.class, VECTOR_4_L_DATA_SERIALIZER);
dataManager.registerTranslator(Complexd.class, COMPLEXD_DATA_SERIALIZER);
dataManager.registerTranslator(Complexf.class, COMPLEXF_DATA_SERIALIZER);
dataManager.registerTranslator(Quaterniond.class, QUATERNIOND_DATA_SERIALIZER);
dataManager.registerTranslator(Quaternionf.class, QUATERNIONF_DATA_SERIALIZER);
dataManager.registerTranslator(LocalTime.class, LOCAL_TIME_DATA_SERIALIZER);
dataManager.registerTranslator(LocalDate.class, LOCAL_DATE_DATA_SERIALIZER);
dataManager.registerTranslator(LocalDateTime.class, LOCAL_DATE_TIME_DATA_SERIALIZER);
dataManager.registerTranslator(ZonedDateTime.class, ZONED_DATE_TIME_DATA_SERIALIZER);
dataManager.registerTranslator(Instant.class, INSTANT_DATA_SERIALIZER);
dataManager.registerTranslator(Month.class, MONTH_DATA_SERIALIZER);
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:26,代码来源:DataTranslators.java
示例2: translate
import com.flowpowered.math.imaginary.Quaternionf; //导入依赖的package包/类
@Override
public Quaternionf translate(DataView view) throws InvalidDataException {
final double x = view.getDouble(DataQueries.X_POS).orElseThrow(invalidDataQuery(DataQueries.X_POS));
final double y = view.getDouble(DataQueries.Y_POS).orElseThrow(invalidDataQuery(DataQueries.Y_POS));
final double z = view.getDouble(DataQueries.Z_POS).orElseThrow(invalidDataQuery(DataQueries.Z_POS));
final double w = view.getDouble(DataQueries.W_POS).orElseThrow(invalidDataQuery(DataQueries.W_POS));
return new Quaternionf(x, y, z, w);
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:DataTranslators.java
示例3: createRotMatrix
import com.flowpowered.math.imaginary.Quaternionf; //导入依赖的package包/类
public static Matrix4f createRotMatrix(double theta, Axis axis) {
return Matrix4f.createRotation(Quaternionf.fromAngleDegAxis(theta, axis.unitVector));
}
开发者ID:TechShroom,项目名称:EmergencyLanding,代码行数:4,代码来源:Maths.java
示例4: fromAxesAnglesDeg
import com.flowpowered.math.imaginary.Quaternionf; //导入依赖的package包/类
/**
* Creates a new quaternion from the float angles in degrees around the x, y and z axes.
*
* @param vector3f The rotation vector
* @return The quaternion defined by the rotations around the axes
*/
public static Quaternionf fromAxesAnglesDeg(Vector3f vector3f) {
return Quaternionf.fromAxesAnglesDeg(vector3f.getX(), vector3f.getY(), vector3f.getZ());
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:10,代码来源:Quaternions.java
注:本文中的com.flowpowered.math.imaginary.Quaternionf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论