本文整理了Java中com.ardor3d.math.Transform.multiply()
方法的一些代码示例,展示了Transform.multiply()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.multiply()
方法的具体详情如下:
包路径:com.ardor3d.math.Transform
类名称:Transform
方法名:multiply
[英]Calculates the product of this transform with the given "transformBy" transform (P = this * T) and stores this in store.
[中]计算此转换与给定“transformBy”转换(P=this*T)的乘积,并将其存储在存储中。
代码示例来源:origin: Renanse/Ardor3D
@Override
public Transform multiply(final ReadOnlyTransform transformBy, final Transform store) {
final Transform transform = super.multiply(transformBy, store);
if (!Transform.isValid(transform)) {
throw new InvalidTransformException("Transform is invalid");
}
return transform;
}
代码示例来源:origin: com.ardor3d/ardor3d-math
@Override
public Transform multiply(final ReadOnlyTransform transformBy, final Transform store) {
final Transform transform = super.multiply(transformBy, store);
if (!Transform.isValid(transform)) {
throw new InvalidTransformException("Transform is invalid");
}
return transform;
}
代码示例来源:origin: com.ardor3d/ardor3d-animation
/**
* Move our managed spatial to align with the referenced joint's position in the given pose, modified by our offset.
* See class javadoc for more information.
*/
public void poseUpdated(final SkeletonPose pose) {
// only update if we have something attached.
if (_attachment != null) {
final Transform t = pose.getGlobalJointTransforms()[_jointIndex];
t.multiply(_offset, _store);
_attachment.setTransform(_store);
}
}
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Move our managed spatial to align with the referenced joint's position in the given pose, modified by our offset.
* See class javadoc for more information.
*/
public void poseUpdated(final SkeletonPose pose) {
// only update if we have something attached.
if (_attachment != null) {
final Transform t = pose.getGlobalJointTransforms()[_jointIndex];
t.multiply(_offset, _store);
_attachment.setTransform(_store);
}
}
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Updates the worldTransform.
*
* @param recurse
* usually false when updating the tree. Set to true when you just want to update the world transforms
* for a branch without updating the full geometric state.
*/
public void updateWorldTransform(final boolean recurse) {
if (_parent != null) {
_parent._worldTransform.multiply(_localTransform, _worldTransform);
} else {
_worldTransform.set(_localTransform);
}
clearDirty(DirtyType.Transform);
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Updates the worldTransform.
*
* @param recurse
* usually false when updating the tree. Set to true when you just want to update the world transforms
* for a branch without updating geometric state.
*/
public void updateWorldTransform(final boolean recurse) {
if (_parent != null) {
_parent._worldTransform.multiply(_localTransform, _worldTransform);
} else {
_worldTransform.set(_localTransform);
}
clearDirty(DirtyType.Transform);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Updates the world material.
*
* @param recurse
* usually false when updating the tree. Set to true when you just want to update the world materials for
* a branch without updating the full geometric state.
*/
public void updateWorldRenderMaterial(final boolean recurse) {
if (_parent != null) {
_parent._worldTransform.multiply(_localTransform, _worldTransform);
} else {
_worldTransform.set(_localTransform);
}
clearDirty(DirtyType.Transform);
}
代码示例来源:origin: com.ardor3d/ardor3d-animation
_globalTransforms[parentIndex].multiply(_localTransforms[index], _globalTransforms[index]);
} else {
_globalTransforms[index].multiply(_skeleton.getJoints()[index].getInverseBindPose(), temp);
temp.getHomogeneousMatrix(_matrixPalette[index]);
代码示例来源:origin: Renanse/Ardor3D
_globalTransforms[parentIndex].multiply(_localTransforms[index], _globalTransforms[index]);
} else {
_globalTransforms[index].multiply(_skeleton.getJoints()[index].getInverseBindPose(), temp);
temp.getHomogeneousMatrix(_matrixPalette[index]);
代码示例来源:origin: Renanse/Ardor3D
@Override
public ResultSample doTransformMultTest(final int count, final int maxCount, final long timeOutMS) {
final ReadOnlyMatrix4 m1 = new Matrix4().fromAngleAxis(MathUtils.nextRandomDouble(),
new Vector3(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble()));
final ReadOnlyMatrix4 m2 = new Matrix4().fromAngleAxis(MathUtils.nextRandomDouble(),
new Vector3(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble()));
final Transform a = new Transform().fromHomogeneousMatrix(m1);
final Transform b = new Transform();
final Transform by = new Transform().fromHomogeneousMatrix(m2);
final long start = System.currentTimeMillis();
int loopCount = 0;
while (System.currentTimeMillis() - start < timeOutMS && loopCount != maxCount) {
++loopCount;
for (int i = 0; i < count; ++i) {
if (i % 2 == 0) {
a.multiply(by, b);
} else {
b.multiply(by, a);
}
}
}
return populateResult(System.currentTimeMillis() - start, loopCount, a.getHomogeneousMatrix(null).toArray(null));
}
代码示例来源:origin: Renanse/Ardor3D
@Test
public void testInvert() {
final Transform trans1 = new Transform();
trans1.setRotation(new Matrix3().applyRotationZ(3 * MathUtils.QUARTER_PI));
final Transform trans2 = trans1.invert(null);
assertEquals(Transform.IDENTITY, trans1.multiply(trans2, null));
trans1.setIdentity().invert(trans1);
assertEquals(Transform.IDENTITY, trans1);
}
代码示例来源:origin: Renanse/Ardor3D
@Test
public void testMultiply() {
final Transform trans1 = new Transform();
final Transform trans2 = new Transform();
assertEquals(Transform.IDENTITY, trans1.multiply(trans2, null));
trans1.setTranslation(1, 2, 3);
final Transform trans3 = trans1.multiply(trans2, null);
assertEquals(trans1, trans3);
trans2.setTranslation(-1, -2, -3);
trans1.multiply(trans2, trans3);
assertEquals(Transform.IDENTITY, trans3);
assertTrue(trans3.isRotationMatrix());
assertTrue(trans3.isIdentity());
assertTrue(trans3.isUniformScale());
trans2.setScale(1, 2, 1);
trans1.multiply(trans2, trans3);
assertEquals(new Transform().setScale(1, 2, 1), trans3);
assertTrue(trans3.isRotationMatrix());
assertFalse(trans3.isIdentity());
assertFalse(trans3.isUniformScale());
trans1.setScale(1, 2, 1);
trans1.multiply(trans2, trans3);
assertEquals(new Transform().setRotation(new Matrix3(1, 0, 0, 0, 4, 0, 0, 0, 1)).setTranslation(0, -2, 0),
trans3);
assertFalse(trans3.isRotationMatrix());
assertFalse(trans3.isIdentity());
assertFalse(trans3.isUniformScale());
}
代码示例来源:origin: com.ardor3d/ardor3d-ui
t.multiply(_localTransform, _worldTransform);
Transform.releaseTempInstance(t);
} else {
代码示例来源:origin: Renanse/Ardor3D
t.multiply(_localTransform, _worldTransform);
Transform.releaseTempInstance(t);
} else {
内容来源于网络,如有侵权,请联系作者删除!