many model need play stand anim or idle anim! so how can auto stop the AnimControl if the model not in camera area?
To test whether the model is āin cameraā, you might use the Spatial.checkCulling()
method.
To disable the control, you might use AnimControl.setEnabled(false);
To perform the test on every update, you might create an AppState
or add it to SimpleApplication.simpleUpdate()
.
One question is why you want to do this.
The mesh itself is only updated when the object is on screen (controlRender()) even if the āanimationā and bones, etc. are updated when the character is off-screen. And sometimes itās important for those bones to be updated even when they arenāt in view.
Do you have like several thousand animated characters or something? If so, I donāt think animating the bones is going to be your bottleneck.
yes i have 5 thousand anim ! so i need auto stop the anim while the model not in camera area
The work that animations are doing when not in view is not very much.
You can implement what you want as already described but it is unlikely to help much. Thatās probably just too many animated characters at once. Off the shelf systems are unlikely to work well in that case.
ā¦which is why you donāt see many video games with 5000 animated characters at once.
yes, even M&B Bannerlord that is known for big battles using detailed models have limits. i belive it was 1000.
well, you can do own control and check if is in view and disable anim control, but im also not sure if this will help.