當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector3f.scale方法代碼示例

本文整理匯總了Java中org.lwjgl.util.vector.Vector3f.scale方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3f.scale方法的具體用法?Java Vector3f.scale怎麽用?Java Vector3f.scale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.util.vector.Vector3f的用法示例。


在下文中一共展示了Vector3f.scale方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseRotation

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
private BlockPartRotation parseRotation(JsonObject p_178256_1_)
{
    BlockPartRotation blockpartrotation = null;

    if (p_178256_1_.has("rotation"))
    {
        JsonObject jsonobject = JsonUtils.getJsonObject(p_178256_1_, "rotation");
        Vector3f vector3f = this.parsePosition(jsonobject, "origin");
        vector3f.scale(0.0625F);
        EnumFacing.Axis enumfacing$axis = this.parseAxis(jsonobject);
        float f = this.parseAngle(jsonobject);
        boolean flag = JsonUtils.getBoolean(jsonobject, "rescale", false);
        blockpartrotation = new BlockPartRotation(vector3f, enumfacing$axis, f, flag);
    }

    return blockpartrotation;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:18,代碼來源:BlockPart.java

示例2: parseRotation

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
@Nullable
private BlockPartRotation parseRotation(JsonObject object)
{
    BlockPartRotation blockpartrotation = null;

    if (object.has("rotation"))
    {
        JsonObject jsonobject = JsonUtils.getJsonObject(object, "rotation");
        Vector3f vector3f = this.parsePosition(jsonobject, "origin");
        vector3f.scale(0.0625F);
        EnumFacing.Axis enumfacing$axis = this.parseAxis(jsonobject);
        float f = this.parseAngle(jsonobject);
        boolean flag = JsonUtils.getBoolean(jsonobject, "rescale", false);
        blockpartrotation = new BlockPartRotation(vector3f, enumfacing$axis, f, flag);
    }

    return blockpartrotation;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:19,代碼來源:BlockPart.java

示例3: move

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
/**
    * Moves the camera in the specified direction by the specified distance
    * @param direction The direction to move in world space
    * @param distance The distance to move in world space
    */
   public void move(Vector3f direction, float distance) {
// Create a copy of the direction to avoid modifying the original TODO: fix temp
Vector3f deltaMovement = new Vector3f(direction);

// Scale the direction to be the length of the specified distance
deltaMovement.normalise();
deltaMovement.scale(distance);

// Add the movement to the camera's position
Vector3f.add(position, deltaMovement, position);
   }
 
開發者ID:camilne,項目名稱:open-world,代碼行數:17,代碼來源:Camera.java

示例4: deserialize

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
public ItemTransformVec3f deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
    JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
    Vector3f vector3f = this.parseVector3f(jsonobject, "rotation", ROTATION_DEFAULT);
    Vector3f vector3f1 = this.parseVector3f(jsonobject, "translation", TRANSLATION_DEFAULT);
    vector3f1.scale(0.0625F);
    vector3f1.x = MathHelper.clamp_float(vector3f1.x, -1.5F, 1.5F);
    vector3f1.y = MathHelper.clamp_float(vector3f1.y, -1.5F, 1.5F);
    vector3f1.z = MathHelper.clamp_float(vector3f1.z, -1.5F, 1.5F);
    Vector3f vector3f2 = this.parseVector3f(jsonobject, "scale", SCALE_DEFAULT);
    vector3f2.x = MathHelper.clamp_float(vector3f2.x, -4.0F, 4.0F);
    vector3f2.y = MathHelper.clamp_float(vector3f2.y, -4.0F, 4.0F);
    vector3f2.z = MathHelper.clamp_float(vector3f2.z, -4.0F, 4.0F);
    return new ItemTransformVec3f(vector3f, vector3f1, vector3f2);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:16,代碼來源:ItemTransformVec3f.java

示例5: deserialize

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
public ItemTransformVec3f deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
    JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
    Vector3f vector3f = this.parseVector3f(jsonobject, "rotation", ROTATION_DEFAULT);
    Vector3f vector3f1 = this.parseVector3f(jsonobject, "translation", TRANSLATION_DEFAULT);
    vector3f1.scale(0.0625F);
    vector3f1.x = MathHelper.clamp(vector3f1.x, -5.0F, 5.0F);
    vector3f1.y = MathHelper.clamp(vector3f1.y, -5.0F, 5.0F);
    vector3f1.z = MathHelper.clamp(vector3f1.z, -5.0F, 5.0F);
    Vector3f vector3f2 = this.parseVector3f(jsonobject, "scale", SCALE_DEFAULT);
    vector3f2.x = MathHelper.clamp(vector3f2.x, -4.0F, 4.0F);
    vector3f2.y = MathHelper.clamp(vector3f2.y, -4.0F, 4.0F);
    vector3f2.z = MathHelper.clamp(vector3f2.z, -4.0F, 4.0F);
    return new ItemTransformVec3f(vector3f, vector3f1, vector3f2);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:16,代碼來源:ItemTransformVec3f.java

示例6: deserialize

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
public ItemTransformVec3f deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
    JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
    Vector3f vector3f = this.parseVector3f(jsonobject, "rotation", ROTATION_DEFAULT);
    Vector3f vector3f1 = this.parseVector3f(jsonobject, "translation", TRANSLATION_DEFAULT);
    vector3f1.scale(0.0625F);
    vector3f1.x = MathHelper.clamp_float(vector3f1.x, -5.0F, 5.0F);
    vector3f1.y = MathHelper.clamp_float(vector3f1.y, -5.0F, 5.0F);
    vector3f1.z = MathHelper.clamp_float(vector3f1.z, -5.0F, 5.0F);
    Vector3f vector3f2 = this.parseVector3f(jsonobject, "scale", SCALE_DEFAULT);
    vector3f2.x = MathHelper.clamp_float(vector3f2.x, -4.0F, 4.0F);
    vector3f2.y = MathHelper.clamp_float(vector3f2.y, -4.0F, 4.0F);
    vector3f2.z = MathHelper.clamp_float(vector3f2.z, -4.0F, 4.0F);
    return new ItemTransformVec3f(vector3f, vector3f1, vector3f2);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:16,代碼來源:ItemTransformVec3f.java

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: getWorldPosition

import org.lwjgl.util.vector.Vector3f; //導入方法依賴的package包/類
/**
 * Calculates a position for the sun, based on the light direction. The
 * distance of the sun from the camera is fairly arbitrary, although care
 * should be taken to ensure it doesn't get rendered outside the skybox.
 * 
 * @param camPos - The camera's position.
 * @return The 3D world position of the sun.
 */
public Vector3f getWorldPosition(Vector3f camPos) {
	Vector3f sunPos = new Vector3f(lightDirection);
	sunPos.negate();
	sunPos.scale(SUN_DIS);
	return Vector3f.add(camPos, sunPos, null);
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:15,代碼來源:Sun.java


注:本文中的org.lwjgl.util.vector.Vector3f.scale方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。