engine/physics/src/physics/physics.cpp
/**
     * Adds the overlap of an object to a specific entry.
     * Returns whether the overlap was added (might be out of space).
     */
Adds the overlap of an object to a specific entry.
Returns whether the overlap was added (might be out of space).
Adds the overlap of an object to a specific entry . Returns whether the overlap was added ( might be out of space ) .
static bool AddOverlap(OverlapEntry* entry, void* object, bool* out_found, const uint32_t trigger_overlap_capacity)
    {
        bool found = false;
        for (uint32_t i = 0; i < entry->m_OverlapCount; ++i)
        {
            Overlap& overlap = entry->m_Overlaps[i];
            if (overlap.m_Object == object)
            {
                ++overlap.m_Count;
                found = true;
                break;
            }
        }
        if (out_found != 0x0)
            *out_found = found;
        if (!found)
        {
            if (entry->m_OverlapCount == trigger_overlap_capacity)
            {
                dmLogError("Trigger overlap capacity reached, overlap will not be stored for enter/exit callbacks.");
                return false;
            }
            else
            {
                Overlap& overlap = entry->m_Overlaps[entry->m_OverlapCount++];
                overlap.m_Object = object;
                overlap.m_Count = 1;
            }
        }
        return true;
    }
static bool AddOverlap ( OverlapEntry * entry , void * object , bool * out_found , const uint32_t trigger_overlap_capacity ) { bool found = false ; for ( uint32_t i = 0 ; i < entry -> m_OverlapCount ; ++ i ) { Overlap & overlap = entry -> m_Overlaps [ i ] ; if ( overlap . m_Object == object ) { ++ overlap . m_Count ; found = true ; break ; } } if ( out_found != 0x0 ) * out_found = found ; if ( ! found ) { if ( entry -> m_OverlapCount == trigger_overlap_capacity ) { dmLogError ( " " ) ; return false ; } else { Overlap & overlap = entry -> m_Overlaps [ entry -> m_OverlapCount ++ ] ; overlap . m_Object = object ; overlap . m_Count = 1 ; } } return true ; }
Adds the overlap of an object to a specific entry.
Adds the overlap of an object to a specific entry .