本文整理汇总了Java中com.badlogic.gdx.math.Matrix4.set方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4.set方法的具体用法?Java Matrix4.set怎么用?Java Matrix4.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.math.Matrix4
的用法示例。
在下文中一共展示了Matrix4.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GLToClipTransform
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
public static void GLToClipTransform(Matrix4 transformOut) {
if(null == transformOut) return;
Director director = Director.getInstance();
Matrix4 projection = director.getMatrix(MATRIX_STACK_TYPE.MATRIX_STACK_PROJECTION);
Matrix4 modelview = director.getMatrix(MATRIX_STACK_TYPE.MATRIX_STACK_MODELVIEW);
// System.out.println(projection);
// System.out.println(modelview);
//?
transformOut.set(projection);
transformOut.mul(modelview);
// *transformOut = projection * modelview;
}
示例2: getNodeToParentTransform
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
/**
* Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
* The matrix is in Pixels.
* Note: If ancestor is not a valid ancestor of the node, the API would return the same value as @see getNodeToWorldTransform
*
* @param ancestor The parent's node pointer.
* @since v3.7
* @return The transformation matrix. <b>(pool object)</b>
*/
public final Matrix4 getNodeToParentTransform(Node ancestor) {
final Matrix4 t = poolMatrix_1;
// System.out.println("nodeToParentTransform = " + getNodeToParentTransform() + this);
t.set(getNodeToParentTransform());
// Mat4 t(this.getNodeToParentTransform());
for (Node p = _parent; p != null && p != ancestor ; p = p._parent) {
// t = p.getNodeToParentTransform() * t;
t.mulLeft(p.getNodeToParentTransform());
}
return t;
}