brunoribeiro / burriswarehouse

Automatically exported from code.google.com/p/burriswarehouse
0 stars 0 forks source link

Collision Detection #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Collision Detection requires a rewrite because of performance issues. Our main 
idea at the moment is to use our already implemented grid to specify places 
where the character can and cannot walk, making it a 2D problem rather than a 
3D problem, and making the calculation much less expensive.

Original issue reported on code.google.com by cjbus...@gmail.com on 3 Feb 2011 at 9:55

GoogleCodeExporter commented 9 years ago
I'll be the official "owner" of it, though, I might be asking a lot of 
questions for help.

Original comment by calebmay...@gmail.com on 6 Feb 2011 at 4:16

GoogleCodeExporter commented 9 years ago
actually, Chris, if you want to start coding some stuff, feel free to...I don't 
mean make you feel like you can't work on it...

Original comment by calebmay...@gmail.com on 6 Feb 2011 at 4:20

GoogleCodeExporter commented 9 years ago
Issue 9 has been merged into this issue.

Original comment by cjbus...@gmail.com on 7 Feb 2011 at 8:09

GoogleCodeExporter commented 9 years ago
Alright...so...I started doing some stuff today. There is now another table in 
the vwburr db. It has 5 fields: an ID, leftX, rightX, lowerZ, and upperZ. These 
fields define areas where the player cannot walk into.

I have created a "BoundingBoxes" class. This class will be used as an array of 
the objects. This will allow a quick search of all of these things and a simple 
if statement to see if the player is inside of this area. Right now, the player 
stops as expected. The problem is that I don't know how to let him lose and 
allow him to walk again. See...I need to get the player translation information 
before the next step, and then put him back at that place so that he doesn't 
get stuck in the box. Anyway...proof of concept works. I will keep working.

Original comment by calebmay...@gmail.com on 7 Feb 2011 at 10:19

GoogleCodeExporter commented 9 years ago
alright, so I've done about half the warehouse racks. The main thing to finish 
is the freezer racks, then all of the interior walls/yellow door guard things.

Also, go hop on a rack and collide into something and tell me what you see. I 
don't know how to fix that...I'd recommend moving the center point of the model 
closer to the front, but I'm not sure how to do that...would I have to go get 
blender? I don't wanna have to make Dan do that...he's pretty swamped as is 
already...anyway, that's the progress. 

Original comment by calebmay...@gmail.com on 10 Feb 2011 at 1:15

GoogleCodeExporter commented 9 years ago
I've done some work on it towards detecting collisions with the vehicle also. I 
modified your BoundingBox class to detect when two boxes are colliding, and 
then added a 2D BoundingBox to the player. It's not a problem when the player 
is on foot, because it's a small square box, so orientation doesn't matter. 
However, we need to come up with a way to rotate the vehicle's box as the 
vehicle rotates. It's probably something simple that I'm overlooking, but it's 
3:30 AM and I can't think geometrically anymore. 

I also changed the object layout a little bit, just to give a little extra 
encapsulation. The collision detection code is now in the Player class again.

I've committed revision 75. If you don't like my changes, just revert back to 
74. Cheers.

Original comment by cjbus...@gmail.com on 10 Feb 2011 at 8:31

GoogleCodeExporter commented 9 years ago
I just committed again...I noticed a few things that I didn't think were quite 
right (like setting the X,Z of the box vehiclePadding...anyway, I'm suggesting 
we keep the checkForCollisions2D function doing both the vehicle and the player 
checking instead of handing off the vehicle checking to someone else. You can 
see the changes I made...

Finally, the only thing I'd say that needs to be worked on is rotating the box. 
That would probably help out a lot. We just need to figure out how to rotate 
it/when to rotate it. I'll probably take a look at that this weekend, or you 
can if you want...

Original comment by calebmay...@gmail.com on 10 Feb 2011 at 5:09

GoogleCodeExporter commented 9 years ago
I put in most of the rest of the boxes needed for detection. The only ones left 
are the interior walls. Also...we really need to 1) figure out what to with 
rotating the vehicles bounding box, as well as making it less choppy. I suppose 
that we could just make it so that the velocity is actually 0. 

Original comment by calebmay...@gmail.com on 12 Feb 2011 at 7:38

GoogleCodeExporter commented 9 years ago
I updated the game so that the vehicle collision box rotates based on the 
actual vehicle rotation. The repository should reflect these changes. 

Therefore, I'm going to close out this issue. I know that there still need to 
be a few more boxes put into the db, but I'll finish that throughout the week, 
while helping you as much as I can. 

Original comment by calebmay...@gmail.com on 15 Feb 2011 at 1:13