public Line(Vector3f pointAOnLine, Vector3f pointBOnLine, Vector3f pointNotOnLine) { p0 = new Plane(pointAOnLine, pointBOnLine, pointNotOnLine); Vector3f temp = pointAOnLine - pointBOnLine; p1 = new Plane(temp.Cross(p1.getNormal()), pointAOnLine); }
public Plane(Vector3f p0, Vector3f p0A, Vector3f p0B) { Vector3f vecA = p0A - p0; Vector3f vecB = p0B - p0; Vector3f normal = vecA.Cross(vecB); a = normal.x; b = normal.y; c = normal.z; d = -1.0f * (normal * p0); }
public RotatableGroundPlane(Vector3f position, float deltaY_X, float deltaY_Z, float friction) { active = true; this.friction = friction; this.position = position; this.deltaY_X = deltaY_X; this.deltaY_Z = deltaY_Z; Vector3f vectorA = new Vector3f(1.0f, -deltaY_X, 0.0f); Vector3f vectorB = new Vector3f(0.0f, -deltaY_Z, 1.0f); normal = vectorA.Cross(vectorB); normal.Normalize(); }
public void crossProductWithZeros() { v0 = new Vector3f(1.0f, 0.0f, 0.0f); v1 = new Vector3f(0.0f, 0.0f, -1.0f); Assert.AreEqual(v0.Cross(v1), new Vector3f(0.0f, 1.0f, 0.0f), v0.ToString() + "x" + v1.ToString()); }
public void crossProduct() { v0 = new Vector3f(3.0f, 0.0f, 0.0f); v1 = new Vector3f(0.0f, 2.0f, 0.0f); Assert.AreEqual(v0.Cross(v1), new Vector3f(0.0f, 0.0f, 6.0f), v0.ToString() + "x" + v1.ToString()); }