src/thirdparty/particles/ParticleDLL/actions.cpp File Reference

#include "actions.h"
#include "ParticleState.h"
#include <algorithm>
#include <sstream>
#include <typeinfo>

Include dependency graph for actions.cpp:

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)


Function Documentation

static void NewBasis ( const pVec u,
const pVec v,
pVec s1,
pVec s2 
) [inline, static]

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Restore ( pVec vel,
const pVec posB,
const pVec pos,
const float  t,
const float  dtSqr,
const float  ttInv6dt,
const float  tttInv3dtSqr 
) [inline, static]

Definition at line 1120 of file actions.cpp.

01122 {
01123     pVec b = (vel*-0.6667f*t + posB - pos) * ttInv6dt;
01124     pVec a = (vel*t - posB - posB + pos + pos) * tttInv3dtSqr;
01125     vel += a + b;
01126 }


Generated on Sat Mar 15 23:10:12 2008 for Armagetron Advanced by  doxygen 1.5.4