Exemplo n.º 1
0
        public override void Print(SectionLayer layer, Thing thing)
        {
            Vector3 center = thing.TrueCenter() + (shadowInfo.offset + new Vector3(GlobalShadowPosOffsetX, 0f, GlobalShadowPosOffsetZ)).RotatedBy(thing.Rotation);

            center.y = AltitudeLayer.Shadows.AltitudeFor();
            Printer_Shadow.PrintShadow(layer, center, shadowInfo, thing.Rotation);
        }
Exemplo n.º 2
0
        public virtual void Print(SectionLayer layer, Thing thing)
        {
            Vector2 size;
            bool    flag;

            if (this.ShouldDrawRotated)
            {
                size = this.drawSize;
                flag = false;
            }
            else
            {
                size = (thing.Rotation.IsHorizontal ? this.drawSize.Rotated() : this.drawSize);
                flag = (thing.Rotation == Rot4.West);
                if (this.data != null && !this.data.allowFlip)
                {
                    flag = false;
                }
            }
            float num = 0f;

            if (this.ShouldDrawRotated)
            {
                num = thing.Rotation.AsAngle;
            }
            if (flag && this.data != null)
            {
                num += this.data.flipExtraRotation;
            }
            Printer_Plane.PrintPlane(layer, thing.TrueCenter(), size, this.MatAt(thing.Rotation, thing), num, flag, null, null, 0.01f);
            if (this.ShadowGraphic != null && thing != null)
            {
                this.ShadowGraphic.Print(layer, thing);
            }
        }
Exemplo n.º 3
0
        public virtual void Print(SectionLayer layer, Thing thing)
        {
            Vector2 size;
            bool    flag;

            if (ShouldDrawRotated)
            {
                size = drawSize;
                flag = false;
            }
            else
            {
                size = (thing.Rotation.IsHorizontal ? drawSize.Rotated() : drawSize);
                flag = ((thing.Rotation == Rot4.West && WestFlipped) || (thing.Rotation == Rot4.East && EastFlipped));
            }
            float num = AngleFromRot(thing.Rotation);

            if (flag && data != null)
            {
                num += data.flipExtraRotation;
            }
            Vector3 center = thing.TrueCenter() + DrawOffset(thing.Rotation);

            Printer_Plane.PrintPlane(layer, center, size, MatAt(thing.Rotation, thing), num, flag);
            if (ShadowGraphic != null && thing != null)
            {
                ShadowGraphic.Print(layer, thing);
            }
        }
        public override void Print(SectionLayer layer, Thing thing)
        {
            Vector3 center = thing.TrueCenter() + this.shadowInfo.offset.RotatedBy(thing.Rotation);

            center.y = Altitudes.AltitudeFor(AltitudeLayer.Shadows);
            Printer_Shadow.PrintShadow(layer, center, this.shadowInfo, thing.Rotation);
        }
Exemplo n.º 5
0
        public virtual void Print(SectionLayer layer, Thing thing)
        {
            Vector2 size;
            bool    flag;

            if (this.ShouldDrawRotated)
            {
                size = this.drawSize;
                flag = false;
            }
            else
            {
                if (!thing.Rotation.IsHorizontal)
                {
                    size = this.drawSize;
                }
                else
                {
                    size = this.drawSize.Rotated();
                }
                flag = ((thing.Rotation == Rot4.West && this.WestFlipped) || (thing.Rotation == Rot4.East && this.EastFlipped));
            }
            float num = this.AngleFromRot(thing.Rotation);

            if (flag && this.data != null)
            {
                num += this.data.flipExtraRotation;
            }
            Printer_Plane.PrintPlane(layer, thing.TrueCenter(), size, this.MatAt(thing.Rotation, thing), num, flag, null, null, 0.01f, 0f);
            if (this.ShadowGraphic != null && thing != null)
            {
                this.ShadowGraphic.Print(layer, thing);
            }
        }
