Large numbers now being handled correctly...

- long long ints being used where necessary
- Commas being added to numbers larger than 999
- No more values being rendered as 1.5332e+012
This commit is contained in:
James Alliban
2014-01-16 20:21:24 +00:00
parent b3e6565bde
commit e51abf7a53
20 changed files with 199 additions and 55 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
// TODO
// ====
// - Add a minimum time for each angle
// - Add a minimum time for each angle to avoif unslightly quick switching
// - optimise - don't calculate graph point values evey frame
// - investigate backward graph animation (use alternating colours)
// - Colour range - tween between 2-3 points
+13
View File
@@ -6,11 +6,13 @@ void Camera::setup(int _camID)
camID = _camID;
lookAtNode.setPosition(0, 0, 0);
setDistance(100);
minSecondsBeforeSwapping = 2;
}
void Camera::update()
{
positionVec.x = sin(ofGetElapsedTimef() * rotSpeed) * distance;
//positionVec.y = 40;
positionVec.z = cos(ofGetElapsedTimef() * rotSpeed) * distance;
@@ -18,4 +20,15 @@ void Camera::update()
lookAtNode.setPosition(lookAtVec);
setPosition(positionVec);
lookAt(lookAtNode);
}
void Camera::activate()
{
timeBecameActive = ofGetElapsedTimef();
}
void Camera::deactivate()
{
}
+4
View File
@@ -15,6 +15,8 @@ class Camera : public ofEasyCam
public:
void setup(int _camID);
void update();
void activate();
void deactivate();
int camID;
@@ -26,4 +28,6 @@ public:
float distance;
float rotSpeed;
float swapProbability;
float minSecondsBeforeSwapping;
float timeBecameActive;
};
+2 -1
View File
@@ -144,6 +144,7 @@ void Scene::switchCamera()
newCamID = (ofRandom(2) < 0.5) ? 0 : 1;
printf("************ changing cameras to %i ************** \n", newCamID);
activeCamera->deactivate();
activeCamera = &cameras[newCamID];
activeCamera->activate();
}