Esempio n. 1
0
        public Pattern3D Clone()
        {
            Pattern3D p = (Pattern3D)MemberwiseClone();

            p.tiles3D = null;

            p.offset = new PVector3(offset);
            p.scale  = new PVector3(scale);
            p.rot    = new PVector3(rot);
            p.pivot  = new PVector3(pivot);

            p.deltaAmp    = new PVector3(deltaAmp);
            p.deltaPivot  = new PVector3(deltaPivot);
            p.deltaSpeed  = new PMatrix4x4(deltaSpeed);
            p.deltaOffset = new PMatrix4x4(deltaOffset);

            if (tex != null)
            {
                p.tex = new TextureData(tex);
            }

            p.linkedScript = new List <Script>();
            p.tags         = new List <string>();
            p.TagStr       = TagStr;
            return(p);
        }
Esempio n. 2
0
        public void Clone(Pattern3D p)
        {
            Pattern3D p1 = p.Clone();

            p1.offset.content += new Vector3(8, 8, 8);
            p1.InitData();
            p1.Build();
            pattern3DList.Add(p1);
        }
Esempio n. 3
0
 public void Remove(Pattern3D p)
 {
     if (pattern3DList.Count > 1)
     {
         pattern3DList.Remove(p);
     }
     else
     {
         PatternManager.Remove(this);
     }
 }
Esempio n. 4
0
 public Tile3D(Pattern3D _pattern3D, bool permanent = true)
 {
     pattern3D = _pattern3D;
     sizeZ     = 0;
     pos       = new IntVector2[9];
     for (int i = 0; i < pos.Length; i++)
     {
         pos[i] = EmptyUV;
     }
     pixelUV  = null;
     uvs      = null;
     vertices = null;
     indexes  = null;
     mesh     = null;
 }
Esempio n. 5
0
        public void AssignFrom(Pattern3D pattern, bool fromShape2Pattern = false)
        {
            constraintSize = pattern.constraintSize;
            geo            = pattern.geo;
            sizeZ          = pattern.sizeZ;

            layer = pattern.layer;

            offset.content = pattern.offset;
            scale.content  = pattern.scale;
            rot.content    = pattern.rot;
            pivot.content  = pattern.pivot;

            deltaAmp.content   = pattern.deltaAmp;
            deltaOffset.target = pattern.deltaOffset;
            deltaSpeed.target  = pattern.deltaSpeed;
            deltaPivot.content = pattern.deltaPivot;

            tex    = pattern.tex;
            alpha  = pattern.alpha;
            fn     = pattern.fn;
            enable = pattern.enable;

            antiShadow = pattern.antiShadow;
            flip       = pattern.flip;
            solid      = pattern.solid;
            fullWarp   = pattern.fullWarp;

            CastShadow    = pattern.CastShadow;
            ReceiveShadow = pattern.ReceiveShadow;

            if (fromShape2Pattern)
            {
                TagStr = pattern.TagStr;
                sizeZ  = Mathf.Min(pattern.sizeZ, MAX_ZSIZE);
                Build();
            }
            else
            {
                refPattern3D = pattern;
                tagStr       = pattern.tagStr;
                tags         = pattern.tags;
                linkedScript = pattern.linkedScript;
            }
        }
Esempio n. 6
0
 public void RunUpdateShape(Pattern3D pattern)
 {
     if (updateShape != null)
     {
         if (enable & !error)
         {
             try
             {
                 UpdateContext();
                 session.Global.Set("shape", pattern);
                 session.Global.Set("shape2D", pattern.Shape2D);
                 updateShape();
             }
             catch (LuaException e)
             {
                 error = true;
                 onNewError(e.Message);
             }
         }
     }
 }
Esempio n. 7
0
        public void Reset()
        {
            refPattern3D = this;

            geo   = Geo3DType.CUBE;
            layer = ZLayer.UNIDENTIFIED;

            scale.content  = Vector3.one;
            offset.content = Vector3.zero;
            rot.content    = Vector3.zero;
            pivot.content  = Vector3.one / 2;

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    deltaSpeed[i, j]  = DefaultSpeed;
                    deltaOffset[i, j] = DefaultOffset;
                }
            }
            deltaAmp.content   = Vector3.zero;
            deltaPivot.content = Vector3.one / 2f;
            alpha  = 1;
            tex    = null;
            fn     = false;
            enable = true;

            antiShadow = false;
            flip       = false;
            solid      = false;
            fullWarp   = false;

            CastShadow    = true;
            ReceiveShadow = true;

            tagStr       = string.Empty;
            linkedScript = null;
            tags         = null;
        }