Initial commit.
This commit is contained in:
commit
44b5f2392f
98 changed files with 11750 additions and 0 deletions
57
rotating.h
Normal file
57
rotating.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
#ifndef MBOSTOCK_ROTATING_H
|
||||
#define MBOSTOCK_ROTATING_H
|
||||
|
||||
#include "model.h"
|
||||
#include "physics/rotation.h"
|
||||
#include "physics/vector.h"
|
||||
#include "room_force.h"
|
||||
#include "room_object.h"
|
||||
#include "transforming.h"
|
||||
|
||||
namespace mbostock {
|
||||
|
||||
class RotatingModel : public Model {
|
||||
public:
|
||||
RotatingModel(Model& m, const Rotation& r);
|
||||
|
||||
virtual void initialize();
|
||||
virtual void display();
|
||||
|
||||
private:
|
||||
Model& model_;
|
||||
const Rotation& rotation_;
|
||||
};
|
||||
|
||||
class RotatingRoomObject : public TransformingRoomObject {
|
||||
public:
|
||||
RotatingRoomObject(RoomObject* o, const Rotation& r);
|
||||
|
||||
virtual Model& model();
|
||||
virtual const Shape& shape() const;
|
||||
virtual Vector velocity(const Vector& x) const;
|
||||
|
||||
private:
|
||||
const Rotation& rotation_;
|
||||
RotatingShape shape_;
|
||||
RotatingModel model_;
|
||||
};
|
||||
|
||||
class RotatingRoomForce : public RoomForce {
|
||||
public:
|
||||
RotatingRoomForce(RoomForce* f, const Rotation& r);
|
||||
virtual ~RotatingRoomForce();
|
||||
|
||||
virtual const Shape& shape() const;
|
||||
virtual Vector force(const Particle& p);
|
||||
|
||||
private:
|
||||
RoomForce* force_;
|
||||
const Rotation& rotation_;
|
||||
RotatingShape shape_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue