Jump to content

engine.game.setTime affects Transforms / Animations.


photo

Recommended Posts

It would be nice when resting game time to zero I could get everything to move back to its original position.

I think I can generally do this if my calculations if I calculate ifps as engine.game.getTime() - engine.game.getTime() that I calculated last update cycle. (negative ifps becomes possible).

This however doesn't work automatically with the WorldTransform, MeshSkinned Classes and it would be nice if it did.

 

Or am I missing the purpose of engine.game.setTime()? is there a good reason why this shouldn't occur?

 

[edit] it would also be highly useful for engine.game.setScale() to support negative values[/edit]

Link to comment
  • 2 weeks later...

The update logic of the engine requires ifps to be non-negative. Ypu can slow down the game speed or stop it completely; however, reversing the game time cannot be implemented because physics simulation and contact solving cannot be reversed. (It is possible only by calling saveScene/restoreScene that make a snapshot of physics first and then roll back to the saved one).

 

If you need to reverse WorldTransform or ObjectMeshSkinned, simply set negative setSpeed().

 

Or am I missing the purpose of engine.game.setTime()?

For example, it can be used to nullify the game time.

Link to comment
×
×
  • Create New...