EgtMachKernel :

- aggiunto flag bToolOn a EmtAddCollisionObjEx per dichiarare che è utensile in lavoro (necessario quando si usano più utensili contemporaneamente).
This commit is contained in:
DarioS
2023-01-18 08:43:12 +01:00
parent 4af09db198
commit b2dacc0cef
5 changed files with 17 additions and 14 deletions
+4 -4
View File
@@ -1319,8 +1319,8 @@ Simulator::ExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType)
// verifico se è l'utensile attivo
string sHead ; m_pGeomDB->GetName( m_pGeomDB->GetParentId( m_CollObj[j].nFrameId), sHead) ;
string sExit ; m_pGeomDB->GetName( m_CollObj[j].nFrameId, sExit) ;
bool bIsTool = ( sHead == m_sHead &&
( sExit == string( "_T") + ToString( m_nExit) || sExit == string( "_TT") + ToString( m_nExit))) ;
bool bIsTool = m_CollObj[j].bToolOn ||
( sHead == m_sHead && ( sExit == "_T" + ToString( m_nExit) || sExit == "_TT" + ToString( m_nExit))) ;
// se utensile attivo su grezzo in lavoro e non è rapido, salto
if ( bIsTool && bIsRaw && nMoveType != 0)
continue ;
@@ -1922,7 +1922,7 @@ Simulator::OnResetMachine( void)
//----------------------------------------------------------------------------
bool
Simulator::AddCollisionObj( int nInd, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3)
Simulator::AddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3)
{
// verifiche sui parametri
if ( nInd <= 0 || nFrameId <= GDB_ID_NULL)
@@ -1948,7 +1948,7 @@ Simulator::AddCollisionObj( int nInd, int nFrameId, int nType, const Vector3d& v
return false ;
}
// aggiungo al vettore
m_CollObj.emplace_back( nInd, nFrameId, nType, vtMove, dPar1, dPar2, dPar3) ;
m_CollObj.emplace_back( nInd, bToolOn, nFrameId, nType, vtMove, dPar1, dPar2, dPar3) ;
return true ;
}