blackbird_dream wrote:...
At time step t0, try different choices of actuations to compute best fit for t0+dt. This is the reason why I must reload the configuration @ time t0 for each try.
in that case all you need to do is implement the serialization.
the function is
void NewtonSerializeToFile (const NewtonWorld* const newtonWorld, const char* const filename, NewtonOnBodySerializationCallback bodyCallback, void* const bodyUserData)
there is also serialization to memory, you can look it up, serialization to file is just an implementation to serialize to a buffer.
it takes a callback to the body because bodies are C objects, you can simple ignores if you do not want to save anything. but in general people want to save the geometry or some custom info.
since the joints are classes, they have their own methods
virtual void Deserialize (NewtonDeserializeCallback callback, void* const userData);
virtual void Serialize (NewtonSerializeCallback callback, void* const userData) const;
if you are not overloading any of them it should just work, is no then you implement that callback and there you save whatever you need.
I just try in the SDK with the demo we made to test the springs and it worked.