示例#1
0
        public CollisionResponser()
        {
            possible_objects = new List <ICollisable>();
            staticTriangles  = new List <StaticTriangle>();

            CollisionStrategy      = new TestCollisionStrategy();
            DisplacementSimplifier = new DisplacementSimplifier();
            Booster = new CollisionEfficencyBooster();
        }
示例#2
0
        public void ThenCollisionSimplifierShouldRemoveTheirDisplacements()
        {
            DisplacementSimplifier simplifierInstance = new DisplacementSimplifier();
            LinearDisplacement     DisplacementA      = null;
            LinearDisplacement     DisplacementB      = null;


            if (Context.World.TryGetObject("bodyA", out GameObject gameObject))
            {
                DisplacementA = new LinearDisplacement(gameObject.Velocity, gameObject.Position, 1);
            }

            if (Context.World.TryGetObject("bodyB", out gameObject))
            {
                DisplacementB = new LinearDisplacement(gameObject.Velocity, gameObject.Position, 1);
            }

            var simplified = simplifierInstance.Simplify(DisplacementA, DisplacementB);

            Assert.IsNull(simplified);
        }