本文整理汇总了Java中com.badlogic.gdx.math.Matrix3.M22属性的典型用法代码示例。如果您正苦于以下问题:Java Matrix3.M22属性的具体用法?Java Matrix3.M22怎么用?Java Matrix3.M22使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.math.Matrix3
的用法示例。
在下文中一共展示了Matrix3.M22属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMatrix
public Matrix4 getMatrix(Matrix4 out) {
out.val[Matrix4.M00] = basis.val[Matrix3.M00];
out.val[Matrix4.M01] = basis.val[Matrix3.M01];
out.val[Matrix4.M02] = basis.val[Matrix3.M02];
out.val[Matrix4.M03] = origin.x;
out.val[Matrix4.M10] = basis.val[Matrix3.M10];
out.val[Matrix4.M11] = basis.val[Matrix3.M11];
out.val[Matrix4.M12] = basis.val[Matrix3.M12];
out.val[Matrix4.M13] = origin.y;
out.val[Matrix4.M20] = basis.val[Matrix3.M20];
out.val[Matrix4.M21] = basis.val[Matrix3.M21];
out.val[Matrix4.M22] = basis.val[Matrix3.M22];
out.val[Matrix4.M23] = origin.z;
out.val[Matrix4.M30] = 0;
out.val[Matrix4.M31] = 0;
out.val[Matrix4.M32] = 0;
out.val[Matrix4.M33] = 1;
return out;
}
示例2: getColumn
public static void getColumn (Matrix3 src, int col, Vector3 v) {
if (col == 0) {
v.x = src.val[Matrix3.M00];
v.y = src.val[Matrix3.M10];
v.z = src.val[Matrix3.M20];
} else if (col == 1) {
v.x = src.val[Matrix3.M01];
v.y = src.val[Matrix3.M11];
v.z = src.val[Matrix3.M21];
} else if (col == 2) {
v.x = src.val[Matrix3.M02];
v.y = src.val[Matrix3.M12];
v.z = src.val[Matrix3.M22];
} else {
throw new GdxRuntimeException("Invalid column");
}
}
示例3: setColumn
public static void setColumn (Matrix3 src, int col, Vector3 v) {
if (col == 0) {
src.val[Matrix3.M00] = v.x;
src.val[Matrix3.M10] = v.y;
src.val[Matrix3.M20] = v.z;
} else if (col == 1) {
src.val[Matrix3.M01] = v.x;
src.val[Matrix3.M11] = v.y;
src.val[Matrix3.M21] = v.z;
} else if (col == 2) {
src.val[Matrix3.M02] = v.x;
src.val[Matrix3.M12] = v.y;
src.val[Matrix3.M22] = v.z;
} else {
throw new GdxRuntimeException("Invalid column");
}
}
示例4: getRow
public static void getRow (Matrix3 src, int row, Vector3 v) {
if (row == 0) {
v.x = src.val[Matrix3.M00];
v.y = src.val[Matrix3.M01];
v.z = src.val[Matrix3.M02];
} else if (row == 1) {
v.x = src.val[Matrix3.M10];
v.y = src.val[Matrix3.M11];
v.z = src.val[Matrix3.M12];
} else if (row == 2) {
v.x = src.val[Matrix3.M20];
v.y = src.val[Matrix3.M21];
v.z = src.val[Matrix3.M22];
} else {
throw new GdxRuntimeException("Invalid row");
}
}
示例5: setRow
public static void setRow (Matrix3 src, int row, float x, float y, float z) {
if (row == 0) {
src.val[Matrix3.M00] = x;
src.val[Matrix3.M01] = y;
src.val[Matrix3.M02] = z;
} else if (row == 1) {
src.val[Matrix3.M10] = x;
src.val[Matrix3.M11] = y;
src.val[Matrix3.M12] = z;
} else if (row == 2) {
src.val[Matrix3.M20] = x;
src.val[Matrix3.M21] = y;
src.val[Matrix3.M22] = z;
} else {
throw new GdxRuntimeException("Invalid row");
}
}
示例6: setRotation
public static void setRotation (Matrix3 dest, Quaternion q) {
float d = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
assert (d != 0f);
float s = 2f / d;
float xs = q.x * s, ys = q.y * s, zs = q.z * s;
float wx = q.w * xs, wy = q.w * ys, wz = q.w * zs;
float xx = q.x * xs, xy = q.x * ys, xz = q.x * zs;
float yy = q.y * ys, yz = q.y * zs, zz = q.z * zs;
dest.val[Matrix3.M00] = 1f - (yy + zz);
dest.val[Matrix3.M01] = xy - wz;
dest.val[Matrix3.M02] = xz + wy;
dest.val[Matrix3.M10] = xy + wz;
dest.val[Matrix3.M11] = 1f - (xx + zz);
dest.val[Matrix3.M12] = yz - wx;
dest.val[Matrix3.M20] = xz - wy;
dest.val[Matrix3.M21] = yz + wx;
dest.val[Matrix3.M22] = 1f - (xx + yy);
}
示例7: HingeConstraint
public HingeConstraint (RigidBody rbA, RigidBody rbB, Transform rbAFrame, Transform rbBFrame) {
super(TypedConstraintType.HINGE_CONSTRAINT_TYPE, rbA, rbB);
this.rbAFrame.set(rbAFrame);
this.rbBFrame.set(rbBFrame);
angularOnly = false;
enableAngularMotor = false;
// flip axis
this.rbBFrame.basis.val[Matrix3.M02] *= -1f;
this.rbBFrame.basis.val[Matrix3.M12] *= -1f;
this.rbBFrame.basis.val[Matrix3.M22] *= -1f;
// start with free
lowerLimit = 1e30f;
upperLimit = -1e30f;
biasFactor = 0.3f;
relaxationFactor = 1.0f;
limitSoftness = 0.9f;
solveLimit = false;
}
示例8: set
public void set(Matrix4 mat) {
basis.val[Matrix3.M00] = mat.val[Matrix4.M00];
basis.val[Matrix3.M01] = mat.val[Matrix4.M01];
basis.val[Matrix3.M02] = mat.val[Matrix4.M02];
basis.val[Matrix3.M10] = mat.val[Matrix4.M10];
basis.val[Matrix3.M11] = mat.val[Matrix4.M11];
basis.val[Matrix3.M12] = mat.val[Matrix4.M12];
basis.val[Matrix3.M20] = mat.val[Matrix4.M20];
basis.val[Matrix3.M21] = mat.val[Matrix4.M21];
basis.val[Matrix3.M22] = mat.val[Matrix4.M22];
origin.set(mat.val[Matrix4.M03], mat.val[Matrix4.M13], mat.val[Matrix4.M23]);
}
示例9: add
public static void add (Matrix3 a, Matrix3 b) {
a.val[Matrix3.M00] += b.val[Matrix3.M00];
a.val[Matrix3.M01] += b.val[Matrix3.M01];
a.val[Matrix3.M02] += b.val[Matrix3.M02];
a.val[Matrix3.M10] += b.val[Matrix3.M10];
a.val[Matrix3.M11] += b.val[Matrix3.M11];
a.val[Matrix3.M12] += b.val[Matrix3.M12];
a.val[Matrix3.M20] += b.val[Matrix3.M20];
a.val[Matrix3.M21] += b.val[Matrix3.M21];
a.val[Matrix3.M22] += b.val[Matrix3.M22];
}
示例10: scale
public static void scale (Matrix3 dest, Matrix3 mat, Vector3 s) {
dest.val[Matrix3.M00] = mat.val[Matrix3.M00] * s.x;
dest.val[Matrix3.M01] = mat.val[Matrix3.M01] * s.y;
dest.val[Matrix3.M02] = mat.val[Matrix3.M02] * s.z;
dest.val[Matrix3.M10] = mat.val[Matrix3.M10] * s.x;
dest.val[Matrix3.M11] = mat.val[Matrix3.M11] * s.y;
dest.val[Matrix3.M12] = mat.val[Matrix3.M12] * s.z;
dest.val[Matrix3.M20] = mat.val[Matrix3.M20] * s.x;
dest.val[Matrix3.M21] = mat.val[Matrix3.M21] * s.y;
dest.val[Matrix3.M22] = mat.val[Matrix3.M22] * s.z;
}
示例11: absolute
public static void absolute (Matrix3 mat) {
mat.val[Matrix3.M00] = Math.abs(mat.val[Matrix3.M00]);
mat.val[Matrix3.M01] = Math.abs(mat.val[Matrix3.M01]);
mat.val[Matrix3.M02] = Math.abs(mat.val[Matrix3.M02]);
mat.val[Matrix3.M10] = Math.abs(mat.val[Matrix3.M10]);
mat.val[Matrix3.M11] = Math.abs(mat.val[Matrix3.M11]);
mat.val[Matrix3.M12] = Math.abs(mat.val[Matrix3.M12]);
mat.val[Matrix3.M20] = Math.abs(mat.val[Matrix3.M20]);
mat.val[Matrix3.M21] = Math.abs(mat.val[Matrix3.M21]);
mat.val[Matrix3.M22] = Math.abs(mat.val[Matrix3.M22]);
}
示例12: getOpenGLSubMatrix
public static void getOpenGLSubMatrix (Matrix3 mat, float[] m) {
m[0] = mat.val[Matrix3.M00];
m[1] = mat.val[Matrix3.M10];
m[2] = mat.val[Matrix3.M20];
m[3] = 0f;
m[4] = mat.val[Matrix3.M01];
m[5] = mat.val[Matrix3.M11];
m[6] = mat.val[Matrix3.M21];
m[7] = 0f;
m[8] = mat.val[Matrix3.M02];
m[9] = mat.val[Matrix3.M12];
m[10] = mat.val[Matrix3.M22];
m[11] = 0f;
}
示例13: invert
public static void invert (Matrix3 mat) {
float co_x = cofac(mat, 1, 1, 2, 2);
float co_y = cofac(mat, 1, 2, 2, 0);
float co_z = cofac(mat, 1, 0, 2, 1);
float det = mat.val[Matrix3.M00] * co_x + mat.val[Matrix3.M01] * co_y + mat.val[Matrix3.M02] * co_z;
assert (det != 0f);
float s = 1f / det;
float m00 = co_x * s;
float m01 = cofac(mat, 0, 2, 2, 1) * s;
float m02 = cofac(mat, 0, 1, 1, 2) * s;
float m10 = co_y * s;
float m11 = cofac(mat, 0, 0, 2, 2) * s;
float m12 = cofac(mat, 0, 2, 1, 0) * s;
float m20 = co_z * s;
float m21 = cofac(mat, 0, 1, 2, 0) * s;
float m22 = cofac(mat, 0, 0, 1, 1) * s;
mat.val[Matrix3.M00] = m00;
mat.val[Matrix3.M01] = m01;
mat.val[Matrix3.M02] = m02;
mat.val[Matrix3.M10] = m10;
mat.val[Matrix3.M11] = m11;
mat.val[Matrix3.M12] = m12;
mat.val[Matrix3.M20] = m20;
mat.val[Matrix3.M21] = m21;
mat.val[Matrix3.M22] = m22;
}
示例14: transformAabb
public static void transformAabb (Vector3 halfExtents, float margin, Transform t, Vector3 aabbMinOut, Vector3 aabbMaxOut) {
Stack stack = Stack.enter();
Vector3 halfExtentsWithMargin = stack.allocVector3();
halfExtentsWithMargin.x = halfExtents.x + margin;
halfExtentsWithMargin.y = halfExtents.y + margin;
halfExtentsWithMargin.z = halfExtents.z + margin;
Matrix3 abs_b = stack.alloc(t.basis);
MatrixUtil.absolute(abs_b);
Vector3 tmp = stack.allocVector3();
Vector3 center = stack.alloc(t.origin);
Vector3 extent = stack.allocVector3();
tmp.x = abs_b.val[Matrix3.M00];
tmp.y = abs_b.val[Matrix3.M01];
tmp.z = abs_b.val[Matrix3.M02];
extent.x = tmp.dot(halfExtentsWithMargin);
tmp.x = abs_b.val[Matrix3.M10];
tmp.y = abs_b.val[Matrix3.M11];
tmp.z = abs_b.val[Matrix3.M12];
extent.y = tmp.dot(halfExtentsWithMargin);
tmp.x = abs_b.val[Matrix3.M20];
tmp.y = abs_b.val[Matrix3.M21];
tmp.z = abs_b.val[Matrix3.M22];
extent.z = tmp.dot(halfExtentsWithMargin);
aabbMinOut.set(center).sub(extent);
aabbMaxOut.set(center).add(extent);
stack.leave();
}
示例15: getAabb
/** getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version. */
@Override
public void getAabb (Transform trans, Vector3 aabbMin, Vector3 aabbMax) {
Stack stack = Stack.enter();
Vector3 localHalfExtents = stack.allocVector3();
localHalfExtents.set(localAabbMax).sub(localAabbMin);
localHalfExtents.scl(0.5f);
localHalfExtents.x += getMargin();
localHalfExtents.y += getMargin();
localHalfExtents.z += getMargin();
Vector3 localCenter = stack.allocVector3();
localCenter.set(localAabbMax).add(localAabbMin);
localCenter.scl(0.5f);
Matrix3 abs_b = stack.alloc(trans.basis);
MatrixUtil.absolute(abs_b);
Vector3 center = stack.alloc(localCenter);
trans.transform(center);
Vector3 tmp = stack.allocVector3();
Vector3 extent = stack.allocVector3();
tmp.x = abs_b.val[Matrix3.M00];
tmp.y = abs_b.val[Matrix3.M01];
tmp.z = abs_b.val[Matrix3.M02];
extent.x = tmp.dot(localHalfExtents);
tmp.x = abs_b.val[Matrix3.M10];
tmp.y = abs_b.val[Matrix3.M11];
tmp.z = abs_b.val[Matrix3.M12];
extent.y = tmp.dot(localHalfExtents);
tmp.x = abs_b.val[Matrix3.M20];
tmp.y = abs_b.val[Matrix3.M21];
tmp.z = abs_b.val[Matrix3.M22];
extent.z = tmp.dot(localHalfExtents);
aabbMin.set(center).sub(extent);
aabbMax.set(center).add(extent);
stack.leave();
}