Clipping and animations

I recently ran into a bug where some of my sliding doors would disappear if they came too close to the edge of the screen. My doors were modelled in an opened resting position, with an armature to close and open it. When the door was closed and only the moving panel was in the extremes of the screen, sometimes it would disappear.

I managed to fix it by modelling the door closed by default and having the armature move it in the opposite direction. But I’m still wondering why it happened so I can avoid it in the future.

What might be happening is that the bounding volume of your model is calculated for the resting pose and not the animated version. You can call showBounds() on your model to see a visualisation of the bounding volume, so that you can see if that’s what’s going on.

If so, then you can set your own bounding volume by creating a BoundingBox or BoundingSphere and assigning it to your model using model.node().setBounds(bounds); model.node().setFinal(True).

You could also disable clipping altogether by setting the bounding volume to an OmniBoundingVolume().