Shahbaz,
Attached is a program which collides 2 cubes.
It uses Canvas3D.preRender() to move the cubes which should be smoother than
using a timer.
It uses WakeupOnCollisionEntry to detect the collision.
It uses Shape3D as the arming node, so should work with both v 1.1.x and v
1.2beta2.
At the moment it just reverses the movement on collision, but I'm working on
better physics simulation.
Martin
http://www.martinb.com/
----- Original Message -----
From: Shahbaz Hafeez
To: [EMAIL PROTECTED]
Sent: Sunday, April 30, 2000 3:59 PM
Subject: [JAVA3D] Collision Detection and stopping movement
> hi everyone,
>
> I could really do with some help in implementing collision :(
> I have 2 objects, one in a static, fixed position and the other (a
colorcube) moving towards it, I cannot seem to stop the
> moving object once it comes into contact/collides with the fixed one and
it just passes through..
> I thought of having aboolean value which flagged true for a collision
then stops the movement of the colorcube but i
> could not implememnt.
> There is a demo which comes with J3d that detects collision - but not
actually stops the moving object from passing
> through the static one.
> I do not have much time left for this project and would really be grateful
if someone could show me how to implement
> this.
>
> I have included 2 simple files that I am working on.. one is a behavior
class the other contains the main method.
> Please can someone help?! :(
>
>
> Shahbaz
mjbOutput2.java