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

            if (el != null)
            {
                factory.DeleteStaticElement(el);
            }
            ent.set <MeshStaticPhysicsElement>(null);
        }
Exemple #2
0
        public void Simulate()
        {
            if (!TW.Graphics.Keyboard.IsKeyPressed(Key.B))
            {
                return;
            }

            var ent = new WorldRendering.Entity
            {
                WorldMatrix =
                    Matrix.Translation(TW.Data.GetSingleton <CameraInfo>().ActiveCamera.ViewInverse.GetTranslation()),
                Mesh   = mesh,
                Solid  = true,
                Static = false
            };


            TW.Data.GetSingleton <Datastore>().Persist(ent);
        }
Exemple #3
0
 public RenderData(VoxelTerrainChunk terrainChunk)
 {
     TerrainChunk = terrainChunk;
     _ent         = new WorldRendering.Entity();
 }
 public EntityPhysX(WorldRendering.Entity ent, MeshPhysicsElementFactory factory)
 {
     Entity       = ent;
     this.factory = factory;
 }