Exemple #1
0
        public DiscreteDynamicsWorld(CollisionDispatcher a_dispatcher, BroadphaseInterface a_broadphase, ConstraintSolver a_solver, CollisionConfiguration a_configuration)
        {
            m_objectPtr      = DiscreteDynamicsWorld_new(a_dispatcher.Ptr, a_broadphase.Ptr, a_solver.Ptr, a_configuration.Ptr);
            m_debugDrawerPtr = IntPtr.Zero;

            m_drawLineEvent  = DrawLine;
            m_errorEvent     = Error;
            m_collisionEvent = OnCollision;

            m_objectLookup = new Dictionary <IntPtr, CollisionObject>();
        }
Exemple #2
0
        public async Task ConnectTest(string room)
        {
            string connectionId = "mockConnection";
            var    hub          = CreateTestHub(connectionId);
            await hub.Connect(room);

            var reader = DrawHub.Connection(connectionId).DrawEvents.Reader;

            Assert.AreEqual(room, DrawHub.Connection(connectionId).Room);

            DrawLineEvent ev1 = new DrawLineEvent
            {
                From = new Point {
                    X = 100, Y = 200
                },
                To = new Point {
                    X = 300, Y = 400
                }
            };
            DrawLineEvent ev2 = new DrawLineEvent
            {
                From = new Point {
                    X = 500, Y = 600
                },
                To = new Point {
                    X = 700, Y = 800
                }
            };

            await hub.SendDrawLine(ev1);

            await hub.SendDrawLine(ev2);

            var ev1Returned = await reader.ReadAsync();

            var ev2Returned = await reader.ReadAsync();

            Assert.AreEqual(ev1.From, ev1Returned.From);
            Assert.AreEqual(ev1.To, ev1Returned.To);
            Assert.AreEqual(ev2.From, ev2Returned.From);
            Assert.AreEqual(ev2.To, ev2Returned.To);
        }
Exemple #3
0
 public void Handle(DrawLineEvent message)
 {
     MediaContainer.Children.Add(message.Line);
 }
Exemple #4
0
 static extern IntPtr ENativeDebugDrawer_new(DrawLineEvent a_drawLineEvent, ErrorEvent a_errorEvent);