I did what Jorge said. In C_BaseEntity::CalcAbsolutePosition before all
calculation of the models position depending of its parent I added this
code:
QAngle oldAngles = m_pMoveParent->GetAbsAngles();
if( m_pMoveParent->IsPlayer() )
{
//Temporarily remove the players pitch
QAngle tempAngle = oldAngles;
tempAngle[ PITCH ] = 0;
m_pMoveParent->SetAbsAngles( tempAngle );
}
And after the calculations I reset the players angles again. This way the
position is calculated as if the player dont pitch.
I tried to add a boolean instead of the m_pMoveParent->IsPlayer(), but when
I added a variable to C_BaseEntity the game keep crashing when starting a
map. I can't figure out why.
2009/7/7 Kohan Venets <[email protected]>
>
> Yeah, that does seem to be the problem, because the code used in the Ep1
> iteration of the mod uses the same code and it works fine :X
>
> -Kohan
>
>
>
> > Date: Tue, 7 Jul 2009 23:16:32 +0200
> > From: [email protected]
> > To: [email protected]
> > Subject: Re: [hlcoders] Unintended Rotation of Parented Props
> >
> > I have a similar problem. I did this in the episode1 code and it worked
> > perfect. It didnt care about the player's pitch. But now when I moved
> over
> > to OB I have the same problem as you do.
> >
> >
> > 2009/7/7 Michael Chang <[email protected]>
> >
> > > You can find all names of bones and attachments using HLMV, under bones
> and
> > > attachment tabs respectively.
> > >
> > > ~M
> > >
> > >
> > >
> > > > FollowEntity(pPlayer, false) produces no different effect, and using
> > > 'true'
> > > > puts the flag at the base of the player, and it still rotates with
> the
> > > > player's view, albeit around that point (the player's feet).
> > > >
> > > > I would try the SetParentAttachment thing, but I have no idea what
> any of
> > > > the skeleton's bones are called :(. Do you know where I could get
> info
> > > on
> > > > the skeleton bone names?
> > > >
> > > > -Kohan
> > > _______________________________________________
> > > To unsubscribe, edit your list preferences, or view the list archives,
> > > please visit:
> > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > >
> > >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
>
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders