com.jme3.math.Quaternion.loadIdentity()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中com.jme3.math.Quaternion.loadIdentity方法的一些代码示例,展示了Quaternion.loadIdentity的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quaternion.loadIdentity方法的具体详情如下:
包路径:com.jme3.math.Quaternion
类名称:Quaternion
方法名:loadIdentity

Quaternion.loadIdentity介绍

[英]Sets this Quaternion to {0, 0, 0, 1}. Same as calling set(0,0,0,1).
[中]将此四元数设置为{0,0,0,1}。与调用集(0,0,0,1)相同。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public Rotation() {
  rotation.loadIdentity();
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * <code>fromAngleNormalAxis</code> sets this quaternion to the values
 * specified by an angle and a normalized axis of rotation.
 *
 * @param angle
 *            the angle to rotate (in radians).
 * @param axis
 *            the axis of rotation (already normalized).
 */
public Quaternion fromAngleNormalAxis(float angle, Vector3f axis) {
  if (axis.x == 0 && axis.y == 0 && axis.z == 0) {
    loadIdentity();
  } else {
    float halfAngle = 0.5f * angle;
    float sin = FastMath.sin(halfAngle);
    w = FastMath.cos(halfAngle);
    x = sin * axis.x;
    y = sin * axis.y;
    z = sin * axis.z;
  }
  return this;
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

public Rotation() {
  rotation.loadIdentity();
}

代码示例来源:origin: info.projectkyoto/mms-engine

public Rotation() {
  rotation.loadIdentity();
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

/**
 * <code>fromAngleNormalAxis</code> sets this quaternion to the values
 * specified by an angle and a normalized axis of rotation.
 *
 * @param angle
 *            the angle to rotate (in radians).
 * @param axis
 *            the axis of rotation (already normalized).
 */
public Quaternion fromAngleNormalAxis(float angle, Vector3f axis) {
  if (axis.x == 0 && axis.y == 0 && axis.z == 0) {
    loadIdentity();
  } else {
    float halfAngle = 0.5f * angle;
    float sin = FastMath.sin(halfAngle);
    w = FastMath.cos(halfAngle);
    x = sin * axis.x;
    y = sin * axis.y;
    z = sin * axis.z;
  }
  return this;
}

代码示例来源:origin: info.projectkyoto/mms-engine

/**
 * <code>fromAngleNormalAxis</code> sets this quaternion to the values
 * specified by an angle and a normalized axis of rotation.
 *
 * @param angle
 *            the angle to rotate (in radians).
 * @param axis
 *            the axis of rotation (already normalized).
 */
public Quaternion fromAngleNormalAxis(float angle, Vector3f axis) {
  if (axis.x == 0 && axis.y == 0 && axis.z == 0) {
    loadIdentity();
  } else {
    float halfAngle = 0.5f * angle;
    float sin = FastMath.sin(halfAngle);
    w = FastMath.cos(halfAngle);
    x = sin * axis.x;
    y = sin * axis.y;
    z = sin * axis.z;
  }
  return this;
}

代码示例来源:origin: info.projectkyoto/mms-engine

bone.getLocalRotation().loadIdentity();

相关文章