Exemplo n.º 6
0
        public override void Print(SectionLayer layer, Thing thing)
        {
            Vector3 a = thing.TrueCenter();

            Rand.PushState();
            Rand.Seed = thing.Position.GetHashCode();
            Filth filth = thing as Filth;
            int   num;

            if (filth == null)
            {
                num = 3;
            }
            else
            {
                num = filth.thickness;
            }
            for (int i = 0; i < num; i++)
            {
                Material matSingle = this.MatSingle;
                Vector3  center    = a + new Vector3(Rand.Range(-0.45f, 0.45f), 0f, Rand.Range(-0.45f, 0.45f));
                Vector2  size      = new Vector2(Rand.Range(0.8f, 1.2f), Rand.Range(0.8f, 1.2f));
                float    rot       = (float)Rand.RangeInclusive(0, 360);
                bool     flipUv    = Rand.Value < 0.5f;
                Printer_Plane.PrintPlane(layer, center, size, matSingle, rot, flipUv, null, null, 0.01f, 0f);
            }
            Rand.PopState();
        }
Exemplo n.º 7
0
        public Effecter Spawn(Thing target, Map map, float scale = 1f)
        {
            Effecter effecter = new Effecter(this);

            effecter.offset = target.TrueCenter() - target.Position.ToVector3Shifted();
            effecter.scale  = scale;
            TargetInfo targetInfo = new TargetInfo(target.Position, map);

            effecter.Trigger(targetInfo, targetInfo);
            return(effecter);
        }
Exemplo n.º 8
0
        public override void DrawWorker(Vector3 loc, Rot4 rot, ThingDef thingDef, Thing thing, float extraRotation)
        {
            Rand.PushState();
            Rand.Seed = thing.thingIDNumber.GetHashCode();
            float     angle  = (float)Rand.Range(0, 360) + ((thing as Gas)?.graphicRotation ?? 0f);
            Vector3   pos    = thing.TrueCenter() + new Vector3(Rand.Range(-0.45f, 0.45f), 0f, Rand.Range(-0.45f, 0.45f));
            Vector3   s      = new Vector3(Rand.Range(0.8f, 1.2f) * drawSize.x, 0f, Rand.Range(0.8f, 1.2f) * drawSize.y);
            Matrix4x4 matrix = default(Matrix4x4);

            matrix.SetTRS(pos, Quaternion.AngleAxis(angle, Vector3.up), s);
            Graphics.DrawMesh(MeshPool.plane10, matrix, MatSingle, 0);
            Rand.PopState();
        }
        public override void Print(SectionLayer layer, Thing thing)
        {
            Vector3 a = thing.TrueCenter();

            Rand.PushState();
            Rand.Seed = thing.Position.GetHashCode();
            int num = (thing as Filth)?.thickness ?? 3;

            for (int i = 0; i < num; i++)
            {
                Material matSingle = MatSingle;
                Vector3  center    = a + new Vector3(Rand.Range(-0.45f, 0.45f), 0f, Rand.Range(-0.45f, 0.45f));
                Vector2  size      = new Vector2(Rand.Range(data.drawSize.x * 0.8f, data.drawSize.x * 1.2f), Rand.Range(data.drawSize.y * 0.8f, data.drawSize.y * 1.2f));
                float    rot       = Rand.RangeInclusive(0, 360);
                bool     flipUv    = Rand.Value < 0.5f;
                Printer_Plane.PrintPlane(layer, center, size, matSingle, rot, flipUv);
            }
            Rand.PopState();
        }
Exemplo n.º 10
0
        public override void Print(SectionLayer layer, Thing thing)
        {
            Material mat = this.LinkedDrawMatFrom(thing, thing.Position);

            Printer_Plane.PrintPlane(layer, thing.TrueCenter(), new Vector2(1f, 1f), mat, 0f, false, null, null, 0.01f, 0f);
        }
Exemplo n.º 11
0
 private static void DrawTargetingHighlight_Thing(Thing t)
 {
     Graphics.DrawMesh(MeshPool.plane10, t.TrueCenter() + Altitudes.AltIncVect, t.Rotation.AsQuat, GenDraw.CurTargetingMat, 0);
 }