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

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

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

Transform.applyInverse介绍

[英]Locally applies the inverse of this transform to the given point: P' = M^{-1}(P-T)
[中]局部地将此变换的逆应用于给定点:P'=M^{-1}
(P-T)

代码示例

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

/**
 * Convert a vector (in) from world coordinate space to this spatial's local coordinate space.
 *
 * @param in
 *            vector to read from
 * @param store
 *            where to write the result (null to create a new vector, may be same as in)
 * @return the result (store)
 */
public Vector3 worldToLocal(final ReadOnlyVector3 in, Vector3 store) {
  if (store == null) {
    store = new Vector3();
  }
  return _worldTransform.applyInverse(in, store);
}

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

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

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

/**
 * Convert a vector (in) from world coordinate space to this spatial's local coordinate space.
 * 
 * @param in
 *            vector to read from
 * @param store
 *            where to write the result (null to create a new vector, may be same as in)
 * @return the result (store)
 */
public Vector3 worldToLocal(final ReadOnlyVector3 in, Vector3 store) {
  if (store == null) {
    store = new Vector3();
  }
  return _worldTransform.applyInverse(in, store);
}

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

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

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

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

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

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

相关文章