Skip to content

Commit

Permalink
Remove unused Ball code.
Browse files Browse the repository at this point in the history
I was testing whether Ball-AABB would be faster. Will investigate further in a later
PR: #1686
  • Loading branch information
joaander committed Dec 19, 2023
1 parent 33ebba0 commit 1108996
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions hoomd/AABB.h
Expand Up @@ -382,50 +382,6 @@ Ball
m_center += v;
}

/** Check if a Ball and AABB overlap
@param other AABB
@returns true when the two shapes overlap, false otherwise
*/
DEVICE inline bool overlaps(const AABB& other) const
{
// https://stackoverflow.com/questions/28343716/sphere-intersection-test-of-aabb
LongReal d_squared_min = 0;

vec3<LongReal> box_min = other.getLower();
vec3<LongReal> box_max = other.getUpper();

if( m_center.x < box_min.x )
{
d_squared_min += ( m_center.x - box_min.x ) * ( m_center.x - box_min.x );
}
else if( m_center.x > box_max.x)
{
d_squared_min += ( m_center.x - box_max.x) * ( m_center.x - box_max.x);
}

if( m_center.y < box_min.y )
{
d_squared_min += ( m_center.y - box_min.y ) * ( m_center.y - box_min.y );
}
else if( m_center.y > box_max.y)
{
d_squared_min += ( m_center.y - box_max.y) * ( m_center.y - box_max.y);
}

if( m_center.z < box_min.z )
{
d_squared_min += ( m_center.z - box_min.z ) * ( m_center.z - box_min.z );
}
else if( m_center.z > box_max.z)
{
d_squared_min += ( m_center.z - box_max.z) * ( m_center.z - box_max.z);
}

return d_squared_min <= m_radius * m_radius;
}
};

// end group overlap
/*! @}*/

Expand Down

0 comments on commit 1108996

Please sign in to comment.