private void deletePhysicsElement(MeshPhysicsElementFactory factory, WorldRendering.Entity ent)
        {
            var el = ent.get <MeshStaticPhysicsElement>();

            if (el != null)
            {
                factory.DeleteStaticElement(el);
            }
            ent.set <MeshStaticPhysicsElement>(null);
        }
예제 #2
0
        public PhysXSimulator()
        {
            data = TW.Data.GetSingleton <PhysXData>();

            root = new ClientPhysicsQuadTreeNode(
                new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)).xna());
            QuadTree.Split(root, 6);

            data.RootNode = root;

            factory = new MeshPhysicsElementFactory(TW.Physics, root);

            factory.Initialize();

            entityUpdater = new EntityPhysXUpdater(factory, root);

            DebugRenderer = new PhysicsDebugRenderer(TW.Graphics, TW.Physics.Scene);
            DebugRenderer.Initialize();
        }
 public EntityPhysX(WorldRendering.Entity ent, MeshPhysicsElementFactory factory)
 {
     Entity       = ent;
     this.factory = factory;
 }
 public EntityPhysXUpdater(MeshPhysicsElementFactory factory, ClientPhysicsQuadTreeNode root)
 {
     this.factory = factory;
     this.root    = root;
 }
예제 #5
0
 public MeshPhysicsFactoryXNA(PhysicsEngine engine, ClientPhysicsQuadTreeNode root)
 {
     Factory = new MeshPhysicsElementFactory(engine, root);
 }