当前位置: 首页>>代码示例>>Java>>正文


Java Vector4f类代码示例

本文整理汇总了Java中com.flowpowered.math.vector.Vector4f的典型用法代码示例。如果您正苦于以下问题:Java Vector4f类的具体用法?Java Vector4f怎么用?Java Vector4f使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector4f类属于com.flowpowered.math.vector包,在下文中一共展示了Vector4f类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerSerializers

import com.flowpowered.math.vector.Vector4f; //导入依赖的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: serialize

import com.flowpowered.math.vector.Vector4f; //导入依赖的package包/类
public static JsonObject serialize(Vector4f vector4f) {
    return JsonBuilder.object()
            .add("x", vector4f.getX())
            .add("y", vector4f.getY())
            .add("z", vector4f.getZ())
            .add("w", vector4f.getW())
            .build();
}
 
开发者ID:lucko,项目名称:helper,代码行数:9,代码来源:VectorSerializers.java

示例3: deserialize4f

import com.flowpowered.math.vector.Vector4f; //导入依赖的package包/类
public static Vector4f deserialize4f(JsonElement element) {
    return new Vector4f(
            element.getAsJsonObject().get("x").getAsFloat(),
            element.getAsJsonObject().get("y").getAsFloat(),
            element.getAsJsonObject().get("z").getAsFloat(),
            element.getAsJsonObject().get("w").getAsFloat()
    );
}
 
开发者ID:lucko,项目名称:helper,代码行数:9,代码来源:VectorSerializers.java

示例4: translate

import com.flowpowered.math.vector.Vector4f; //导入依赖的package包/类
@Override
public Vector4f 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 Vector4f(x, y, z, w);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:DataTranslators.java

示例5: asFloatVector

import com.flowpowered.math.vector.Vector4f; //导入依赖的package包/类
public Vector4f asFloatVector() {
    return new Vector4f(getX() * conversion, getY() * conversion, getZ() * conversion, getW() * conversion);
}
 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:4,代码来源:Color.java


注:本文中的com.flowpowered.math.vector.Vector4f类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。