public void TriangleIsoscelesTest(int i, int x1, int y1, int x2, int y2) { TriangleIsosceles triangleIsosceles = new TriangleIsosceles(); triangleIsosceles._startPoint = new Point(x1, y1); triangleIsosceles._endPoint = new Point(x2, y2); TriangleIsoscelesMoks triangleIsoscelesMoks = new TriangleIsoscelesMoks(); List <Point> Exp = triangleIsoscelesMoks.Get(i); List <Point> Act = triangleIsosceles.GetPoints(); CollectionAssert.AreEqual(Exp, Act); }
private void SetupPhysics() { if (body == null) { body = GetComponent <FSBodyComponent>().PhysicsBody; body.OnCollision += OnCollisionEvent; Vertices vertices = TriangleIsosceles.CreateVertexList(length, angle); FVector2 firstPoint = vertices.NextVertex(0); vertices.Translate(new FVector2(-firstPoint.X, -firstPoint.Y)); vertices.Rotate(Mathf.PI / 180.0f * angle); PolygonShape polyTemp = new PolygonShape(vertices, 1.0f); body.CreateFixture(polyTemp); } }
private void SetupPhysics() { if (body == null) { body = GetComponent <FSBodyComponent>().PhysicsBody; PolygonShape[] shapeList = TriangleIsosceles.CreateFanSet(radius, maxAngle, shardCount, 1); for (int i = 0; i < shardCount; i++) { body.CreateFixture(shapeList[i]); } body.OnCollision += OnCollisionEvent; body.AngularVelocity = rotationRate * Mathf.PI / 180.0f; } }
public override void Update() { figure = new TriangleIsosceles(); }
public TriangleIsoscelesFactory() { figure = new TriangleIsosceles(); }