Example #1
0
        public Portal(Sector sourceSector, Sector destinationSector, Vector3 position, Quaternion rotation,
                      IEnumerable <Triangle> triangles)
        {
            if (sourceSector == null)
            {
                throw new ArgumentNullException("sourceSector");
            }
            if (destinationSector == null)
            {
                throw new ArgumentNullException("destinationSector");
            }
            if (triangles == null)
            {
                throw new ArgumentNullException("triangles");
            }
            if (sourceSector == destinationSector)
            {
                throw new ArgumentException("sourceSector and destinationSector must differ.");
            }

            this.sourceSector      = sourceSector;
            this.destinationSector = destinationSector;
            this.worldMatrix       = Matrix.Transformation(Vector3.Zero, Quaternion.Identity, new Vector3(1f), Vector3.Zero, rotation,
                                                           position);

            this.triangles.AddRange(triangles);
            this.trianglesRO = new TriangleReadOnlyCollection(this.triangles);
            CalculateBounary();
        }
Example #2
0
        public Portal(Sector sourceSector, Sector destinationSector, Vector3 position, Quaternion rotation,
            IEnumerable<Triangle> triangles)
        {
            if (sourceSector == null)
                throw new ArgumentNullException("sourceSector");
            if (destinationSector == null)
                throw new ArgumentNullException("destinationSector");
            if (triangles == null)
                throw new ArgumentNullException("triangles");
            if (sourceSector == destinationSector)
                throw new ArgumentException("sourceSector and destinationSector must differ.");

            this.sourceSector = sourceSector;
            this.destinationSector = destinationSector;
            this.worldMatrix = Matrix.Transformation(Vector3.Zero, Quaternion.Identity, new Vector3(1f), Vector3.Zero, rotation,
                                                     position);

            this.triangles.AddRange(triangles);
            this.trianglesRO = new TriangleReadOnlyCollection(this.triangles);
            CalculateBounary();
        }