示例#1
0
/*
extern void SendProxy_Angles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID );
void SendProxy_FuncRotatingAngles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID )
{
	CFuncRotating *entity = (CFuncRotating*)pStruct;
	Assert( entity );
	if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
	{
		const QAngle *a = &entity->m_vecClientAngles;
		pOut->m_Vector[ 0 ] = anglemod( a->x );
		pOut->m_Vector[ 1 ] = anglemod( a->y );
		pOut->m_Vector[ 2 ] = anglemod( a->z );
		return;
	}

	SendProxy_Angles( pProp, pStruct, pData, pOut, iElement, objectID );
}
*/
void SendProxy_FuncRotatingAngle( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID)
{
    CFuncRotating *entity = (CFuncRotating*)pStruct;
    Assert( entity );

    vec_t const *qa = (vec_t *)pData;
    vec_t const *ea = entity->GetLocalAngles().Base();
    NOTE_UNUSED(ea);
    // Assert its actually an index into m_angRotation if not this won't work

    Assert( (uintp)qa >= (uintp)ea && (uintp)qa < (uintp)ea + sizeof( QAngle ));

#ifdef TF_DLL
    if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
    {
        const QAngle *a = &entity->m_vecClientAngles;

        pOut->m_Float = anglemod( (*a)[ qa - ea ] );
        return;
    }
#endif

    pOut->m_Float = anglemod( *qa );

    Assert( IsFinite( pOut->m_Float ) );
}
示例#2
0
void SendProxy_FuncRotatingSimulationTime( const SendProp *pProp, const void *pStruct, const void *pVarData, DVariant *pOut, int iElement, int objectID )
{
	CFuncRotating *entity = (CFuncRotating*)pStruct;
	Assert( entity );
	if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
	{
		pOut->m_Int = 0;
		return;
	}

	SendProxy_SimulationTime( pProp, pStruct, pVarData, pOut, iElement, objectID );
}
示例#3
0
void SendProxy_FuncRotatingAngles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID )
{
	CFuncRotating *entity = (CFuncRotating*)pStruct;
	Assert( entity );
	if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
	{
		const QAngle *a = &entity->m_vecClientAngles;
		pOut->m_Vector[ 0 ] = anglemod( a->x );
		pOut->m_Vector[ 1 ] = anglemod( a->y );
		pOut->m_Vector[ 2 ] = anglemod( a->z );
		return;
	}

	SendProxy_Angles( pProp, pStruct, pData, pOut, iElement, objectID );
}
示例#4
0
void SendProxy_FuncRotatingOrigin( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID )
{
	CFuncRotating *entity = (CFuncRotating*)pStruct;
	Assert( entity );
	if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
	{
		const Vector *v = &entity->m_vecClientOrigin;
		pOut->m_Vector[ 0 ] = v->x;
		pOut->m_Vector[ 1 ] = v->y;
		pOut->m_Vector[ 2 ] = v->z;
		return;
	}

	SendProxy_Origin( pProp, pStruct, pData, pOut, iElement, objectID );
}