Skip to main content

Temporal behavior of collision detection

1 reply [Last post]
faralla
Offline
Joined: 2007-01-08
Points: 0

Hi,

I am trying to build a simulation using the Java3D geometry-based
collision detection.
To be able to reproduce the spatial state ob my models I rely on
deterministic timing properties of the collision detection.

Thus I registered WakeupOnCollisionExit and WakeupOnCollisionEntry
instances in a custom Behavior.

When moving an object, I expected the WakeupOnCollisionEntry to trigger
the processStimulus(Enumeration) method of the behavior on the next
frame. Which ist not the case.
It seems that processing these WakeupCriterions will only happen, if
there is not again a collision entry or exit on the next frame. If
there is, they seem to be collected.

A little example:

in frame 1 objects are moved so that a collision is made. If the
objects don't move in frame 2, processStimulus will be called in frame
2.
If the collision is removed in frame 2, I will receive 2 notifications
during frame 3 (one CollisionEntry and one CollisionExit)

Can anybody confirm the observed behavior? And is there any way to get
notified on the next frame is the collision state is altered not matter
what happens afterwards?
So far, I am refreshing my object locations only on every other frame,
which obviously helps, but I cannot judge if this makes any noticable
impact on the simulation speed.

Comments are appreciated.

Regards,
Philipp

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mikelizzi2
Offline
Joined: 2011-10-13
Points: 0

Collision Detection in Java3D is done after all objects are rendered. If you are "refreshing my object locations only on every other frame" then collision detection will only be done every other frame. Do I understand you correctly? Does that help?