/** * Creates a manifold point as a copy of the given point * @param cp point to copy from */ public ManifoldPoint(ManifoldPoint cp) { localPoint = cp.localPoint.clone(); normalImpulse = cp.normalImpulse; tangentImpulse = cp.tangentImpulse; id = new ContactID(cp.id); }
/** * Sets this manifold point form the given one * @param cp the point to copy from */ public void set(ManifoldPoint cp) { localPoint.set(cp.localPoint); normalImpulse = cp.normalImpulse; tangentImpulse = cp.tangentImpulse; id.set(cp.id); }
/** * creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints. */ public Manifold() { points = new ManifoldPoint[Settings.maxManifoldPoints]; for (int i = 0; i < Settings.maxManifoldPoints; i++) { points[i] = new ManifoldPoint(); } localNormal = new Vec2(); localPoint = new Vec2(); pointCount = 0; }
/** * Creates this manifold as a copy of the other * * @param other */ public Manifold(Manifold other) { points = new ManifoldPoint[Settings.maxManifoldPoints]; localNormal = other.localNormal.clone(); localPoint = other.localPoint.clone(); pointCount = other.pointCount; type = other.type; // djm: this is correct now for (int i = 0; i < Settings.maxManifoldPoints; i++) { points[i] = new ManifoldPoint(other.points[i]); } }