public Quaterniond add(Quaterniondc q2, Quaterniond dest) { dest.x = x + q2.x(); dest.y = y + q2.y(); dest.z = z + q2.z(); dest.w = w + q2.w(); return dest; }
public Matrix4d reflect(Quaterniondc orientation, Vector3dc point, Matrix4d dest) { double num1 = orientation.x() + orientation.x(); double num2 = orientation.y() + orientation.y(); double num3 = orientation.z() + orientation.z(); double normalX = orientation.x() * num3 + orientation.w() * num2; double normalY = orientation.y() * num3 - orientation.w() * num1; double normalZ = 1.0 - (orientation.x() * num1 + orientation.y() * num2); return reflect(normalX, normalY, normalZ, point.x(), point.y(), point.z(), dest); }
/** * Create a new {@link Quaterniond} and initialize its components to the same values as the given {@link Quaterniond}. * * @param source * the {@link Quaterniond} to take the component values from */ public Quaterniond(Quaterniondc source) { x = source.x(); y = source.y(); z = source.z(); w = source.w(); }
public Quaterniond add(Quaterniondc q2, Quaterniond dest) { dest.x = x + q2.x(); dest.y = y + q2.y(); dest.z = z + q2.z(); dest.w = w + q2.w(); return dest; }
public Matrix4d reflect(Quaterniondc orientation, Vector3dc point, Matrix4d dest) { double num1 = orientation.x() + orientation.x(); double num2 = orientation.y() + orientation.y(); double num3 = orientation.z() + orientation.z(); double normalX = orientation.x() * num3 + orientation.w() * num2; double normalY = orientation.y() * num3 - orientation.w() * num1; double normalZ = 1.0 - (orientation.x() * num1 + orientation.y() * num2); return reflect(normalX, normalY, normalZ, point.x(), point.y(), point.z(), dest); }
public Matrix4x3d reflect(Quaterniondc orientation, Vector3dc point, Matrix4x3d dest) { double num1 = orientation.x() + orientation.x(); double num2 = orientation.y() + orientation.y(); double num3 = orientation.z() + orientation.z(); double normalX = orientation.x() * num3 + orientation.w() * num2; double normalY = orientation.y() * num3 - orientation.w() * num1; double normalZ = 1.0 - (orientation.x() * num1 + orientation.y() * num2); return reflect(normalX, normalY, normalZ, point.x(), point.y(), point.z(), dest); }
/** * Create a new {@link Quaterniond} and initialize its components to the same values as the given {@link Quaterniond}. * * @param source * the {@link Quaterniond} to take the component values from */ public Quaterniond(Quaterniondc source) { x = source.x(); y = source.y(); z = source.z(); w = source.w(); }
public Matrix4x3d reflect(Quaterniondc orientation, Vector3dc point, Matrix4x3d dest) { double num1 = orientation.x() + orientation.x(); double num2 = orientation.y() + orientation.y(); double num3 = orientation.z() + orientation.z(); double normalX = orientation.x() * num3 + orientation.w() * num2; double normalY = orientation.y() * num3 - orientation.w() * num1; double normalZ = 1.0 - (orientation.x() * num1 + orientation.y() * num2); return reflect(normalX, normalY, normalZ, point.x(), point.y(), point.z(), dest); }
public double dot(Quaterniondc otherQuat) { return this.x * otherQuat.x() + this.y * otherQuat.y() + this.z * otherQuat.z() + this.w * otherQuat.w(); }
public Quaterniond difference(Quaterniondc other, Quaterniond dest) { double invNorm = 1.0 / (x * x + y * y + z * z + w * w); double x = -this.x * invNorm; double y = -this.y * invNorm; double z = -this.z * invNorm; double w = this.w * invNorm; dest.set(w * other.x() + x * other.w() + y * other.z() - z * other.y(), w * other.y() - x * other.z() + y * other.w() + z * other.x(), w * other.z() + x * other.y() - y * other.x() + z * other.w(), w * other.w() - x * other.x() - y * other.y() - z * other.z()); return dest; }
/** * Add <code>q2</code> to this quaternion. * * @param q2 * the quaternion to add to this * @return this */ public Quaterniond add(Quaterniondc q2) { x += q2.x(); y += q2.y(); z += q2.z(); w += q2.w(); return this; }
public double dot(Quaterniondc otherQuat) { return this.x * otherQuat.x() + this.y * otherQuat.y() + this.z * otherQuat.z() + this.w * otherQuat.w(); }
public Quaterniond difference(Quaterniondc other, Quaterniond dest) { double invNorm = 1.0 / (x * x + y * y + z * z + w * w); double x = -this.x * invNorm; double y = -this.y * invNorm; double z = -this.z * invNorm; double w = this.w * invNorm; dest.set(w * other.x() + x * other.w() + y * other.z() - z * other.y(), w * other.y() - x * other.z() + y * other.w() + z * other.x(), w * other.z() + x * other.y() - y * other.x() + z * other.w(), w * other.w() - x * other.x() - y * other.y() - z * other.z()); return dest; }
/** * Set this quaternion to be a copy of q. * * @param q * the {@link Quaterniondc} to copy * @return this */ public Quaterniond set(Quaterniondc q) { x = q.x(); y = q.y(); z = q.z(); w = q.w(); return this; }
public Quaterniond div(Quaterniondc b, Quaterniond dest) { double invNorm = 1.0 / (b.x() * b.x() + b.y() * b.y() + b.z() * b.z() + b.w() * b.w()); double x = -b.x() * invNorm; double y = -b.y() * invNorm; double z = -b.z() * invNorm; double w = b.w() * invNorm; dest.set(this.w * x + this.x * w + this.y * z - this.z * y, this.w * y - this.x * z + this.y * w + this.z * x, this.w * z + this.x * y - this.y * x + this.z * w, this.w * w - this.x * x - this.y * y - this.z * z); return dest; }
public Quaterniond div(Quaterniondc b, Quaterniond dest) { double invNorm = 1.0 / (b.x() * b.x() + b.y() * b.y() + b.z() * b.z() + b.w() * b.w()); double x = -b.x() * invNorm; double y = -b.y() * invNorm; double z = -b.z() * invNorm; double w = b.w() * invNorm; dest.set(this.w * x + this.x * w + this.y * z - this.z * y, this.w * y - this.x * z + this.y * w + this.z * x, this.w * z + this.x * y - this.y * x + this.z * w, this.w * w - this.x * x - this.y * y - this.z * z); return dest; }