Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Collision Detection Idea
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default Collision Detection Idea - 02-02-2010, 11:52 AM

For collision detection, all I've figured out is how to get the bounding sphere of an object and make it not enter within that area. This is good and all if spheres were being used as walls.

I was thinking that if we used a trick from the environments from older 3D games and use simple flat shapes (more specifically, a flat square) as the environment instead of full 3D ones, the environments created within the world could have lots of shapes that can be easily manipulated.

The problem with this is how could the flat object be detected without a 3D bounding sphere and without nesting several functions within a large function (as so to cut down on the memory usage).

I'm essentially at a loss and need some ideas to try out (If there's already a working one here, I'd rather not see it since I want to make this myself).
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 02-02-2010, 12:21 PM

That's exactly the issue several of us are trying to deal with. Let us know if you find anything revolutionary.


(')>
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 02-02-2010, 12:29 PM

I'm currently looking into raycasting and geometric planes. I may have found something that could solve it.
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 02-02-2010, 12:56 PM

I may have found something.

Having the dynamic object (or player) as a sphere is the first step. Now add the wall, but it has to be either exactly horizontal or vertical (from the point of view of looking at it from the top).

Next, you would need to calculate the X1 and X2 values as well as a single Z value if it is lying horizontally (vice versa if it's vertical).

Here's the function that will be tested. If the distance to the Z value is equal to the sphere's radius, then if the sphere's X value is between X1 and X2 of the wall, then return true.

This would only work for horizontal or vertical walls because if the wall is at an angle, the Z value from before would change. I'm thinking that we could change the Z value to the slope of the X1 and X2 values, however this is just theory. I'll test this out after I've finished my lunch.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 02-02-2010, 01:58 PM

Sounds promising.


(')>
   
Reply With Quote
had this last year
Old
dmitchell
Guest
 
Status:
Posts: n/a
Cool had this last year - 02-02-2010, 06:19 PM

we dealt with this last year just make it so that if your person is within .1 meters from the object the person "Stops" its kinda easy found a great demo for it last year if i find it again i will post it for you
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 02-03-2010, 12:06 AM

That function would be flawed. If there was a large static object (non-moving), a dynamic object (moving) would pass right through the shell.

The main objective of collision detection is to make objects not be aloud to intersect within each other, regardless of size or shape.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 02-03-2010, 04:00 PM

I'm working on a solution. It checks a list of objects for "collision," and then checks directions. These directions are saved in a variable, which can be used by the move methods. How does this sound? The Player would be a cylinder (Person can be attached using vehicles, and it can be made invisible) and the walls are squares no more than 1 or so meters in size.

When I started working on collision detection, it was immediately occupant that the objects used for collision detection would never be seen by the player. Seperate objects must be made, like squares.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 02-03-2010, 04:22 PM

This depends on the function used for the collision detection. What i want to do is have 2 objects (a sphere as the moving object and a square as the static object) and then use 2D vector math to calculate if the end of the radius is equal to one of the two vectors, then check the other vector as so not to create an infinite plane where the square is.

After this, I will integrate the Y axis (which will be very easy to do).
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 02-03-2010, 04:52 PM

Quote:
Originally Posted by Niteshifter View Post
This depends on the function used for the collision detection. What i want to do is have 2 objects (a sphere as the moving object and a square as the static object) and then use 2D vector math to calculate if the end of the radius is equal to one of the two vectors, then check the other vector as so not to create an infinite plane where the square is.

After this, I will integrate the Y axis (which will be very easy to do).
That's exactly what I'm doing! Using the distance functions, you can do this generally easily.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Reply


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.