当前位置: 首页>>代码示例>>C#>>正文


C# Math3D.MyVector类代码示例

本文整理汇总了C#中Game.Orig.Math3D.MyVector的典型用法代码示例。如果您正苦于以下问题:C# MyVector类的具体用法?C# MyVector怎么用?C# MyVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MyVector类属于Game.Orig.Math3D命名空间,在下文中一共展示了MyVector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetPointers

        public void SetPointers(MyVector boundryLower, MyVector boundryUpper)
		{
			_boundryLower = boundryLower;
			_boundryUpper = boundryUpper;

			// Apply Settings
			trkWidth_Scroll(this, new EventArgs());
			trkHeight_Scroll(this, new EventArgs());
		}
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:9,代码来源:MapShape.cs

示例2: SolidBallTester

        public SolidBallTester()
        {
            InitializeComponent();

            _bitmap = new Bitmap(pictureBox1.DisplayRectangle.Width, pictureBox1.DisplayRectangle.Height);
            _graphics = Graphics.FromImage(_bitmap);

            _boundryLower = new MyVector(0, 0, 0);
            _boundryUpper = new MyVector(pictureBox1.DisplayRectangle.Width, pictureBox1.DisplayRectangle.Height, 0);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:10,代码来源:SolidBallTester.cs

示例3: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            MyVector v1 = new MyVector(1, 0, 0);
            MyVector v2 = new MyVector(0, 1, 0);

            MyVector rotationAxis;
            double radians;
            v1.GetAngleAroundAxis(out rotationAxis, out radians, v2);

            v2.GetAngleAroundAxis(out rotationAxis, out radians, v1);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:11,代码来源:VectorTester.cs

示例4: Ball

        public Ball(MyVector position, DoubleVector origDirectionFacing, double radius, double mass)
            : base(position, origDirectionFacing, radius)
        {
            // I use the property sets to enforce the values
            this.Mass = mass;
            this.Elasticity = 1d;

            _usesBoundingBox = false;
            _boundingLower = null;
            _boundingUpper = null;
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:11,代码来源:Ball.cs

示例5: MyQuaternion

        /// <summary>
        /// This constructs a unit quaternion that represents the rotation
        /// </summary>
        public MyQuaternion(MyVector rotationAxis, double radians)
        {
            double halfAngle = radians / 2d;
            double sinHalfAngle = Math.Sin(halfAngle);
            MyVector rotateAroundUnit = MyVector.BecomeUnitVector(rotationAxis);

            // Set my values
            this.X = rotateAroundUnit.X * sinHalfAngle;
            this.Y = rotateAroundUnit.Y * sinHalfAngle;
            this.Z = rotateAroundUnit.Z * sinHalfAngle;
            this.W = Math.Cos(halfAngle);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:15,代码来源:MyQuaternion.cs

示例6: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            MyVector v1 = new MyVector(3, 4, 5);

            v1.Add(1, 2, 3);

            v1.BecomeUnitVector();

            MyVector v2 = v1.Clone();

            v2.Multiply(3);

            v1.Divide(3);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:14,代码来源:VectorTester.cs

示例7: BallAdder

        private Ball _drawingBall = null;		// ball is the lowest base class.  it could also be solidball or rigidbody

        //private double _diminishPercent = 1d;

        #endregion

        #region Constructor

        public BallAdder(LargeMapViewer2D picturebox, ObjectRenderer renderer, BallProps newBallProps, SimpleMap map, MyVector boundryLower, MyVector boundryUpper, List<long> tempObjects)
        {
            _picturebox = picturebox;
            _renderer = renderer;
            _newBallProps = newBallProps;
            _map = map;
            _boundryLower = boundryLower;
            _boundryUpper = boundryUpper;
            _tempObjects = tempObjects;

            _picturebox.MouseDown += new MouseEventHandler(picturebox_MouseDown);
            _picturebox.MouseUp += new MouseEventHandler(picturebox_MouseUp);
            _picturebox.MouseMove += new MouseEventHandler(picturebox_MouseMove);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:22,代码来源:BallAdder.cs

示例8: DoGravityDown

        private void DoGravityDown()
        {
            const double ACCELDOWN = .1d;

            MyVector accel = new MyVector(0, ACCELDOWN * _gravityMultiplier, 0);

            foreach(BallBlip blip in _map.GetAllBlips())
            {
                if (blip.CollisionStyle != CollisionStyle.Standard)
                {
                    continue;
                }

                blip.Ball.Acceleration.Add(accel);       // I do acceleration instead of force so they all fall at the same rate
            }
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:16,代码来源:GravityController.cs

示例9: GravMouse

        public GravMouse(LargeMapViewer2D picturebox, SimpleMap map, MyVector boundryLower, MyVector boundryUpper)
        {
            const double RADIUS = 400;

            _picturebox = picturebox;
            _map = map;
            _boundryLower = boundryLower;
            _boundryUpper = boundryUpper;

            _cursorBlip = new BallBlip(new Ball(new MyVector(), new DoubleVector(1, 0, 0, 0, 1, 0), RADIUS, UtilityCore.GetMassForRadius(RADIUS, 1d), 1, 0, 0, _boundryLower, _boundryUpper), CollisionStyle.Stationary, RadarBlipQual.BallUserDefined05, TokenGenerator.NextToken());

            _picturebox.MouseDown += new MouseEventHandler(picturebox_MouseDown);
            _picturebox.MouseUp += new MouseEventHandler(picturebox_MouseUp);
            _picturebox.MouseMove += new MouseEventHandler(picturebox_MouseMove);
            _picturebox.MouseLeave += new EventHandler(picturebox_MouseLeave);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:16,代码来源:GravMouse.cs

示例10: Trail

        /// <summary>
        /// This constructor is meant to assist the clone function
        /// </summary>
        protected Trail(MyVector[] points, int curPtr, int startRed, int startGreen, int startBlue, int endRed, int endGreen, int endBlue)
        {

            // Store stuff passed in
            _points = points;
            _curPtr = curPtr;
            _startRed = startRed;
            _startGreen = startGreen;
            _startBlue = startBlue;
            _endRed = endRed;
            _endGreen = endGreen;
            _endBlue = endBlue;

            // Set up the other misc stuff
            _isInitialized = true;

        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:20,代码来源:Trail.cs

示例11: VectorField2D

        public VectorField2D(VectorField2DMode fieldMode, double sizeX, double sizeY, int squaresPerSideX, int squaresPerSideY, double strength, MyVector position)
        {
            // I use the property sets to enforce constraints
            this.FieldMode = fieldMode;

            this.SizeX = sizeX;
            this.SizeY = sizeY;

            this.SquaresPerSideX = squaresPerSideX;
            this.SquaresPerSideY = squaresPerSideY;

            this.Strength = strength;

            // By waiting until now to set the position, I've kept ResetField from running (called by the property sets)
            _position = position;

            ResetField();
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:18,代码来源:VectorField2D.cs

示例12: FillPie

        public void FillPie(Brush brush, MyVector centerPoint, double radius, MyVector centerLine, double sweepRadians)
        {
            // Turn the centerline and sweep radians into angles that GDI likes
            MyVector dummy = new MyVector(1, 0, 0);
            double startDegrees;
            dummy.GetAngleAroundAxis(out dummy, out startDegrees, centerLine);
            startDegrees = Utility3D.GetRadiansToDegrees(startDegrees);

            if (centerLine.Y < 0)
            {
                startDegrees *= -1;
            }

            double sweepDegrees = Utility3D.GetRadiansToDegrees(sweepRadians);

            startDegrees -= sweepDegrees / 2d;

            // Call my overload
            FillPie(brush, centerPoint, radius, startDegrees, sweepDegrees);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:20,代码来源:LargeMapViewer2D.cs

示例13: FillRectangle

 public void FillRectangle(Brush brush, MyVector lower, MyVector upper)
 {
     try
     {
         _graphics.FillRectangle(brush,
             PosWToV_X(lower.X), PosWToV_Y(lower.Y),
             DistWToV(upper.X - lower.X), DistWToV(upper.Y - lower.Y));
     }
     catch (OverflowException)
     {
         // Oh well
     }
 }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:13,代码来源:LargeMapViewer2D.cs

示例14: FillCircle

        public void FillCircle(Brush brush, MyVector centerPoint, double radius)
        {
            try
            {
                float widthAndHeight = DistWToV(radius * 2d);

                _graphics.FillEllipse(brush,
                    PosWToV_X(centerPoint.X - radius), PosWToV_Y(centerPoint.Y - radius),
                    widthAndHeight, widthAndHeight);
            }
            catch (OverflowException)
            {
                // Oh well
            }
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:15,代码来源:LargeMapViewer2D.cs

示例15: LargeMapViewer2D

        public LargeMapViewer2D()
        {
            InitializeComponent();

            // Default to viewing everything
            _centerPoint = new MyVector();
            ZoomFit();

            // AutoScroll Emulator
            _autoscroll = new AutoScrollEmulator();
            _autoscroll.AutoScroll += new AutoScrollHandler(Autoscroll_AutoScroll);
            _autoscroll.CursorChanged += new EventHandler(Autoscroll_CursorChanged);
        }
开发者ID:charlierix,项目名称:AsteroidMiner,代码行数:13,代码来源:LargeMapViewer2D.cs


注:本文中的Game.Orig.Math3D.MyVector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。