本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}