예제 #1
0
        public GameKeepHookPoint(DBKeepHookPoint dbhookPoint, GameKeepComponent component)
        {
            double angle = component.Keep.Heading * ((Math.PI * 2) / 360);             // angle*2pi/360;

            switch (component.ComponentHeading)
            {
            case 0:
                X = (int)(component.X + Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
                Y = (int)(component.Y - Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
                break;

            case 1:
                X = (int)(component.X + Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
                Y = (int)(component.Y + Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
                break;

            case 2:
                X = (int)(component.X - Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
                Y = (int)(component.Y + Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
                break;

            case 3:
                X = (int)(component.X - Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
                Y = (int)(component.Y - Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
                break;
            }
            this.Z           = component.Z + dbhookPoint.Z;
            this.Heading     = (ushort)(component.Heading + dbhookPoint.Heading);
            this.m_index     = dbhookPoint.HookPointID;
            this.Component   = component;
            m_hookpointTimer = new HookpointTimer(this, this.Component);
        }
예제 #2
0
		public GameKeepHookPoint(DBKeepHookPoint dbhookPoint, GameKeepComponent component)
		{
			double angle = component.AbstractKeep.Heading * ((Math.PI * 2) / 360); // angle*2pi/360;
			switch (component.ComponentHeading)
			{
				case 0:
					X = (int)(component.X + Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
					Y = (int)(component.Y - Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
					break;
				case 1:
					X = (int)(component.X + Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
					Y = (int)(component.Y + Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
					break;
				case 2:
					X = (int)(component.X - Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
					Y = (int)(component.Y + Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
					break;
				case 3:
					X = (int)(component.X - Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
					Y = (int)(component.Y - Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
					break;
			}
			this.Z = component.Z + dbhookPoint.Z;
			this.Heading = (ushort)(component.Heading + dbhookPoint.Heading);
			this.m_index = dbhookPoint.HookPointID;
			this.Component = component;
			m_hookpointTimer = new HookpointTimer(this, this.Component);
		}
예제 #3
0
        public GameKeepHookPoint(DBKeepHookPoint dbhookPoint, GameKeepComponent component)
        {
            double  angle = component.Keep.Heading * ((Math.PI * 2) / 360);            // angle*2pi/360;
            Vector3 p     = component.Position;

            switch (component.ComponentHeading)
            {
            case 0:
                p.X += (int)(Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
                p.Y -= (int)(Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
                break;

            case 1:
                p.X += (int)(Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
                p.Y += (int)(Math.Cos(angle) * dbhookPoint.X + Math.Sin(angle) * dbhookPoint.Y);
                break;

            case 2:
                p.X -= (int)(Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
                p.Y += (int)(Math.Cos(angle) * dbhookPoint.Y - Math.Sin(angle) * dbhookPoint.X);
                break;

            case 3:
                p.X -= (int)(Math.Cos(angle) * dbhookPoint.Y + Math.Sin(angle) * dbhookPoint.X);
                p.Y -= (int)(Math.Cos(angle) * dbhookPoint.X - Math.Sin(angle) * dbhookPoint.Y);
                break;
            }
            p.Z             += dbhookPoint.Z;
            this.Position    = p;
            this.Heading     = (ushort)(component.Heading + dbhookPoint.Heading);
            this.m_index     = dbhookPoint.HookPointID;
            this.Component   = component;
            m_hookpointTimer = new HookpointTimer(this, this.Component);
        }
예제 #4
0
 public GameKeepHookPoint(int id, GameKeepComponent component)
 {
     m_index          = id;
     m_component      = component;
     m_hookpointTimer = new HookpointTimer(this, this.Component);
     this.Position    = component.Position;
     this.Heading     = component.Heading;
 }
예제 #5
0
 public GameKeepHookPoint(int id, GameKeepComponent component)
 {
     m_index          = id;
     m_component      = component;
     m_hookpointTimer = new HookpointTimer(this, this.Component);
     this.X           = component.X;
     this.Y           = component.Y;
     this.Z           = component.Z;
     this.Heading     = component.Heading;
 }
예제 #6
0
		public GameKeepHookPoint(int id, GameKeepComponent component)
		{
			m_index = id;
			m_component = component;
			m_hookpointTimer = new HookpointTimer(this, this.Component);
			this.X = component.X;
			this.Y = component.Y;
			this.Z = component.Z;
			this.Heading = component.Heading;
		}