Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Help with creating rope on runtime
#4
(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).
Reply


Messages In This Thread
Help with creating rope on runtime - by Smurfj3 - 06-06-2019, 12:00 PM
RE: Help with creating rope on runtime - by josemendez - 07-06-2019, 07:57 AM