Our math library has functions for converting to/from QAngle and a matrix (use 
matrix3x4_t for a standard rotation + translation).

So you'd do something like:

matrix3x4_t currentRotation, incrementalRotation, nextRotation;
QAngle angles = GetAbsAngle();
AngleMatrix( angles, currentRotation );

// compute an incremental 1 degree of roll
AngleMatrix( QAngle( 0, 0, 1 ), incremenetalRotation );

ConcatTransforms( incrementalRotation, currentRotation, nextRotation );
MatrixAngles( nextRotation, angles );
SetAbsAngles( angles );

To do your previous example of adding 1 degree to roll.

You could just use a matrix all the way through, but I'm describing it this way 
in case you're using a bunch of our other code (like player orientation) that 
is already using/networking a QAangle for orientation.

Jay


> -----Original Message-----
> From: hlcoders-boun...@list.valvesoftware.com
> [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of
> Christopher Harris
> Sent: Friday, February 27, 2009 1:48 PM
> To: 'Discussion of Half-Life Programming'
> Subject: Re: [hlcoders] Flight controls problem
>
> Instead of doing angle.x/y/z += value you need to instead
> compute a rotation
> matrix and then multiply it with the current angle and set
> that to the new
> angle.
>
> Chris
>
> -----Original Message-----
> From: hlcoders-boun...@list.valvesoftware.com
> [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Grash
> Sent: Friday, February 27, 2009 4:28 PM
> To: Discussion of Half-Life Programming
> Subject: Re: [hlcoders] Flight controls problem
>
>
> My students are asking...
> Where would I apply this matrix translation? Im currently just using
> setabsangle(qangle)
>
>
> --- On Fri, 2/27/09, Julian Moschüring <ar...@gmx.com> wrote:
>
> From: Julian Moschüring <ar...@gmx.com>
> Subject: Re: [hlcoders] Flight controls problem
> To: "Discussion of Half-Life Programming"
> <hlcoders@list.valvesoftware.com>
> Date: Friday, February 27, 2009, 4:11 PM
>
> http://en.wikipedia.org/wiki/Gimbal_lock
>
> Garry Newman schrieb:
> > Rotate using a Matrix
> > garry
> >
> > On Fri, Feb 27, 2009 at 8:23 PM, Grash <mr_gr...@yahoo.com> wrote:
> >
> >   
> >> They've been trying to figure this out for the past 3
> weeks. What's the
> >> best way to tackle this problem?
> >>
> >> - Grash
> >>
> >> --- On Fri, 2/27/09, Christopher Harris
> <char...@resrchnet.com> wrote:
> >>
> >> From: Christopher Harris <char...@resrchnet.com>
> >> Subject: Re: [hlcoders] Flight controls problem
> >> To: "'Discussion of Half-Life Programming'" <
> >> hlcoders@list.valvesoftware.com>
> >> Date: Friday, February 27, 2009, 3:05 PM
> >>
> >> I think that the more rolled toward 90 degrees on side you
> are the more
> yaw
> >> will need to adjusted versus pitch since to the game each
> axis of the
> angle
> >> is independent of each other.
> >>
> >> Chris
> >>
> >> -----Original Message-----
> >> From: hlcoders-boun...@list.valvesoftware.com
> >> [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Grash
> >> Sent: Friday, February 27, 2009 1:58 PM
> >> To: Discussion of Half-Life Programming
> >> Subject: [hlcoders] Flight controls problem
> >>
> >>
> >> One of my students is writing this email out about a
> problem they are
> >> having. Any help would be greatly appreciated.
> >>
> >> "We are looking to replace the player with an aircraft
> model. We changed
> >> the
> >> mouse controls to affect the pitch and roll, rather then
> the pitch and
> yaw.
> >> the mousex is affecting the roll and the mousey is affecting the
> >> pitch(which
> >> hasn't changed) for some reason when we roll the player lets say 90
> degrees
> >> on its side. when we change the pitch, the player model is
> not pivoting
> >> right. the pitch will still have the player look to the
> sky rather then
> >> rotating sidewards. The 90 degree change on the roll
> should be affecting
> >> the
> >> pitch, but it is not. This is an example of the code we are using.
> >>
> >>
> >> QAngle angle = GetAbsAngle();
> >>
> >> angle.z+=1;
> >>
> >> SetAbsAngle(angle);
> >> "

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to