protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[8]; contour[1] = new Microsoft.DirectX.Vector2[8]; int i = 0; contour[0][i++] = new Microsoft.DirectX.Vector2(0, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(0.5f * t2, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, 0.5f * t3); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0.5f * t2, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0, 0.5f * t3); for (i = 0; i < 8; i++) { contour[0][i].X -= 0.5f * t2; contour[0][i].Y -= 0.5f * t3; } i = 0; contour[1][i++] = new Microsoft.DirectX.Vector2(0, -1); contour[1][i++] = new Microsoft.DirectX.Vector2(0, -1); contour[1][i++] = new Microsoft.DirectX.Vector2(1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(0, 1); contour[1][i++] = new Microsoft.DirectX.Vector2(0, 1); contour[1][i++] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
public static Vector2 ConvertFrom(Microsoft.DirectX.Vector2 value) { return(new Vector2() { X = value.X, Y = value.Y }); }
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Microsoft.DirectX.Vector2 curPosition = new Microsoft.DirectX.Vector2((float)this.worldWindow.DrawArgs.WorldCamera.Latitude.Degrees, (float)this.worldWindow.DrawArgs.WorldCamera.Longitude.Degrees); if (this.curPathLine != null && this.lastPosition != curPosition) { this.curPathLine.AddPointToPath(curPosition.X, curPosition.Y, false, this.curHeight); } }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[14]; contour[1] = new Microsoft.DirectX.Vector2[14]; contour[0][0] = new Microsoft.DirectX.Vector2(0, 0); contour[0][1] = new Microsoft.DirectX.Vector2(t2 / 2.0f, 0); contour[0][2] = new Microsoft.DirectX.Vector2(t2, 0); contour[0][3] = new Microsoft.DirectX.Vector2(t2, tf); contour[0][4] = new Microsoft.DirectX.Vector2((t2 + tw) / 2.0f, tf); contour[0][5] = new Microsoft.DirectX.Vector2(tw, tf); contour[0][6] = new Microsoft.DirectX.Vector2(tw, t3 / 2.0f); contour[0][7] = new Microsoft.DirectX.Vector2(tw, t3 - tf); contour[0][8] = new Microsoft.DirectX.Vector2((t2 + tw) / 2.0f, t3 - tf); contour[0][9] = new Microsoft.DirectX.Vector2(t2, t3 - tf); contour[0][10] = new Microsoft.DirectX.Vector2(t2, t3); contour[0][11] = new Microsoft.DirectX.Vector2(t2 / 2.0f, t3); contour[0][12] = new Microsoft.DirectX.Vector2(0, t3); contour[0][13] = new Microsoft.DirectX.Vector2(0, t3 / 2.0f); float a1 = t3 * tw; float a2 = 2 * (t2 - tw) * tf; float c3 = (a1 * (tw / 2.0F) + a2 * (tw + t2 / 2.0F)) / (a1 + a2); float c2 = t3 / 2.0F; for (int i = 0; i < 14; i++) { contour[0][i].X = contour[0][i].X - c3; contour[0][i].Y -= c2; } contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(0, -1); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, 1); contour[1][4] = new Microsoft.DirectX.Vector2(0, 1); contour[1][5] = new Microsoft.DirectX.Vector2(1, 0); contour[1][6] = new Microsoft.DirectX.Vector2(1, 0); contour[1][7] = new Microsoft.DirectX.Vector2(0, -1); contour[1][8] = new Microsoft.DirectX.Vector2(0, -1); contour[1][9] = new Microsoft.DirectX.Vector2(1, 0); contour[1][10] = new Microsoft.DirectX.Vector2(0, 1); contour[1][11] = new Microsoft.DirectX.Vector2(0, 1); contour[1][12] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][13] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
private void SelectWindowArrayVisibility(Window callingWindow) { int i = 0; foreach (CollapseItem item in this.mItems) { if (this.GetHighlighted().Contains(item.Text)) { Vector2 v = windowScls[i]; if (float.IsNaN(v.X) == false && float.IsNaN(v.Y) == false) { float newScaleX = v.X; float newScaleY = v.Y; if (float.IsNaN(v.X)) { newScaleX = Parent.ScaleX; } if (float.IsNaN(v.Y)) { newScaleY = Parent.ScaleY; } Parent.SetScaleTL(newScaleX, newScaleY, true); // parentWindow.X += v.X - parentWindow.ScaleX; // this.Parent.ScaleX = v.X; } ((WindowArray)item.ReferenceObject).Visible = true; } else { ((WindowArray)item.ReferenceObject).Visible = false; } i++; } if (this.NumberOfVisibleElements >= Items.Count) { ScrollBarVisible = false; } else { ScrollBarVisible = true; } }
public void RunTests() { Vector2 v1 = new Vector2(3, 2); Vector2 v2 = new Vector2(-4, 5); DXVec2 dx1 = new DXVec2(3, 2); DXVec2 dx2 = new DXVec2(-4, 5); TestMagnitude(v1, v2, dx1, dx2); TestNormalize(v1, v2, dx1, dx2); TestDot(v1, v2, dx1, dx2); TestAdd(v1, v2, dx1, dx2); TestSub(v1, v2, dx1, dx2); TestScale(v1, v2, dx1, dx2); TestTransform(v1, v2, dx1, dx2); PrintResults(v1, v2); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[segments]; contour[1] = new Microsoft.DirectX.Vector2[segments]; int i; float angle, delta = 2.0f * (float)Math.PI / (float)segments; float r = t3 / 2.0f; for (i = 0, angle = 0; i < segments; angle += delta, i++) { contour[0][i] = new Microsoft.DirectX.Vector2((float)Math.Cos(angle) * r, (float)Math.Sin(angle) * r); contour[1][i] = contour[0][i]; } buildHighStressCover(); UpdateData(); }
private void buttonStart_Click(object sender, System.EventArgs e) { try { this.listBoxPaths.Enabled = false; this.textBoxName.Enabled = false; this.buttonStop.Enabled = true; this.buttonStart.Enabled = false; this.buttonSave.Enabled = false; this.numericUpDownHeight.Enabled = false; this.numericUpDownFrequency.Enabled = false; World.Settings.ShowCrosshairs = true; this.curPathLine = new PathLine(this.textBoxName.Text + " - " + this.getAvailableLineNumber() + ".wwb", this.worldWindow.CurrentWorld, null, (float)this.numericUpDownHeight.Value, System.Drawing.Color.Red); this.worldWindow.CurrentWorld.RenderableObjects.Add(this.curPathLine); this.curPathLine.IsOn = true; this.curHeight = (float)this.numericUpDownHeight.Value; this.lastPosition = new Microsoft.DirectX.Vector2((float)this.worldWindow.DrawArgs.WorldCamera.Latitude.Degrees, (float)this.worldWindow.DrawArgs.WorldCamera.Longitude.Degrees); this.curPathLine.AddPointToPath(this.lastPosition.X, this.lastPosition.Y, false, (float)this.numericUpDownHeight.Value); if (this.timer == null) { this.timer = new System.Timers.Timer((double)this.numericUpDownFrequency.Value); this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); } else { this.timer.Interval = (double)this.numericUpDownFrequency.Value; } this.timer.Start(); } catch (Exception caught) { Log.Write(caught); } }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[16]; contour[1] = new Microsoft.DirectX.Vector2[16]; contour[0][0] = new Microsoft.DirectX.Vector2(-t2b / 2.0f, -t3 / 2.0f); contour[0][1] = new Microsoft.DirectX.Vector2(0, contour[0][0].Y); contour[0][2] = new Microsoft.DirectX.Vector2(-contour[0][0].X, contour[0][0].Y); contour[0][3] = new Microsoft.DirectX.Vector2(contour[0][2].X, contour[0][2].Y + tfb); contour[0][4] = new Microsoft.DirectX.Vector2(contour[0][3].X + (tw - t2b) / 2.0f, contour[0][3].Y); contour[0][5] = new Microsoft.DirectX.Vector2(contour[0][4].X, 0); contour[0][6] = new Microsoft.DirectX.Vector2(contour[0][4].X, t3 / 2.0f - tf); contour[0][7] = new Microsoft.DirectX.Vector2(t2 / 2.0f, contour[0][6].Y); contour[0][8] = new Microsoft.DirectX.Vector2(contour[0][7].X, contour[0][7].Y + tf); contour[0][9] = new Microsoft.DirectX.Vector2(0, contour[0][8].Y); contour[0][10] = new Microsoft.DirectX.Vector2(-contour[0][8].X, contour[0][8].Y); contour[0][11] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][6].Y); contour[0][12] = new Microsoft.DirectX.Vector2(contour[0][11].X + (t2 - tw) / 2.0f, contour[0][6].Y); contour[0][13] = new Microsoft.DirectX.Vector2(contour[0][12].X, 0); contour[0][14] = new Microsoft.DirectX.Vector2(contour[0][12].X, contour[0][3].Y); contour[0][15] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][3].Y); contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(0, -1); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, 1); contour[1][4] = new Microsoft.DirectX.Vector2(1, 0); contour[1][5] = new Microsoft.DirectX.Vector2(1, 0); contour[1][6] = new Microsoft.DirectX.Vector2(0, -1); contour[1][7] = new Microsoft.DirectX.Vector2(1, 0); contour[1][8] = new Microsoft.DirectX.Vector2(0, 1); contour[1][9] = new Microsoft.DirectX.Vector2(0, 1); contour[1][10] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][11] = new Microsoft.DirectX.Vector2(0, -1); contour[1][12] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][13] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][14] = new Microsoft.DirectX.Vector2(0, 1); contour[1][15] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
public void SetCategoryScale(string category, float newScaleX, float newScaleY) { int index = -1; for (int i = 0; i < mItems.Count; i++) { if (mItems[i].Text == category) { index = i; break; } } if (index != -1) { windowScls[index] = new Vector2(newScaleX, newScaleY); } }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[11]; contour[1] = new Microsoft.DirectX.Vector2[11]; contour[0][0] = new Microsoft.DirectX.Vector2(-tw / 2.0f, 0); contour[0][1] = new Microsoft.DirectX.Vector2(contour[0][0].X + tw, contour[0][0].Y); contour[0][2] = new Microsoft.DirectX.Vector2(contour[0][1].X, (t3 - tf) / 2.0f); contour[0][3] = new Microsoft.DirectX.Vector2(contour[0][2].X, t3 - tf); contour[0][4] = new Microsoft.DirectX.Vector2(t2 / 2.0f, contour[0][3].Y); contour[0][5] = new Microsoft.DirectX.Vector2(contour[0][4].X, t3); contour[0][6] = new Microsoft.DirectX.Vector2(0, contour[0][5].Y); contour[0][7] = new Microsoft.DirectX.Vector2(-t2 / 2.0f, contour[0][6].Y); contour[0][8] = new Microsoft.DirectX.Vector2(contour[0][7].X, contour[0][3].Y); contour[0][9] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][8].Y); contour[0][10] = new Microsoft.DirectX.Vector2(contour[0][0].X, 0); float a1 = t3 * tw; float a2 = (t2 - tw) * tf; float cgy = (a1 * (t3 / 2.0f) + a2 * ((t3 + tf) / 2.0f)) / (a1 + a2); for (int i = 0; i < 11; i++) { contour[0][i].Y -= cgy; } contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(1, 0); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, -1); contour[1][4] = new Microsoft.DirectX.Vector2(1, 0); contour[1][5] = new Microsoft.DirectX.Vector2(0, 1); contour[1][6] = new Microsoft.DirectX.Vector2(0, 1); contour[1][7] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][8] = new Microsoft.DirectX.Vector2(0, -1); contour[1][9] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][10] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
private Vector2 DXToV2(DXVec2 dxv) { return new Vector2(dxv.X, dxv.Y); }
private void TestTransform(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { TransformResults = new Vector2[4]; float rads = (float)(30 * Math.PI / 180); Matrix2 rotation = Matrix2.Rotation(rads); DXTransformMatrix = Microsoft.DirectX.Matrix.AffineTransformation2D(1, new DXVec2(0, 0), rads, new DXVec2(0, 0)); DXTransformResults = new Microsoft.DirectX.Vector4[2]; DXTransformResults[0] = DXVec2.Transform(dx1, DXTransformMatrix); DXTransformResults[1] = DXVec2.Transform(dx2, DXTransformMatrix); TransformResults[0] = v1 * rotation; TransformResults[1] = v2 * rotation; TransformResults[2] = new Vector2(DXTransformResults[0].X, DXTransformResults[0].Y); TransformResults[3] = new Vector2(DXTransformResults[1].X, DXTransformResults[1].Y); }
private void TestSub(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { SubtractionResults = new Vector2[2]; SubtractionResults[0] = v1 - v2; SubtractionResults[1] = DXToV2(dx1 - dx2); }
/// <summary> /// Converts a <see cref="Microsoft.DirectX.Vector2"/> to <see cref="Fusee.Math.Core.Vector2F"/>. /// </summary> /// <param name="value">The vector to convert.</param> /// <returns>A <see cref="Fusee.Math.Core.Vector2F"/> value.</returns> public static Fusee.Math.Core.Vector2F FromDirectX(Microsoft.DirectX.Vector2 value) { return(new Fusee.Math.Core.Vector2F(value.X, value.Y)); }
private void TestAdd(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { AdditionResults = new Vector2[2]; AdditionResults[0] = v1 + v2; AdditionResults[1] = DXToV2(dx1 + dx2); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[11]; contour[1] = new Microsoft.DirectX.Vector2[11]; contour[0][0] = new Microsoft.DirectX.Vector2(-tw / 2.0f, 0); contour[0][1] = new Microsoft.DirectX.Vector2(contour[0][0].X + tw, contour[0][0].Y); contour[0][2] = new Microsoft.DirectX.Vector2(contour[0][1].X, (t3 - tf) / 2.0f); contour[0][3] = new Microsoft.DirectX.Vector2(contour[0][2].X, t3 - tf); contour[0][4] = new Microsoft.DirectX.Vector2(t2 / 2.0f, contour[0][3].Y); contour[0][5] = new Microsoft.DirectX.Vector2(contour[0][4].X, t3); contour[0][6] = new Microsoft.DirectX.Vector2(0, contour[0][5].Y); contour[0][7] = new Microsoft.DirectX.Vector2(-t2 / 2.0f, contour[0][6].Y); contour[0][8] = new Microsoft.DirectX.Vector2(contour[0][7].X, contour[0][3].Y); contour[0][9] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][8].Y); contour[0][10] = new Microsoft.DirectX.Vector2(contour[0][0].X, 0); float a1 = t3 * tw; float a2 = (t2 - tw) * tf; float cgy = (a1 * (t3 / 2.0f) + a2 * ((t3 + tf) / 2.0f)) / (a1 + a2); for (int i = 0; i < 11; i++) contour[0][i].Y -= cgy; contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(1, 0); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, -1); contour[1][4] = new Microsoft.DirectX.Vector2(1, 0); contour[1][5] = new Microsoft.DirectX.Vector2(0, 1); contour[1][6] = new Microsoft.DirectX.Vector2(0, 1); contour[1][7] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][8] = new Microsoft.DirectX.Vector2(0, -1); contour[1][9] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][10] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[16]; contour[1] = new Microsoft.DirectX.Vector2[16]; contour[0][0] = new Microsoft.DirectX.Vector2(-t2b / 2.0f, -t3 / 2.0f); contour[0][1] = new Microsoft.DirectX.Vector2(0, contour[0][0].Y); contour[0][2] = new Microsoft.DirectX.Vector2(-contour[0][0].X, contour[0][0].Y); contour[0][3] = new Microsoft.DirectX.Vector2(contour[0][2].X, contour[0][2].Y + tfb); contour[0][4] = new Microsoft.DirectX.Vector2(contour[0][3].X + (tw - t2b) / 2.0f, contour[0][3].Y); contour[0][5] = new Microsoft.DirectX.Vector2(contour[0][4].X, 0); contour[0][6] = new Microsoft.DirectX.Vector2(contour[0][4].X, t3/2.0f - tf); contour[0][7] = new Microsoft.DirectX.Vector2(t2 / 2.0f, contour[0][6].Y); contour[0][8] = new Microsoft.DirectX.Vector2(contour[0][7].X, contour[0][7].Y + tf); contour[0][9] = new Microsoft.DirectX.Vector2(0, contour[0][8].Y); contour[0][10] = new Microsoft.DirectX.Vector2(-contour[0][8].X, contour[0][8].Y); contour[0][11] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][6].Y); contour[0][12] = new Microsoft.DirectX.Vector2(contour[0][11].X + (t2 - tw) / 2.0f, contour[0][6].Y); contour[0][13] = new Microsoft.DirectX.Vector2(contour[0][12].X, 0); contour[0][14] = new Microsoft.DirectX.Vector2(contour[0][12].X, contour[0][3].Y); contour[0][15] = new Microsoft.DirectX.Vector2(contour[0][0].X, contour[0][3].Y); contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(0, -1); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, 1); contour[1][4] = new Microsoft.DirectX.Vector2(1, 0); contour[1][5] = new Microsoft.DirectX.Vector2(1, 0); contour[1][6] = new Microsoft.DirectX.Vector2(0, -1); contour[1][7] = new Microsoft.DirectX.Vector2(1, 0); contour[1][8] = new Microsoft.DirectX.Vector2(0, 1); contour[1][9] = new Microsoft.DirectX.Vector2(0, 1); contour[1][10] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][11] = new Microsoft.DirectX.Vector2(0, -1); contour[1][12] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][13] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][14] = new Microsoft.DirectX.Vector2(0, 1); contour[1][15] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
private void TestDot(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { DotProducts = new float[2]; DotProducts[0] = Vector2.Dot(v1, v2); DotProducts[1] = DXVec2.Dot(dx1, dx2); }
public void SetCategoryScale(string category, float newScaleX, float newScaleY) { int index = -1; for (int i = 0; i < mItems.Count; i++) { if (mItems[i].Text == category) { index = i; break; } } if (index != -1) { windowScls[index] = new Vector2(newScaleX, newScaleY); } }
private void TestMagnitude(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { Magnitudes = new float[4]; Magnitudes[0] = v1.Magnitude(); Magnitudes[1] = v2.Magnitude(); Magnitudes[2] = dx1.Length(); Magnitudes[3] = dx2.Length(); MagnitudesSq = new float[4]; MagnitudesSq[0] = v1.MagnitudeS(); MagnitudesSq[1] = v2.MagnitudeS(); MagnitudesSq[2] = dx1.LengthSq(); MagnitudesSq[3] = dx2.LengthSq(); }
private void TestNormalize(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { NormResults = new Vector2[4]; NormResults[0] = (new Vector2(v1)).Normalize(); NormResults[1] = (new Vector2(v2)).Normalize(); NormResults[2] = DXToV2(DXVec2.Normalize(dx1)); NormResults[3] = DXToV2(DXVec2.Normalize(dx2)); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[14]; contour[1] = new Microsoft.DirectX.Vector2[14]; contour[0][0] = new Microsoft.DirectX.Vector2(0, 0); contour[0][1] = new Microsoft.DirectX.Vector2(t2 / 2.0f, 0); contour[0][2] = new Microsoft.DirectX.Vector2(t2, 0); contour[0][3] = new Microsoft.DirectX.Vector2(t2, tf); contour[0][4] = new Microsoft.DirectX.Vector2((t2 + tw) / 2.0f, tf); contour[0][5] = new Microsoft.DirectX.Vector2(tw, tf); contour[0][6] = new Microsoft.DirectX.Vector2(tw, t3 / 2.0f); contour[0][7] = new Microsoft.DirectX.Vector2(tw, t3 - tf); contour[0][8] = new Microsoft.DirectX.Vector2((t2 + tw) / 2.0f, t3 - tf); contour[0][9] = new Microsoft.DirectX.Vector2(t2, t3 - tf); contour[0][10] = new Microsoft.DirectX.Vector2(t2, t3); contour[0][11] = new Microsoft.DirectX.Vector2(t2 / 2.0f, t3); contour[0][12] = new Microsoft.DirectX.Vector2(0, t3); contour[0][13] = new Microsoft.DirectX.Vector2(0, t3 / 2.0f); float a1 = t3 * tw; float a2 = 2 * (t2 - tw) * tf; float c3 = (a1 * (tw / 2.0F) + a2 * (tw + t2 / 2.0F)) / (a1 + a2); float c2 = t3 / 2.0F; for (int i = 0; i < 14; i++) { contour[0][i].X = contour[0][i].X - c3; contour[0][i].Y -= c2; } contour[1][0] = new Microsoft.DirectX.Vector2(0, -1); contour[1][1] = new Microsoft.DirectX.Vector2(0, -1); contour[1][2] = new Microsoft.DirectX.Vector2(1, 0); contour[1][3] = new Microsoft.DirectX.Vector2(0, 1); contour[1][4] = new Microsoft.DirectX.Vector2(0, 1); contour[1][5] = new Microsoft.DirectX.Vector2(1, 0); contour[1][6] = new Microsoft.DirectX.Vector2(1, 0); contour[1][7] = new Microsoft.DirectX.Vector2(0, -1); contour[1][8] = new Microsoft.DirectX.Vector2(0, -1); contour[1][9] = new Microsoft.DirectX.Vector2(1, 0); contour[1][10] = new Microsoft.DirectX.Vector2(0, 1); contour[1][11] = new Microsoft.DirectX.Vector2(0, 1); contour[1][12] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][13] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdateData(); }
private void TestScale(Vector2 v1, Vector2 v2, DXVec2 dx1, DXVec2 dx2) { ScaleResults = new Vector2[4]; ScaleResults[0] = v1 * 2.0f; ScaleResults[1] = v2 * .5f; ScaleResults[2] = DXToV2(DXVec2.Multiply(dx1, 2.0f)); ScaleResults[3] = DXToV2(DXVec2.Multiply(dx2, 0.5f)); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[segments]; contour[1] = new Microsoft.DirectX.Vector2[segments]; int i; float angle, delta = 2.0f * (float)Math.PI / (float)segments; float r = t3 / 2.0f; for (i = 0, angle = 0; i < segments; angle += delta, i++) { contour[0][i] = new Microsoft.DirectX.Vector2((float)Math.Cos(angle) * r, (float)Math.Sin(angle) * r); contour[1][i] = contour[0][i]; } buildHighStressCover(); UpdateData(); }
protected override void initContour() { contour[0] = new Microsoft.DirectX.Vector2[8]; contour[1] = new Microsoft.DirectX.Vector2[8]; int i = 0; contour[0][i++] = new Microsoft.DirectX.Vector2(0, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(0.5f * t2, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, 0); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, 0.5f * t3); contour[0][i++] = new Microsoft.DirectX.Vector2(t2, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0.5f * t2, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0, t3); contour[0][i++] = new Microsoft.DirectX.Vector2(0, 0.5f * t3); for (i = 0; i < 8; i++) { contour[0][i].X -= 0.5f * t2; contour[0][i].Y -= 0.5f * t3; } i = 0; contour[1][i++] = new Microsoft.DirectX.Vector2(0, -1); contour[1][i++] = new Microsoft.DirectX.Vector2(0, -1); contour[1][i++] = new Microsoft.DirectX.Vector2(1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(0, 1); contour[1][i++] = new Microsoft.DirectX.Vector2(0, 1); contour[1][i++] = new Microsoft.DirectX.Vector2(-1, 0); contour[1][i++] = new Microsoft.DirectX.Vector2(-1, 0); buildHighStressCover(); UpdataData(); }