public void CreateUserMesh(Vector3D pMinBox, Vector3D pMaxBox,
			EventHandler<CUserMeshCollisionCollideEventArgs> pCollideCallback,
			EventHandler<CUserMeshCollisionRayHitEventArgs> pRayHitCallback,
			EventHandler<CUserMeshCollisionDestroyEventArgs> pDestroyCallback)
		{
			m_UserMeshCollisionCollide = pCollideCallback;
			m_NewtonUserMeshCollisionCollide = new Newton.NewtonUserMeshCollisionCollide(InvokeUserMeshCollisionCollide);

			m_UserMeshCollisionRayHit = pRayHitCallback;
			m_NewtonUserMeshCollisionRayHit = new Newton.NewtonUserMeshCollisionRayHit(InvokeUserMeshCollisionRayHit);

			m_UserMeshCollisionDestroy = pDestroyCallback;
			m_NewtonUserMeshCollisionDestroy = new Newton.NewtonUserMeshCollisionDestroy(InvokeUserMeshCollisionDestroy);

			m_Handle = Newton.NewtonCreateUserMeshCollision(m_World.Handle,
				new NewtonVector3(pMinBox).NWVector3,
				new NewtonVector3(pMaxBox).NWVector3,
				new IntPtr(),
				m_NewtonUserMeshCollisionCollide,
				m_NewtonUserMeshCollisionRayHit,
				m_NewtonUserMeshCollisionDestroy);

			CHashTables.Collision.Add(m_Handle, this);
		}
Beispiel #2
0
        public void CreateUserMesh(Vector3D pMinBox, Vector3D pMaxBox,
                                   EventHandler <CUserMeshCollisionCollideEventArgs> pCollideCallback,
                                   EventHandler <CUserMeshCollisionRayHitEventArgs> pRayHitCallback,
                                   EventHandler <CUserMeshCollisionDestroyEventArgs> pDestroyCallback)
        {
            m_UserMeshCollisionCollide       = pCollideCallback;
            m_NewtonUserMeshCollisionCollide = new Newton.NewtonUserMeshCollisionCollide(InvokeUserMeshCollisionCollide);

            m_UserMeshCollisionRayHit       = pRayHitCallback;
            m_NewtonUserMeshCollisionRayHit = new Newton.NewtonUserMeshCollisionRayHit(InvokeUserMeshCollisionRayHit);

            m_UserMeshCollisionDestroy       = pDestroyCallback;
            m_NewtonUserMeshCollisionDestroy = new Newton.NewtonUserMeshCollisionDestroy(InvokeUserMeshCollisionDestroy);

            m_Handle = Newton.NewtonCreateUserMeshCollision(m_World.Handle,
                                                            new NewtonVector3(pMinBox).NWVector3,
                                                            new NewtonVector3(pMaxBox).NWVector3,
                                                            new IntPtr(),
                                                            m_NewtonUserMeshCollisionCollide,
                                                            m_NewtonUserMeshCollisionRayHit,
                                                            m_NewtonUserMeshCollisionDestroy);

            CHashTables.Collision.Add(m_Handle, this);
        }