本文整理汇总了C++中IPhysicsObject::GetContactPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ IPhysicsObject::GetContactPoint方法的具体用法?C++ IPhysicsObject::GetContactPoint怎么用?C++ IPhysicsObject::GetContactPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPhysicsObject
的用法示例。
在下文中一共展示了IPhysicsObject::GetContactPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckWater
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CPropJeep::CheckWater( void )
{
bool bInWater = false;
// Check all four wheels.
for ( int iWheel = 0; iWheel < JEEP_WHEEL_COUNT; ++iWheel )
{
// Get the current wheel and get its contact point.
IPhysicsObject *pWheel = m_VehiclePhysics.GetWheel( iWheel );
if ( !pWheel )
continue;
// Check to see if we hit water.
if ( pWheel->GetContactPoint( &m_WaterData.m_vecWheelContactPoints[iWheel], NULL ) )
{
m_WaterData.m_bWheelInWater[iWheel] = ( UTIL_PointContents( m_WaterData.m_vecWheelContactPoints[iWheel] ) & MASK_WATER ) ? true : false;
if ( m_WaterData.m_bWheelInWater[iWheel] )
{
bInWater = true;
}
}
}
// Check the body and the BONNET.
int iEngine = LookupAttachment( "vehicle_engine" );
Vector vecEnginePoint;
QAngle vecEngineAngles;
GetAttachment( iEngine, vecEnginePoint, vecEngineAngles );
m_WaterData.m_bBodyInWater = ( UTIL_PointContents( vecEnginePoint ) & MASK_WATER ) ? true : false;
if ( m_WaterData.m_bBodyInWater )
{
if ( m_bHasPoop )
{
RemoveAllDecals();
m_bHasPoop = false;
}
if ( !m_VehiclePhysics.IsEngineDisabled() )
{
m_VehiclePhysics.SetDisableEngine( true );
}
}
else
{
if ( m_VehiclePhysics.IsEngineDisabled() )
{
m_VehiclePhysics.SetDisableEngine( false );
}
}
if ( bInWater )
{
// Check the player's water level.
CheckWaterLevel();
}
return bInWater;
}