Beispiel #1
0
		public void LinearBoxSweepCallback()
		{
			using( CreateCoreAndScene() )
			{
				CreateBoxActor( 0, 0, 20 );

				Box box = new Box( new Vector3( 0, 2.5f, 0 ), new Vector3( 5, 5, 5 ) );

				SweepCallback callback = new SweepCallback();

				this.Scene.LinearObbSweep( box, new Vector3( 0, 0, 1000 ), SweepFlags.Dynamics | SweepFlags.Statics, "Dummy Object", callback );

				Assert.IsTrue( callback.NumberOfHits == 1, "The linear box sweep should of returned 1 hit. Hits returned: {0}", callback.NumberOfHits );
			}
		}
Beispiel #2
0
        public void LinearBoxSweepCallback()
        {
            using (CreateCoreAndScene())
            {
                CreateBoxActor(0, 0, 20);

                Box box = new Box(new Vector3(0, 2.5f, 0), new Vector3(5, 5, 5));

                SweepCallback callback = new SweepCallback();

                this.Scene.LinearObbSweep(box, new Vector3(0, 0, 1000), SweepFlags.Dynamics | SweepFlags.Statics, "Dummy Object", callback);

                Assert.IsTrue(callback.NumberOfHits == 1, "The linear box sweep should of returned 1 hit. Hits returned: {0}", callback.NumberOfHits);
            }
        }
Beispiel #3
0
        public void LinearCapsuleSweepCallback()
        {
            using (CreateCoreAndScene())
            {
                CreateBoxActor(0, 0, 20);

                Capsule capsule = new Capsule(new Vector3(0, -5, 0), new Vector3(0, 5, 0), 10);

                SweepCallback callback = new SweepCallback();

                this.Scene.LinearCapsuleSweep(capsule, new Vector3(0, 0, 1000), SweepFlags.Dynamics | SweepFlags.Statics, "Dummy Object", callback);

                Assert.IsTrue(callback.NumberOfHits == 1, "The linear capsule sweep should of returned 1 hit. Hits returned: {0}", callback.NumberOfHits);
            }
        }
Beispiel #4
0
		public void LinearCapsuleSweepCallback()
		{
			using( CreateCoreAndScene() )
			{
				CreateBoxActor( 0, 0, 20 );

				Capsule capsule = new Capsule( new Vector3( 0, -5, 0 ), new Vector3( 0, 5, 0 ), 10 );

				SweepCallback callback = new SweepCallback();

				this.Scene.LinearCapsuleSweep( capsule, new Vector3( 0, 0, 1000 ), SweepFlags.Dynamics | SweepFlags.Statics, "Dummy Object", callback );

				Assert.IsTrue( callback.NumberOfHits == 1, "The linear capsule sweep should of returned 1 hit. Hits returned: {0}", callback.NumberOfHits );
			}
		}