![]() |
Why solver will suddenly stop? - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: Why solver will suddenly stop? (/thread-860.html) |
Why solver will suddenly stop? - _gaoyu_ - 01-02-2019 1 The whole scene have a floor and many soft ball on floor. when I run ,I manual rotate the floor fast. I found sometime solver stop suddenly. Any idea? 2 I want to get position of ball, how to coding? Thanks RE: Why solver will suddenly stop? - josemendez - 01-02-2019 Quote:The whole scene have a floor and many soft ball on floor. when I run ,I manual rotate the floor fast. I found sometime solver stop suddenly. Can you record a video of this happening? there's no reason for a solver to stop. Quote:I want to get position of ball, how to coding? Softbodies automatically update their transform. So you can just do: Code: Vector3 position = ball.transform.position; RE: Why solver will suddenly stop? - _gaoyu_ - 01-02-2019 video: https://pan.baidu.com/s/1HZ1lmg_O0eRIHo7zkSyvkg another video: https://pan.baidu.com/s/12jOc-bj01KJie2sKl2SgkA RE: Why solver will suddenly stop? - josemendez - 01-02-2019 (01-02-2019, 10:45 AM)_gaoyu_ Wrote: video: https://pan.baidu.com/s/1HZ1lmg_O0eRIHo7zkSyvkg Hi, This is because you have "simulate when invisible" disabled in your solver. So when the ball goes out of the camera frustum, the solver stops simulating to save performance (instead of simulating something that cannot be seen). Simply enable this setting. See: http://obi.virtualmethodstudio.com/tutorials/obisolver.html RE: Why solver will suddenly stop? - _gaoyu_ - 01-02-2019 ball.transform.position is incorrect I was wrong you are right I found function in ObiActor.cs public Vector3 GetParticlePosition(int index) how to get "index"? RE: Why solver will suddenly stop? - josemendez - 01-02-2019 (01-02-2019, 11:09 AM)_gaoyu_ Wrote: ball.transform.position is incorrect Hi, Read the documentation on particle scripting: http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html RE: Why solver will suddenly stop? - _gaoyu_ - 01-02-2019 Hi, I want to know how to reset particle’ position during simulation? RE: Why solver will suddenly stop? - josemendez - 01-02-2019 (01-02-2019, 12:16 PM)_gaoyu_ Wrote: Hi, Hi, simply assign the rest position to the position: Code: solver.positions[ball.particleIndices[i]] = ball.restPositions[i]; Note that this will reset the actor to the center of the scene, since restPositions are expressed in local space, while solver positions are expressed in world space. You might want to convert them using Unity's TransformPoint or InverseTransformPoint methods, It depends on whether you want to reset its deformation only, or completely reset all positions. |