Exemplo n.º 1
0
        public WallMeshComponents(Wall wall, Texture texture)
        {
            this.wall          = wall;
            this.texture       = texture;
            this.gameObject    = new GameObject($"Wall {wall.Index} ({wall.Section}: Line {wall.Side.Line.Index}, Side {wall.Side.Index})");
            this.Mesh          = CreateMesh();
            this.Filter        = CreateFilter();
            this.Renderer      = CreateRenderer();
            this.Collider      = CreateBoxCollider();
            this.collisionInfo = CollisionInfo.CreateOn(gameObject, wall);

            Update(0);
        }
Exemplo n.º 2
0
        public SubsectorPlane(int index, SectorPlane sectorPlane, List <Seg2F> edges)
        {
            Debug.Assert(edges.Count >= 3, $"Two or less lines is not a polygon (subsector plane {index})");

            string facingText = sectorPlane.IsCeiling ? "Ceiling" : "Floor";

            Index          = index;
            SectorPlane    = sectorPlane;
            Edges          = edges.ToList();
            gameObject     = new GameObject($"Subsector {index} (Sector {sectorPlane.Sector.Index} Plane {sectorPlane.Index} {facingText})");
            MeshComponents = new SubsectorMeshComponents(this, sectorPlane, edges, gameObject);
            collisionInfo  = CollisionInfo.CreateOn(gameObject, this);

            sectorPlane.SubsectorPlanes.Add(this);
        }
Exemplo n.º 3
0
 public Entity(int id, ActorDefinition definition, Vec3F position, BitAngle angle,
               Sector sector, EntityManager manager)
 {
     ID             = id;
     Definition     = definition;
     Position       = new Vec3Interpolation(position);
     Angle          = angle;
     Box            = CreateBoxAt(position);
     Sector         = sector;
     entityManager  = manager;
     frameTracker   = new FrameTracker(this);
     GameObject     = CreateGameObject();
     meshComponents = new EntityMeshComponents(this, GameObject);
     collider       = CreateCollider();
     collisionInfo  = CollisionInfo.CreateOn(GameObject, this);
 }