Beispiel #1
0
        private void OnPointsFoundDirty()
        {
            System.Collections.Generic.List <Vector3> points = TriangleMath.CalcEqTriangle3DPoints(_centroid, _sideLength, _rotation);
            _points[(int)EqTrianglePoint.Left]  = points[(int)EqTrianglePoint.Left];
            _points[(int)EqTrianglePoint.Top]   = points[(int)EqTrianglePoint.Top];
            _points[(int)EqTrianglePoint.Right] = points[(int)EqTrianglePoint.Right];

            _arePointsDirty = false;
        }
        private void OnPointsFoundDirty()
        {
            var points = TriangleMath.CalcEqTriangle3DPoints(_centroid, _sideLength, _rotation);

            _points[(int)EqTrianglePoint.Left]  = points[(int)EqTrianglePoint.Left];
            _points[(int)EqTrianglePoint.Top]   = points[(int)EqTrianglePoint.Top];
            _points[(int)EqTrianglePoint.Right] = points[(int)EqTrianglePoint.Right];

            _arePointsDirty = false;
        }
Beispiel #3
0
        public static Mesh CreateWireEqXY(Vector3 centroid, float sideLength, Color color)
        {
            Vector3[] positions = TriangleMath.CalcEqTriangle3DPoints(centroid, sideLength, Quaternion.identity).ToArray();

            Mesh mesh = new Mesh();

            mesh.vertices = positions;
            mesh.colors   = new Color[] { color, color, color };
            mesh.SetIndices(new int[] { 0, 1, 2, 0 }, MeshTopology.LineStrip, 0);
            mesh.UploadMeshData(false);

            return(mesh);
        }