I've structured up the code and created both a node class and an edge class to keep track of the data. I also have a class that controls everything and creates the breakable object. The object will be consisting of a bunch of nodes connected with edges in a cube formation. The edges will then apply spring forces to the nodes. If the springs are stiff enough this will hopefully mean that the object will be unmoving in its resting state and once enough force is put on the object it will start deforming and eventually crack. I haven't started applying the physics yet but I've made the code for constructing an object with a set width/height/depth. At the moment I'm using spheres to represent the nodes but there's currently no visual representation of the edges.


Inga kommentarer:
Skicka en kommentar