本文整理汇总了C++中VMatrix::SetupMatrixOrgAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ VMatrix::SetupMatrixOrgAngles方法的具体用法?C++ VMatrix::SetupMatrixOrgAngles怎么用?C++ VMatrix::SetupMatrixOrgAngles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMatrix
的用法示例。
在下文中一共展示了VMatrix::SetupMatrixOrgAngles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputePanelToWorld
//-----------------------------------------------------------------------------
// Computes the panel center to world transform
//-----------------------------------------------------------------------------
void C_VGuiScreen::ComputePanelToWorld()
{
// The origin is at the upper-left corner of the screen
Vector vecOrigin, vecUR, vecLL;
ComputeEdges( &vecOrigin, &vecUR, &vecLL );
m_PanelToWorld.SetupMatrixOrgAngles( vecOrigin, GetAbsAngles() );
}
示例2: MatrixFromAngles
//-----------------------------------------------------------------------------
// Setup a matrix from euler angles.
//-----------------------------------------------------------------------------
void MatrixFromAngles( const QAngle& vAngles, VMatrix& dst )
{
dst.SetupMatrixOrgAngles( vec3_origin, vAngles );
}
示例3: SetupMatrixOrgAngles
VMatrix SetupMatrixOrgAngles(const Vector &origin, const QAngle &vAngles)
{
VMatrix mRet;
mRet.SetupMatrixOrgAngles( origin, vAngles );
return mRet;
}
示例4: ClientThink
void C_Hairball::ClientThink()
{
// Do some AI-type stuff.. move the entity around.
//C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
//m_vecAngles = SetAbsAngles( pPlayer->GetAbsAngles() ); // copy player angles.
Assert( !GetMoveParent() );
// Sophisticated AI.
m_flCurSpinTime += gpGlobals->frametime;
if ( m_flCurSpinTime < m_flSpinDuration )
{
float div = m_flCurSpinTime / m_flSpinDuration;
QAngle angles = GetLocalAngles();
angles.x += m_flSpinRateX * SmoothCurve( div );
angles.y += m_flSpinRateY * SmoothCurve( div );
SetLocalAngles( angles );
}
else
{
// Flip between stopped and starting.
if ( fabs( m_flSpinRateX ) > 0.01f )
{
m_flSpinRateX = m_flSpinRateY = 0;
m_flSpinDuration = RandomFloat( 1, 2 );
}
else
{
static float flXSpeed = 3;
static float flYSpeed = flXSpeed * 0.1f;
m_flSpinRateX = RandomFloat( -M_PI*flXSpeed, M_PI*flXSpeed );
m_flSpinRateY = RandomFloat( -M_PI*flYSpeed, M_PI*flYSpeed );
m_flSpinDuration = RandomFloat( 1, 4 );
}
m_flCurSpinTime = 0;
}
if ( m_flSitStillTime > 0 )
{
m_flSitStillTime -= gpGlobals->frametime;
if ( m_flSitStillTime <= 0 )
{
// Shoot out some random lines and find the longest one.
m_vMoveDir.Init( 1, 0, 0 );
float flLongestFraction = 0;
for ( int i=0; i < 15; i++ )
{
Vector vDir( RandomFloat( -1, 1 ), RandomFloat( -1, 1 ), RandomFloat( -1, 1 ) );
VectorNormalize( vDir );
trace_t trace;
UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + vDir * 10000, MASK_SOLID, NULL, COLLISION_GROUP_NONE, &trace );
if ( trace.fraction != 1.0 )
{
if ( trace.fraction > flLongestFraction )
{
flLongestFraction = trace.fraction;
m_vMoveDir = vDir;
}
}
}
m_vMoveDir *= 650; // set speed.
m_flSitStillTime = -1; // Move in this direction..
}
}
else
{
// Move in the specified direction.
Vector vEnd = GetAbsOrigin() + m_vMoveDir * gpGlobals->frametime;
trace_t trace;
UTIL_TraceLine( GetAbsOrigin(), vEnd, MASK_SOLID, NULL, COLLISION_GROUP_NONE, &trace );
if ( trace.fraction < 1 )
{
// Ok, stop moving.
m_flSitStillTime = RandomFloat( 1, 3 );
}
else
{
SetLocalOrigin( GetLocalOrigin() + m_vMoveDir * gpGlobals->frametime );
}
}
// Transform the base hair positions so we can lock them down.
VMatrix mTransform;
mTransform.SetupMatrixOrgAngles( GetLocalOrigin(), GetLocalAngles() );
for ( int i=0; i < m_HairPositions.Count(); i++ )
//.........这里部分代码省略.........