コード例 #1
0
        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);
        }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
ファイル: ArmorFan.cs プロジェクト: JazzMcFly/GreenRabbit
    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;
        }
    }
コード例 #4
0
 public override void Update()
 {
     figure = new TriangleIsosceles();
 }
コード例 #5
0
 public TriangleIsoscelesFactory()
 {
     figure = new TriangleIsosceles();
 }