Alice Community  

Go Back   Alice Community > Alice 2 > Suggestion Box

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Collision Detection
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default Collision Detection - 02-18-2011, 04:09 AM

I know there has been a lot of people saying "We want collision detection! Blah! Blah!" I'm not going to be that type of person that just demands a feature. Instead, I was wondering, if the people creating Alice 3.0 could access all of the "points" of any particular object.

For example, if we assign a letter for every three-dimensional position, if object1 contains points in the positions {a, b, c, d} and object2 contains points in the positions {d, e, f, g} then it would show as a collision since they share a common point {d} in the same position. I know that most objects contain more than four points, so I'm not sure if checking for collisions using this method would be practical.

So yeah, Alice could have a built in "isColliding" function, using two parameters for the two different objects and the result would return true if the any points in the first object are in the same position as the second object.

So yeah... to sum it up in hard code:

isColliding = function(object1, object2)
{
//object.points is an array containing all the points in that object.
//intersection is a function that returns the commonalities between two arrays
newArray = intersection(object1.points, object2.points);
if (newArray.size >= 1)
{
return true;
}
}

I don't know what data the Alice development team has access to, but hopefully this might help.
   
Reply With Quote
 


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.