12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "GeneratorTemplate.h"
- GeneratorTemplate::GeneratorTemplate()
- : ReferenceCounter(),
- propability(0.f)
- {}
- void GeneratorTemplate::setMinPosOffset(Framework::Vec3<int> minPosOffset)
- {
- this->minPosOffset = minPosOffset;
- }
- void GeneratorTemplate::setMaxSize(Framework::Vec3<int> maxSize)
- {
- this->maxSize = maxSize;
- }
- void GeneratorTemplate::setPropability(float propability)
- {
- this->propability = propability;
- }
- bool GeneratorTemplate::canEffect(
- Framework::Vec3<int> location, Framework::Vec3<int> affectedLocation) const
- {
- Framework::Vec3<int> localPos
- = affectedLocation - (location + minPosOffset);
- return localPos.x >= 0 && localPos.y >= 0 && localPos.z >= 0
- && localPos.x < maxSize.x && localPos.y < maxSize.y
- && localPos.z < maxSize.z;
- }
- float GeneratorTemplate::getPropability() const
- {
- return propability;
- }
- Framework::Vec3<int> GeneratorTemplate::getMinAffectedOffset() const
- {
- return minPosOffset;
- }
- Framework::Vec3<int> GeneratorTemplate::getMaxAffectedOffset() const
- {
- return minPosOffset + maxSize;
- }
|