Ejemplo n.º 1
0
        public void Execute(int i)
        {
            //Sample the Vector Field
            particlesCurrent[i] += field.trilinearSample(particlesCurrent[i]) * 0.1f;

            //Integrate the Particle via Verlet Integration
            Vector3 temp = particlesCurrent[i];

            particlesCurrent[i] += (particlesCurrent[i] - particlesPrevious[i]);
            particlesPrevious[i] = temp;

            //Write the particle positions out to transformation matrices
            particleMatrices[i] = Matrix4x4.TRS(particlesCurrent[i], Quaternion.identity, Vector3.one * 0.01f);
        }
Ejemplo n.º 2
0
        public void Execute(int i)
        {
            //Sample the Vector Field
            data.particlesCurrent[i] += field.trilinearSample(data.particlesCurrent[i]) * 0.1f;

            //Integrate the Particle via Verlet Integration
            Vector3 temp = data.particlesCurrent[i];

            data.particlesCurrent[i] += (data.particlesCurrent[i] - data.particlesPrevious[i]);
            data.particlesPrevious[i] = temp;

            //Write the particle positions out to transformation matrices
            data.particleMatrices[i] = Matrix4x4.TRS(data.particlesCurrent[i], new Quaternion(0f, 0f, 0f, 1f), new Vector3(1f, 1f, 1f) * 0.01f);
        }
Ejemplo n.º 3
0
 public Vector3 trilinearSample(Vector3 position)
 {
     return(field.trilinearSample(position));
 }
Ejemplo n.º 4
0
 public Vector3 trilinearSample(Vector3 position)
 {
     return(transform.TransformDirection(field.trilinearSample(transform.InverseTransformPoint(position))));
 }