Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Humvee driver with collision detection
Old
davidghemer
Member
 
Status: Offline
Posts: 38
Join Date: Nov 2011
Default Humvee driver with collision detection - 11-30-2011, 09:30 PM

The attached world lets you drive a Humvee around. I've included two kinds of collision detection. One is for circular objects where the distance to function is used.
The second is for rectangular objects where I use a combination of is right of, is left of etc functions and distance to left, distance to right etc.

This works reasonably well. I still get some false collisions on corners - probably because of the fact I use half the Humvee depth as my threshold.

It also (very) occasionally drives into walls.

Other than that it seems to work fairly well.
Attached Files
File Type: a2w CollisionDetection.a2w (546.1 KB, 138 views)


For video tutorials on programming in Alice 2.2 check out my YouTube channel

http://www.youtube.com/user/drdave785

Also check out my Programming in Alice blog at

http://programminginalice.com
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 11-30-2011, 10:47 PM

It works well. The only cases it doesn't work is when running into corners. It also doesn't work on odd shaped objects. You would have to tailor your objects towards your collision for it to work. For example, the windmill is a bit odd because the blades end up increasing the "radius" of the object by being an extending part of the windmill. This would be fixed by separating the extending part from the object and placing it on the same hierarchy level, but that would be silly. The house with the steps is odd in that the steps are the extending part. If you separated the steps and placed them on the same level, then it would allow for more complex collision.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.