// Use this for initialization
 void Awake()
 {
     cA = Camera.main.GetComponent <CubeArray> ();
     //Assign the 4 blocks of each group
     blocks = new Transform[4];
     for (int i = 0; i < transform.childCount; i++)
     {
         blocks [i] = transform.GetChild(i);
     }
     getRotByType(type);
 }
Exemple #2
0
        public static Vector3d GetPoint(CubeArray <Vector3d> array, double u, double v, double w)
        {
            for (int y = 0; y < 4; y++)
            {
                for (int x = 0; x < 4; x++)
                {
                    _coordBufferSurf.Value[x + y * 4] = BezierHelper.Bezier(array[x, y, 0], array[x, y, 1], array[x, y, 2], array[x, y, 3], w);
                }
            }

            for (int x = 0; x < 4; x++)
            {
                _coordBufferCurv.Value[x] = BezierHelper.Bezier(_coordBufferSurf.Value[x + 4 * 0], _coordBufferSurf.Value[x + 4 * 1], _coordBufferSurf.Value[x + 4 * 2], _coordBufferSurf.Value[x + 4 * 3], v);
            }

            return(BezierHelper.Bezier(_coordBufferCurv.Value[0], _coordBufferCurv.Value[1], _coordBufferCurv.Value[2], _coordBufferCurv.Value[3], u));
        }
Exemple #3
0
        public override void Initialize()
        {
            _jellyData             = OwnerNode.GetComponent <JellyData>();
            _initialData           = new CubeArray <Vector3d>(_jellyData.DataPoints);
            _displacementVectors   = new CubeArray <Vector3d>(_initialData.xSize, _initialData.ySize, _initialData.zSize);
            _displacementFrequency = new CubeArray <double>(_initialData.xSize, _initialData.ySize, _initialData.zSize);
            var gen = new Random();

            for (int y = 0; y < _initialData.ySize; y++)
            {
                for (int z = 0; z < _initialData.zSize; z++)
                {
                    for (int x = 0; x < _initialData.xSize; x++)
                    {
                        _displacementVectors[x, y, z]   = new Vector3d(gen.NextDouble() * 2.0 - 1.0, gen.NextDouble() * 2.0 - 1.0, gen.NextDouble() * 2.0 - 1.0).Normalized();
                        _displacementFrequency[x, y, z] = gen.NextDouble() * _frequencyMult;
                    }
                }
            }
            base.Initialize();
        }
Exemple #4
0
 void Start()
 {
     cA     = gameObject.GetComponent <CubeArray> ();
     hScore = gameObject.GetComponent <Highscore> ();
 }
Exemple #5
0
 void Start()
 {
     cA    = gameObject.GetComponent <CubeArray>();
     score = gameObject.GetComponent <Scoring>();
 }
Exemple #6
0
 public static Vector3d GetPoint(CubeArray <Vector3d> array, Vector3d uvw)
 {
     return(GetPoint(array, uvw.X, uvw.Y, uvw.Z));
 }