Browse files

- Added flat roof tunnel mesh

- Renamed BoundingBox class to AABB
  • Loading branch information...
1 parent 72f2c66 commit 595c429b392a98b2a84811ee36a80526581aaba8 seb committed Jun 14, 2012
View
BIN ogre-resources/meshes/CurvedRoofTunnel.blend
Binary file not shown.
View
BIN ogre-resources/meshes/CurvedRoofTunnel.mesh
Binary file not shown.
View
BIN ogre-resources/meshes/FlatRoofTunnel.blend
Binary file not shown.
View
BIN ogre-resources/meshes/FlatRoofTunnel.mesh
Binary file not shown.
View
31 src/Application.cpp
@@ -74,11 +74,11 @@ void Application::playTrackFile(std::string filename) {
// 1/100 sec. simulation frequency
unsigned int dt = 5000;
- // TODO 3: Understand performance problem on Eray's Macbook. Might have to do with the game speed timing code.
-
// TODO 4: Make simulation step frequency configurable by introducing a time factor multiplicator in Vehicle::step() and...
// all other places where it matters.
+ unsigned long stepCount = 0;
+
//########### BEGIN The Main Loop! ##########
while (!quit) {
@@ -114,11 +114,9 @@ void Application::playTrackFile(std::string filename) {
// If the ship is destroyed, reset to the starting position:
if (mpPlayerVehicle->mKilled) {
mpRenderer->showKilledInfo(true);
- }
- else if (mpPlayerVehicle->mFinish) {
+ } else if (mpPlayerVehicle->mFinish) {
mpRenderer->showTrackCompletedInfo(true);
- }
- else {
+ } else {
mpPlayerVehicle->mOldVel = mpPlayerVehicle->mVelocity;
// Find colliding track atoms:
@@ -143,8 +141,15 @@ void Application::playTrackFile(std::string filename) {
}
accumulator -= dt;
+
+ stepCount++;
}
+ /*
+ if (stepCount % 100 == 0) {
+ std::cout << double(stepCount) / 100 << std::endl;
+ }
+*/
// gettimeofday(&before, NULL);
// Render next frame:
@@ -178,32 +183,32 @@ std::vector<CollisionInfo> Application::findCollidingTrackAtoms() {
if (ta->mBBox.getIntersectingAxis(mpPlayerVehicle->mBBox, x, y, z) == 2) {
- HitSide hitSide = HIT_NONE;
+ TrackAtom::HitSide hitSide = TrackAtom::HIT_NONE;
if (!x) {
if (mpPlayerVehicle->mVelocity[0] > 0) {
- hitSide = HIT_LEFT;
+ hitSide = TrackAtom::HIT_LEFT;
} else {
- hitSide = HIT_RIGHT;
+ hitSide = TrackAtom::HIT_RIGHT;
}
}
else if (!y) {
if (mpPlayerVehicle->mVelocity[1] > 0) {
- hitSide = HIT_BOTTOM;
+ hitSide = TrackAtom::HIT_BOTTOM;
} else {
- hitSide = HIT_TOP;
+ hitSide = TrackAtom::HIT_TOP;
}
}
else if (!z) {
if (mpPlayerVehicle->mVelocity[2] > 0) {
- hitSide = HIT_BACK;
+ hitSide = TrackAtom::HIT_BACK;
} else {
- hitSide = HIT_FRONT;
+ hitSide = TrackAtom::HIT_FRONT;
}
}
View
16 src/GameModel/Racer/Racer.cpp
@@ -69,8 +69,7 @@ void Racer::reset() {
void Racer::updateVelocity() {
- // Apply gravity:
- mVelocity += getGravity();
+ cml::vector3f addVelocity = getGravity();
// ################ BEGIN Apply player vehicle control commands ###################
@@ -94,7 +93,7 @@ void Racer::updateVelocity() {
cml::vector3f forwardComponent = cml::dot(mDirForward, mVelocity) * mDirForward;
if ((mThrustForward > 0 && forwardComponent.length() < mMaxSpeedForward) || (mThrustForward < 0 && forwardComponent.length() > 0)) {
- mVelocity += mDirForward * mThrustForward;
+ addVelocity += mDirForward * mThrustForward;
}
//############ END Apply forward thrust ##############
@@ -119,15 +118,17 @@ void Racer::updateVelocity() {
cml::vector3f sidewardComponent = cml::dot(mDirLeft, mVelocity) * mDirLeft;
if (sidewardComponent.length() < mMaxSpeedSideward) {
- mVelocity += mDirLeft * mThrustSideward;
+ addVelocity += mDirLeft * mThrustSideward;
}
//############### END Apply sideward thrust ################
// Apply "friction":
- mVelocity -= forwardComponent * 0.03;
- mVelocity -= sidewardComponent * 0.02;
+ addVelocity -= forwardComponent * 0.03;
+ addVelocity -= sidewardComponent * 0.02;
// ################ END Apply player vehicle control commands ###################
+
+ mVelocity += addVelocity;
}
@@ -142,13 +143,14 @@ void Racer::updatePosition() {
// thickness of the block in that direction!
// TODO 4: Try to fix this.
+ // Enforce top speed limit:
int topSpeed = 2;
if (mVelocity.length() > topSpeed) {
mVelocity = mVelocity.normalize() * topSpeed;
}
- // Apply backwards spped limit (moving backwards is not allowed at all):
+ // Apply backwards speed limit (moving backwards is not allowed at all):
if (cml::dot(mDirForward, mVelocity) < 0) {
mVelocity -= cml::dot(mDirForward, mVelocity) * mDirForward;
}
View
4 src/GameModel/Racer/Racer.h
@@ -8,7 +8,7 @@
#ifndef SHIP_H_
#define SHIP_H_
-#include "BoundingBox.h"
+#include "AABB.h"
#include <vector>
@@ -66,7 +66,7 @@ class Racer {
cml::vector3f mPos;
- BoundingBox mBBox;
+ AABB mBBox;
cml::vector3f mBBoxPosOffset;
cml::vector3f mGravity;
View
2 src/GameModel/Track/Track.h
@@ -32,7 +32,7 @@ class Track {
std::vector<TrackDecorationMesh> mMeshes;
- BoundingBox mExtent;
+ AABB mExtent;
protected:
View
2 src/GameModel/Track/TrackAtom/GravChangerTrackAtom.cpp
@@ -9,7 +9,7 @@
#include "GravChangerTrackAtom.h"
-GravChangerTrackAtom::GravChangerTrackAtom(BoundingBox bbox) : SolidTrackAtom(bbox) {
+GravChangerTrackAtom::GravChangerTrackAtom(AABB bbox) : SolidTrackAtom(bbox) {
// TODO Auto-generated constructor stub
View
2 src/GameModel/Track/TrackAtom/GravChangerTrackAtom.h
@@ -12,7 +12,7 @@
class GravChangerTrackAtom: public SolidTrackAtom {
public:
- GravChangerTrackAtom(BoundingBox bbox);
+ GravChangerTrackAtom(AABB bbox);
virtual ~GravChangerTrackAtom();
virtual void applyContactEffects(Racer* ship, HitSide hs);
View
2 src/GameModel/Track/TrackAtom/SolidTrackAtom.cpp
@@ -7,7 +7,7 @@
#include "SolidTrackAtom.h"
-SolidTrackAtom::SolidTrackAtom(BoundingBox bbox) :
+SolidTrackAtom::SolidTrackAtom(AABB bbox) :
TrackAtom(bbox) {
mRenderMaterial = "SpaceRoads/Track/Solid";
View
2 src/GameModel/Track/TrackAtom/SolidTrackAtom.h
@@ -12,7 +12,7 @@
class SolidTrackAtom : public TrackAtom {
public:
- SolidTrackAtom(BoundingBox bbox);
+ SolidTrackAtom(AABB bbox);
virtual ~SolidTrackAtom();
virtual void applyContactEffects(Racer* ship, HitSide hs);
View
2 src/GameModel/Track/TrackAtom/TrackAtom.cpp
@@ -8,7 +8,7 @@
#include "TrackAtom.h"
-TrackAtom::TrackAtom(BoundingBox bbox) {
+TrackAtom::TrackAtom(AABB bbox) {
mBBox = bbox;
mRenderMaterial = "SolidTrackAtom";
View
15 src/GameModel/Track/TrackAtom/TrackAtom.h
@@ -9,24 +9,25 @@
#define TRACKATOM_H_
#include <string>
-#include "../util/BoundingBox.h"
+#include "../util/AABB.h"
#include "../../Racer/Racer.h"
-enum HitSide {
- HIT_TOP, HIT_BOTTOM, HIT_LEFT, HIT_RIGHT, HIT_FRONT, HIT_BACK, HIT_NONE
-};
class TrackAtom {
public:
+ enum HitSide {
+ HIT_TOP, HIT_BOTTOM, HIT_LEFT, HIT_RIGHT, HIT_FRONT, HIT_BACK, HIT_NONE
+ };
+
- TrackAtom(BoundingBox bbox);
+ TrackAtom(AABB bbox);
virtual ~TrackAtom();
virtual void applyContactEffects(Racer* ship, HitSide hs);
virtual void applyCounterForces(Racer* ship, HitSide hs);
- BoundingBox mBBox;
+ AABB mBBox;
std::string mName;
std::string mRenderMaterial;
@@ -41,7 +42,7 @@ class TrackAtom {
struct CollisionInfo {
TrackAtom* ta;
- HitSide hs;
+ TrackAtom::HitSide hs;
};
View
4 src/GameModel/Track/XMLFileTrack.cpp
@@ -64,12 +64,12 @@ XMLFileTrack::XMLFileTrack(std::string filename) {
std::string type = taElem->Attribute("type");
if (type == "finish") {
- ta = new TrackAtom(BoundingBox(cml::vector3d(x, y, z), cml::vector3d(sizex, sizey, sizez)));
+ ta = new TrackAtom(AABB(cml::vector3d(x, y, z), cml::vector3d(sizex, sizey, sizez)));
ta->mIsFinish = true;
} else {
- ta = new SolidTrackAtom(BoundingBox(cml::vector3d(x, y, z), cml::vector3d(sizex, sizey, sizez)));
+ ta = new SolidTrackAtom(AABB(cml::vector3d(x, y, z), cml::vector3d(sizex, sizey, sizez)));
SolidTrackAtom* solid = (SolidTrackAtom*) ta;
View
17 src/util/BoundingBox.cpp → src/util/AABB.cpp
@@ -5,26 +5,29 @@
* Author: sebastian
*/
-#include "BoundingBox.h"
+// TODO 3: Think about changing "Pos" and "size" to "min" and "max"...
+// NOTE: This is not only name, it's also semantic and requires code changes!
-BoundingBox::BoundingBox() {
+#include "AABB.h"
+
+AABB::AABB() {
// TODO Auto-generated constructor stub
mPos.set(0, 0, 0);
mSize.set(0, 0, 0);
}
-BoundingBox::BoundingBox(cml::vector3f pos, cml::vector3f size) {
+AABB::AABB(cml::vector3f pos, cml::vector3f size) {
// TODO Auto-generated constructor stub
mPos = pos;
mSize = size;
}
-BoundingBox::~BoundingBox() {
+AABB::~AABB() {
// TODO Auto-generated destructor stub
}
-bool BoundingBox::containsPoint(const cml::vector3f& v) {
+bool AABB::containsPoint(const cml::vector3f& v) {
if (mPos[0] > v[0] || mPos[0] + mSize[0] < v[0]) return false;
if (mPos[1] > v[1] || mPos[1] + mSize[1] < v[1]) return false;
@@ -34,7 +37,7 @@ bool BoundingBox::containsPoint(const cml::vector3f& v) {
}
-bool BoundingBox::intersectsWith(const BoundingBox& other) {
+bool AABB::intersectsWith(const AABB& other) {
cml::vector3d own_max = mPos + mSize;
cml::vector3d other_max = other.mPos + other.mSize;
@@ -49,7 +52,7 @@ bool BoundingBox::intersectsWith(const BoundingBox& other) {
return true;
}
-int BoundingBox::getIntersectingAxis(const BoundingBox& other, bool& x, bool& y, bool& z) {
+int AABB::getIntersectingAxis(const AABB& other, bool& x, bool& y, bool& z) {
cml::vector3d own_max = mPos + mSize;
cml::vector3d other_max = other.mPos + other.mSize;
View
12 src/util/BoundingBox.h → src/util/AABB.h
@@ -10,18 +10,18 @@
#include "cml/cml.h"
-class BoundingBox {
+class AABB {
public:
- BoundingBox();
- BoundingBox(cml::vector3f, cml::vector3f);
- virtual ~BoundingBox();
+ AABB();
+ AABB(cml::vector3f, cml::vector3f);
+ virtual ~AABB();
cml::vector3f mPos;
cml::vector3f mSize;
bool containsPoint(const cml::vector3f&);
- bool intersectsWith(const BoundingBox& other);
- int getIntersectingAxis(const BoundingBox& other, bool& x, bool& y, bool& z);
+ bool intersectsWith(const AABB& other);
+ int getIntersectingAxis(const AABB& other, bool& x, bool& y, bool& z);
};
View
40 tracks/default_track.xml
@@ -23,10 +23,10 @@
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="-32" z="40" scalex="1" scaley="10" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="40" z="40" scalex="1" scaley="10" scalez="20" />
<!-- ########## BEGIN Tunnel ########## -->
-<Mesh material="SpaceRoads/Track/Red" mesh="Tunnel" y="1" x="0" z="60" scalex="8" scaley="5.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="60" scalex="1" scaley="4.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="60" scalex="1" scaley="4.01" scalez="80" />
-<Atom slipOffset="2.3" material="none" type="solid" y="5.01" x="0" z="60" scalex="8" scaley="1" scalez="80" />
+<Mesh material="SpaceRoads/Track/Red" mesh="FlatRoofTunnel" y="1" x="0" z="60" scalex="8" scaley="5" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="60" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="60" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" type="solid" y="5" x="0" z="60" scalex="8" scaley="1" scalez="80" />
<!-- ########## END Tunnel ########## -->
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="8" z="60" scalex="8" scaley="1" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="-8" z="60" scalex="8" scaley="1" scalez="20" />
@@ -165,10 +165,10 @@
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="-32" z="440" scalex="1" scaley="10" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="40" z="440" scalex="1" scaley="10" scalez="20" />
<!-- ########## BEGIN Tunnel ########## -->
-<Mesh material="SpaceRoads/Track/Red" mesh="Tunnel" y="1" x="0" z="460" scalex="8" scaley="5.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="460" scalex="1" scaley="4.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="460" scalex="1" scaley="4.01" scalez="80" />
-<Atom slipOffset="2.3" material="none" type="solid" y="5.01" x="0" z="460" scalex="8" scaley="1" scalez="80" />
+<Mesh material="SpaceRoads/Track/Red" mesh="FlatRoofTunnel" y="1" x="0" z="460" scalex="8" scaley="5" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="460" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="460" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" type="solid" y="5" x="0" z="460" scalex="8" scaley="1" scalez="80" />
<!-- ########## END Tunnel ########## -->
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="8" z="460" scalex="8" scaley="1" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="-8" z="460" scalex="8" scaley="1" scalez="20" />
@@ -307,10 +307,10 @@
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="-32" z="840" scalex="1" scaley="10" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="40" z="840" scalex="1" scaley="10" scalez="20" />
<!-- ########## BEGIN Tunnel ########## -->
-<Mesh material="SpaceRoads/Track/Red" mesh="Tunnel" y="1" x="0" z="860" scalex="8" scaley="5.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="860" scalex="1" scaley="4.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="860" scalex="1" scaley="4.01" scalez="80" />
-<Atom slipOffset="2.3" material="none" type="solid" y="5.01" x="0" z="860" scalex="8" scaley="1" scalez="80" />
+<Mesh material="SpaceRoads/Track/Red" mesh="FlatRoofTunnel" y="1" x="0" z="860" scalex="8" scaley="5" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="860" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="860" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" type="solid" y="5" x="0" z="860" scalex="8" scaley="1" scalez="80" />
<!-- ########## END Tunnel ########## -->
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="8" z="860" scalex="8" scaley="1" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="-8" z="860" scalex="8" scaley="1" scalez="20" />
@@ -449,10 +449,10 @@
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="-32" z="1240" scalex="1" scaley="10" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="40" z="1240" scalex="1" scaley="10" scalez="20" />
<!-- ########## BEGIN Tunnel ########## -->
-<Mesh material="SpaceRoads/Track/Red" mesh="Tunnel" y="1" x="0" z="1260" scalex="8" scaley="5.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="1260" scalex="1" scaley="4.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="1260" scalex="1" scaley="4.01" scalez="80" />
-<Atom slipOffset="2.3" material="none" type="solid" y="5.01" x="0" z="1260" scalex="8" scaley="1" scalez="80" />
+<Mesh material="SpaceRoads/Track/Red" mesh="FlatRoofTunnel" y="1" x="0" z="1260" scalex="8" scaley="5" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="1260" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="1260" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" type="solid" y="5" x="0" z="1260" scalex="8" scaley="1" scalez="80" />
<!-- ########## END Tunnel ########## -->
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="8" z="1260" scalex="8" scaley="1" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="-8" z="1260" scalex="8" scaley="1" scalez="20" />
@@ -591,10 +591,10 @@
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="-32" z="1640" scalex="1" scaley="10" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="25" x="40" z="1640" scalex="1" scaley="10" scalez="20" />
<!-- ########## BEGIN Tunnel ########## -->
-<Mesh material="SpaceRoads/Track/Red" mesh="Tunnel" y="1" x="0" z="1660" scalex="8" scaley="5.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="1660" scalex="1" scaley="4.01" scalez="80" />
-<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="1660" scalex="1" scaley="4.01" scalez="80" />
-<Atom slipOffset="2.3" material="none" type="solid" y="5.01" x="0" z="1660" scalex="8" scaley="1" scalez="80" />
+<Mesh material="SpaceRoads/Track/Red" mesh="FlatRoofTunnel" y="1" x="0" z="1660" scalex="8" scaley="5" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="0" z="1660" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" jaumpForce="0" type="solid" y="1" x="7" z="1660" scalex="1" scaley="4" scalez="80" />
+<Atom material="none" type="solid" y="5" x="0" z="1660" scalex="8" scaley="1" scalez="80" />
<!-- ########## END Tunnel ########## -->
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="8" z="1660" scalex="8" scaley="1" scalez="20" />
<Atom material="SpaceRoads/Track/DarkGrey" type="solid" y="0" x="-8" z="1660" scalex="8" scaley="1" scalez="20" />
View
26 tracks/generate_track.py
@@ -16,12 +16,12 @@ def makeXMLTag(element, attributes, close):
return result
-def makeTunnel(x,y,z, scalex, scaley, scalez):
+def makeCurvedRoofTunnel(x,y,z, scalex, scaley, scalez):
result = "<!-- ########## BEGIN Tunnel ########## -->\n"
# Decorative mesh:
- result += makeXMLTag("Mesh", {'x':x, 'y':y+1, 'z':z, 'scalex':scalex, 'scaley':scaley, 'scalez':scalez, 'mesh':"Tunnel", 'material':"SpaceRoads/Track/Red"}, True) + "\n"
+ result += makeXMLTag("Mesh", {'x':x, 'y':y+1, 'z':z, 'scalex':scalex, 'scaley':scaley, 'scalez':scalez, 'mesh':"CurvedRoofTunnel", 'material':"SpaceRoads/Track/Red"}, True) + "\n"
# Floor:
# result += makeXMLTag("Atom", {'x':x, 'y':y, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez':scalez, 'jaumpForce':0}, True) + "\n"
@@ -34,7 +34,27 @@ def makeTunnel(x,y,z, scalex, scaley, scalez):
result += makeXMLTag("Atom", {'x':x, 'y':y+scaley, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez':scalez, 'material':'none', 'slipOffset': scalex / 2 - 1.7, 'type':"solid"}, True) + "\n"
result += "<!-- ########## END Tunnel ########## -->\n"
return result
+
+
+def makeFlatRoofTunnel(x,y,z, scalex, scaley, scalez):
+
+ result = "<!-- ########## BEGIN Tunnel ########## -->\n"
+
+ # Decorative mesh:
+ result += makeXMLTag("Mesh", {'x':x, 'y':y+1, 'z':z, 'scalex':scalex, 'scaley':scaley, 'scalez':scalez, 'mesh':"FlatRoofTunnel", 'material':"SpaceRoads/Track/Red"}, True) + "\n"
+
+ # Floor:
+ # result += makeXMLTag("Atom", {'x':x, 'y':y, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez':scalez, 'jaumpForce':0}, True) + "\n"
+ # Walls:
+ result += makeXMLTag("Atom", {'x':x, 'y':y+1, 'z':z, 'scalex':1, 'scaley': scaley - 1, 'scalez':scalez, 'material':'none', 'jaumpForce':0, 'type':"solid"}, True) + "\n"
+ result += makeXMLTag("Atom", {'x':x + scalex - 1, 'y':y+1, 'z':z, 'scalex':1, 'scaley': scaley - 1, 'scalez':scalez, 'material':'none', 'jaumpForce':0, 'type':"solid"}, True) + "\n"
+
+ # Roof:
+ result += makeXMLTag("Atom", {'x':x, 'y':y+scaley, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez':scalez, 'material':'none', 'type':"solid"}, True) + "\n"
+ result += "<!-- ########## END Tunnel ########## -->\n"
+ return result
+
####################### Here begins the program #######################
@@ -75,7 +95,7 @@ def makeTunnel(x,y,z, scalex, scaley, scalez):
if (ii - 3) % 20 == 0:
- outfile.write(makeTunnel(x,y,z, scalex, 5.01,80))
+ outfile.write(makeFlatRoofTunnel(x,y,z, scalex, 5,80))
#outfile.write(makeXMLTag("Atom", {'x':x + scalex, 'y':y, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez': 60, 'material': material}, True) + "\n")
#outfile.write(makeXMLTag("Atom", {'x':x - scalex, 'y':y, 'z':z, 'scalex':scalex, 'scaley': 1, 'scalez': 60, 'material': material}, True) + "\n")

0 comments on commit 595c429

Please sign in to comment.