本文整理汇总了Java中com.ra4king.opengl.util.math.Vector3.y方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3.y方法的具体用法?Java Vector3.y怎么用?Java Vector3.y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ra4king.opengl.util.math.Vector3
的用法示例。
在下文中一共展示了Vector3.y方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: offsetOrientation
import com.ra4king.opengl.util.math.Vector3; //导入方法依赖的package包/类
private void offsetOrientation(Vector3 axis, float angle) {
angle = angle * (float)Math.PI / 180;
axis.normalize().mult((float)Math.sin(angle / 2));
Quaternion offset = new Quaternion(axis.x(), axis.y(), axis.z(), (float)Math.cos(angle / 2));
switch(offsetRelative) {
case MODEL_RELATIVE:
orientation.mult(offset);
break;
case WORLD_RELATIVE:
orientation = offset.mult(orientation);
break;
case CAMERA_RELATIVE:
Matrix4 camMat = calcLookAtMatrix(resolveCamPosition(), camTarget, new Vector3(0, 1, 0));
Quaternion viewQuat = camMat.toQuaternion();
orientation = new Quaternion(viewQuat).conjugate().mult(offset).mult(viewQuat).mult(orientation);
break;
}
orientation.normalize();
}
示例2: parseVector3
import com.ra4king.opengl.util.math.Vector3; //导入方法依赖的package包/类
@CopyStruct
public static Vector3 parseVector3(String s) throws NumberFormatException {
String[] comp = StringUtil.split(s, ' ');
if(comp.length != 3)
throw new IllegalArgumentException("invalid Vector3");
Vector3 vec = new Vector3();
vec.x(Float.parseFloat(comp[0]));
vec.y(Float.parseFloat(comp[1]));
vec.z(Float.parseFloat(comp[2]));
return vec;
}
示例3: offsetOrientation
import com.ra4king.opengl.util.math.Vector3; //导入方法依赖的package包/类
private void offsetOrientation(Vector3 axis, float angle) {
angle = angle * (float)Math.PI / 180;
axis.normalize().mult((float)Math.sin(angle / 2));
Quaternion offset = new Quaternion(axis.x(), axis.y(), axis.z(), (float)Math.cos(angle / 2));
if(rightMultiply)
orientation = orientation.mult(offset);
else
orientation = offset.mult(orientation);
orientation.normalize();
}
示例4: parseVector3
import com.ra4king.opengl.util.math.Vector3; //导入方法依赖的package包/类
public static Vector3 parseVector3(String s) throws NumberFormatException {
String[] comp = StringUtil.split(s, ' ');
if(comp.length != 3)
throw new IllegalArgumentException("invalid Vector3");
Vector3 vec = new Vector3();
vec.x(Float.parseFloat(comp[0]));
vec.y(Float.parseFloat(comp[1]));
vec.z(Float.parseFloat(comp[2]));
return vec;
}