コード例 #1
0
ファイル: Scrolls.cs プロジェクト: aglab2/f3dfix
        public TextureScroll(int segmentedAddress, byte speed, byte acts, TextureAxis axis, int behav, int offset) : base(speed, acts, axis, offset, behav)
        {
            if (speed < 16)
            {
                throw new Exception("TextureScroll can't scroll less than 16 UVs per frame");
            }

            this.segmentedAddress = segmentedAddress;
        }
コード例 #2
0
    public Side(int id, Plane plane, VMT?material, TextureAxis uAxis, TextureAxis vAxis,
                Displacement?displacement)
    {
        ID           = id;
        Plane        = plane;
        Material     = material;
        _uAxis       = uAxis;
        _vAxis       = vAxis;
        Displacement = displacement;

        Polygon = Plane.ToPolygon(this);
    }
コード例 #3
0
    public static void TestConstruction()
    {
        var axis  = new TextureAxis(Vector.One, 1, 1);
        var plane = Plane.CreateFromVertices(Vector.Zero, Vector.UnitZ, Vector.UnitY);
        var side  = new Side(123, plane, null, axis, axis, null);

        Assert.That(side.Polygon.Count, Is.EqualTo(4));
        Assert.That(side.Polygon.Vertices.Co[0].X, Is.EqualTo(0.0));
        Assert.That(side.Polygon.Vertices.Co[1].X, Is.EqualTo(0.0));
        Assert.That(side.Polygon.Vertices.Co[2].X, Is.EqualTo(0.0));
        Assert.That(side.Polygon.Vertices.Co[3].X, Is.EqualTo(0.0));
        Assert.That(side.Plane.Normal, Is.EqualTo(-Vector.UnitX));
        Assert.That(side.Plane.D, Is.EqualTo(0.0));
    }
コード例 #4
0
    public static void TestRealWorldCSG()
    {
        var planes = new[]
        {
            "(-88 7020 -3248) (-160 6848 -3024) (-88 7020 -3024)".ParsePlaneString(),
            "(-88.9224 7020.3862 -3248) (-88.9224 7020.3862 -3024) (-160.9224 6848.3862 -3024)".ParsePlaneString(),
            "(-88 7020 -3248) (-88.9224 7020.3862 -3248) (-159.9998 6848 -3248)".ParsePlaneString(),
            "(-159.9998 6848 -3248) (-160.9223 6848.3862 -3248) (-160 6848 -3024)".ParsePlaneString(),
            "(-160 6848 -3024) (-160.9224 6848.3862 -3024) (-88 7020 -3024)".ParsePlaneString(),
            "(-88 7020 -3024) (-88.9224 7020.3862 -3024) (-88 7020 -3248)".ParsePlaneString(),
        };
        var axis  = new TextureAxis(Vector.One, 1, 1);
        var sides = planes.Select(plane =>
                                  new Side(123, plane, VMT.Empty, axis, axis, null)).ToList();

        var solid = new Solid(2, sides);
        var cos   = solid.Vertices.ToList();

        Assert.That(cos.Count, Is.EqualTo(8));
        Assert.That(cos.Select(static _ => _.Co.X).NotInRange(-161, -87.9), Is.Empty);
コード例 #5
0
ファイル: Scrolls.cs プロジェクト: aglab2/f3dfix
 public EditorScroll(int vertexCount, int segmentedAddress, byte speed, byte acts, TextureAxis axis, int behav, int offset) : base(speed, acts, axis, offset, behav)
 {
     this.vertexCount      = vertexCount;
     this.segmentedAddress = segmentedAddress;
 }
コード例 #6
0
ファイル: Scrolls.cs プロジェクト: aglab2/f3dfix
 public Scroll(byte speed, byte acts, TextureAxis axis)
 {
     this.speed = speed;
     this.acts  = acts;
     this.axis  = axis;
 }
コード例 #7
0
ファイル: Scrolls.cs プロジェクト: aglab2/f3dfix
 public ScrollObject(byte speed, byte acts, TextureAxis axis, int romOffset, int behavior) : base(speed, acts, axis)
 {
     this.romOffset = romOffset;
     this.behavior  = behavior;
 }