• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Vector2f类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: registerSerializers

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

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public Model createPlane(Addon addon, String programName, UniformHolder uniforms, Vector2f size) throws IOException {
    // Generate the plane
    final VertexData data = MeshGenerator.generatePlane(size);
    final VertexArray array = context.newVertexArray();
    array.create();
    array.setData(data);

    // Grab the program
    Program program = loadProgram(addon, programName);

    // Create a material for it
    final Material material = new Material(program);
    material.getUniforms().addAll(uniforms);

    return new Model(array, material);
}
 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:17,代码来源:Renderer.java


示例3: Button

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public Button(Form form, String name, int x, int y, String text, Font font, int width, int height) {
    super(form, name, x, y, text, font);

    final Model backgroundModel;
    final StringModel stringModel;
    try {
        backgroundModel = form.getAddon().getGame().getGuiRenderer().createColoredPlane(form.getAddon(), "basic", backgroundUniforms, Colors.BLUE.getValue(), new Vector2f(width, height));
        stringModel = form.getAddon().getGame().getGuiRenderer().createString(form.getAddon(), "font", text, font, StringModel.AntiAliasing.ON, Font.PLAIN, 12);
    } catch (Exception e) {
        // Should NEVER get here as font is provided by the mod
        throw new RuntimeException(e);
    }

    models.add(backgroundModel);
    models.add(stringModel);
}
 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:17,代码来源:Button.java


示例4: createTexturedPlane

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
@Override
public Model createTexturedPlane(Addon addon, String programName, UniformHolder holder, Texture diffuse, Texture normal, Texture specular, Vector2f size) throws IOException {
    // We ignore normal and specular for the GUI
    if (diffuse == null) {
        throw new IOException(addon.getDescription().getName() + " attempted to texture a plane with a null diffuse!");
    }

    // Generate the plane
    final VertexData data = MeshGenerator.generatePlane(size);
    final VertexArray array = context.newVertexArray();
    array.create();
    array.setData(data);

    // Grab the textured program
    final Program program = loadProgram(((CommonAddonManager) game.getAddonManager()).getInternalAddon(), programName);

    // Create a material for it
    final Material material = new Material(program);
    if (holder != null) {
        material.getUniforms().addAll(holder);
    }
    material.addTexture(0, diffuse);

    final Model model = new Model(array, material);
    final float aspect = diffuse.getWidth() / (float) diffuse.getHeight();
    model.setScale(new Vector3f(aspect, 1, 1));
    return model;
}
 
开发者ID:ObsidianBox,项目名称:Obsidian,代码行数:29,代码来源:GuiRenderer.java


示例5: serialize

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


示例6: deserialize2f

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


示例7: translate

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


示例8: createColoredPlane

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public Model createColoredPlane(Addon addon, String programName, UniformHolder holder, Color color, Vector2f size) throws IOException {
    holder.add(new Uniform.Vector4Uniform("inputColor", color.asFloatVector()));

    return createPlane(addon, programName, holder, size);
}
 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:6,代码来源:Renderer.java


示例9: getDisplaySize

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public Vector2f getDisplaySize() {
    return displaySize;
}
 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:4,代码来源:Renderer.java


示例10: renderString

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public void renderString(String string, Vector2f position) {
    nvgFontFaceId(this.nvgHandle, this.fontMem);
    nvgFontSize(this.nvgHandle, this.data.getFontSize());
    nvgTextBox(this.nvgHandle, position.getX(), position.getY(), 1e5f, string, MemoryUtil.NULL);
}
 
开发者ID:TechShroom,项目名称:EmergencyLanding,代码行数:6,代码来源:StringRenderer.java


示例11: createTexturedPlane

import com.flowpowered.math.vector.Vector2f; //导入依赖的package包/类
public abstract Model createTexturedPlane(Addon addon, String programName, UniformHolder holder, Texture diffuse, Texture normal, Texture specular, Vector2f size) throws IOException; 
开发者ID:ObsidianBox,项目名称:Magma,代码行数:2,代码来源:Renderer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowLayout类代码示例发布时间:2022-05-22
下一篇:
Java HttpRequestEntity类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap