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:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user