本文整理了Java中com.badlogic.gdx.math.Matrix4.set()
方法的一些代码示例,展示了Matrix4.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix4.set()
方法的具体详情如下:
包路径:com.badlogic.gdx.math.Matrix4
类名称:Matrix4
方法名:set
[英]Sets the matrix to a rotation matrix representing the quaternion.
[中]将矩阵设置为表示四元数的旋转矩阵。
代码示例来源:origin: libgdx/libgdx
/** Sets the matrix to the given matrix.
*
* @param matrix The matrix that is to be copied. (The given matrix is not modified)
* @return This matrix for the purpose of chaining methods together. */
public Matrix4 set (Matrix4 matrix) {
return this.set(matrix.val);
}
代码示例来源:origin: libgdx/libgdx
/** Calculates the local transform based on the translation, scale and rotation
* @return the local transform */
public Matrix4 calculateLocalTransform () {
if (!isAnimated) localTransform.set(translation, rotation, scale);
return localTransform;
}
代码示例来源:origin: libgdx/libgdx
/** For dynamic and static bodies this method is called by bullet once to get the initial state of the body. For kinematic
* bodies this method is called on every update, unless the body is deactivated. */
@Override
public void getWorldTransform (final Matrix4 worldTrans) {
worldTrans.set(transform);
}
代码示例来源:origin: libgdx/libgdx
/** Sets the projection matrix to be used for rendering. Usually this will be set to {@link Camera#combined}.
* @param matrix */
public void setProjectionMatrix (Matrix4 matrix) {
projectionMatrix.set(matrix);
matrixDirty = true;
}
代码示例来源:origin: libgdx/libgdx
/** Construct a matrix from the given translation, rotation and scale.
* @param position The translation
* @param rotation The rotation, must be normalized
* @param scale The scale */
public Matrix4 (Vector3 position, Quaternion rotation, Vector3 scale) {
set(position, rotation, scale);
}
代码示例来源:origin: libgdx/libgdx
/** Sets the matrix to the given matrix.
*
* @param matrix The matrix that is to be copied. (The given matrix is not modified)
* @return This matrix for the purpose of chaining methods together. */
public Matrix4 set (Matrix4 matrix) {
return this.set(matrix.val);
}
代码示例来源:origin: libgdx/libgdx
/** Sets the matrix to a rotation matrix representing the quaternion.
*
* @param quaternion The quaternion that is to be used to set this matrix.
* @return This matrix for the purpose of chaining methods together. */
public Matrix4 set (Quaternion quaternion) {
return set(quaternion.x, quaternion.y, quaternion.z, quaternion.w);
}
代码示例来源:origin: libgdx/libgdx
/** Set this matrix to the specified translation and rotation.
* @param position The translation
* @param orientation The rotation, must be normalized
* @return This matrix for chaining */
public Matrix4 set (Vector3 position, Quaternion orientation) {
return set(position.x, position.y, position.z, orientation.x, orientation.y, orientation.z, orientation.w);
}
代码示例来源:origin: libgdx/libgdx
/** Calculates the world transform; the product of local transform and the parent's world transform.
* @return the world transform */
public Matrix4 calculateWorldTransform () {
if (inheritTransform && parent != null)
globalTransform.set(parent.globalTransform).mul(localTransform);
else
globalTransform.set(localTransform);
return globalTransform;
}
代码示例来源:origin: libgdx/libgdx
/** Sets the current transformation to the given one.
* @param transform the new transform matrix */
public void setTransform (Matrix4 transform) {
this.transform.set(transform);
transform.getScale(scale);
}
代码示例来源:origin: libgdx/libgdx
/** Sets the current transformation to the given one.
* @param transform the new transform matrix */
public void setTransform (Matrix4 transform) {
this.transform.set(transform);
transform.getScale(scale);
}
代码示例来源:origin: libgdx/libgdx
/** Sets the current transformation. */
public void setTransform (float x, float y, float z, float qx, float qy, float qz, float qw, float scale) {
transform.set(x, y, z, qx, qy, qz, qw, scale, scale, scale);
this.scale.set(scale, scale, scale);
}
代码示例来源:origin: libgdx/libgdx
public Renderable set (Renderable renderable) {
worldTransform.set(renderable.worldTransform);
material = renderable.material;
meshPart.set(renderable.meshPart);
bones = renderable.bones;
environment = renderable.environment;
shader = renderable.shader;
userData = renderable.userData;
return this;
}
}
代码示例来源:origin: libgdx/libgdx
/** Sets this matrix to a rotation matrix from the given euler angles.
* @param yaw the yaw in degrees
* @param pitch the pitch in degrees
* @param roll the roll in degrees
* @return This matrix */
public Matrix4 setFromEulerAngles (float yaw, float pitch, float roll) {
quat.setEulerAngles(yaw, pitch, roll);
return set(quat);
}
代码示例来源:origin: libgdx/libgdx
/** Set the shape renderer transformation matrix, often with the result of {@link #computeTransform()}. Note this causes the
* shape renderer to be flushed. {@link #resetTransform(ShapeRenderer)} will restore the transform to what it was before this
* call. */
protected void applyTransform (ShapeRenderer shapes, Matrix4 transform) {
oldTransform.set(shapes.getTransformMatrix());
shapes.setTransformMatrix(transform);
}
代码示例来源:origin: libgdx/libgdx
@Override
public void setTransformMatrix (Matrix4 transform) {
if (drawing) flush();
transformMatrix.set(transform);
if (drawing) setupMatrices();
}
代码示例来源:origin: libgdx/libgdx
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
shader.set(inputID, temp.set(shader.camera.combined).mul(renderable.worldTransform));
}
};
代码示例来源:origin: libgdx/libgdx
@Override
public void setTransformMatrix (Matrix4 transform) {
if (drawing) flush();
transformMatrix.set(transform);
if (drawing) setupMatrices();
}
代码示例来源:origin: libgdx/libgdx
private void setupMatrices () {
combinedMatrix.set(projectionMatrix).mul(transformMatrix);
if (customShader != null) {
customShader.setUniformMatrix("u_projTrans", combinedMatrix);
customShader.setUniformi("u_texture", 0);
} else {
shader.setUniformMatrix("u_projTrans", combinedMatrix);
shader.setUniformi("u_texture", 0);
}
}
代码示例来源:origin: libgdx/libgdx
public Matrix4 setToWorld (Vector3 position, Vector3 forward, Vector3 up) {
tmpForward.set(forward).nor();
right.set(tmpForward).crs(up).nor();
tmpUp.set(right).crs(tmpForward).nor();
this.set(right, tmpUp, tmpForward.scl(-1), position);
return this;
}
内容来源于网络,如有侵权,请联系作者删除!