Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Positions Saving & Loading
#1
Hello.

I need to save disposed positions of particles (or vertices) after closing the game and to load them when I start the game.
I managed to write actor's positions and obiCloth's meshVertices arrays to XML files and to read them.

But I faced with two problems:
1) It's ok to SetParticlePositions using the values from the file; but it was not possible to get changed positions of particles (I mean the position[] array doesn't change, however the real picture is ok while deforming the object). Maybe it's necessary to RequireRenderablePosition (or/and PullDataFromSolver), isn't it?
2) On the other hand, values of meshVertices array change when I deform the mesh, but I have no luck in changing them manually with the values from the XML file (I mean the clothMesh from ObiClothBase class).

Maybe I missed something important?

For clarity, here is an example of what I need:
1) I start my game with a ball.
[attachment=215]

2) Then I deform it (via the "finger" collider), save it, and quit the game.
[attachment=217]

3) When I open the game again I am to see the second picture.
Reply


Messages In This Thread
Positions Saving & Loading - by Loki_Priest - 16-01-2019, 05:03 AM
RE: Positions Saving & Loading - by josemendez - 16-01-2019, 08:22 AM
RE: Positions Saving & Loading - by Loki_Priest - 16-01-2019, 08:33 AM