Quote:
Originally Posted by Natsheh
it Works, but i found something strange rgflAngles in GetAttachment as well as in GetBonePosition is not retrieved, why so ?
and also the origin of attachment is always retrieved with respect to the angles 0.0 0.0 0.0.
|
Work around solution....
PHP Code:
GetAttachmentData(const id, const iAttachmentID, Float:fRetOrigin[3], Float:fRetAngles[3])
{
static Float:fStart[3], Float:fVAngles[3], Float:fOrigin[3], Float:fVec[3], Float:fHeight;
engfunc(EngFunc_GetAttachment, id, iAttachmentID, fStart, fVAngles);
pev(id, pev_origin, fOrigin);
pev(id, pev_angles, fVAngles);
fHeight = fOrigin[2] = fStart[2];
xs_vec_sub(fStart, fOrigin, fStart);
xs_vec_copy(fStart, fVec);
fStart[0] = ((fVec[0] * floatcos(fVAngles[1],degrees)) - fVec[1] * floatsin(fVAngles[1],degrees)) + fOrigin[0];
fStart[1] = ((fVec[0] * floatsin(fVAngles[1],degrees)) + fVec[1] * floatcos(fVAngles[1],degrees)) + fOrigin[1];
fStart[2] = fHeight;
xs_vec_copy(fStart, fRetOrigin);
xs_vec_copy(fVAngles, fRetAngles);
}
__________________