public void SetCollisionCallback(CMaterial pId0, CMaterial pId1, CMaterialPhysicsSpecialEffect pSpecialEffect, EventHandler<CContactBeginEventArgs> pContactBegin, EventHandler<CContactProcessEventArgs> pContactProcess, EventHandler<CContactEndEventArgs> pContactEnd)
		{
            IntPtr aKey = IntPtr.Zero;
            if (pSpecialEffect != null)
            {
                aKey = (IntPtr)pSpecialEffect.GetHashCode();
                CHashTables.MaterialsUserData.Add(aKey, pSpecialEffect);
            }

            // Takes in a delegate, stores it, but then hooks 
			m_ContactBegin = pContactBegin;
			m_NewtonContactBegin = new Newton.NewtonContactBegin(InvokeContactBegin);

			m_ContactProcess = pContactProcess;
			m_NewtonContactProcess = new Newton.NewtonContactProcess(InvokeContactProcess);

			m_ContactEnd = pContactEnd;
			m_NewtonContactEnd = new Newton.NewtonContactEnd(InvokeContactEnd);

			Newton.NewtonMaterialSetCollisionCallback(m_World.Handle, pId0.ID, pId1.ID, aKey, m_NewtonContactBegin, m_NewtonContactProcess, m_NewtonContactEnd);
		}
Example #2
0
        public void SetCollisionCallback(CMaterial pId0, CMaterial pId1, CMaterialPhysicsSpecialEffect pSpecialEffect, EventHandler <CContactBeginEventArgs> pContactBegin, EventHandler <CContactProcessEventArgs> pContactProcess, EventHandler <CContactEndEventArgs> pContactEnd)
        {
            IntPtr aKey = IntPtr.Zero;

            if (pSpecialEffect != null)
            {
                aKey = (IntPtr)pSpecialEffect.GetHashCode();
                CHashTables.MaterialsUserData.Add(aKey, pSpecialEffect);
            }

            // Takes in a delegate, stores it, but then hooks
            m_ContactBegin       = pContactBegin;
            m_NewtonContactBegin = new Newton.NewtonContactBegin(InvokeContactBegin);

            m_ContactProcess       = pContactProcess;
            m_NewtonContactProcess = new Newton.NewtonContactProcess(InvokeContactProcess);

            m_ContactEnd       = pContactEnd;
            m_NewtonContactEnd = new Newton.NewtonContactEnd(InvokeContactEnd);

            Newton.NewtonMaterialSetCollisionCallback(m_World.Handle, pId0.ID, pId1.ID, aKey, m_NewtonContactBegin, m_NewtonContactProcess, m_NewtonContactEnd);
        }
 public CollisionEndEventArgs(IntPtr materialPtr, IntPtr contactPoint, CMaterial material1, CMaterial material2)
 {
     _materialPtr = materialPtr;
     _contactPoint = contactPoint;
     _material1 = material1;
     _material2 = material2;
 }
		public CMaterialPhysicsSpecialEffect GetSpecialEffect(CMaterial pId0, CMaterial pId1)
		{
			IntPtr aKey = Newton.NewtonMaterialGetUserData(m_World.Handle, pId0.ID, pId1.ID);

			return (CMaterialPhysicsSpecialEffect)CHashTables.MaterialsUserData[aKey];
		}
		public void SetDefaultFriction(CMaterial pId0, CMaterial pId1, float pStaticFriction, float pKineticFriction)
		{
			Newton.NewtonMaterialSetDefaultFriction(m_World.Handle, pId0.ID, pId1.ID, pStaticFriction, pKineticFriction);
		}
		public void SetContinuousCollisionMode(CMaterial pId0, CMaterial pId1, int pState)
		{
			Newton.NewtonMaterialSetContinuousCollisionMode(m_World.Handle, pId0.ID, pId1.ID, pState);
		}
		public void SetDefaultCollidable(CMaterial pId0, CMaterial pId1, int pState)
		{
			Newton.NewtonMaterialSetDefaultCollidable(m_World.Handle, pId0.ID, pId1.ID, pState);
		}
		public void SetDefaultElasticity(CMaterial pId0, CMaterial pId1, float pElasticCoef)
		{
			Newton.NewtonMaterialSetDefaultElasticity(m_World.Handle, pId0.ID, pId1.ID, pElasticCoef);
		}
		public void SetDefaultSoftness(CMaterial pId0, CMaterial pId1, float pSoftness)
		{
			Newton.NewtonMaterialSetDefaultSoftness(m_World.Handle, pId0.ID, pId1.ID, pSoftness);
		}
Example #10
0
        public CMaterialPhysicsSpecialEffect GetSpecialEffect(CMaterial pId0, CMaterial pId1)
        {
            IntPtr aKey = Newton.NewtonMaterialGetUserData(m_World.Handle, pId0.ID, pId1.ID);

            return((CMaterialPhysicsSpecialEffect)CHashTables.MaterialsUserData[aKey]);
        }
Example #11
0
 public void SetDefaultFriction(CMaterial pId0, CMaterial pId1, float pStaticFriction, float pKineticFriction)
 {
     Newton.NewtonMaterialSetDefaultFriction(m_World.Handle, pId0.ID, pId1.ID, pStaticFriction, pKineticFriction);
 }
Example #12
0
 public void SetContinuousCollisionMode(CMaterial pId0, CMaterial pId1, int pState)
 {
     Newton.NewtonMaterialSetContinuousCollisionMode(m_World.Handle, pId0.ID, pId1.ID, pState);
 }
Example #13
0
 public void SetDefaultCollidable(CMaterial pId0, CMaterial pId1, int pState)
 {
     Newton.NewtonMaterialSetDefaultCollidable(m_World.Handle, pId0.ID, pId1.ID, pState);
 }
Example #14
0
 public void SetDefaultElasticity(CMaterial pId0, CMaterial pId1, float pElasticCoef)
 {
     Newton.NewtonMaterialSetDefaultElasticity(m_World.Handle, pId0.ID, pId1.ID, pElasticCoef);
 }
Example #15
0
 public void SetDefaultSoftness(CMaterial pId0, CMaterial pId1, float pSoftness)
 {
     Newton.NewtonMaterialSetDefaultSoftness(m_World.Handle, pId0.ID, pId1.ID, pSoftness);
 }