#include "actions.h"
#include "ParticleState.h"
#include <algorithm>
#include <sstream>
#include <typeinfo>
Go to the source code of this file.
Functions | |
static void | NewBasis (const pVec &u, const pVec &v, pVec &s1, pVec &s2) |
static void | Restore (pVec &vel, const pVec &posB, const pVec &pos, const float t, const float dtSqr, const float ttInv6dt, const float tttInv3dtSqr) |
Definition at line 19 of file actions.cpp.
References pVec::x(), pVec::y(), and pVec::z().
Referenced by PABounce::Exec(), and PAAvoid::Exec().
00020 { 00021 pVec w = Cross(u, v); 00022 00023 float det = 1.0f / (w.z()*u.x()*v.y() - w.z()*u.y()*v.x() - u.z()*w.x()*v.y() - u.x()*v.z()*w.y() + v.z()*w.x()*u.y() + u.z()*v.x()*w.y()); 00024 00025 s1 = pVec((v.y()*w.z() - v.z()*w.y()), (v.z()*w.x() - v.x()*w.z()), (v.x()*w.y() - v.y()*w.x())); 00026 s1 *= det; 00027 s2 = pVec((u.y()*w.z() - u.z()*w.y()), (u.z()*w.x() - u.x()*w.z()), (u.x()*w.y() - u.y()*w.x())); 00028 s2 *= -det; 00029 }