Example #1
0
void MoveUp ( int iID, float fStep )
{
	// update internal data
	if ( iID < 1 || iID > MAXIMUMVALUE )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNUMBERILLEGAL);
		return;
	}
	if ( !UpdatePtr ( iID ) )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNOTEXISTS);
		return;
	}

	m_pPos->vecPosition += ( fStep * m_pPos->vecUp );
	m_pPos->bHasBeenMovedForResponse=true;

	InternalUpdate ( iID );
}
Example #2
0
void MatrixZRotate ( int iID, float fZ )
{
	// update internal data
	if ( iID < 1 || iID > MAXIMUMVALUE )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNUMBERILLEGAL);
		return;
	}
	if ( !UpdateMatrixPtr ( iID ) )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNOTEXISTS);
		return;
	}

	// rotate an object around it's z axis

	// store the new rotation values
	m_pMatrixPos->vecRotate = D3DXVECTOR3 ( m_pMatrixPos->vecRotate.x, m_pMatrixPos->vecRotate.y, fZ );
	m_pMatrixPos->bFreeFlightRotation = false;

	// apply the changes
	MatrixInternalUpdate ( iID );
}
Example #3
0
void Rotate ( int iID, float fX, float fY, float fZ )
{
	// update internal data
	if ( iID < 1 || iID > MAXIMUMVALUE )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNUMBERILLEGAL);
		return;
	}
	if ( !UpdatePtr ( iID ) )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNOTEXISTS);
		return;
	}

	// rotate an object around all 3 axes

	// store the new rotation values
	m_pPos->vecRotate = D3DXVECTOR3 ( fX, fY, fZ );
	m_pPos->bFreeFlightRotation = false;

	// apply the changes
	InternalUpdate ( iID );
}
Example #4
0
void XRotate ( int iID, float fX )
{
	// update internal data
	if ( iID < 1 || iID > MAXIMUMVALUE )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNUMBERILLEGAL);
		return;
	}
	if ( !UpdatePtr ( iID ) )
	{
		RunTimeError(RUNTIMEERROR_B3DMODELNOTEXISTS);
		return;
	}

	// rotate an object around it's x axis

	// store the new rotation values
//	m_pPos->vecRotate = D3DXVECTOR3 ( fX, D3DXToDegree ( m_pPos->vecRotate.y ), D3DXToDegree ( m_pPos->vecRotate.z ) );
	m_pPos->vecRotate = D3DXVECTOR3 ( fX, m_pPos->vecRotate.y, m_pPos->vecRotate.z );
	m_pPos->bFreeFlightRotation = false;

	// apply the changes
	InternalUpdate ( iID );
}
/**
 *  Used to throw an actual C++ exception from the runtime, don't do this from the jitted code
 *  as you won't be able to actually catch it from there. This only has the return type int so
 *  we can include it inside if statements etc
 *  @param  userdata        Pointer to user-supplied data
 */
int smart_tpl_throw_exception(void* userdata, const char *error)
{
    throw RunTimeError(error);
}