mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-04-18 17:07:15 +00:00
fix wrong collision box scaling of physics props
This commit is contained in:
parent
29985681a1
commit
326e3665a6
@ -6071,18 +6071,18 @@ bool UTIL_CreateScaledPhysObject( CBaseAnimating *pInstance, float flScale )
|
|||||||
pInstance->VPhysicsDestroyObject();
|
pInstance->VPhysicsDestroyObject();
|
||||||
pInstance->VPhysicsSetObject( pNewObject );
|
pInstance->VPhysicsSetObject( pNewObject );
|
||||||
|
|
||||||
|
// Scale the base model as well
|
||||||
|
pInstance->SetModelScale( flScale );
|
||||||
|
|
||||||
// Increase our model bounds
|
// Increase our model bounds
|
||||||
const model_t *pModel = modelinfo->GetModel( pInstance->GetModelIndex() );
|
const model_t *pModel = modelinfo->GetModel( pInstance->GetModelIndex() );
|
||||||
if ( pModel )
|
if ( pModel )
|
||||||
{
|
{
|
||||||
Vector mins, maxs;
|
Vector mins, maxs;
|
||||||
modelinfo->GetModelBounds( pModel, mins, maxs );
|
modelinfo->GetModelBounds( pModel, mins, maxs );
|
||||||
pInstance->SetCollisionBounds( mins*flScale, maxs*flScale );
|
pInstance->SetCollisionBounds( mins, maxs );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scale the base model as well
|
|
||||||
pInstance->SetModelScale( flScale );
|
|
||||||
|
|
||||||
if ( pInstance->GetParent() )
|
if ( pInstance->GetParent() )
|
||||||
{
|
{
|
||||||
pNewObject->SetShadow( 1e4, 1e4, false, false );
|
pNewObject->SetShadow( 1e4, 1e4, false, false );
|
||||||
|
Loading…
Reference in New Issue
Block a user