07-06-2019, 07:57 AM
(This post was last modified: 07-06-2019, 07:58 AM by josemendez.)
(06-06-2019, 04:34 PM)Smurfj3 Wrote: Awesome thanks for the quick reply and indeed got it all working now, is there a page that explains more about the Solver since I don't understand why it actually works now. I find the line 'rope.AddToSolver(null);' very confusing.
Hi,
There's a description of how the overall architecture is designed here:
http://obi.virtualmethodstudio.com/tutor...cture.html
Quoting the manual, here's what happens when AddToSolver() is called:
Quote:Now, the basic steps that take place when an ObiActor gets added to an ObiSolver are:
.
- ObiActor borrows a handful of particles from its ObiSolver, and sets their initial properties.
- ObiActor asks its ObiConstraints components to generate constraints of multiple kinds between these particles.
- In turn, each ObiConstraints component asks the ObiSolver to put these constraints in place
So basically, you first tell the actor which solver will be in charge of managing it:
Quote:actor.Solver = solver;Then, you can AddToSolver() (particles and constraints needed to simulate the actor are allocated by the solver) or RemoveFromSolver() (the actor particles/constraints are deallocated and returned to the solver pool).