Hello everyone,

It works!! Everything is in the file GameStudioModelRenderer_Sample.*
The only things you need to change are:

-All calls to StudioSetupBones, StudioEstimateGait,
StudioProcessGait, StudioFxTransform should use the default implementation
in CStudioModelRenderer.

-In hl_weapons.cpp, all you need to setup is the call to Game_SetSequence
and Game_SetOrientation in HUD_PostRunCmd. You
add :

        // Store of final sequence, etc. for client side animation
        if ( g_runfuncs )
        {
                Game_SetSequence( to->playerstate.sequence,
to->playerstate.gaitsequence );
                Game_SetOrientation( to->playerstate.origin, cmd->viewangles );
        }

The implementations of these look like this:

void Game_GetSequence( int *seq, int *gaitseq )
{
        *seq = g_rseq;
        *gaitseq = g_gaitseq;
}

void Game_SetSequence( int seq, int gaitseq )
{
        g_rseq = seq;
        g_gaitseq = gaitseq;
}


void Game_SetOrientation( vec3_t o, vec3_t a )
{
        g_clorg = o;
        g_clang = a;
}

void Game_GetOrientation( float *o, float *a )
{
        int i;

        for ( i = 0; i < 3; i++ )
        {
                o[ i ] = g_clorg[ i ];
                a[ i ] = g_clang[ i ];
        }
}

And of course this at the top of the .cpp:

// For storing predicted sequence and gaitsequence and origin/angles data
static int g_rseq = 0, g_gaitseq = 0;
static vec3_t g_clorg, g_clang;

It works great! I even added some lag with the command "fakelag" and it
predicts
very well. If anyone has any questions, feel free!:)

Georges

-----------------------------------------------------------
Project Lead/Coder/Designer
Gladiator mod
[EMAIL PROTECTED]
ICQ: 11425443
http://gladiator.lan-gaming.com




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Pat Magnan
Sent: Tuesday, January 29, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Third person camera problem


I believe your analysis is right -- that pev->angles coming over the
wire is little off from what the client code is doing with the camera.

Depending on what your goal is, you might want to rethink your
thirdperson viewpoint. If it would be acceptable to have a fixed camera
(above and behind the player), then just go into this code (in
CAM_Think - in_camera.cpp):
        camAngles[ PITCH ] = 0; // cam_idealpitch->value;
        camAngles[ YAW ] = 180; // cam_idealyaw->value;
        dist = cam_idealdist->value;

And just set it to some static values (as I have done here). The player
rotates independent of the viewpoint. I believe that cam_idealpitch,
etc is being reset with info from the server like the pev->angles, etc.
You'll need to edit the code there to take into account rotation (yaw?)
only, but you may end up with the same problem.

If you can't use a fixed camera, maybe you can try to get a reference
to the local player, and update the camera position only based on their
pev->angles... although you still may have a lack of synchronization
between the two over the net.

This is a semi educated guess. I was working on a thirdperson mod
briefly, but it was single player, so we didn't ever try to see the
effects of the net traffic on the viewpoint.


> Hello,
>
> I've been working on third person camera and have ran into a problem
> I'm not sure can be corrected. Basically, when rotating the view (thus
> rotating the player model), the model seems to constantly jerk a
little
> while
> it is turning, as if it's constantly correcting it's angles. This only
> happens to a person connected to a server, the server itself of course
> has no problem.
>
> It's as if everytime you rotate, the pev->angles is always off a bit
> compared
> to the view_angle. I also checked out the locked camera mode for the
> spectators,
> and it does the same kinda of jerking when a player rotates.
>
> Does anyone have any ideas what's causing this? Has anyone else ran
into
> this problem?
>
> Georges
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list
archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>

---------------------------------------
Eighty percent of life is showing up.
  -- Woody Allen
_______________________________________________
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

Reply via email to