Save updateGeometricState-calls

what exactly does updategeometricstate do? i call it whenever my objects have been moved and my profiler identified this as a pretty hot spot compared to anything else.

when a lot of animated models are flying around, half of the cpu time is spend in keyframecontroller.update which i think is useless because i give it 0.0 as the time for most of the calls since they happen during a single tick (just one gives the time difference to update the animation), so no animation has to be interpolated.



should i

a) insert if time==0.0F then return into the keyframecontroller

or

b) is there a way to prevent the controller's update from being called?

I could be wrong, but i only call updateGeometricState() once per update cycle on the root Node.



First i called the method always after a Object has changed its location, but that was obviously too much, as it messed thing up.

Meaning that some objects moved way too fast and others slower.



So i think, updateGeometricState() only needs to be called once per Spatial and update cycle.

my bound checks do not work if i don't call updateGeo() after every chance, so it has to be called. i found out the keyframe controller also adjusts the animation speed to the given time, so two calls with time x = twice animation speed, so i gave it the tpf once and 0.0 after the movements.

If you are not changing the shape of your objects, then it should suffice to call updateWorldData (i.e. rotation translation and/or scale). updateGeometricState is for when you change the actual vertexes and colors/textures.

Perhaps there should be an optimization to not update controllers if TPF is 0?

one more question: if an object is not being rendered (culled), is the keyframecontroller still upating the animations? in my case this makes no sense and could save alot of performance if i could just skip the update is this case. is this possible?

HamsterofDeath said:

one more question: if an object is not being rendered (culled), is the keyframecontroller still upating the animations? in my case this makes no sense and could save alot of performance if i could just skip the update is this case. is this possible?


This is not a general purpose rule we could apply...  There are a number of scenarios where controllers may move things into the scene, make non-visual changes, etc.  Your controller can optimize though.