Beispiel #1
0
 public PlayerBehavior()
     : base("PlayerBehavior")
 {
     this.direction = NONE;
     this.trans2D = null;
     this.currentState = PlayerState.Idle;
 }
Beispiel #2
0
 public Text(
     string textContent,
     SpriteFont spriteFont,
     Transform2D parentTransform = null)
     : this(textContent, spriteFont, new Transform2D(), parentTransform)
 {
 }
        public BackgroundKite(float initialX)
        {
            var scale = this.GetRandomScale();

            var scrollBehavior = new ScrollBehavior(scale * 0.1f);

            var transform = new Transform2D()
            {
                X = initialX,
                Y = WaveServices.ViewportManager.VirtualHeight,
                Origin = Vector2.UnitY,
                XScale = scale,
                YScale = scale
            };

            var spriteAtlas = new SpriteAtlas(Textures.GAME_ATLAS, this.GetRandomTextureName());

            this.entity = new Entity()
                .AddComponent(transform)
                .AddComponent(spriteAtlas)
                .AddComponent(new SpriteAtlasRenderer(DefaultLayers.Opaque))
                .AddComponent(scrollBehavior);

            scrollBehavior.EntityOutOfScreen += (entity) =>
            {
                transform.X = WaveServices.ViewportManager.RightEdge;

                var newScale = this.GetRandomScale();
                transform.XScale = newScale;
                transform.YScale = newScale;

                //Set a new kite texture
                spriteAtlas.TextureName = this.GetRandomTextureName();
            };
        }
 public EnemyBehavior()
     : base()
 {
     this.transform = null;
     this.speed = 2;
     this.shootRatio = TimeSpan.FromMilliseconds(WaveServices.Random.Next(1100, 1600));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SpriteRenderer" /> class.
 /// </summary>
 /// <param name="layerType">
 /// Layer type (available at <see cref="DefaultLayers"/>).
 /// Example: new SpriteRenderer(DefaultLayers.Alpha)
 /// </param>
 /// <param name="samplerMode">
 /// Sampler mode <see cref="AddressMode"/>
 /// Example: new SpriteRenderer(DefaultLayers.Alpha)
 /// </param>
 public SpriteRenderer(Type layerType, AddressMode samplerMode = AddressMode.LinearClamp)
     : base("SpriteRenderer" + instances++, layerType)
 {
     this.Transform2D = null;
     this.Sprite = null;
     this.samplerMode = samplerMode;            
 }
 public LinkedRopeBehavior(Entity from, Vector2 fromOrigin, Entity to, Vector2 toOrigin)
 {
     this.fromTransform = from.FindComponent<Transform2D>();
     this.toTransform = to.FindComponent<Transform2D>();
     this.fromOrigin = fromOrigin;
     this.toOrigin = toOrigin;
 }
Beispiel #7
0
        public Identity2D(bool DependsOnCamera)
        {
            Transform = Transform2D.Identity;
            Parent = null;

            this.DependsOnCamera = DependsOnCamera;
        }
Beispiel #8
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            this.player = EntityManager.Find<Player>("player");
            this.playerTransform = this.player.Entity.FindComponent<Transform2D>();
        }
Beispiel #9
0
 public StarBehavior(float speed, float margin)
     : base()
 {
     this.transform = null;
     this.speed = speed;
     this.margin = margin;
 }
        private RectangleF GetTotalRectangle(Entity entity, Transform2D parentTransform2D)
        {
            RectangleF result = RectangleF.Empty;
            var entityTransform = entity.FindComponent<Transform2D>();

            if (entityTransform != null)
            {
                result = entityTransform.Rectangle;

                if (parentTransform2D != null)
                {
                    result.Offset(
                        entityTransform.X - (entityTransform.Rectangle.Width * entityTransform.Origin.X),
                        entityTransform.Y - (entityTransform.Rectangle.Height * entityTransform.Origin.Y));

                    result.Offset(
                        -1 * (parentTransform2D.X - (parentTransform2D.Rectangle.Width * parentTransform2D.Origin.X)),
                        -1 * (parentTransform2D.Y - (parentTransform2D.Rectangle.Height * parentTransform2D.Origin.Y)));
                }

                foreach (var child in entity.ChildEntities)
                {
                    var childTotalRectangle = this.GetTotalRectangle(child, entityTransform);

                    RectangleF.Union(ref result, ref childTotalRectangle, out result);
                }
            }

            return result;
        }
Beispiel #11
0
 public Text(
     string textContent,
     SpriteFont spriteFont,
     Transform2D transform,
     Transform2D parentTransform = null)
     : this(textContent, spriteFont, Color.Black, transform, parentTransform)
 {
 }
Beispiel #12
0
 public EnemyBehavior()
     : base()
 {
     transform = null;
     speed = 2;
     deepPosition = (int)-WaveServices.ViewportManager.VirtualHeight * 3;
     this.shootRatio = TimeSpan.FromMilliseconds(1200);
 }
