I'm getting thrashing when I use KeyNavigatorBehavior.
I've tried turning off mouse navigation, decreasing the bounds in
the bounding leaf, and using an ordinary bounds instead of a bounding leaf.
Thrashing still occurs.
Does anyone happen to know of a problem with KeyNavigatorBehavior
with J3D 1.1.2, or an error in my approach below?
Bounds behaviorBounds = new BoundingSphere( new
Point3d(), 2000.0 );
...
...
if ( bRotate && bTranslate && bZoom )
{
KeyNavigatorBehavior behavior = new KeyNavigatorBehavior( vpTrans );
m_bgNavBehavior.addChild( behavior );
KeyNavigatorBehavior behavior = new KeyNavigatorBehavior( vpTrans );
m_bgNavBehavior.addChild( behavior );
BoundingLeaf boundingLeaf = new
BoundingLeaf( behaviorBounds );
m_bgNavBounds.addChild( boundingLeaf );
behavior.setSchedulingBoundingLeaf( boundingLeaf );
}
m_bgNavBounds.addChild( boundingLeaf );
behavior.setSchedulingBoundingLeaf( boundingLeaf );
}
//===========================================================
// Add the new bounds to the view branch.
//===========================================================
try {
if ( null == super.platformGeometry ) {
super.setPlatformGeometry( new PlatformGeometry() );
}
super.platformGeometry.setCapability( javax.media.j3d.Group.ALLOW_CHILDREN_EXTEND );
super.platformGeometry.addChild( m_bgNavBounds );
super.platformGeometry.compile();
}
catch ( javax.media.j3d.RestrictedAccessException e ) {
// No-op: platformGeometry already compiled. Probably already existed.
}
//===========================================================
// Add the new behaviors to requested content branch.
// Add the new bounds to the view branch.
//===========================================================
try {
if ( null == super.platformGeometry ) {
super.setPlatformGeometry( new PlatformGeometry() );
}
super.platformGeometry.setCapability( javax.media.j3d.Group.ALLOW_CHILDREN_EXTEND );
super.platformGeometry.addChild( m_bgNavBounds );
super.platformGeometry.compile();
}
catch ( javax.media.j3d.RestrictedAccessException e ) {
// No-op: platformGeometry already compiled. Probably already existed.
}
//===========================================================
// Add the new behaviors to requested content branch.
//===========================================================
newBehaviorParent.addChild( m_bgNavBehavior );
newBehaviorParent.addChild( m_bgNavBehavior );
