Beispiel #1
0
        /// <summary>
        /// Gets the Iobjects in range.
        /// </summary>
        /// <param name="frustrum">The frustrum.</param>
        /// <param name="condition">The condition.</param>
        /// <param name="resp">The resp.</param>
        public void GetIObjectsInRange(BoundingFrustum frustrum, CullerConditionAvaliator <IPhysicObject, IObject> condition, List <IObject> resp)
        {
            resp.Clear();
            List <BroadPhaseEntry> ent = new List <BroadPhaseEntry>();

            space.BroadPhase.QueryAccelerator.GetEntries(frustrum, ent);
            foreach (var item in ent)
            {
                IPhysicObject phyObj = BepuEntityObject.RecoverIPhysicObjectFromBroadPhase(item);
                if (phyObj != null)
                {
                    if (condition(phyObj, phyObj.ObjectOwner))
                    {
                        resp.Add(phyObj.ObjectOwner);
                    }
                }
            }
        }
Beispiel #2
0
        public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator <IPhysicObject, IObject> CullerAvaliator, List <IPhysicObject> resp)
        {
            resp.Clear();
            List <BroadPhaseEntry> ent = new List <BroadPhaseEntry>();

            space.BroadPhase.QueryAccelerator.GetEntries(new BoundingSphere(position, distance), ent);
            foreach (var item in ent)
            {
                IPhysicObject phyObj = BepuEntityObject.RecoverIPhysicObjectFromBroadPhase(item);
                if (phyObj != null)
                {
                    if (CullerAvaliator(phyObj, phyObj.ObjectOwner))
                    {
                        resp.Add(phyObj);
                    }
                }
            }
        }
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator<IPhysicObject, IObject> CullerAvaliator, List<IPhysicObject> resp)
 {
     resp.Clear();
     List<BroadPhaseEntry> ent = new List<BroadPhaseEntry>();
     space.BroadPhase.QueryAccelerator.GetEntries(new BoundingSphere(position, distance), ent);
     foreach (var item in ent)
     {
         IPhysicObject phyObj = BepuEntityObject.RecoverIPhysicObjectFromBroadPhase(item);
         if (phyObj != null)
         {
             if (CullerAvaliator(phyObj, phyObj.ObjectOwner))
             {
                 resp.Add(phyObj);
             }
         }
     }
 }
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator <IPhysicObject, SceneControl.IObject> CullerAvaliator, System.Collections.Generic.List <IPhysicObject> resp)
 {
     SphereShape.SetUnscaledRadius(distance);
     CollisionObject.WorldTransform = Matrix.CreateTranslation(position);
     CollisionObject.CollisionShape = SphereShape;
     contactcallbac.objs            = new List <IPhysicObject>();
     world.ContactTest(CollisionObject, contactcallbac);
     foreach (var item in contactcallbac.objs)
     {
         if (CullerAvaliator(item, item.ObjectOwner) == true)
         {
             resp.Add(item);
         }
     }
 }
 /// <summary>
 /// Gets the Iobjects in range.
 /// </summary>
 /// <param name="frustrum">The frustrum.</param>
 /// <param name="condition">The condition.</param>
 /// <param name="resp">The resp.</param>
 public void GetIObjectsInRange(BoundingFrustum frustrum, CullerConditionAvaliator<IPhysicObject, IObject> condition,List<IObject> resp)
 {
     resp.Clear();
     List<BroadPhaseEntry> ent = new List<BroadPhaseEntry>();            
     space.BroadPhase.QueryAccelerator.GetEntries(frustrum, ent);            
     foreach (var item in ent)
     {
             IPhysicObject phyObj = BepuEntityObject.RecoverIPhysicObjectFromBroadPhase(item);                
             if (phyObj != null)
             {
                 if (condition(phyObj, phyObj.ObjectOwner))
                 {
                     resp.Add(phyObj.ObjectOwner);
                 }
             }                
     }            
 }
 /// <summary>
 /// Get the objects near the position passed as parameter
 /// </summary>
 /// <param name="position">The position.</param>
 /// <param name="distance">The distance.</param>
 /// <param name="CullerAvaliator">The culler avaliator.</param>
 /// <param name="resp">The resp.</param>
 public abstract void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator<IPhysicObject, IObject> CullerAvaliator, List<IPhysicObject> resp);
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator<IPhysicObject, SceneControl.IObject> CullerAvaliator, List<IPhysicObject> resp)
 {
     SphereGeometry SphereGeometry = new PhysX.SphereGeometry(distance);
     foreach (var item in scene.OverlapMultiple(SphereGeometry, PhysX.Math.Matrix.Translation(position.AsPhysX())))
     {
         if (item.UserData is IPhysicObject)
         {
             IPhysicObject IPhysicObject = item.UserData as IPhysicObject;
             if (CullerAvaliator(IPhysicObject, IPhysicObject.ObjectOwner))
             {
                 resp.Add(IPhysicObject);
             }
         }
     }
 }
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator<IPhysicObject, SceneControl.IObject> CullerAvaliator, System.Collections.Generic.List<IPhysicObject> resp)
 {
     SphereShape.SetUnscaledRadius(distance);
     CollisionObject.WorldTransform = Matrix.CreateTranslation(position);
     CollisionObject.CollisionShape = SphereShape;
     contactcallbac.objs = new List<IPhysicObject>();
     world.ContactTest(CollisionObject, contactcallbac);
     foreach (var item in contactcallbac.objs)
     {
         if (CullerAvaliator(item, item.ObjectOwner) == true)
         {
             resp.Add(item);
         }
     }
      
 }
