public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, dest); }
public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, dest); }
public Matrix4d shadow(Vector4dc light, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }
public Matrix4d shadow(Vector4dc light, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }
public Vector3d mulPosition(Matrix4dc mat, Vector3d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30(); double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31(); double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32(); dest.x = rx; dest.y = ry; dest.z = rz; return dest; }
public Vector4d mulAffine(Matrix4dc mat, Vector4d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30() * w; double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31() * w; double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32() * w; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = w; return dest; }
public Vector4d mulAffine(Matrix4dc mat, Vector4d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30() * w; double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31() * w; double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32() * w; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = w; return dest; }
public Vector3d mulPosition(Matrix4dc mat, Vector3d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30(); double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31(); double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32(); dest.x = rx; dest.y = ry; dest.z = rz; return dest; }
public Matrix4d fma4x3(Matrix4dc other, double otherFactor, Matrix4d dest) { dest.m00 = m00 + other.m00() * otherFactor; dest.m01 = m01 + other.m01() * otherFactor; dest.m02 = m02 + other.m02() * otherFactor; dest.m03 = m03; dest.m10 = m10 + other.m10() * otherFactor; dest.m11 = m11 + other.m11() * otherFactor; dest.m12 = m12 + other.m12() * otherFactor; dest.m13 = m13; dest.m20 = m20 + other.m20() * otherFactor; dest.m21 = m21 + other.m21() * otherFactor; dest.m22 = m22 + other.m22() * otherFactor; dest.m23 = m23; dest.m30 = m30 + other.m30() * otherFactor; dest.m31 = m31 + other.m31() * otherFactor; dest.m32 = m32 + other.m32() * otherFactor; dest.m33 = m33; dest.properties = 0; return dest; }
public Matrix4d sub4x3(Matrix4dc subtrahend, Matrix4d dest) { dest.m00 = m00 - subtrahend.m00(); dest.m01 = m01 - subtrahend.m01(); dest.m02 = m02 - subtrahend.m02(); dest.m03 = m03; dest.m10 = m10 - subtrahend.m10(); dest.m11 = m11 - subtrahend.m11(); dest.m12 = m12 - subtrahend.m12(); dest.m13 = m13; dest.m20 = m20 - subtrahend.m20(); dest.m21 = m21 - subtrahend.m21(); dest.m22 = m22 - subtrahend.m22(); dest.m23 = m23; dest.m30 = m30 - subtrahend.m30(); dest.m31 = m31 - subtrahend.m31(); dest.m32 = m32 - subtrahend.m32(); dest.m33 = m33; dest.properties = 0; return dest; }
public Vector3d mulProject(Matrix4dc mat, Vector3d dest) { double invW = 1.0 / (mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33()); double rx = (mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30()) * invW; double ry = (mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31()) * invW; double rz = (mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32()) * invW; dest.x = rx; dest.y = ry; dest.z = rz; return dest; }
public double mulPositionW(Matrix4dc mat, Vector3d dest) { double w = mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33(); double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30(); double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31(); double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32(); dest.x = rx; dest.y = ry; dest.z = rz; return w; }
private Vector4d mulGeneric(Matrix4dc mat, Vector4d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30() * w; double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31() * w; double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32() * w; double rw = mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33() * w; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = rw; return dest; }
private Vector4d mulGeneric(Matrix4dc mat, Vector4d dest) { double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30() * w; double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31() * w; double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32() * w; double rw = mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33() * w; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = rw; return dest; }
public Vector4d mulProject(Matrix4dc mat, Vector4d dest) { double invW = 1.0 / (mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33() * w); double rx = (mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30()) * invW; double ry = (mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31()) * invW; double rz = (mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32()) * invW; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = 1.0; return dest; }
public double mulPositionW(Matrix4dc mat, Vector3d dest) { double w = mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33(); double rx = mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30(); double ry = mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31(); double rz = mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32(); dest.x = rx; dest.y = ry; dest.z = rz; return w; }
public Vector4d mulProject(Matrix4dc mat, Vector4d dest) { double invW = 1.0 / (mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33() * w); double rx = (mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30()) * invW; double ry = (mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31()) * invW; double rz = (mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32()) * invW; dest.x = rx; dest.y = ry; dest.z = rz; dest.w = 1.0; return dest; }
public Vector3d mulProject(Matrix4dc mat, Vector3d dest) { double invW = 1.0 / (mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33()); double rx = (mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30()) * invW; double ry = (mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31()) * invW; double rz = (mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32()) * invW; dest.x = rx; dest.y = ry; dest.z = rz; return dest; }
public Matrix4d add(Matrix4dc other, Matrix4d dest) { dest.m00 = m00 + other.m00(); dest.m01 = m01 + other.m01(); dest.m02 = m02 + other.m02(); dest.m03 = m03 + other.m03(); dest.m10 = m10 + other.m10(); dest.m11 = m11 + other.m11(); dest.m12 = m12 + other.m12(); dest.m13 = m13 + other.m13(); dest.m20 = m20 + other.m20(); dest.m21 = m21 + other.m21(); dest.m22 = m22 + other.m22(); dest.m23 = m23 + other.m23(); dest.m30 = m30 + other.m30(); dest.m31 = m31 + other.m31(); dest.m32 = m32 + other.m32(); dest.m33 = m33 + other.m33(); dest.properties = 0; return dest; }
public Matrix4d mulComponentWise(Matrix4dc other, Matrix4d dest) { dest.m00 = m00 * other.m00(); dest.m01 = m01 * other.m01(); dest.m02 = m02 * other.m02(); dest.m03 = m03 * other.m03(); dest.m10 = m10 * other.m10(); dest.m11 = m11 * other.m11(); dest.m12 = m12 * other.m12(); dest.m13 = m13 * other.m13(); dest.m20 = m20 * other.m20(); dest.m21 = m21 * other.m21(); dest.m22 = m22 * other.m22(); dest.m23 = m23 * other.m23(); dest.m30 = m30 * other.m30(); dest.m31 = m31 * other.m31(); dest.m32 = m32 * other.m32(); dest.m33 = m33 * other.m33(); dest.properties = 0; return dest; }