Move source to src.
This commit is contained in:
parent
6f246722f9
commit
2442efc1a6
82 changed files with 13 additions and 236 deletions
20
src/room_force.cpp
Normal file
20
src/room_force.cpp
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue