Does CullHint affect Controls?

Are controls not updated if a Spatial’s CullHint is set to Always?



I have an object whose visibility I want to animate. Right now, I have it flipping the CullHint from Always to Dynamic depending on whether or not it’s visible at that given waypoint. However, it appears that once I flip it to CullHint.Always, my MotionTrack isn’t update anymore.



Are my observations correct, or have I got something else going on?

My understanding is, that controll do get updated, but its second method (forhot it’s name, something with rendering) is not called. So depends where your logic is.

Controls are not updated if the object is culled with CullHint.

pspeed said:
Controls are not updated if the object is culled with CullHint.

Really paul? Because I am pretty sure updateLogicalState() goes through the entire tree each time.
I think you might be referring to controlRender vs. controlUpdate. controlRender() indeed isn't called if the object has been culled

D’oh… you are right.



It was LOD I was trying to do with a control and if you cull yourself in controlRender() (where you have access to the camera) then you will never be called again to uncull yourself.

.

…my bad.

pspeed said:
It was LOD I was trying to do with a control and if you cull yourself in controlRender() (where you have access to the camera) then you will never be called again to uncull yourself.


This is basically exactly what I was trying to do.

Is there a better way to make a mesh invisible while still keeping it in the scene graph and updating movement controls on it? I suppose I could swap in a different material, but is there a lower-cost alternative?

The controls are updated when the spatial is culled, just the render() method isn’t called, the update() method is.

Ah, alright. I actually figured out my problem.



Apparently the waypoint callback for MotionPath is, um, a little unstable. It seems that a somewhat random number of waypoints are actually called back. Well, specifically, the last one or two might not be called.



So, I wrote my own little position-observer control, and now things work much, much better.