Files
geant4/source/geometry/volumes/include/G4AuxiliaryNavServices.icc
T
2016-06-01 15:25:35 +02:00

34 lines
802 B
Plaintext

inline G4bool G4AuxiliaryNavServices::CheckPointOnSurface( const G4VSolid* sampleSolid,
const G4ThreeVector& localPoint,
const G4ThreeVector* globalDirection,
const G4AffineTransform& sampleTransform,
const G4bool locatedOnEdge)
{
G4ThreeVector localDirection, sampleNormal;
G4bool enter=false;
if (sampleSolid->Inside(localPoint)!=kOutside)
{
if(locatedOnEdge && (globalDirection!=0))
{
// We are probably located on an edge.
localDirection= sampleTransform.TransformAxis(*globalDirection);
// Check whether we enter the volume
//
sampleNormal= sampleSolid->SurfaceNormal(localPoint);
if ( sampleNormal.dot(localDirection) <= 0 )
{
enter= true;
}
}
else
{
enter= true;
}
}
return enter;
}