Hi,
I wrote a behavior and when I add it to my root scene graph BG, my PickMouseBehavior becomes inactive (no call to updateScene(x,y)). I haven't found the problem.
Maybe it's because my behavior changes the geometry (a tube is linking two objects and the behavior updates the geometry when one of the objects is moving) ?
This is my scene graph :
Root -> BG -> PickMouseBehavior
-> BG -> Tube (BG) -> Shape3D
-> TubeBehavior (modifies Tube geometry)
This is my behavior :
public class TubeBehavior extends Behavior
{
private WakeupOr criterion;
private Tube tube;
public TubeBehavior(Tube tube, Pieces3D p1, Pieces3D p2)
{
this.tube = tube;
WakeupCriterion [] criterions = new WakeupCriterion[2];
criterions[0] = new WakeupOnTransformChange(p1.tgSpin);
criterions[1] = new WakeupOnTransformChange(p2.tgSpin);
criterion = new WakeupOr(criterions);
this.setEnable(true);
this.setSchedulingBounds(new BoundingSphere(new Point3d(0.0,0.0,0.0), 1000.0));
}
public void initialize() {
tube.updateGeometry();
wakeupOn(criterion);
}
public void processStimulus(Enumeration criteria) {
tube.updateGeometry();
wakeupOn(criterion);
}
}
Thanks !!
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en fran�ais !
