Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is this a documented Collision Avoidance method???

843799Aug 5 2003 — edited Aug 6 2003
I keep the avatar in my app above the terrain by checking the x and z location every frame and then positioning it at the appropriate y point (i.e. the height of the terrain at point y) - I've seen methods of collision avoidance implemented before using picking, it seemed fairly complex. I want mine as simple as possible so I plan to do it like this:

- Add the objects to the terrain so the avatar would go over them regardless of their height
- At every frame, store the current x,y and z co ordinates
- Then calculate the hieght of what the new x, y and z coordinates will be
- If the the new y coordinate has too greater difference between that and the old one (relative to the differences betweeen the x and y as this will reflect the speed) then keep the avatar in the position of the old x, y and z.

The value that represents the difference between the old y and new y cordinates would in effect be how steep the avatar can climb.

Is this a documented mothod of collision avoidance?
How good is this, speed wise, compared to other methods - I favour speed over accuracy.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2003
Added on Aug 5 2003
6 comments
122 views