本文整理了Java中com.ardor3d.math.Transform.setRotation()
方法的一些代码示例,展示了Transform.setRotation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.setRotation()
方法的具体详情如下:
包路径:com.ardor3d.math.Transform
类名称:Transform
方法名:setRotation
[英]Sets the matrix portion of this transform to the given value. NB: Calling this with a matrix that is not purely rotational (orthonormal) will result in a Transform whose scale comes from its matrix. Further attempts to set scale directly will throw an error.
[中]将此变换的矩阵部分设置为给定值。注:用一个非纯旋转(正交)的矩阵来调用它,将导致一个变换,其尺度来自于它的矩阵。进一步尝试直接设置比例将抛出错误。
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Sets the world rotation quaternion.
*
* @param rotation
* the new world rotation
*/
public void setWorldRotation(final ReadOnlyQuaternion rotation) {
_worldTransform.setRotation(rotation);
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Sets the world rotation matrix.
*
* @param rotation
* the new world rotation
*/
public void setWorldRotation(final ReadOnlyMatrix3 rotation) {
_worldTransform.setRotation(rotation);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Sets the world rotation matrix.
*
* @param rotation
* the new world rotation
*/
public void setWorldRotation(final ReadOnlyMatrix3 rotation) {
_worldTransform.setRotation(rotation);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Sets the world rotation quaternion.
*
* @param rotation
* the new world rotation
*/
public void setWorldRotation(final ReadOnlyQuaternion rotation) {
_worldTransform.setRotation(rotation);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Sets the type of rotation this BillboardNode will have. The alignment can be ScreenAligned, CameraAligned, AxialY
* or AxialZ. Invalid alignments will assume no billboard rotation.
*/
public void setAlignment(final BillboardAlignment alignment) {
_alignment = alignment;
_worldTransform.setRotation(Matrix3.IDENTITY);
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform.
*
* @param rotation
* the new rotation of this spatial
* @see Transform#setRotation(Matrix3)
*/
public void setRotation(final ReadOnlyMatrix3 rotation) {
_localTransform.setRotation(rotation);
markDirty(DirtyType.Transform);
}
代码示例来源:origin: com.ardor3d/ardor3d-math
@Override
public ValidatingTransform setRotation(final ReadOnlyMatrix3 rotation) {
super.setRotation(rotation);
validate();
return this;
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform.
*
* @param rotation
* the new rotation of this spatial
* @see Transform#setRotation(Matrix3)
*/
public void setRotation(final ReadOnlyMatrix3 rotation) {
_localTransform.setRotation(rotation);
markDirty(DirtyType.Transform);
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform.
*
* @param rotation
* the new rotation of this spatial
* @see Transform#setRotation(Quaternion)
*/
public void setRotation(final ReadOnlyQuaternion rotation) {
_localTransform.setRotation(rotation);
markDirty(DirtyType.Transform);
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public ValidatingTransform setRotation(final ReadOnlyQuaternion rotation) {
super.setRotation(rotation);
validate();
return this;
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform.
*
* @param rotation
* the new rotation of this spatial
* @see Transform#setRotation(Quaternion)
*/
public void setRotation(final ReadOnlyQuaternion rotation) {
_localTransform.setRotation(rotation);
markDirty(DirtyType.Transform);
}
代码示例来源:origin: com.ardor3d/ardor3d-math
@Override
public ValidatingTransform setRotation(final ReadOnlyQuaternion rotation) {
super.setRotation(rotation);
validate();
return this;
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public ValidatingTransform setRotation(final ReadOnlyMatrix3 rotation) {
super.setRotation(rotation);
validate();
return this;
}
代码示例来源:origin: Renanse/Ardor3D
private void rotateNone() {
if(_localRot != null) {
_orient.set(getRotation());
_orient.multiplyLocal(_localRot);
_worldTransform.setRotation(_orient);
}
}
代码示例来源:origin: com.ardor3d/ardor3d-animation
public void applyTo(final Transform transform) {
transform.setIdentity();
transform.setRotation(getRotation());
transform.setScale(getScale());
transform.setTranslation(getTranslation());
}
代码示例来源:origin: Renanse/Ardor3D
public void applyTo(final Transform transform) {
transform.setIdentity();
transform.setRotation(getRotation());
transform.setScale(getScale());
transform.setTranslation(getTranslation());
}
代码示例来源:origin: Renanse/Ardor3D
public ReadOnlyTransform getValue() {
final Transform t = new Transform();
t.setTranslation(_translationX.getDoubleValue(), _translationY.getDoubleValue(), 0);
final double val = _rotation.getDoubleValue() * MathUtils.DEG_TO_RAD;
final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(0, 0, val);
t.setRotation(mat);
Matrix3.releaseTempInstance(mat);
t.setScale(_scale.getDoubleValue());
return t;
}
代码示例来源:origin: Renanse/Ardor3D
/**
* Rotate the billboard so it points directly opposite the direction the camera's facing
*/
private void rotateScreenAligned() {
final Camera camera = Camera.getCurrentCamera();
_look.set(camera.getDirection()).negateLocal();
_left.set(camera.getLeft()).negateLocal();
_orient.fromAxes(_left, camera.getUp(), _look);
if(_localRot != null)
_orient.multiplyLocal(_localRot);
_worldTransform.setRotation(_orient);
}
代码示例来源:origin: Renanse/Ardor3D
public ReadOnlyTransform getValue() {
final Transform t = new Transform();
t.setTranslation(_translation.getValue());
final Vector3 val = _rotation.getValue().multiplyLocal(MathUtils.DEG_TO_RAD);
final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(val.getX(), val.getY(), val.getZ());
t.setRotation(mat);
Matrix3.releaseTempInstance(mat);
t.setScale(_scale.getValue());
return t;
}
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!