Archive 17/01/2023.

Scene update double time precision

George

It would be useful to have an override scene_->Update to take double value precision.

This is useful for developing realtime application.

Cheers
George

codingmonkey

all moves two times faster - scene->SetTimeScale(2.0f);

/// Set update time scale. 1.0 = real time (default.) void SetTimeScale(float scale);

codingmonkey

oh sorry, he about value precision. Update(float timeStep) -> Update(double timeStep)

cadaver

Nearly all internally used values are floats so this would require a lot of changes to be useful.

If your purpose is using Urho for some sort of scientific application I would advise to do all calculations / updates in your own code and only use Urho as a dumb renderer, similarly how you would use Ogre.

George

Thanks that is what I’m doing at the moment.

However, I used Node::Translate(direction*deltaTime) for animation and moving child node over to different parent nodes when child node reach a certain distance. Over sometimes, space between child nodes changes.

Regards
George

cadaver

For now you could maintain your own data structures which operate on doubles and just dump the values after your update into the Urho scene graph. This means however that you’ll have to bring your own math classes / operations, since the Urho math is floats.

George

Thanks cadaver,
I’ll do that.

1vanK

Timers and Sleep() allow to increase the precision?

cadaver

No, the precision is already set to maximum (talking of Windows here.)

Use HiresTimer and busywaiting when you need more precision.