Taking inspiration of your LookupBone function, I've done one :

void GetOrgBone ( void* pmodel, char *name, float* org )
{
     studiohdr_t *pstudiohdr = (studiohdr_t *)pmodel;

     if (!pstudiohdr)
          return;

     mstudiobone_t *pbones = (mstudiobone_t *)( (byte *)pstudiohdr +
pstudiohdr->boneindex );

     for (int i = 0; i < pstudiohdr->numbones; i++)
     {
          if (stricmp(pbones[i].name, name) == 0)
          {
               org[0] = pbones[i].value[0]; // I have to add pEnt->origin
later
               org[1] = pbones[i].value[1];
               org[2] = pbones[i].value[2];
               return;
          }
     }
     return;
}

I think it'd work nice but... the origin of the bone I want ( "Bip01 L
Foot" ) is always the same (its origin is perhaps coherent, x and y are
equal to 0 :-(   ).
So, how could I get the "dynamic" origin of a bone ?

Thx :)

      - Cortex : mapper & coder www.hlalbator.fr.st


----- Original Message -----
From: Cortex
To: [EMAIL PROTECTED]
Sent: Wednesday, February 13, 2002 7:29 PM
Subject: Re: [hlcoders] Bone position


This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Thx for the code :)
I'll try it in a few moment :)

      - Cortex : mapper & coder www.hlalbator.fr.st
  ----- Original Message -----
  From: Ken Birdwell
  To: '[EMAIL PROTECTED]'
  Sent: Sunday, February 10, 2002 11:06 PM
  Subject: RE: [hlcoders] Bone position


  Look up the bone by name.  Bone names are stored in the models bone array.

  int LookupBone( void *pmodel, char *name )
  {
  studiohdr_t *pstudiohdr = (studiohdr_t *)pmodel;
  if (! pstudiohdr)
  return -1;

  mstudiobone_t *pbones = (mstudiobone_t *)( (byte *)pstudiohdr +
  pstudiohdr->boneindex );

  for (int i = 0; i < pstudiohdr->numbones; i++)
  {
  if (stricmp(pbones[i].name, name) == 0)
  {
  return i;
  }
  }
  return -1;
  }

  -----Original Message-----
  From: Cortex [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, February 09, 2002 11:25 AM
  To: coders
  Subject: [hlcoders] Bone position


  This is a multi-part message in MIME format.
  --
  [ Picked text/plain from multipart/alternative ]
  <Sorry, I've send this message on topica list too :( I made a mistake :(>

  Hello,

  I wanted to get the world position of a bone (Right and left foot) client
  side.
  I've only the id of the concerned entity...

  After searching, I've found the GET_BONE_POSITION function but I don't
know
  what value to use for the first parameter (int iBone)...

  If someone could give me some light, it would be very appreciated :)

        - Cortex : mapper & coder www.hlalbator.fr.st
  --


  _______________________________________________
  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

Reply via email to