rotating player

Grab your favourite IDE and tinker with the innards of game engines

rotating player

Postby pfannkuchen_gesicht on Sun Jan 02, 2011 8:35 pm

Hello,
I have a little problem, I want to rotate the player to make wall runs possible, but apparently CBasePlayer::SetAbsAngles() doesn't work.
Any ideas?
pfannkuchen_gesicht
Member
Member
 
Joined: Sat May 29, 2010 11:36 pm

Re: rotating player

Postby omnicoder on Sun Jan 02, 2011 9:00 pm

Player isn't allowed to rotate like that as it would mess up collisions. The player uses an Axis-Aligned Bounding-Box:
Wikipedia wrote:In many applications the bounding box is aligned with the axes of the co-ordinate system, and it is then known as an axis-aligned bounding box (AABB). To distinguish the general case from an AABB, an arbitrary bounding box is sometimes called an oriented bounding box (OBB). AABBs are much simpler to test for intersection than OBBs, but have the disadvantage that when the model is rotated they cannot be simply rotated with it, but need to be recomputed.
Image
If only the future implemented IForeseeable...
"whats threading? does it have to do with strings?" - stegarootbeer
User avatar
omnicoder
Been Here A While
Been Here A While
 
Joined: Sun Feb 07, 2010 8:35 am

Re: rotating player

Postby pfannkuchen_gesicht on Sun Jan 02, 2011 10:11 pm

eh, it's possible somehow, I already seen something similar to what I want to do
pfannkuchen_gesicht
Member
Member
 
Joined: Sat May 29, 2010 11:36 pm

Re: rotating player

Postby Gary on Mon Jan 03, 2011 1:43 am

Yeah, there was an entire mod based on the ideas of walking on walls and ceilings. No doubt it is possible.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: rotating player

Postby dark0r on Mon Jan 03, 2011 1:40 pm

It's definitely possible to be on the ceiling using SetAbsAngles (although you would most definitely fall to the floor below, you'd need to disable gravity). Surely you'd just have to set the roll to 180 degrees for the view (which should happen if the view angle is copied from the absolute angles of the player)

Try forcing CBasePlayer::CalcViewRoll to return 180. Hope that helps you off.
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: rotating player

Postby -=Biohazard=- on Mon Jan 03, 2011 2:04 pm

dark0r wrote:It's definitely possible to be on the ceiling using SetAbsAngles

No...

This patch by Winston should get you started with the gamemovement and viewvector offset (iirc). All that is left to do is write some custom input stuff that translates your mouseinput into worldspace and rotates the player properly etc.

For the AABB I'd use something like (-) Vector(36,36,36) for min/max; if this is for mp you also need to override GetRenderAngles/ Origin (the latter just in case you have surfaces that are not axis aligned) and do something with the hitboxes.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Return to Programming

Who is online

Users browsing this forum: No registered users