An example in the sdk code would be the yaw and pitch pose parameters
for making the player model look up/down and to the side. The pose
parameters are "body_pitch" and "body_yaw".
In base_playeranimstate.cpp:
void CBasePlayerAnimState::ComputePoseParam_BodyPitch()
{
// Get pitch from v_angle
float flPitch = m_flEyePitch;
if ( flPitch > 180.0f )
{
flPitch -= 360.0f;
}
flPitch = clamp( flPitch, -90, 90 );
// See if we have a blender for pitch
int pitch = GetOuter()->LookupPoseParameter( "body_pitch" );
if ( pitch < 0 )
return;
SetOuterPoseParameter( pitch, flPitch );
g_flLastBodyPitch = flPitch;
}
..
void CBasePlayerAnimState::SetOuterPoseParameter( int iParam, float
flValue )
{
GetOuter()->SetPoseParameter( iParam, flValue ); //
GetOuter() is the player
}
You can define new pose parameters in the .qc file for your model to
control blending between two sequences. See the definitions of body_yaw
in the .qc for more info on that.
For attachment points, search for GetAttachment. There are a number of
ways to get an attachment point's location and angles by name. Most
common would be:
Vector vecOrigin;
Qangle vecAngle;
int iAttachmentIndex = pMyModel->LookupAttachment(
"attachment_name" );
pMyModel->GetAttachment( iAttachmentIndex, vecOrigin, vecAngle
);
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Beppo
Sent: Friday, January 07, 2005 2:03 PM
To: [email protected]
Subject: Re: [hlcoders] Bone manipulation via code
It would be better to use an animation in the player model and change
the rotation of a specific joint with a pose parameter.
And how to do that? Any examples available within the codes?
Its also easier to get position and angles of a particular bone if you
put an attachment point on it and get that.
And how to get the location and rotation of these attachment points
then? :)
Reason for all this is that the model has to follow specific movements
of ie. your mouse.
I guess this can be done with the 'pose parameters' you spoke about.
I found some references about the speedometer needle defined by pose
parameters.
So, how to set such things up and how to access them via code?
Any basic tutorials or descriptions about these parts of the SDK out
there?
thanks,
Beppo
--
Norbert Bogenrieder aka Beppo Lead Programmer and Project Lead
[EMAIL PROTECTED] Sentry Studios - Infiltration
[EMAIL PROTECTED] http://www.sentrystudios.net
http://infiltration.sentrystudios.net
----- Original Message -----
From: "Matt Boone" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, January 07, 2005 10:50 PM
Subject: RE: [hlcoders] Bone manipulation via code
It would be better to use an animation in the player model and change
the rotation of a specific joint with a pose parameter. What effect
are you trying to accomplish?
Its also easier to get position and angles of a particular bone if you
put an attachment point on it and get that.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Beppo
Sent: Friday, January 07, 2005 1:43 PM
To: [email protected]
Subject: [hlcoders] Bone manipulation via code
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ] Hi,
where can I find examples on how to manipulate bones (rotate, move)
within a player model from within the codes?
Can these manipulations be done using the bones own coordinate system
and/or the world coordinates?
And the other way around too... how to get a bones position and
rotation (own system and world) from any object not just the player
model?
How to attach and detach objects to/from specific bones via code?
Where to find such basic knowledge? Or aren't these 'basic' features
the SDK codes do offer?
Are there some base classes that define all this (and more) that you
should check?
thanks and regards,
Beppo
--
Norbert Bogenrieder aka Beppo Lead Programmer and Project Lead
[EMAIL PROTECTED] Sentry Studios - Infiltration
[EMAIL PROTECTED] http://www.sentrystudios.net
http://infiltration.sentrystudios.net
--
_______________________________________________
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
_______________________________________________
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