本文整理汇总了Java中com.jme3.math.Quaternion.getY方法的典型用法代码示例。如果您正苦于以下问题:Java Quaternion.getY方法的具体用法?Java Quaternion.getY怎么用?Java Quaternion.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.Quaternion
的用法示例。
在下文中一共展示了Quaternion.getY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAsString
import com.jme3.math.Quaternion; //导入方法依赖的package包/类
/**
* 将目标对象转换为字符串形式
* @param value
* @return
*/
public final static String getAsString(Object value) {
if (value == null)
return null;
if (value instanceof String) {
return (String) value;
} else if (value instanceof Vector2f) {
Vector2f v2 = (Vector2f) value;
return v2.x + "," + v2.y;
} else if (value instanceof Vector3f) {
Vector3f v3 = (Vector3f) value;
return v3.x + "," + v3.y + "," + v3.z;
} else if (value instanceof Vector4f) {
Vector4f v4 = (Vector4f) value;
return v4.x + "," + v4.y + "," + v4.z + "," + v4.w;
} else if (value instanceof Quaternion) {
Quaternion q4 = (Quaternion) value;
return q4.getX() + "," + q4.getY() + "," + q4.getZ() + "," + q4.getW();
} else if (value instanceof ColorRGBA) {
ColorRGBA c4 = (ColorRGBA) value;
return c4.r + "," + c4.g + "," + c4.b + "," + c4.a;
}
return value.toString();
}
示例2: serialize
import com.jme3.math.Quaternion; //导入方法依赖的package包/类
@Override
protected void serialize(int i, Quaternion store) {
int j = i * getTupleSize();
array[j] = store.getX();
array[j + 1] = store.getY();
array[j + 2] = store.getZ();
array[j + 3] = store.getW();
}
示例3: getValueAsString
import com.jme3.math.Quaternion; //导入方法依赖的package包/类
/**
* Returns the material parameter value as it would appear in a J3M
* file. E.g.<br/>
* <code>
* MaterialParameters {<br/>
* ABC : 1 2 3 4<br/>
* }<br/>
* </code>
* Assuming "ABC" is a Vector4 parameter, then the value
* "1 2 3 4" would be returned by this method.
* <br/><br/>
* @return material parameter value as it would appear in a J3M file.
*/
public String getValueAsString() {
switch (type) {
case Boolean:
case Float:
case Int:
return value.toString();
case Vector2:
Vector2f v2 = (Vector2f) value;
return v2.getX() + " " + v2.getY();
case Vector3:
Vector3f v3 = (Vector3f) value;
return v3.getX() + " " + v3.getY() + " " + v3.getZ();
case Vector4:
// can be either ColorRGBA, Vector4f or Quaternion
if (value instanceof Vector4f) {
Vector4f v4 = (Vector4f) value;
return v4.getX() + " " + v4.getY() + " "
+ v4.getZ() + " " + v4.getW();
} else if (value instanceof ColorRGBA) {
ColorRGBA color = (ColorRGBA) value;
return color.getRed() + " " + color.getGreen() + " "
+ color.getBlue() + " " + color.getAlpha();
} else if (value instanceof Quaternion) {
Quaternion quat = (Quaternion) value;
return quat.getX() + " " + quat.getY() + " "
+ quat.getZ() + " " + quat.getW();
} else {
throw new UnsupportedOperationException("Unexpected Vector4 type: " + value);
}
case Texture2D:
case Texture3D:
case TextureArray:
case TextureBuffer:
case TextureCubeMap:
Texture texVal = (Texture) value;
TextureKey texKey = (TextureKey) texVal.getKey();
String ret = "";
if (texKey.isFlipY()) {
ret += "Flip ";
}
if (texVal.getWrap(Texture.WrapAxis.S) == WrapMode.Repeat) {
ret += "Repeat ";
}
return ret + texKey.getName();
default:
return null; // parameter type not supported in J3M
}
}