10 T Diff(
const T& a,
const T& b ){
16 VT
Dist(
const T& a,
const T& b ){
38 VT
Dist(
const NPnt<DIM>& a,
const NPnt<DIM>& b ){
48 virtual void operator ()(){
67 bool operator < (
const Distance& d)
const {
return id < d.id; }
69 Distance(T& a, T& b) : a(&a), b(&b), sqLength(
Dist(a,b) ) {
71 if (sqLength==0) { a.vprint(); b.vprint(); }
82 auto diff = Diff( *a, *b);
85 float d = diff.wt() + sq;
86 float r = d == 0 ? -.5 : ( sq ) / ( d ) - .5;
116 Verlet() : mIter(20), mTimeStep(.2){}
124 double timeSq() {
return mTimeStep * mTimeStep; }
139 for (
int i = 0; i < this->num(); ++i ){
140 T tmp = this->data(i);
141 T v = this->data(i) - this->prev(i);
147 for (
int i = 0; i < mIter; ++i){
148 for (
int j = 0; j < constraint.size(); ++j){
149 constraint[j] -> verlet();
Definition: vsr_constraint.h:43
core namespaced operations that are metric-agnostic
Definition: vsr_set.h:104
Definition: vsr_constraint.h:61
VT Dist(const T &a, const T &b)
Squared Distances.
Definition: vsr_constraint.h:16
the versor library namespace
Definition: vsr_algebra.h:29
Definition: vsr_constraint.h:106