Exemple #1
0
        private void CollisionShape(PShape s1, PShape s2, PCollisionChooser cc_0)
        {
            PContact[] cs  = new PContact[2];
            int        num = cc_0.Collide(s1, s2, cs);

            if (num == 0)
            {
                return;
            }
            bool found = false;

            for (int f = 0; f < numSolvers; f++)
            {
                if (s1 != solvers[f].s1 || s2 != solvers[f].s2)
                {
                    continue;
                }
                solvers[f].Update(cs, num);
                found = true;
                break;
            }

            if (!found)
            {
                PSolver solver = new PSolver(s1, s2, cs, num);
                AddSolver(solver);
            }
        }
Exemple #2
0
		private void CollisionShape(PShape s1, PShape s2, PCollisionChooser cc_0) {
			PContact[] cs = new PContact[2];
			int num = cc_0.Collide(s1, s2, cs);
			if (num == 0) {
				return;
			}
			bool found = false;
			for (int f = 0; f < numSolvers; f++) {
				if (s1 != solvers[f].s1 || s2 != solvers[f].s2) {
					continue;
				}
				solvers[f].Update(cs, num);
				found = true;
				break;
			}
	
			if (!found) {
				PSolver solver = new PSolver(s1, s2, cs, num);
				AddSolver(solver);
			}
		}