diff --git a/server/novodex.cpp b/server/novodex.cpp index 7c2f8033..2ff350ec 100644 --- a/server/novodex.cpp +++ b/server/novodex.cpp @@ -1134,9 +1134,6 @@ void *CPhysicNovodex :: CreateKinematicBodyFromEntity( CBaseEntity *pObject ) if (!pCollision) return NULL; - //if( !UTIL_CanRotate( pObject )) - // BodyDesc.flags |= NX_BF_FROZEN_ROT; // entity missed origin-brush - PxRigidDynamic *pActor = m_pPhysics->createRigidDynamic(PxTransform(PxIdentity)); PxShape *pShape = PxRigidActorExt::createExclusiveShape(*pActor, PxTriangleMeshGeometry(pCollision), *m_pDefaultMaterial); @@ -1146,6 +1143,15 @@ void *CPhysicNovodex :: CreateKinematicBodyFromEntity( CBaseEntity *pObject ) return NULL; } + if (!UTIL_CanRotate(pObject)) + { + // entity missed origin-brush + pActor->setRigidDynamicLockFlags( + PxRigidDynamicLockFlag::eLOCK_ANGULAR_X | + PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y | + PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z); + } + float mat[16]; matrix4x4( pObject->GetAbsOrigin(), pObject->GetAbsAngles(), 1.0f ).CopyToArray( mat );