本文整理汇总了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());
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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
}
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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
}
}
示例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
}
}
示例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);
}