本文整理汇总了C++中IPhysicsObject::SetDamping方法的典型用法代码示例。如果您正苦于以下问题:C++ IPhysicsObject::SetDamping方法的具体用法?C++ IPhysicsObject::SetDamping怎么用?C++ IPhysicsObject::SetDamping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPhysicsObject
的用法示例。
在下文中一共展示了IPhysicsObject::SetDamping方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetachEntity
void CGravControllerPoint::DetachEntity( void )
{
CBaseEntity *pEntity = m_attachedEntity;
if ( pEntity )
{
IPhysicsObject *pPhys = GetPhysObjFromPhysicsBone( pEntity, m_attachedPhysicsBone );
if ( pPhys )
{
// on the odd chance that it's gone to sleep while under anti-gravity
pPhys->Wake();
pPhys->SetDamping( NULL, &m_saveDamping );
pPhys->SetMass( m_saveMass );
}
}
m_attachedEntity = NULL;
m_attachedPhysicsBone = 0;
if ( physenv )
{
physenv->DestroyMotionController( m_controller );
}
m_controller = NULL;
// UNDONE: Does this help the networking?
m_targetPosition = vec3_origin;
m_worldPosition = vec3_origin;
}
示例2: DetachEntity
void CGrabController::DetachEntity( void )
{
CBaseEntity *pEntity = GetAttached();
if ( pEntity )
{
IPhysicsObject *pPhys = pEntity->VPhysicsGetObject();
if ( pPhys )
{
// on the odd chance that it's gone to sleep while under anti-gravity
pPhys->Wake();
pPhys->SetDamping( NULL, &m_saveRotDamping );
PhysClearGameFlags( pPhys, FVPHYSICS_PLAYER_HELD );
}
}
m_attachedEntity = NULL;
physenv->DestroyMotionController( m_controller );
m_controller = NULL;
}
示例3: DetachEntity
void CGrabController::DetachEntity( bool bClearVelocity )
{
Assert(!PhysIsInCallback());
CBaseEntity *pEntity = GetAttached();
if ( pEntity )
{
// Restore the LS blocking state
pEntity->SetBlocksLOS( m_bCarriedEntityBlocksLOS );
IPhysicsObject *pList[VPHYSICS_MAX_OBJECT_LIST_COUNT];
int count = pEntity->VPhysicsGetObjectList( pList, ARRAYSIZE(pList) );
for ( int i = 0; i < count; i++ )
{
IPhysicsObject *pPhys = pList[i];
if ( !pPhys )
continue;
// on the odd chance that it's gone to sleep while under anti-gravity
pPhys->EnableDrag( true );
pPhys->Wake();
pPhys->SetMass( m_savedMass[i] );
pPhys->SetDamping( NULL, &m_savedRotDamping[i] );
PhysClearGameFlags( pPhys, FVPHYSICS_PLAYER_HELD );
if ( bClearVelocity )
{
PhysForceClearVelocity( pPhys );
}
else
{
ClampPhysicsVelocity( pPhys, player_walkspeed.GetFloat() * 1.5f, 2.0f * 360.0f );
}
}
}
m_attachedEntity = NULL;
physenv->DestroyMotionController( m_controller );
m_controller = NULL;
}