public void update(float speed,float amplitude,IBroadphaseInterface pbi)
		{
			time +=	speed;
			center.X = (float)(System.Math.Cos(time*2.17f)*amplitude+System.Math.Sin(time)*amplitude/2f);
			center.Y =	(float)(System.Math.Cos(time*1.38f)*amplitude+System.Math.Sin(time)*amplitude);
			center.Z = (float)(System.Math.Sin(time*0.777f)*amplitude);
			Vector3 temp1 = center-extents;
			Vector3 temp2 = center+extents;
			pbi.SetAabb(proxy,ref temp1,ref temp2,null);
		}
Пример #2
0
        public void update(float speed, float amplitude, IBroadphaseInterface pbi)
        {
            time    += speed;
            center.X = (float)(Math.Cos(time * 2.17f) * amplitude + Math.Sin(time) * amplitude / 2f);
            center.Y = (float)(Math.Cos(time * 1.38f) * amplitude + Math.Sin(time) * amplitude);
            center.Z = (float)(Math.Sin(time * 0.777f) * amplitude);
            IndexedVector3 temp1 = center - extents;
            IndexedVector3 temp2 = center + extents;

            pbi.SetAabb(proxy, ref temp1, ref temp2, null);
        }
Пример #3
0
 public override void UpdateAabbs()
 {
     //IndexedMatrix predictedTrans = IndexedMatrix.Identity;
     foreach (CollisionObject colObj in m_collisionObjects)
     {
         RigidBody body = RigidBody.Upcast(colObj);
         if (body != null)
         {
             if (body.IsActive() && (!body.IsStaticObject()))
             {
                 IndexedVector3 minAabb;
                 IndexedVector3 maxAabb;
                 colObj.GetCollisionShape().GetAabb(colObj.GetWorldTransform(), out minAabb, out maxAabb);
                 IBroadphaseInterface bp = GetBroadphase();
                 bp.SetAabb(body.GetBroadphaseHandle(), ref minAabb, ref maxAabb, m_dispatcher1);
             }
         }
     }
 }