本文整理了Java中com.ardor3d.math.Transform.applyForward()
方法的一些代码示例,展示了Transform.applyForward()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.applyForward()
方法的具体详情如下:
包路径:com.ardor3d.math.Transform
类名称:Transform
方法名:applyForward
[英]Locally applies this transform to the given point: P' = M*P+T
[中]
代码示例来源:origin: Renanse/Ardor3D
/**
* Convert a vector (in) from this spatial's local coordinate space to world 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 localToWorld(final ReadOnlyVector3 in, Vector3 store) {
if (store == null) {
store = new Vector3();
}
return _worldTransform.applyForward(in, store);
}
代码示例来源:origin: Renanse/Ardor3D
final Vector3 vec3 = new Vector3(0, 1, 0);
final Vector3 result = trans.applyForward(vec3, null);
assertTrue(Math.abs(new Vector3(1, 2, 4).distance(result)) <= MathUtils.EPSILON);
trans.applyForward(vec3, result);
assertTrue(Math.abs(new Vector3(1, 2, 4).distance(result)) <= MathUtils.EPSILON);
trans.applyForward(vec3);
assertTrue(Math.abs(new Vector3(1, 2, 4).distance(vec3)) <= MathUtils.EPSILON);
trans.applyForward(vec3);
trans.applyInverse(vec3);
assertTrue(Math.abs(orig.distance(vec3)) <= 10 * MathUtils.EPSILON); // accumulated error
trans.applyForward(vec3);
assertEquals(orig, vec3);
trans.applyForwardVector(vec3);
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Convert a vector (in) from this spatial's local coordinate space to world 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 localToWorld(final ReadOnlyVector3 in, Vector3 store) {
if (store == null) {
store = new Vector3();
}
return _worldTransform.applyForward(in, store);
}
代码示例来源:origin: com.ardor3d/ardor3d-math
/**
* Applies this transform to the given point and returns the result in the given store vector: P' = M*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 applyForward(final ReadOnlyVector3 point, final Vector3 store) {
Vector3 result = store;
if (result == null) {
result = new Vector3();
}
result.set(point);
return applyForward(result);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Applies this transform to the given point and returns the result in the given store vector: P' = M*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 applyForward(final ReadOnlyVector3 point, final Vector3 store) {
Vector3 result = store;
if (result == null) {
result = new Vector3();
}
result.set(point);
return applyForward(result);
}
代码示例来源:origin: Renanse/Ardor3D
public void transformVertices(final Transform transform) {
final FloatBuffer vertexBuffer = getVertexBuffer();
final Vector3 store = new Vector3();
for (int x = 0; x < _vertexCount; x++) {
BufferUtils.populateFromBuffer(store, vertexBuffer, x);
transform.applyForward(store, store);
BufferUtils.setInBuffer(store, vertexBuffer, x);
}
}
代码示例来源:origin: com.ardor3d/ardor3d-core
public void transformVertices(final Transform transform) {
final Vector3 store = new Vector3();
for (int x = 0; x < _vertexCount; x++) {
BufferUtils.populateFromBuffer(store, _vertexCoords.getBuffer(), x);
transform.applyForward(store, store);
BufferUtils.setInBuffer(store, _vertexCoords.getBuffer(), x);
}
}
代码示例来源:origin: Renanse/Ardor3D
@Test(expected = NullPointerException.class)
public void testApplyFail1() {
final Transform trans = new Transform();
trans.applyForward(null);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* translates/rotates and scales the vectors of this Mesh to world coordinates based on its world settings. The
* results are stored in the given FloatBuffer. If given FloatBuffer is null, one is created.
*
* @param store
* the FloatBuffer to store the results in, or null if you want one created.
* @return store or new FloatBuffer if store == null.
*/
public FloatBuffer getWorldVectors(FloatBuffer store) {
final FloatBuffer vertBuf = _meshData.getVertexBuffer();
if (store == null || store.capacity() != vertBuf.limit()) {
store = BufferUtils.createFloatBuffer(vertBuf.limit());
}
final Vector3 compVect = Vector3.fetchTempInstance();
for (int v = 0, vSize = store.capacity() / 3; v < vSize; v++) {
BufferUtils.populateFromBuffer(compVect, vertBuf, v);
_worldTransform.applyForward(compVect);
BufferUtils.setInBuffer(compVect, store, v);
}
Vector3.releaseTempInstance(compVect);
return store;
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* translates/rotates and scales the vectors of this Mesh to world coordinates based on its world settings. The
* results are stored in the given FloatBuffer. If given FloatBuffer is null, one is created.
*
* @param store
* the FloatBuffer to store the results in, or null if you want one created.
* @return store or new FloatBuffer if store == null.
*/
public FloatBuffer getWorldVectors(FloatBuffer store) {
final FloatBuffer vertBuf = _meshData.getVertexBuffer();
if (store == null || store.capacity() != vertBuf.limit()) {
store = BufferUtils.createFloatBuffer(vertBuf.limit());
}
final Vector3 compVect = Vector3.fetchTempInstance();
for (int v = 0, vSize = store.capacity() / 3; v < vSize; v++) {
BufferUtils.populateFromBuffer(compVect, vertBuf, v);
_worldTransform.applyForward(compVect);
BufferUtils.setInBuffer(compVect, store, v);
}
Vector3.releaseTempInstance(compVect);
return store;
}
代码示例来源:origin: com.ardor3d/ardor3d-animation
start.applyForward(Vector3.ZERO, stPnt);
end.applyForward(Vector3.ZERO, endPnt);
代码示例来源:origin: Renanse/Ardor3D
start.applyForward(Vector3.ZERO, stPnt);
end.applyForward(Vector3.ZERO, endPnt);
代码示例来源:origin: Renanse/Ardor3D
_transform.applyForward(vect);
if (vect.getX() < minX) {
minX = vect.getX();
代码示例来源:origin: com.ardor3d/ardor3d-terrain
_transform.applyForward(vect);
if (vect.getX() < minX) {
minX = vect.getX();
代码示例来源:origin: com.ardor3d/ardor3d-animation
point.zero();
SkeletalDebugger.jointText.setTranslation(Camera.getCurrentCamera().getScreenCoordinates(
t.applyForward(point)));
代码示例来源:origin: Renanse/Ardor3D
SkeletalDebugger.jointText.setTranslation(current.getScreenCoordinates(t.applyForward(point)));
代码示例来源:origin: com.ardor3d/ardor3d-effects
_emitterTransform.applyForward(p.getPosition());
p.getPosition().divideLocal(_emitterTransform.getScale());
代码示例来源:origin: Renanse/Ardor3D
_emitterTransform.applyForward(p.getPosition());
p.getPosition().divideLocal(_emitterTransform.getScale());
内容来源于网络,如有侵权,请联系作者删除!