Beispiel #9
0
 /// <summary>
 /// Get the objects near the position passed as parameter
 /// </summary>
 /// <param name="position">The position.</param>
 /// <param name="distance">The distance.</param>
 /// <param name="CullerAvaliator">The culler avaliator.</param>
 /// <param name="resp">The resp.</param>
 public abstract void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator <IPhysicObject, IObject> CullerAvaliator, List <IPhysicObject> resp);
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator<IPhysicObject, SceneControl.IObject> CullerAvaliator, List<IPhysicObject> resp)
 {
     foreach (var item in Scene.OverlappedShapes(new Sphere(distance, position.AsPhysX()), ShapesType.All))
     {
         if (item.Actor.UserData is IPhysicObject)
         {
             IPhysicObject IPhysicObject = item.Actor.UserData as IPhysicObject;
             if (CullerAvaliator(IPhysicObject, IPhysicObject.ObjectOwner))
             {
                 resp.Add(IPhysicObject);
             }
         }
     }
 }
        public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator <IPhysicObject, SceneControl.IObject> CullerAvaliator, List <IPhysicObject> resp)
        {
            SphereGeometry SphereGeometry = new PhysX.SphereGeometry(distance);

            foreach (var item in scene.OverlapMultiple(SphereGeometry, PhysX.Math.Matrix.Translation(position.AsPhysX())))
            {
                if (item.UserData is IPhysicObject)
                {
                    IPhysicObject IPhysicObject = item.UserData as IPhysicObject;
                    if (CullerAvaliator(IPhysicObject, IPhysicObject.ObjectOwner))
                    {
                        resp.Add(IPhysicObject);
                    }
                }
            }
        }
Beispiel #12
0
 public override void GetPhysicsObjectsInRange(Vector3 position, float distance, CullerConditionAvaliator <IPhysicObject, SceneControl.IObject> CullerAvaliator, List <IPhysicObject> resp)
 {
     foreach (var item in Scene.OverlappedShapes(new Sphere(distance, position.AsPhysX()), ShapesType.All))
     {
         if (item.Actor.UserData is IPhysicObject)
         {
             IPhysicObject IPhysicObject = item.Actor.UserData as IPhysicObject;
             if (CullerAvaliator(IPhysicObject, IPhysicObject.ObjectOwner))
             {
                 resp.Add(IPhysicObject);
             }
         }
     }
 }