Beispiel #13
0
 public TimBehavior()
     : base("TimBehavior")
 {
     this.direction = NONE;
     this.anim2D = null;
     this.trans2D = null;
     this.currentState = AnimState.Idle;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AnimatedSpriteRenderer" /> class.
 /// </summary>
 /// <param name="layer">Layer type.</param>
 /// <param name="samplerMode">The sampler mode.</param>
 public AnimatedSpriteRenderer(Type layer, AddressMode samplerMode = AddressMode.LinearClamp)
     : base("AnimatedSpriteRenderer" + instances++, layer)
 {
     this.Transform2D = null;
     this.Sprite = null;            
     this.Animation2D = null;
     this.samplerMode = samplerMode;
 }
Beispiel #15
0
        protected override void Initialize()
        {
            base.Initialize();

            if (!string.IsNullOrEmpty(this.TargetPath))
            {
                this.targetTrasnform = this.EntityManager.Find(this.TargetPath)?.FindComponent<Transform2D>();
            }
        }
Beispiel #16
0
 public PlayerAIBehavior(Entity ball)
     : base("PlayerIABehavior")
 {
     this.trans2D = null;
     this.ball = ball;
     this.transBall2D = ball.FindComponent<Transform2D>();
     this.ballBehavior = ball.FindComponent<BallBehavior>();
     this.direction = ballBehavior.HorizontalDirection;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SpriteRenderer" /> class.
 /// </summary>
 /// <param name="layerType">Type of the layer.</param>
 public SpriteRenderer(Type layerType)
     : base("SpriteRenderer" + instances++, layerType)
 {
     this.Transform2D = null;
     this.Sprite = null;
     this.scale = Vector2.Zero;
     this.position = Vector2.Zero;
     this.origin = Vector2.Zero;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageControlRenderer" /> class.
 /// </summary>
 /// <param name="layerType">Type of the layer.</param>
 public ImageControlRenderer(Type layerType)
     : base("ImageRenderer" + instances++, layerType)
 {
     this.Transform2D = null;
     this.Image = null;
     this.scale = Vector2.Zero;
     this.position = Vector2.Zero;
     this.origin = Vector2.Zero;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AnimatedSpriteRenderer" /> class.
 /// </summary>
 /// <param name="layer">Layer type.</param>
 public AnimatedSpriteRenderer(Type layer)
     : base("AnimatedSpriteRenderer" + instances++, layer)
 {
     this.Transform2D = null;
     this.Sprite = null;
     this.scale = Vector2.Zero;
     this.position = Vector2.Zero;
     this.origin = Vector2.Zero;
     this.Animation2D = null;
 }
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            this.gamePlayScene = this.Scene as GamePlayScene;
            this.scoreboardPanel = this.gamePlayScene.EntityManager.Find<ScoreboardPanel>("scoreboardPanel");
            this.target = this.gamePlayScene.EntityManager.Find<Entity>("BallTarget");
            this.targetTransform = this.target.FindComponent<Transform2D>();

            this.start = this.gamePlayScene.EntityManager.Find<Entity>("BallStart");
            this.startTransform = this.start.FindComponent<Transform2D>();
        }
Beispiel #21
0
        protected override void Initialize()
        {
            base.Initialize();

            this.followTransform = this.followEntity.FindComponent<Transform2D>();

            this.virtualScreenManager = this.Owner.Scene.VirtualScreenManager;
            this.platform = WaveServices.Platform;

            this.platform.OnScreenSizeChanged += OnScreenSizeChanged;
            this.RefreshCameraLimits();
        }
        public Follower2DBehavior(Entity entity, FollowTypes followType)
        {
            this.followedTranform = entity.FindComponent<Transform2D>();
            this.followType = followType;

            this.lastFollowPosition = Vector2.Zero;

            if (this.lastFollowPosition == null)
            {
                throw new NotImplementedException("The Transform2D component must be used by the entity to follow");
            }
        }
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            var playerEntity = this.EntityManager.Find("Player");

            if (playerEntity != null)
            {
                this.player = playerEntity.FindComponent<PlayerBehavior>();
                this.playerTransform = playerEntity.FindComponent<Transform2D>();
            }
        }
Beispiel #24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JumpButton" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="area">The area.</param>
        public JumpButton(string name, RectangleF area)
        {
            // Touch area
            this.entity = new Entity(name)
                                .AddComponent(new Transform2D()
                                {
                                    X = area.X,
                                    Y = area.Y,
                                    Rectangle = new RectangleF(0, 0, area.Width, area.Height),
                                })
                                .AddComponent(new RectangleCollider2D())
                                .AddComponent(new TouchGestures());

            // Thumb
            this.thumb = new Entity()
                            .AddComponent(new Transform2D()
                            {
                                Origin = Vector2.Center,
                                DrawOrder = 0.1f,
                            })
                            .AddComponent(new Sprite(WaveContent.Assets.joystickThumb_png))
                            .AddComponent(new SpriteRenderer(DefaultLayers.Alpha));

            this.thumb.IsVisible = false;
            this.thumbTransform = this.thumb.FindComponent<Transform2D>();
            this.entity.AddChild(this.thumb);

            // Touch Events
            var touch = this.entity.FindComponent<TouchGestures>();
            touch.TouchPressed += (s, o) =>
            {
                this.pressedPosition = o.GestureSample.Position;

                this.thumbTransform.X = this.pressedPosition.X;
                this.thumbTransform.Y = this.pressedPosition.Y;
                this.thumb.IsVisible = true;

                this.IsShooting = true;
            };
            touch.TouchMoved += (s, o) =>
            {
                Vector2 deltaTouch = this.pressedPosition - o.GestureSample.Position;

                this.thumbTransform.X = this.pressedPosition.X - deltaTouch.X;
                this.thumbTransform.Y = this.pressedPosition.Y - deltaTouch.Y;
            };
            touch.TouchReleased += (s, o) =>
            {
                this.thumb.IsVisible = false;
                this.IsShooting = false;
            };
        }
Beispiel #25
0
 public BallBehavior(Entity player, Entity barBot, Entity barTop, Entity playerIA)
     : base("BallBehavior")
 {
     this.trans2D = null;
     this.player = player;
     this.rectPlayer = player.FindComponent<RectangleCollider>();
     this.player2 = playerIA;
     this.rectPlayer2 = playerIA.FindComponent<RectangleCollider>();
     this.barBot = barBot;
     this.rectBarBot = barBot.FindComponent<RectangleCollider>();
     this.barTop = barTop;
     this.rectBarTop = barTop.FindComponent<RectangleCollider>();
 }
Beispiel #26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Sprite" /> class.
        /// </summary>
        /// <param name="texturePath">The texture path.</param>
        /// <exception cref="System.ArgumentException">TexturePath can not be null.</exception>
        public Sprite(string texturePath)
            : base("Sprite" + instances++)
        {
            if (string.IsNullOrEmpty(texturePath))
            {
                throw new ArgumentException("TexturePath can not be null.");
            }

            this.SourceRectangle = null;
            this.Transform2D = null;
            this.isGlobalAsset = false;
            this.TexturePath = texturePath;
            this.TintColor = Color.White;
        }
Beispiel #27
0
        public Text(
            string textContent,
            SpriteFont spriteFont,
            Color fontColor,
            Transform2D transform,
            Transform2D parentTransform = null)
        {
            this.TextContent = textContent;
            this.SpriteFont = spriteFont;
            this.FontColor = fontColor;

            this.Transform = transform;
            this.Transform.Parent = parentTransform;
        }
        private Vector2 GetPointWithOrigin(Transform2D entityTransform, Vector2 origin)
        {
            var rotationQuad = Quaternion.CreateFromYawPitchRoll(0, 0, entityTransform.Rotation);

            var destPoint = new Vector2(
                (origin.X * entityTransform.Rectangle.Width) - (entityTransform.Origin.X * entityTransform.Rectangle.Width),
                (origin.Y * entityTransform.Rectangle.Height) - (entityTransform.Origin.Y * entityTransform.Rectangle.Height));

            Vector2.Transform(ref destPoint, ref rotationQuad, out destPoint);

            destPoint += new Vector2(entityTransform.X, entityTransform.Y);

            return destPoint;
        }
Beispiel #29
0
        public YureiDecorator(string name, Vector3 position, Vector3 scale, Entity dustEntity, Type layer)
        {
            Transform2D transform = new Transform2D();
            transform.Transform3D.Position = position;
            transform.Transform3D.Scale = scale;

            this.entity = new Entity(name)
            .AddComponent(transform)
            .AddComponent(new YureiBehavior(dustEntity))
            .AddComponent(new SkeletalData("Content/Yurei/yurei.spine"))
            .AddComponent(new SkeletalAnimation("Content/Yurei/yurei.json"))
            .AddComponent(new SkeletalRenderer(layer) { ActualDebugMode = WaveEngine.Spine.SkeletalRenderer.DebugMode.Quads });
            ;
        }
Beispiel #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SpriteAtlas" /> class.
        /// </summary>
        /// <param name="atlasPath">The path to the atlas.</param>
        /// <param name="textureName">Name of the texture from where this atlas is loaded.</param>
        /// <exception cref="System.ArgumentException">TexturePath can not be null.</exception>
        public SpriteAtlas(string atlasPath, string textureName)
            : base("SpriteAtlas" + instances++)
        {
            if (string.IsNullOrEmpty(atlasPath))
            {
                throw new ArgumentException("TexturePath can not be null.");
            }

            this.TextureName = textureName;
            this.Transform2D = null;
            this.isGlobalAsset = false;
            this.AtlasPath = atlasPath;
            this.TintColor = Color.White;
        }
Beispiel #31
0
 public override Box2D ComputeBox(Transform2D transform)
 {
     return(new Box2D(Vector2D.Zero, Dimensions).Transform(transform));
 }
 protected override void GenerateEpisode(Transform2D virtualUserTransform, Space2D virtualSpace)
 {
     currentTargetPosition = targetPositionList[currentEpisodeIndex];
 }
Beispiel #33
0
 public override void Transform(Transform2D transform)
 {
     throw new System.NotImplementedException();
 }
 public PicVisitorTransform(Transform2D transf)
 {
     Transform = transf;
 }
Beispiel #35
0
 public void LookAt(Transform2D target, Vector2f worldUp)
 {
     LookAt(target.GetPosition(), worldUp);
 }
Beispiel #36
0
 public override void Transform(Transform2D transform)
 {
     Point = transform.transform(Point);
 }
Beispiel #37
0
            public override Box2D ComputeBox(Transform2D transform)
            {
                Box2D box = Box2D.Initial;

                return(box);
            }
    public (Vector2, float) VirtualMove(Object2D realUser, Object2D virtualUser, Space2D virtualSpace)
    {
        Transform2D virtualUserTransform = virtualUser.transform;

        if (!initializing)
        {
            ResetCurrentState(virtualUserTransform);
            initializing = false;
        }

        if (episode.IsNotEnd())
        {
            if (isFirst)
            {
                isFirst         = false;
                targetPosition  = episode.GetTarget(virtualUserTransform, virtualSpace);
                initialToTarget = targetPosition - virtualUserTransform.localPosition;
                float InitialAngle    = Vector2.SignedAngle(virtualUserTransform.forward, initialToTarget);
                float initialDistance = Vector2.Distance(virtualUserTransform.localPosition, targetPosition);

                virtualTargetDirection = Matrix3x3.CreateRotation(InitialAngle) * virtualUser.transform.forward; // target을 향하는 direction(forward)를 구함
                //realTargetDirection = Matrix3x3.CreateRotation(InitialAngle) * realUser.transform.forward;

                virtualTargetPosition = virtualUser.transform.localPosition + virtualTargetDirection * initialDistance; // target에 도달하는 position을 구함
                //realTargetPosition = realUser.transform.localPosition + realTargetDirection * initialDistance;

                maxRotTime      = Mathf.Abs(InitialAngle) / rotationSpeed;
                maxTransTime    = initialDistance / translationSpeed;
                remainRotTime   = 0;
                remainTransTime = 0;

                initialAngleDirection = Mathf.Sign(InitialAngle);
            }

            float distance = (targetPosition - virtualUserTransform.localPosition).magnitude;
            float angle    = Vector2.SignedAngle(virtualUserTransform.forward, initialToTarget);

            if (remainRotTime < maxRotTime)
            {
                virtualUser.Rotate(initialAngleDirection * rotationSpeed * Time.fixedDeltaTime);
                remainRotTime += Time.fixedDeltaTime;
            }
            else if (remainTransTime < maxTransTime)
            {
                if (isFirst2) // 방향을 동기화
                {
                    isFirst2 = false;
                    SyncDirection(virtualUser, virtualTargetDirection);
                }
                else
                {
                    virtualUser.Translate(virtualUserTransform.forward * translationSpeed * Time.fixedDeltaTime, Space.World);
                    remainTransTime += Time.fixedDeltaTime;
                }
            }
            else
            {
                if (isFirst3) // 위치를 동기화
                {
                    isFirst3 = false;
                    SyncPosition(virtualUser, virtualTargetPosition);
                }
                else
                {
                    episode.DeleteTarget();

                    //Debug.Log(string.Format("realUser: {0}", realUser.transform));
                    //Debug.Log(string.Format("virtualUser: {0}", virtualUser.transform));

                    isFirst  = true;
                    isFirst2 = true;
                    isFirst3 = true;
                }
            }
        }

        UpdateCurrentState(virtualUserTransform);

        return(GetDelta(virtualUserTransform.forward));
    }
Beispiel #39
0
        public void CreateFactoryEntities(PicFactory factory, ParameterStack stack, Transform2D transform)
        {
            PicFactory fTemp = new PicFactory();

            // free variables
            double a = stack.GetDoubleParameterValue("a");
            double b = stack.GetDoubleParameterValue("b");
            double h = stack.GetDoubleParameterValue("h");
            double e = stack.GetDoubleParameterValue("e");
            double g = stack.GetDoubleParameterValue("g");

            int iTop = stack.GetMultiParameterValue("TOP");
            int iBot = stack.GetMultiParameterValue("BOTTOM");

            double gg = 15.0;

            // formulas
            SortedList <uint, PicEntity> entities = new SortedList <uint, PicEntity>();

            if (g < 5)
            { // Glue_flap
                IPlugin        pluginIn = Host.GetPluginByGuid("729625f4-921d-4f72-af43-4248835a59f3");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                gg = stackIn.GetDoubleParameterValue("g");
            }
            else
            {
                gg = g;
            }
            //---------- TOP Architecture ---------------------
            if (iTop == 0)
            { // Sleeve
                IPlugin        pluginIn = Host.GetPluginByGuid("da290efa-83a5-4ccd-808c-9a5eec81f36b");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("H", h / 2);         // H
                stackIn.SetDoubleParameter("g", gg);            // g
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iTop == 1)
            { // Tuck_end
                int iTuck = stack.GetMultiParameterValue("TUCK");

                IPlugin        pluginIn = Host.GetPluginByGuid("818567a3-ce01-45f5-b328-04031713c12c");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // A
                stackIn.SetDoubleParameter("b", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // H
                stackIn.SetDoubleParameter("e", e);             // t
                stackIn.SetDoubleParameter("g", g);             // g
                if (2 == iTuck)
                {
                    int iHole = stack.GetMultiParameterValue("HOLE");
                    stackIn.SetMultiParameter("HOLE", iHole);           // Hanging Hole
                }
                stackIn.SetDoubleParameter("bp", iTuck);
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iTop == 2)
            { // Inverted_Tuck_end
                int iTuck = stack.GetMultiParameterValue("TUCK");

                IPlugin        pluginIn = Host.GetPluginByGuid("66e5437d-a8a8-404d-951c-e7bf944d2342");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // A
                stackIn.SetDoubleParameter("b", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // H
                stackIn.SetDoubleParameter("e", e);             // t
                stackIn.SetDoubleParameter("g", g);             // g
                stackIn.SetDoubleParameter("bp", iTuck);
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iTop == 3)
            { // Edge_Lock
                int iEdge = stack.GetMultiParameterValue("Edge");

                IPlugin        pluginIn = Host.GetPluginByGuid("827b4625-ccad-41f8-823a-c165852ca8f4");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("g", gg);            // g
                stackIn.SetMultiParameter("Edge", iEdge);       // Edge Lock
                stackIn.SetDoubleParameter("A1", b);            // A1
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iTop == 4)
            { // Seal_End
                int iSeal = stack.GetMultiParameterValue("Seal");

                IPlugin        pluginIn = Host.GetPluginByGuid("af7fb901-90de-4034-9a27-c21d51f826d2");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("g", gg);            // g
                stackIn.SetMultiParameter("Seal", iSeal);       // Seal End
                stackIn.SetDoubleParameter("e", e);             // e
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }


            //---------- BOTTOM Architecture ---------------------
            if (iBot == 0)
            { // Sleeve
                IPlugin        pluginIn = Host.GetPluginByGuid("da290efa-83a5-4ccd-808c-9a5eec81f36b");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("H", h / 2);         // H
                stackIn.SetDoubleParameter("g", gg);            // g
                bool        reflectionX = true, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 1)
            { // Tuck_end
                int            iBTuck   = stack.GetMultiParameterValue("BTUCK");
                IPlugin        pluginIn = Host.GetPluginByGuid("818567a3-ce01-45f5-b328-04031713c12c");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // A
                stackIn.SetDoubleParameter("b", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // H
                stackIn.SetDoubleParameter("e", e);             // t
                stackIn.SetDoubleParameter("g", g);             // g
                stackIn.SetDoubleParameter("bp", 0.0);
                if (iBTuck == 2)
                {
                    stackIn.SetDoubleParameter("bp", 0);
                }
                else
                {
                    stackIn.SetDoubleParameter("bp", iBTuck);
                }
                bool        reflectionX = true, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 2)
            { // Inverted_Tuck_end
                int iBTuck = stack.GetMultiParameterValue("BTUCK");

                IPlugin        pluginIn = Host.GetPluginByGuid("66e5437d-a8a8-404d-951c-e7bf944d2342");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // A
                stackIn.SetDoubleParameter("b", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // H
                stackIn.SetDoubleParameter("e", e);             // t
                stackIn.SetDoubleParameter("g", g);             // g
                stackIn.SetDoubleParameter("bp", 0.0);
                if (iBTuck == 2)
                {
                    stackIn.SetDoubleParameter("bp", 0);
                }
                else
                {
                    stackIn.SetDoubleParameter("bp", iBTuck);
                }
                bool        reflectionX = true, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 3)
            { // Snap_lock_base
                IPlugin        pluginIn = Host.GetPluginByGuid("2c366e1f-35d1-4e72-ba2b-7786e699f94c");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // a
                stackIn.SetDoubleParameter("b", b);             // b
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("g", g);             // g
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 4)
            { // Crash_lock_base
                IPlugin        pluginIn = Host.GetPluginByGuid("2015adce-a857-49c8-b051-b6891b90b941");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("a", a);             // a
                stackIn.SetDoubleParameter("b", b);             // b
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("d", e);             // d
                stackIn.SetDoubleParameter("g", g);             // g
                bool        reflectionX = false, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(0.0, -h / 2))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 5)
            { // Edge_Lock
                int iBEdge = stack.GetMultiParameterValue("BEdge");

                IPlugin        pluginIn = Host.GetPluginByGuid("827b4625-ccad-41f8-823a-c165852ca8f4");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("e", e);             // e
                stackIn.SetDoubleParameter("g", gg);            // g
                stackIn.SetMultiParameter("Edge", iBEdge);      // Edge Lock
                stackIn.SetDoubleParameter("A1", b);            // A1
                bool        reflectionX = true, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }
            else if (iBot == 6)
            { // Seal_End
                int iBSeal = stack.GetMultiParameterValue("BSeal");

                IPlugin        pluginIn = Host.GetPluginByGuid("af7fb901-90de-4034-9a27-c21d51f826d2");
                ParameterStack stackIn  = Host.GetInitializedParameterStack(pluginIn);
                stackIn.SetDoubleParameter("A", a);             // A
                stackIn.SetDoubleParameter("B", b);             // B
                stackIn.SetDoubleParameter("h", h / 2);         // h
                stackIn.SetDoubleParameter("g", gg);            // g
                stackIn.SetMultiParameter("Seal", iBSeal);      // Seal End
                stackIn.SetDoubleParameter("e", e);             // e
                bool        reflectionX = true, reflectionY = false;
                Transform2D transfReflect = (reflectionY ? Transform2D.ReflectionY : Transform2D.Identity) * (reflectionX ? Transform2D.ReflectionX : Transform2D.Identity);
                pluginIn.CreateFactoryEntities(fTemp, stackIn,
                                               Transform2D.Translation(new Vector2D(gg, 0.0))
                                               * Transform2D.Rotation(0.0)
                                               * transfReflect);
            }

            factory.AddEntities(fTemp, transform);
        }
Beispiel #40
0
 public ViewComponent2D()
 {
     View = new Transform2D();
 }
Beispiel #41
0
 /// <summary>
 /// Resolves the dependencies needed for this instance to work.
 /// </summary>
 protected override void ResolveDependencies()
 {
     base.ResolveDependencies();
     this.ownerTransform = this.Owner.Parent.FindComponent <Transform2D>();
 }
Beispiel #42
0
        public void Draw3D()
        {
            int drawItems = ClipInstance.Clip.DrawOrder.Length;

            for (int i = 0; i < drawItems; ++i)
            {
                int         index = ClipInstance.Clip.DrawOrder[i];
                SpriteState js    = ClipInstance.JointStates[index];
                if (js.Texture != null && js.Visible)
                {
                    float tw = js.Texture.Width;
                    float th = js.Texture.Height;
                    float w  = js.TextureRect.Width;
                    float h  = js.TextureRect.Height;

                    // Apply the current transform to the quad corners
                    Transform2D xform    = ClipInstance.AbsoluteTransforms[index];
                    Vector2     flipping = new Vector2(
                        ClipInstance.FlipX ? -1.0f : 1.0f,
                        ClipInstance.FlipY ? -1.0f : 1.0f);

                    Vector2 tl = xform.TransformPoint(new Vector2(0, 0), flipping);
                    Vector2 tr = xform.TransformPoint(new Vector2(w, 0), flipping);
                    Vector2 bl = xform.TransformPoint(new Vector2(0, h), flipping);
                    Vector2 br = xform.TransformPoint(new Vector2(w, h), flipping);

                    // Convert pixel rectangle to texture coordinates
                    Vector2 uvMin;
                    uvMin.X = js.TextureRect.X / tw;
                    uvMin.Y = js.TextureRect.Y / th;
                    Vector2 uvMax;
                    uvMax.X = (js.TextureRect.X + w) / tw;
                    uvMax.Y = (js.TextureRect.Y + h) / th;

                    // Swap X components if flipped horizontally
                    if (0 != (js.FlipState & SpriteEffects.FlipHorizontally))
                    {
                        float tmp = uvMin.X;
                        uvMin.X = uvMax.X;
                        uvMax.X = tmp;
                    }

                    // Swap Y components if flipped horizontally
                    if (0 != (js.FlipState & SpriteEffects.FlipVertically))
                    {
                        float tmp = uvMin.Y;
                        uvMin.Y = uvMax.Y;
                        uvMax.Y = tmp;
                    }

                    // Assign the 6 vertex values
                    // Verts laid out to render as a list of two clockwise triangles:
                    // 0--1 4
                    // | / /|
                    // |/ / |
                    // 2 3--5
                    float z = Settings.PositionZ;
                    s_quadVerts[0].Position.X          = tl.X;
                    s_quadVerts[0].Position.Y          = tl.Y;
                    s_quadVerts[0].Position.Z          = z;
                    s_quadVerts[0].Color               = js.Color;
                    s_quadVerts[0].TextureCoordinate.X = uvMin.X;
                    s_quadVerts[0].TextureCoordinate.Y = uvMin.Y;
                    s_quadVerts[1].Position.X          = tr.X;
                    s_quadVerts[1].Position.Y          = tr.Y;
                    s_quadVerts[1].Position.Z          = z;
                    s_quadVerts[1].Color               = js.Color;
                    s_quadVerts[1].TextureCoordinate.X = uvMax.X;
                    s_quadVerts[1].TextureCoordinate.Y = uvMin.Y;
                    s_quadVerts[2].Position.X          = bl.X;
                    s_quadVerts[2].Position.Y          = bl.Y;
                    s_quadVerts[2].Position.Z          = z;
                    s_quadVerts[2].Color               = js.Color;
                    s_quadVerts[2].TextureCoordinate.X = uvMin.X;
                    s_quadVerts[2].TextureCoordinate.Y = uvMax.Y;
                    s_quadVerts[3].Position.X          = bl.X;
                    s_quadVerts[3].Position.Y          = bl.Y;
                    s_quadVerts[3].Position.Z          = z;
                    s_quadVerts[3].Color               = js.Color;
                    s_quadVerts[3].TextureCoordinate.X = uvMin.X;
                    s_quadVerts[3].TextureCoordinate.Y = uvMax.Y;
                    s_quadVerts[4].Position.X          = tr.X;
                    s_quadVerts[4].Position.Y          = tr.Y;
                    s_quadVerts[4].Position.Z          = z;
                    s_quadVerts[4].Color               = js.Color;
                    s_quadVerts[4].TextureCoordinate.X = uvMax.X;
                    s_quadVerts[4].TextureCoordinate.Y = uvMin.Y;
                    s_quadVerts[5].Position.X          = br.X;
                    s_quadVerts[5].Position.Y          = br.Y;
                    s_quadVerts[5].Position.Z          = z;
                    s_quadVerts[5].Color               = js.Color;
                    s_quadVerts[5].TextureCoordinate.X = uvMax.X;
                    s_quadVerts[5].TextureCoordinate.Y = uvMax.Y;

                    // Send quad to screen's RenderBatch
                    parentScreen.RenderBatch.AddGeometry(s_quadVerts, js.Texture);
                }
            }
        }
Beispiel #43
0
        public void DrawSprite(Sprite sprite, Transform2D transform)
        {
            if (sprite == null)
            {
                return;
            }

            // Work out bounding rectangle of sprite
            float   ex = 0.0f, ey = 0.0f;
            vec2d_f s = transform.Forward(0.0f, 0.0f);
            vec2d_f p = new vec2d_f(s);

            s.x = Math.Min(s.x, p.x);
            s.y = Math.Min(s.y, p.y);
            ex  = Math.Max(ex, p.x);
            ey  = Math.Max(ey, p.y);

            transform.Forward(sprite.Width, sprite.Height);
            s.x = Math.Min(s.x, p.x);
            s.y = Math.Min(s.y, p.y);
            ex  = Math.Max(ex, p.x);
            ey  = Math.Max(ey, p.y);

            p   = transform.Forward(0.0f, sprite.Height);
            s.x = Math.Min(s.x, p.x);
            s.y = Math.Min(s.y, p.y);
            ex  = Math.Max(ex, p.x);
            ey  = Math.Max(ey, p.y);

            p   = transform.Forward(sprite.Width, 0.0f);
            s.x = Math.Min(s.x, p.x);
            s.y = Math.Min(s.y, p.y);
            ex  = Math.Max(ex, p.x);
            ey  = Math.Max(ey, p.y);

            // Perform inversion of transform if required
            transform.Invert();

            float sx = s.x;
            float sy = s.y;

            if (ex < sx)
            {
                PGEMath.Swap(ref ex, ref sx);
            }
            if (ey < sy)
            {
                PGEMath.Swap(ref ey, ref sy);
            }
            s.x = sx;
            s.y = sy;

            // Iterate through render space, and sample Sprite from suitable texel location
            for (float i = s.x; i < ex; i++)
            {
                for (float j = s.y; j < ey; j++)
                {
                    vec2d_f o = transform.Backward(i, j);
                    pge.Draw((uint)i, (uint)j, sprite.GetPixel((uint)(o.x + 0.5f), (uint)(o.y + 0.5f)));
                }
            }
        }
Beispiel #44
0
 protected override void DrawSpecific(PicGraphics graphics, Transform2D transform)
 {
 }
Beispiel #45
0
 public override void Transform(Transform2D transform)
 {
     SetModified();
     throw new NotImplementedException();
 }
Beispiel #46
0
 public override void Transform(Transform2D transform)
 {
     Position = transform.transform(Position);
 }
Beispiel #47
0
 public override Box2D ComputeBox(Transform2D transform) => Box2D.Initial;
 public override void Inicial()
 {
     base.Inicial();
     transform = gameObject.GetComponent <Transform2D>();
 }
Beispiel #49
0
        protected override void DrawSpecific(PicGraphics graphics, Transform2D transform)
        {
            float fontSize = (Math.Abs(FontSize) < 0.1f) ? PicCotation.GlobalCotationProperties.FontSize : graphics.FontSizePt(FontSize);

            graphics.DrawText(Text, PicGraphics.TextType.FT_COTATION, fontSize, Point + graphics.OffsetFont(FontSize, VAlignment), HAlignment, VAlignment, TextDirection);
        }
 public AABB TransformedAABB(Transform2D transform)
 {
     return(AABB.Transformed(AABB, transform));
 }
Beispiel #51
0
 public void Translate(Vector2f translation, Transform2D relativeTo)
 {
     Translate(relativeTo.TransformDirection(Math.Normalize(translation)) * translation.length, true);
 }
Beispiel #52
0
 public static PicBlockRef CreateNewBlockRef(uint id, PicBlock block, Transform2D transf)
 {
     return(new PicBlockRef(id, block, transf.TranslationVector, transf.RotationAngle));
 }
Beispiel #53
0
 public void LookAt(Transform2D target)
 {
     LookAt(target.GetPosition());
 }
Beispiel #54
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Joystick" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="area">The area.</param>
        public Joystick(string name, RectangleF area)
        {
            // Touch area
            this.entity = new Entity(name)
                          .AddComponent(new Transform2D()
            {
                X         = area.X,
                Y         = area.Y,
                Rectangle = new RectangleF(0, 0, area.Width, area.Height),
            })
                          .AddComponent(new RectangleCollider2D())
                          .AddComponent(new TouchGestures());

            // Background
            this.background = new Entity()
                              .AddComponent(new Transform2D()
            {
                Origin    = Vector2.Center,
                DrawOrder = 0.2f,
            })
                              .AddComponent(new Sprite(WaveContent.Assets.joystickBackground_png))
                              .AddComponent(new SpriteRenderer(DefaultLayers.Alpha));
            this.background.IsVisible = false;
            this.entity.AddChild(this.background);

            // Thumb
            this.thumb = new Entity()
                         .AddComponent(new Transform2D()
            {
                Origin    = Vector2.Center,
                DrawOrder = 0.1f,
            })
                         .AddComponent(new Sprite(WaveContent.Assets.joystickThumb_png))
                         .AddComponent(new SpriteRenderer(DefaultLayers.Alpha));
            this.thumb.IsVisible = false;
            this.entity.AddChild(this.thumb);

            // Touch Events
            this.backgroundTransform = this.background.FindComponent <Transform2D>();
            this.thumbTransform      = this.thumb.FindComponent <Transform2D>();
            var touch = this.entity.FindComponent <TouchGestures>();

            touch.TouchPressed += (s, o) =>
            {
                this.pressedPosition = o.GestureSample.Position;

                this.backgroundTransform.X = this.pressedPosition.X;
                this.backgroundTransform.Y = this.pressedPosition.Y;
                this.background.IsVisible  = true;

                this.thumbTransform.X = this.pressedPosition.X;
                this.thumbTransform.Y = this.pressedPosition.Y;
                this.thumb.IsVisible  = true;

                this.direction = Vector2.Zero;
            };
            touch.TouchMoved += (s, o) =>
            {
                Vector2 deltaTouch = this.pressedPosition - o.GestureSample.Position;
                deltaTouch.X          = MathHelper.Clamp(deltaTouch.X, -offset, offset);
                deltaTouch.Y          = MathHelper.Clamp(deltaTouch.Y, -offset, offset);
                this.thumbTransform.X = this.pressedPosition.X - deltaTouch.X;
                this.thumbTransform.Y = this.pressedPosition.Y - deltaTouch.Y;

                deltaTouch    /= this.offsetLimits;
                this.direction = -deltaTouch;
            };
            touch.TouchReleased += (s, o) =>
            {
                this.background.IsVisible = false;
                this.thumb.IsVisible      = false;
                this.direction            = Vector2.Zero;
            };
        }
Beispiel #55
0
 public Vector2 TransformPointToOtherLocal(Vector2 localPoint, Transform2D other) // this local 좌표계 있는 point를 other local 좌표계로 변환
 {
     return(other.InverseTransformPoint(this.TransformPoint(localPoint)));
 }
Beispiel #56
0
        static public void CreateFactoryEntities(PicFactory factory, ParameterStack stack, Transform2D transform)
        {
            PicFactory           fTemp  = new PicFactory();
            const PicGraphics.LT ltCut  = PicGraphics.LT.LT_CUT;
            const PicGraphics.LT ltFold = PicGraphics.LT.LT_CREASING;

            // free variables
            double A  = stack.GetDoubleParameterValue("A");
            double B  = stack.GetDoubleParameterValue("B");
            double H  = stack.GetDoubleParameterValue("H");
            double e  = stack.GetDoubleParameterValue("e");
            double g  = stack.GetDoubleParameterValue("g");
            double hc = stack.GetDoubleParameterValue("hc");
            double pr = stack.GetDoubleParameterValue("pr");

            // formulas
            double hp = B / 2 - e;
            double v9 = g * Tand(15);
            double v1 = 8;
            double v2 = 8;
            double v3 = hp * Tand(15);
            double r  = pr / 4;
            SortedList <uint, PicEntity> entities = new SortedList <uint, PicEntity>();

            // segments
            double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0;

            // 3 : (481.462, 303.394) <-> (481.462, 467.206)
            x0 = 69.6211 + g + A + B + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(3, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 4 : (223.218, 468.17) <-> (352.341, 468.17)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            entities.Add(4, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 5 : (352.341, 467.206) <-> (480.017, 467.206)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(5, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 6 : (352.34, 302.431) <-> (223.218, 302.431)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            entities.Add(6, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 7 : (352.34, 303.394) <-> (480.017, 303.394)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(7, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 8 : (223.218, 240.761) <-> (101.323, 240.761)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(8, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 9 : (223.218, 211.853) <-> (101.323, 211.853)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(9, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 10 : (352.34, 211.853) <-> (474.235, 211.853)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(10, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 11 : (352.34, 240.761) <-> (474.235, 240.761)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(11, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 12 : (352.341, 530.804) <-> (461.326, 530.804)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            x1 = 69.6211 + g + A + B + A - e - v3;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(12, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 13 : (94.0963, 467.206) <-> (69.6211, 462.388)
            x0 = 69.6211 + g;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H - v9;
            entities.Add(13, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 14 : (69.6211, 308.213) <-> (69.6211, 462.388)
            x0 = 69.6211;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + v9;
            x1 = 69.6211;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H - v9;
            entities.Add(14, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 15 : (94.0963, 303.395) <-> (69.621, 308.213)
            x0 = 69.6211 + g;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + v9;
            entities.Add(15, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 16 : (223.218, 303.394) <-> (95.542, 303.394)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(16, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 17 : (223.218, 467.206) <-> (95.5415, 467.206)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(17, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 18 : (352.34, 149.701) <-> (474.235, 149.701)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g;
            entities.Add(18, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 19 : (466.489, 120.793) <-> (360.086, 120.793)
            x0 = 69.6211 + g + A + B + A - e - v2 - v9;
            y0 = 120.793;
            x1 = 69.6211 + g + A + B + v9;
            y1 = 120.793;
            entities.Add(19, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 20 : (480.017, 467.206) <-> (480.017, 476.842)
            x0 = 69.6211 + g + A + B + A - e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5;
            entities.Add(20, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 21 : (474.235, 482.623) <-> (480.017, 476.842)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5 + v2;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5;
            entities.Add(21, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 22 : (474.235, 482.623) <-> (461.326, 530.804)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5 + v2;
            x1 = 69.6211 + g + A + B + A - e - v3;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(22, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 23 : (223.218, 530.804) <-> (114.233, 530.804)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            x1 = 69.6211 + g + e + v3;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(23, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 24 : (95.5415, 467.206) <-> (95.5415, 476.842)
            x0 = 69.6211 + g + e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5;
            entities.Add(24, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 25 : (101.323, 482.624) <-> (95.5415, 476.842)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5 + v2;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5;
            entities.Add(25, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 26 : (101.323, 482.624) <-> (114.233, 530.804)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + hp / 5 + v2;
            x1 = 69.6211 + g + e + v3;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(26, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 27 : (223.218, 149.701) <-> (101.323, 149.701)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g;
            entities.Add(27, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 28 : (215.473, 120.793) <-> (109.069, 120.793)
            x0 = 69.6211 + g + A - v9;
            y0 = 120.793;
            x1 = 69.6211 + g + e + v2 + v9;
            y1 = 120.793;
            entities.Add(28, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 29 : (480.017, 303.394) <-> (480.017, 293.759)
            x0 = 69.6211 + g + A + B + A - e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5;
            entities.Add(29, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 30 : (474.235, 287.977) <-> (480.017, 293.759)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5 - v2;
            x1 = 69.6211 + g + A + B + A - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5;
            entities.Add(30, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 31 : (95.542, 303.394) <-> (95.542, 293.759)
            x0 = 69.6211 + g + e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5;
            entities.Add(31, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 32 : (101.323, 287.978) <-> (95.542, 293.759)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5 - v2;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5;
            entities.Add(32, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 33 : (101.323, 149.701) <-> (109.069, 120.793)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + e + v2 + v9;
            y1 = 120.793;
            entities.Add(33, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 34 : (223.218, 149.701) <-> (215.473, 120.793)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A - v9;
            y1 = 120.793;
            entities.Add(34, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 35 : (352.34, 149.699) <-> (360.086, 120.793)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A + B + v9;
            y1 = 120.793;
            entities.Add(35, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 36 : (474.235, 149.701) <-> (466.489, 120.793)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A + B + A - e - v2 - v9;
            y1 = 120.793;
            entities.Add(36, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 37 : (609.621, 303.394) <-> (609.621, 467.206)
            x0 = 69.6211 + g + A + B + A + B - e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A + B - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(37, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 38 : (94.0963, 467.206) <-> (95.5415, 467.206)
            x0 = 69.6211 + g;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(38, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 39 : (94.0963, 303.394) <-> (95.542, 303.394)
            x0 = 69.6211 + g;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(39, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 40 : (94.0963, 303.394) <-> (94.0963, 467.206)
            x0 = 69.6211 + g;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(40, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 41 : (236.709, 594.401) <-> (338.85, 594.401)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            x1 = 69.6211 + g + A + B - 2 * e - v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            entities.Add(41, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 42 : (340.524, 625.236) <-> (235.034, 625.236)
            x0 = 69.6211 + g + A + B - 2 * e - v1 + 1.6741;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + pr;
            x1 = 69.6211 + g + A + 2 * e + v1 - 1.67455;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + pr;
            entities.Add(42, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 43 : (348.524, 617.236) <-> (348.524, 596.328)
            x0 = 69.6211 + g + A + B - 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + pr - 8.00006;
            x1 = 69.6211 + g + A + B - 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(43, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 59 : (227.034, 617.236) <-> (227.034, 596.328)
            x0 = 69.6211 + g + A + 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + pr - 8;
            x1 = 69.6211 + g + A + 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(59, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 69 : (338.85, 176.2) <-> (236.709, 176.2)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            x1 = 69.6211 + g + A + 2 * e + v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            entities.Add(69, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 70 : (235.035, 145.365) <-> (339.525, 145.364)
            x0 = 69.6211 + g + A + 2 * e + v1 - 1.67406;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - pr;
            x1 = 69.6211 + g + A + B - 2 * e - v1 + 0.674561;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - pr;
            entities.Add(70, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 71 : (227.035, 153.365) <-> (227.035, 174.272)
            x0 = 69.6211 + g + A + 2 * e;
            y0 = 120.793 + g + 3.66388;
            x1 = 69.6211 + g + A + 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(71, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 73 : (348.525, 174.272) <-> (348.525, 154.364)
            x0 = 69.6211 + g + A + B - 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + B - 2 * e;
            y1 = 120.793 + g + 4.66336;
            entities.Add(73, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 98 : (227.034, 596.328) <-> (223.218, 596.328)
            x0 = 69.6211 + g + A + 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(98, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 99 : (236.709, 596.328) <-> (227.034, 596.328)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A + 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(99, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 100 : (352.341, 303.394) <-> (352.341, 467.206)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(100, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 101 : (352.341, 467.206) <-> (352.341, 467.399)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(101, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 102 : (223.218, 303.394) <-> (223.218, 467.206)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(102, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 103 : (223.218, 467.206) <-> (223.218, 467.399)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(103, fTemp.AddSegment(ltFold, 1, 1, x0, y0, x1, y1));

            // 104 : (480.017, 467.206) <-> (481.462, 467.206)
            x0 = 69.6211 + g + A + B + A - e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A + B + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(104, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 105 : (481.462, 467.206) <-> (609.621, 467.206)
            x0 = 69.6211 + g + A + B + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A + B + A + B - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(105, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 106 : (480.017, 303.394) <-> (481.462, 303.394)
            x0 = 69.6211 + g + A + B + A - e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(106, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 107 : (481.462, 303.394) <-> (609.621, 303.394)
            x0 = 69.6211 + g + A + B + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            x1 = 69.6211 + g + A + B + A + B - e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(107, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 108 : (352.341, 468.17) <-> (352.341, 467.399)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            entities.Add(108, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 109 : (352.341, 530.804) <-> (352.341, 468.17)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            entities.Add(109, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 110 : (352.341, 596.328) <-> (352.341, 530.804)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(110, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 111 : (223.218, 467.399) <-> (223.218, 468.17)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            entities.Add(111, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 112 : (223.218, 468.17) <-> (223.218, 530.804)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            entities.Add(112, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 113 : (223.218, 530.804) <-> (223.218, 596.328)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + B / 2 - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(113, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 114 : (474.235, 149.701) <-> (474.235, 211.853)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(114, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 115 : (474.235, 211.853) <-> (474.235, 240.761)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(115, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 116 : (474.235, 240.761) <-> (474.235, 287.977)
            x0 = 69.6211 + g + A + B + A - e - v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + A + B + A - e - v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5 - v2;
            entities.Add(116, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 117 : (101.323, 149.701) <-> (101.323, 211.853)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(117, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 118 : (101.323, 211.853) <-> (101.323, 240.761)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(118, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 119 : (101.323, 240.761) <-> (101.323, 287.978)
            x0 = 69.6211 + g + e + v2;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + e + v2;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - hp / 5 - v2;
            entities.Add(119, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 120 : (223.218, 149.701) <-> (223.218, 174.272)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(120, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 121 : (223.218, 174.272) <-> (223.218, 211.853)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(121, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 122 : (223.218, 211.853) <-> (223.218, 240.761)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(122, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 123 : (223.218, 240.761) <-> (223.218, 302.431)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            entities.Add(123, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 124 : (223.218, 302.431) <-> (223.218, 303.394)
            x0 = 69.6211 + g + A;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(124, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 125 : (352.34, 149.701) <-> (352.34, 174.272)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(125, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 126 : (352.34, 174.272) <-> (352.34, 211.853)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e;
            entities.Add(126, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 127 : (352.34, 211.853) <-> (352.34, 240.761)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc;
            entities.Add(127, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 128 : (352.34, 240.761) <-> (352.34, 302.431)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            entities.Add(128, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 129 : (352.34, 302.431) <-> (352.34, 303.394)
            x0 = 69.6211 + g + A + B;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e;
            entities.Add(129, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 130 : (338.85, 596.328) <-> (348.524, 596.328)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A + B - 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(130, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 131 : (348.524, 596.328) <-> (352.341, 596.328)
            x0 = 69.6211 + g + A + B - 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(131, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 132 : (338.85, 592.474) <-> (338.85, 594.401)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A - e;
            x1 = 69.6211 + g + A + B - 2 * e - v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            entities.Add(132, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 133 : (338.85, 594.401) <-> (338.85, 596.328)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            x1 = 69.6211 + g + A + B - 2 * e - v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            entities.Add(133, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 134 : (236.709, 594.401) <-> (236.709, 592.474)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            x1 = 69.6211 + g + A + 2 * e + v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A - e;
            entities.Add(134, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 135 : (236.709, 596.328) <-> (236.709, 594.401)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A + e;
            x1 = 69.6211 + g + A + 2 * e + v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e + H + e + A;
            entities.Add(135, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 136 : (338.85, 174.272) <-> (348.525, 174.272)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + B - 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(136, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 137 : (348.525, 174.272) <-> (352.341, 174.272)
            x0 = 69.6211 + g + A + B - 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + B;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(137, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 138 : (227.035, 174.272) <-> (223.218, 174.272)
            x0 = 69.6211 + g + A + 2 * e;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(138, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 139 : (236.709, 174.272) <-> (227.035, 174.272)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + 2 * e;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(139, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 140 : (236.709, 176.2) <-> (236.709, 174.272)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            x1 = 69.6211 + g + A + 2 * e + v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            entities.Add(140, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 141 : (236.709, 178.127) <-> (236.709, 176.2)
            x0 = 69.6211 + g + A + 2 * e + v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A + e;
            x1 = 69.6211 + g + A + 2 * e + v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            entities.Add(141, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 142 : (338.85, 174.272) <-> (338.85, 176.2)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A - e;
            x1 = 69.6211 + g + A + B - 2 * e - v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            entities.Add(142, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // 143 : (338.85, 176.2) <-> (338.85, 178.127)
            x0 = 69.6211 + g + A + B - 2 * e - v1;
            y0 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A;
            x1 = 69.6211 + g + A + B - 2 * e - v1;
            y1 = 120.793 + g + B / 2 - 2 * e + hc + B / 2 - e - e - A + e;
            entities.Add(143, fTemp.AddSegment(ltCut, 1, 1, x0, y0, x1, y1));

            // arcs
            // 44 : radius = 8  s0 = 42  s1 = 43
            fTemp.ProcessTool(new PicToolRound(
                                  entities[42]
                                  , entities[43]
                                  , r                           // radius
                                  ));
            // 60 : radius = 8  s0 = 42  s1 = 59
            fTemp.ProcessTool(new PicToolRound(
                                  entities[42]
                                  , entities[59]
                                  , r                           // radius
                                  ));
            // 72 : radius = 8  s0 = 70  s1 = 71
            fTemp.ProcessTool(new PicToolRound(
                                  entities[70]
                                  , entities[71]
                                  , r                           // radius
                                  ));
            // 144 : radius = 9  s0 = 70  s1 = 73
            fTemp.ProcessTool(new PicToolRound(
                                  entities[70]
                                  , entities[73]
                                  , r                           // radius
                                  ));

            factory.AddEntities(fTemp, transform);
        }
Beispiel #57
0
 public Vehicle()
 {
     Transform = new Transform2D();
 }
Beispiel #58
0
 private int _GetOffsetOfTransform2D_Scale()
 {
     var tempObj = new Transform2D(); Transform2D *ptr = &tempObj; var filedPtr = &(ptr->Scale); return((int)((long)filedPtr - (long)ptr));
 }
Beispiel #59
0
 public override void Transform(Transform2D transform)
 {
     _coord = transform.transform(_coord);
     _angle = transform.transform(_angle);
     SetModified();
 }
Beispiel #60
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    public override void OnInspectorGUI()
    {
        exSprite editSprite = target as exSprite;

        inAnimMode = AnimationUtility.InAnimationMode();

#if UNITY_3_4
        isPrefab = (EditorUtility.GetPrefabType(target) == PrefabType.Prefab);
#else
        isPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
#endif

        // TEMP: not sure this is good {
        Event e = Event.current;
        if (e.type == EventType.MouseDown && e.button == 0 && e.clickCount == 1)
        {
            if (isPrefab)
            {
                Undo.RegisterUndo(editPlane, "editPlane");
            }
            else
            {
                Undo.RegisterSceneUndo("ex2D.Scene");
            }
        }
        // } TEMP end

        EditorGUIUtility.LookLikeInspector();
        EditorGUILayout.Space();
        ++EditorGUI.indentLevel;

        if (isPrefab && editPlane.meshFilter && editPlane.meshFilter.sharedMesh)
        {
            editPlane.meshFilter.sharedMesh = null;
        }

        // TODO: I do not know how to do it. {
        // // ========================================================
        // // Script
        // // ========================================================

        // MonoScript script = (MonoScript)AssetDatabase.LoadAssetAtPath( AssetDatabase.GetAssetPath (target), typeof(MonoScript) );
        // script = (MonoScript)EditorGUILayout.ObjectField( "Script", script, typeof(MonoScript) );
        // } TODO end

        // ========================================================
        // trans2d
        // ========================================================

        GUI.enabled = !inAnimMode;
        EditorGUIUtility.LookLikeControls();
        Transform2D newTrans2D = (Transform2D)EditorGUILayout.EnumPopup("Transform 2D", trans2d, GUILayout.Width(200), GUILayout.ExpandWidth(false));
        EditorGUIUtility.LookLikeInspector();
        GUI.enabled = true;

        //
        if (newTrans2D != trans2d)
        {
            trans2d = newTrans2D;

            exScreenPosition screenPos = editPlane.GetComponent <exScreenPosition>();
            if (screenPos != null)
            {
                Object.DestroyImmediate(screenPos, true);
            }
            exViewportPosition vpPos = editPlane.GetComponent <exViewportPosition>();
            if (vpPos != null)
            {
                Object.DestroyImmediate(vpPos, true);
            }

            switch (trans2d)
            {
            case Transform2D.None:
                break;

            case Transform2D.Screen:
                editPlane.gameObject.AddComponent <exScreenPosition>();
                break;

            case Transform2D.Viewport:
                editPlane.gameObject.AddComponent <exViewportPosition>();
                break;
            }
        }

        // ========================================================
        // use animation helper
        // ========================================================

        GUILayout.BeginHorizontal();
        GUILayout.Space(15);
        GUI.enabled = !inAnimMode;
        exAnimationHelper compAnimHelper = editPlane.GetComponent <exAnimationHelper>();
        bool hasAnimHelper = compAnimHelper != null;
        bool useAnimHelper = GUILayout.Toggle(hasAnimHelper, "Use Animation Helper");
        if (useAnimHelper != hasAnimHelper)
        {
            if (useAnimHelper)
            {
                AddAnimationHelper();
            }
            else
            {
                Object.DestroyImmediate(compAnimHelper, true);
            }
            GUI.changed = true;
        }
        GUI.enabled = true;
        GUILayout.EndHorizontal();

        // ========================================================
        // camera type
        // ========================================================

        GUI.enabled = !inAnimMode;
        EditorGUIUtility.LookLikeControls();
        if (isPrefab)
        {
            GUILayout.BeginHorizontal();
            bool isPrefabCamera = false;
            if (editPlane.renderCameraForPrefab != null)
            {
#if UNITY_3_4
                isPrefabCamera = (EditorUtility.GetPrefabType(editPlane.renderCameraForPrefab) == PrefabType.Prefab);
#else
                isPrefabCamera = (PrefabUtility.GetPrefabType(editPlane.renderCameraForPrefab) == PrefabType.Prefab);
#endif
            }
            editPlane.renderCamera = (Camera)EditorGUILayout.ObjectField("Camera"
                                                                         , isPrefabCamera ? editPlane.renderCameraForPrefab : null
                                                                         , typeof(Camera)
                                                                         , false
                                                                         , GUILayout.Width(300));
            labelStyle.fontStyle        = FontStyle.Bold;
            labelStyle.normal.textColor = Color.yellow;
            GUILayout.Label("(Prefab Only)", labelStyle);
            GUILayout.EndHorizontal();
            GUILayout.Space(5);
        }
        else
        {
            editPlane.renderCamera = (Camera)EditorGUILayout.ObjectField("Camera"
                                                                         , editPlane.renderCamera
                                                                         , typeof(Camera)
                                                                         , true
                                                                         , GUILayout.Width(300));
        }
        EditorGUIUtility.LookLikeInspector();

        // ========================================================
        // anchor
        // ========================================================

        EditorGUILayout.LabelField("Anchor", "");
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        editPlane.anchor
            = (exPlane.Anchor)GUILayout.SelectionGrid((int)editPlane.anchor,
                                                      anchorTexts,
                                                      3,
                                                      GUILayout.Width(80));
        GUILayout.EndHorizontal();

        // ========================================================
        // use texture offset
        // ========================================================

        if (editSprite != null)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            editSprite.useTextureOffset = GUILayout.Toggle(editSprite.useTextureOffset, "Use Texture Offset");
            GUILayout.EndHorizontal();
        }
        GUI.enabled = true;

        // ========================================================
        // offset
        // ========================================================

        EditorGUIUtility.LookLikeControls();
        editPlane.offset = EditorGUILayout.Vector2Field("Offset", editPlane.offset);
        EditorGUIUtility.LookLikeInspector();

        // ========================================================
        // check dirty
        // ========================================================

        if (GUI.changed)
        {
            EditorUtility.SetDirty(editPlane);
        }
        --EditorGUI.indentLevel;
    }