Move source to src.

This commit is contained in:
Mike Bostock 2012-12-14 10:06:18 -08:00
parent 6f246722f9
commit 2442efc1a6
82 changed files with 13 additions and 236 deletions

20
src/room_force.cpp Normal file
View file

@ -0,0 +1,20 @@
// -*- C++ -*-
#include "room_force.h"
#include "physics/particle.h"
#include "physics/vector.h"
using namespace mbostock;
ConstantRoomForce::ConstantRoomForce(const Vector& min, const Vector& max,
const Vector& f)
: box_(min, max), force_(f) {
}
const Shape& ConstantRoomForce::shape() const {
return box_;
}
Vector ConstantRoomForce::force(const Particle& p) {
return box_.contains(p.position) ? force_ : Vector::ZERO();
}