Exposed matrix3x4_t and FireBulletsInfo_t to VScript, expanded available math functions

This commit is contained in:
Blixibon
2020-06-11 23:30:22 -05:00
parent 05303c9e66
commit 66a44d0739
13 changed files with 603 additions and 12 deletions

View File

@@ -287,6 +287,9 @@ BEGIN_ENT_SCRIPTDESC( CBaseAnimating, CBaseEntity, "Animating models" )
DEFINE_SCRIPTFUNC( LookupAttachment, "Get the named attachement id" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentOrigin, "GetAttachmentOrigin", "Get the attachement id's origin vector" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentAngles, "GetAttachmentAngles", "Get the attachement id's angles as a p,y,r vector" )
#ifdef MAPBASE_VSCRIPT
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentMatrix, "GetAttachmentMatrix", "Get the attachement id's matrix transform" )
#endif
DEFINE_SCRIPTFUNC( IsSequenceFinished, "Ask whether the main sequence is done playing" )
DEFINE_SCRIPTFUNC( SetBodygroup, "Sets a bodygroup")
END_SCRIPTDESC();
@@ -2155,6 +2158,16 @@ const Vector& CBaseAnimating::ScriptGetAttachmentAngles( int iAttachment )
return absAngles;
}
#ifdef MAPBASE_VSCRIPT
HSCRIPT CBaseAnimating::ScriptGetAttachmentMatrix( int iAttachment )
{
static matrix3x4_t matrix;
CBaseAnimating::GetAttachment( iAttachment, matrix );
return ScriptCreateMatrixInstance( matrix );
}
#endif
//-----------------------------------------------------------------------------
// Returns the attachment in local space
//-----------------------------------------------------------------------------