Will WakeupOnCollisionMovement() processStimulus() be called if the two 'colliding' objects are attached to differenct locales?
As I never tried it before and the Java 3D specs, books, etc. don't give any hints about this subject I adapted the Java 3D sample program 'org.jdesktop.j3d.examples.collision.TickTockCollision'.
At first, I created a second Locale instance with a slightly different HiResCoord and added one of the two objects and the corresponding CollisionDetector-Behavior to its BranchGroup. The flying cube in the first Locale still hit this object but no collision was signaled.
Secondly, I created a second CollisionDetector-Behavior instance and added this one also to the first Locale. Now a collision was signaled but before the flying cube hit the object.
After checking the internal sources my conclusions are:
- A WakeupOnCollisionXXX criterion is tested only against objects in the Locale of its corresponding Behavior.
- A collison test doesn't take into account the spherical offset due to the Locale's HiResCoord.
Typically different Locales are chosen if sub-scenes have distances above the value range of single-precision floating-point values.
If your Locales' volumes do intersect and the objects can really collide would it be feasible to add all these objects into one Locale?
Many thanks for the confirmation. I too have made a few 'experimental' scenes, to no avail: no collisions apparent between objects in different locales.
Also unfortunately, many of my scene objects are the definition of 'widely moving' and require periodic 're-attaching' to different Locales. I was going to use collisions to 'sense' which Locale to attach to. I however have a 'work around' in place, not involving J3D collision detection.
Once again, many thanks for the information.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.