com.ardor3d.math.Transform.applyInverseVector()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(126)

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

Transform.applyInverseVector介绍

[英]Locally applies the inverse of this transform to the given vector: V' = M^{-1}*V
[中]对给定向量局部应用此变换的逆:V'=M^{-1}*V

代码示例

代码示例来源:origin: Renanse/Ardor3D

/**
 * Applies the inverse of this transform to the given vector and returns the result in the given store vector: V' =
 * M^{-1}*V
 *
 * @param vector
 * @param store
 *            the vector to store our result in. if null, a new vector will be created.
 * @return the transformed vector.
 * @throws NullPointerException
 *             if vector is null.
 */
@Override
public Vector3 applyInverseVector(final ReadOnlyVector3 vector, final Vector3 store) {
  Vector3 result = store;
  if (result == null) {
    result = new Vector3();
  }
  result.set(vector);
  return applyInverseVector(result);
}

代码示例来源:origin: com.ardor3d/ardor3d-math

/**
 * Applies the inverse of this transform to the given vector and returns the result in the given store vector: V' =
 * M^{-1}*V
 * 
 * @param vector
 * @param store
 *            the vector to store our result in. if null, a new vector will be created.
 * @return the transformed vector.
 * @throws NullPointerException
 *             if vector is null.
 */
@Override
public Vector3 applyInverseVector(final ReadOnlyVector3 vector, final Vector3 store) {
  Vector3 result = store;
  if (result == null) {
    result = new Vector3();
  }
  result.set(vector);
  return applyInverseVector(result);
}

代码示例来源:origin: Renanse/Ardor3D

@Test(expected = NullPointerException.class)
public void testApplyFail4() {
  final Transform trans = new Transform();
  trans.applyInverseVector(null);
}

代码示例来源:origin: Renanse/Ardor3D

final Vector3 result4 = trans.applyInverseVector(vec3, null);
assertTrue(Math.abs(new Vector3(0, 1, -1).distance(result4)) <= MathUtils.EPSILON);
trans.applyInverseVector(vec3, result4);
assertTrue(Math.abs(new Vector3(0, 1, -1).distance(result4)) <= MathUtils.EPSILON);
trans.applyInverseVector(vec3);
assertTrue(Math.abs(new Vector3(0, 1, -1).distance(vec3)) <= MathUtils.EPSILON);
trans.applyInverseVector(vec3);
assertTrue(Math.abs(orig.distance(vec3)) <= 10 * MathUtils.EPSILON); // accumulated error
trans.applyInverse(vec3);
assertEquals(orig, vec3);
trans.applyInverseVector(vec3);
assertEquals(orig, vec3);

相关文章