We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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.
Answers
ok, I solved it. I couldn't understand how super works.