Initial commit.
This commit is contained in:
commit
44b5f2392f
98 changed files with 11750 additions and 0 deletions
58
block.cpp
Normal file
58
block.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
#include "block.h"
|
||||
#include "material.h"
|
||||
#include "model.h"
|
||||
#include "physics/shape.h"
|
||||
#include "physics/vector.h"
|
||||
#include "room.h"
|
||||
|
||||
using namespace mbostock;
|
||||
|
||||
AxisAlignedBlock::AxisAlignedBlock(const Vector& min, const Vector& max)
|
||||
: box_(min, max), model_(box_) {
|
||||
}
|
||||
|
||||
Model& AxisAlignedBlock::model() {
|
||||
return model_;
|
||||
}
|
||||
|
||||
const Shape& AxisAlignedBlock::shape() const {
|
||||
return box_;
|
||||
}
|
||||
|
||||
void AxisAlignedBlock::setMaterial(const Material& m) {
|
||||
model_.setMaterial(m);
|
||||
}
|
||||
|
||||
void AxisAlignedBlock::setTopMaterial(const Material& m) {
|
||||
model_.setTopMaterial(m);
|
||||
}
|
||||
|
||||
float AxisAlignedBlock::slip() const {
|
||||
return model_.material().slip();
|
||||
}
|
||||
|
||||
Block::Block(const Vector& c, const Vector& x, const Vector& y, const Vector& z)
|
||||
: box_(c, x, y, z), model_(box_) {
|
||||
}
|
||||
|
||||
Model& Block::model() {
|
||||
return model_;
|
||||
}
|
||||
|
||||
const Shape& Block::shape() const {
|
||||
return box_;
|
||||
}
|
||||
|
||||
void Block::setMaterial(const Material& m) {
|
||||
model_.setMaterial(m);
|
||||
}
|
||||
|
||||
void Block::setTopMaterial(const Material& m) {
|
||||
model_.setTopMaterial(m);
|
||||
}
|
||||
|
||||
float Block::slip() const {
|
||||
return model_.material().slip();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue