Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Confusion with VerletParticle in toxiclibs

$
0
0

Hello, I started using VerletParticle from toxiclibs, but it's the first time I'm using inheritance logic and I'm quite confused. I have the following code for the extended class:

`class Particle extends VerletParticle {

Particle(Vec3D loc) { super(loc); physics.addParticle(this); }

void run() { display(); moveUpdate(); }

void display() { stroke(255, 0, 0); strokeWeight(6); point(x, y, z); }

void moveUpdate(){

}

} ` I want to set a moveUpdate function so that the particles can move. I tried doing it the same way that it works for classes with the following idea, but it doesn't seem to work:

void moveUpdate(){ vel.addSelf(acc); vel.limit(1); loc.addSelf(vel); acc.clear(); }

If anyone could help me clarify how VerletParticle works, it would be much appreciated.


Viewing all articles
Browse latest Browse all 2896

Trending Articles