void CCollisionProperty::CalcNearestPoint(const Vector& vecWorldPt, Vector *pVecNearestWorldPt) const { Vector localPt, localClosestPt; WorldToCollisionSpace(vecWorldPt, &localPt); CalcClosestPointOnAABB(this->m_vecMins.Get(), this->m_vecMaxs.Get(), localPt, localClosestPt); CollisionToWorldSpace(localClosestPt, pVecNearestWorldPt); }
//----------------------------------------------------------------------------- // Computes the nearest point in the OBB to a point specified in world space //----------------------------------------------------------------------------- float CCollisionProperty::CalcDistanceFromPoint( const Vector &vecWorldPt ) const { // Calculate physics force Vector localPt, localClosestPt; WorldToCollisionSpace( vecWorldPt, &localPt ); CalcClosestPointOnAABB( m_vecMins.Get(), m_vecMaxs.Get(), localPt, localClosestPt ); return localPt.DistTo( localClosestPt ); }
//----------------------------------------------------------------------------- // Computes the nearest point in the OBB to a point specified in world space //----------------------------------------------------------------------------- void CCollisionProperty::CalcNearestPoint( const Vector &vecWorldPt, Vector *pVecNearestWorldPt ) const { // Calculate physics force Vector localPt, localClosestPt; WorldToCollisionSpace( vecWorldPt, &localPt ); CalcClosestPointOnAABB( m_vecMins.Get(), m_vecMaxs.Get(), localPt, localClosestPt ); CollisionToWorldSpace( localClosestPt, pVecNearestWorldPt ); }
float CECollisionProperty::CalcDistanceFromPoint( const Vector &vecWorldPt ) const { // Calculate physics force Vector localPt, localClosestPt; centity->CollisionProp_Actual()->WorldToCollisionSpace( vecWorldPt, &localPt ); CalcClosestPointOnAABB( centity->m_vecMins, centity->m_vecMaxs, localPt, localClosestPt ); return localPt.DistTo( localClosestPt ); }