MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TriangleWall.cc File Reference
#include <MercuryBase.h>
#include "TriangleWall.h"
#include "InteractionHandler.h"
#include "WallHandler.h"
#include "DPMBase.h"
#include "Particles/BaseParticle.h"

Go to the source code of this file.

Functions

bool setDistance (Mdouble &distance, const Vec3D &branch, Mdouble distanceMax)
 

Function Documentation

bool setDistance ( Mdouble distance,
const Vec3D branch,
Mdouble  distanceMax 
)

Definition at line 34 of file TriangleWall.cc.

References Vec3D::getLengthSquared().

35 {
36  const Mdouble distance2 = branch.getLengthSquared();
37  if (distance2 > distanceMax * distanceMax) return false;
38  distance = sqrt(distance2);
39  return true;
40 }
double Mdouble
Definition: GeneralDefine.h:34
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316