Permalink
Browse files

cleanup

  • Loading branch information...
1 parent 311c1db commit 24a2e165041bb36ab72cfc5c93cddf57d66f888d @mdipierro committed Oct 30, 2011
Showing with 7 additions and 12 deletions.
  1. +1 −0 .gitignore
  2. BIN cylon.bin
  3. +3 −6 cylon/cylon.cpp
  4. BIN docs/cylon.pdf
  5. +3 −6 docs/implementation.tex
View
@@ -1,4 +1,5 @@
*~
+*.bak2
docs/*.log
docs/*.aux
docs/*.idx
View
BIN cylon.bin
Binary file not shown.
View
@@ -23,7 +23,7 @@ using namespace std;
*/
#define array vector // to avoid name collions
#define forXYZ(i) for(int i=0; i<3; i++)
-const float PRECISION = 0.0001;
+const float PRECISION = 0.00001;
const int X=0;
const int Y=1;
const int Z=2;
@@ -87,7 +87,7 @@ class Rotation : public Matrix {
Rotation(const Vector& v) {
float theta = sqrt(v*v);
if(theta<PRECISION) {
- m[X][X]=m[Y][Y]=m[Z][Z]=1;
+ forXYZ(i) forXYZ(j) m[i][j] = (i==j)?1:0;
} else {
float s = sin(theta), c=cos(theta);
float t = 1-c;
@@ -421,7 +421,6 @@ void createWindow(const char* title) {
}
Universe myuniverse;
-int frame=0;
/**
* Called each frame to update the 3D scene. Delegates to
@@ -432,7 +431,6 @@ void update() {
float timeStep = 0.016f; // 60fps fixed rate.
myuniverse.evolve(timeStep);
glutPostRedisplay();
- frame+=1;
}
/**
@@ -506,11 +504,10 @@ int main(int argc, char** argv) {
createWindow("GPNS");
Body b = Body();
b.loadObj("assets/sphere.obj");
- b.F = Vector(0,-0.01,0);
b.p = Vector(0,2,0);
b.L = Vector(0.1,0,0);
myuniverse.bodies.push_back(&b);
- myuniverse.forces.push_back(new GravityForce(&b,0.1));
+ myuniverse.forces.push_back(new GravityForce(&b,0.01));
// Set up the appropriate handler functions
glutReshapeFunc(reshape);
View
Binary file not shown.
View
@@ -23,7 +23,7 @@
\begin{lstlisting}
#define array vector // to avoid name collions
#define forXYZ(i) for(int i=0; i<3; i++)
-const float PRECISION = 0.0001;
+const float PRECISION = 0.00001;
const int X=0;
const int Y=1;
const int Z=2;
@@ -87,7 +87,7 @@
Rotation(const Vector& v) {
float theta = sqrt(v*v);
if(theta<PRECISION) {
- m[X][X]=m[Y][Y]=m[Z][Z]=1;
+ forXYZ(i) forXYZ(j) m[i][j] = (i==j)?1:0;
} else {
float s = sin(theta), c=cos(theta);
float t = 1-c;
@@ -419,7 +419,6 @@
}
Universe myuniverse;
-int frame=0;
\end{lstlisting}
Called each frame to update the 3D scene. Delegates to
@@ -430,7 +429,6 @@
float timeStep = 0.016f; // 60fps fixed rate.
myuniverse.evolve(timeStep);
glutPostRedisplay();
- frame+=1;
}
\end{lstlisting}
@@ -504,11 +502,10 @@
createWindow("GPNS");
Body b = Body();
b.loadObj("assets/sphere.obj");
- b.F = Vector(0,-0.01,0);
b.p = Vector(0,2,0);
b.L = Vector(0.1,0,0);
myuniverse.bodies.push_back(&b);
- myuniverse.forces.push_back(new GravityForce(&b,0.1));
+ myuniverse.forces.push_back(new GravityForce(&b,0.01));
// Set up the appropriate handler functions
glutReshapeFunc(reshape);

0 comments on commit 24a2e16

Please sign in to comment.