mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-30 00:49:34 +03:00
Fix ScriptGetAttachmentMatrix/Angles
This commit is contained in:
parent
2fd480704c
commit
da45be6eb5
@ -1531,35 +1531,32 @@ float C_BaseAnimating::ClampCycle( float flCycle, bool isLooping )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
const Vector& C_BaseAnimating::ScriptGetAttachmentOrigin( int iAttachment )
|
const Vector& C_BaseAnimating::ScriptGetAttachmentOrigin( int iAttachment )
|
||||||
{
|
{
|
||||||
|
|
||||||
static Vector absOrigin;
|
static Vector absOrigin;
|
||||||
static QAngle qa;
|
QAngle qa;
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
||||||
|
|
||||||
return absOrigin;
|
return absOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vector& C_BaseAnimating::ScriptGetAttachmentAngles( int iAttachment )
|
const QAngle& C_BaseAnimating::ScriptGetAttachmentAngles( int iAttachment )
|
||||||
{
|
{
|
||||||
|
|
||||||
static Vector absOrigin;
|
|
||||||
static Vector absAngles;
|
|
||||||
static QAngle qa;
|
static QAngle qa;
|
||||||
|
Vector absOrigin;
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
|
||||||
absAngles.x = qa.x;
|
return qa;
|
||||||
absAngles.y = qa.y;
|
|
||||||
absAngles.z = qa.z;
|
|
||||||
return absAngles;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HSCRIPT C_BaseAnimating::ScriptGetAttachmentMatrix( int iAttachment )
|
HSCRIPT_RC C_BaseAnimating::ScriptGetAttachmentMatrix( int iAttachment )
|
||||||
{
|
{
|
||||||
static matrix3x4_t matrix;
|
matrix3x4_t *matrix = new matrix3x4_t;
|
||||||
|
|
||||||
C_BaseAnimating::GetAttachment( iAttachment, matrix );
|
if ( C_BaseAnimating::GetAttachment( iAttachment, *matrix ) )
|
||||||
return g_pScriptVM->RegisterInstance( &matrix );
|
return g_pScriptVM->RegisterInstance( matrix, true );
|
||||||
|
|
||||||
|
delete matrix;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void C_BaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
|
void C_BaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
|
||||||
|
@ -464,8 +464,8 @@ public:
|
|||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
int ScriptLookupAttachment( const char *pAttachmentName ) { return LookupAttachment( pAttachmentName ); }
|
int ScriptLookupAttachment( const char *pAttachmentName ) { return LookupAttachment( pAttachmentName ); }
|
||||||
const Vector& ScriptGetAttachmentOrigin(int iAttachment);
|
const Vector& ScriptGetAttachmentOrigin(int iAttachment);
|
||||||
const Vector& ScriptGetAttachmentAngles(int iAttachment);
|
const QAngle& ScriptGetAttachmentAngles(int iAttachment);
|
||||||
HSCRIPT ScriptGetAttachmentMatrix(int iAttachment);
|
HSCRIPT_RC ScriptGetAttachmentMatrix(int iAttachment);
|
||||||
|
|
||||||
void ScriptGetBoneTransform( int iBone, HSCRIPT hTransform );
|
void ScriptGetBoneTransform( int iBone, HSCRIPT hTransform );
|
||||||
void ScriptSetBoneTransform( int iBone, HSCRIPT hTransform );
|
void ScriptSetBoneTransform( int iBone, HSCRIPT hTransform );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user