Here is what I have: particles is an array full of particle objects. Currently I just add references of the object to the array, so after the loop ends every object has the same velocity values. But I want different for each one. What needs to be done, that there are actual objects in the array and not just references to the object?
for (i = 0; count > i; i++){
var particle = this.model; //object i want to have multiple clonse from
particle.velocity = vec3.create(); //vec3.create from glmatrix library
var x = Math.random() * (0.1 - (-0.1)) + (-0.1); //value -0.1-->0.1
var y = Math.random() * 0.1; //value 0-->0.1
var z = Math.random() * (0.1 - (-0.1)) + (-0.1); //value -0.1-->0.1
vec3.set(particle.velocity, x, y, z);
this.particles.push(particle);
}
this.model?