Colliding with a rotated box?
by Daniel Buckmaster · in Torque Game Engine · 01/15/2009 (8:10 am) · 5 replies
I'm doing work on a free-rotating Player, but I can't seem to get the collision working properly. My Players still collide as if their bounding bozes are oriented vertically, even if the Player is rotated to lie on one side. When I turn on bounding box rendering, everything seems to align correctly.
And is it just me, or have a ton of posts been lost in the move? :P I don't recognise any posts in the forum now...
And is it just me, or have a ton of posts been lost in the move? :P I don't recognise any posts in the forum now...
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
01/16/2009 (7:31 am)
Asfar as I know, that resource just deals with changing the size of the box, rather than actually rotating it. I've implemented it, and some modifications/improvements, and they work nicely, but I'm lost trying to fathom the collision detection system.
#3
01/17/2009 (5:02 am)
Ha! Found the problem. In Player::updateMove, there was an 'early out' check that would skip the collision process if the end location was empty. This check used a non-oriented box, so until this non-oriented box collided with something, the early-out check was precluding the check against the rotated box. Fixed that, and it's time to work on the resource...
#4
01/17/2009 (5:38 am)
ahhh great work on that Daniel - are you going to post an update to the resource so others can share :)
#5
Um... for some reason, it appears as a blog. Check the latest blogs for it :P.
In fact... no, let me take it down... blogs are public, right?
Okay, okay, it seems that all the resources are public... so it should be fine to stick the resource in a blog. I just want to wait for an official word from GG on this :P.
01/17/2009 (7:22 am)
Nope, I'm creating a new resource from scratch. Having a free-rotating Player and having a Player that can crouch are two entirely different cans of worms, and will be of use to different people. I'm uploading it right now, though it might take a while to be moderated.Um... for some reason, it appears as a blog. Check the latest blogs for it :P.
In fact... no, let me take it down... blogs are public, right?
Okay, okay, it seems that all the resources are public... so it should be fine to stick the resource in a blog. I just want to wait for an official word from GG on this :P.
Torque Owner Andy Rollins
ZDay Game
You might want to have a look at the swim, crouch, crawl resource as I believe it rotated the boxes correctly www.garagegames.com/community/resource/view/4348