Exemplo n.º 1
0
        public void Execute(int index)
        {
            Voxel vox = voxels[index];

            vox.velocity  = VectorFieldUtils.DirectionalNoise(math.mul(_matrix, new float4(vox.position, 1)).xyz, noiseScale, noiseSpeed, time);
            voxels[index] = vox;

            directions[index] = vox.velocity;
        }
Exemplo n.º 2
0
        public void Execute(int index)
        {
            VectorFieldUtils.i_to_XYZ(index, width, height, out int x, out int y, out int z);
            float3 pos    = new float3(x, y, z) * size;
            float3 _noise = VectorFieldUtils.DirectionalNoise(pos, noiseScale, noiseSpeed, 0);

            voxels[index] = new Voxel
            {
                X        = x,
                Y        = y,
                Z        = z,
                i        = index,
                position = pos,
                velocity = _noise
            };

            positions[index]  = pos;
            directions[index] = _noise;
        }