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


Java Vector3f.set方法代码示例

本文整理汇总了Java中org.lwjgl.util.vector.Vector3f.set方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3f.set方法的具体用法?Java Vector3f.set怎么用?Java Vector3f.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.util.vector.Vector3f的用法示例。


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

示例1: rotateScale

import org.lwjgl.util.vector.Vector3f; //导入方法依赖的package包/类
private void rotateScale(Vector3f position, Vector3f rotationOrigin, Matrix4f rotationMatrix, Vector3f scale)
{
    Vector4f vector4f = new Vector4f(position.x - rotationOrigin.x, position.y - rotationOrigin.y, position.z - rotationOrigin.z, 1.0F);
    Matrix4f.transform(rotationMatrix, vector4f, vector4f);
    vector4f.x *= scale.x;
    vector4f.y *= scale.y;
    vector4f.z *= scale.z;
    position.set(vector4f.x + rotationOrigin.x, vector4f.y + rotationOrigin.y, vector4f.z + rotationOrigin.z);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:FaceBakery.java

示例2: func_178407_a

import org.lwjgl.util.vector.Vector3f; //导入方法依赖的package包/类
private void func_178407_a(Vector3f p_178407_1_, BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (partRotation.axis)
        {
            case X:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;

            case Y:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;

            case Z:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(field_178418_a);
            }
            else
            {
                vector3f.scale(field_178417_b);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:46,代码来源:FaceBakery.java

示例3: func_178407_a

import org.lwjgl.util.vector.Vector3f; //导入方法依赖的package包/类
private void func_178407_a(Vector3f p_178407_1_, BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (FaceBakery.FaceBakery$1.field_178399_b[partRotation.axis.ordinal()])
        {
            case 1:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;

            case 2:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;

            case 3:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(field_178418_a);
            }
            else
            {
                vector3f.scale(field_178417_b);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:46,代码来源:FaceBakery.java

示例4: rotatePart

import org.lwjgl.util.vector.Vector3f; //导入方法依赖的package包/类
private void rotatePart(Vector3f p_178407_1_, @Nullable BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (partRotation.axis)
        {
            case X:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;

            case Y:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;

            case Z:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(SCALE_ROTATION_22_5);
            }
            else
            {
                vector3f.scale(SCALE_ROTATION_GENERAL);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:46,代码来源:FaceBakery.java

示例5: rotatePart

import org.lwjgl.util.vector.Vector3f; //导入方法依赖的package包/类
private void rotatePart(Vector3f p_178407_1_, @Nullable BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (partRotation.axis)
        {
            case X:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;
            case Y:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;
            case Z:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(SCALE_ROTATION_22_5);
            }
            else
            {
                vector3f.scale(SCALE_ROTATION_GENERAL);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:FaceBakery.java


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