Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating tour for minor changes, incorporating fs::path and removing …

…implicit Vec3f -> float*
  • Loading branch information...
commit b1cfc518136d4f51b51ca3ec3758a4431acafa0e 1 parent c11294a
@andrewfb andrewfb authored
View
2  tour/Section 1/Chapter 4/src/TutorialApp.cpp
@@ -123,7 +123,7 @@ void TutorialApp::draw()
}
if( mSaveFrames ){
- writeImage( getHomeDirectory() + "image_" + toString( getElapsedFrames() ) + ".png", copyWindowSurface() );
+ writeImage( getHomeDirectory() / ("image_" + toString( getElapsedFrames() ) + ".png"), copyWindowSurface() );
}
}
View
2  tour/Section 1/Chapter 5/src/TutorialApp.cpp
@@ -147,7 +147,7 @@ void TutorialApp::draw()
}
if( mSaveFrames ){
- writeImage( getHomeDirectory() + "image_" + toString( getElapsedFrames() ) + ".png", copyWindowSurface() );
+ writeImage( getHomeDirectory() / ( "image_" + toString( getElapsedFrames() ) + ".png" ), copyWindowSurface() );
}
}
View
4 tour/Section 2/Chapter 2/src/Particle.cpp
@@ -75,9 +75,9 @@ void Particle::draw()
void Particle::drawTail()
{
gl::color( ColorA( 1.0f, 1.0f, 1.0f, 1.0f ) );
- glVertex3fv( mPos );
+ gl::vertex( mPos );
gl::color( ColorA( 1.0f, 0.0f, 0.0f, 1.0f ) );
- glVertex3fv( mTailPos );
+ gl::vertex( mTailPos );
}
View
7 tour/Section 2/Chapter 3/src/Particle.cpp
@@ -76,10 +76,7 @@ void Particle::draw()
void Particle::drawTail()
{
gl::color( ColorA( 1.0f, 1.0f, 1.0f, 1.0f ) );
- glVertex3fv( mPos );
+ gl::vertex( mPos );
gl::color( ColorA( 1.0f, 0.0f, 0.0f, 1.0f ) );
- glVertex3fv( mTailPos );
+ gl::vertex( mTailPos );
}
-
-
-
View
2  tour/Section 2/Chapter 4/src/FlockingApp.cpp
@@ -125,7 +125,7 @@ void FlockingApp::draw()
mParticleController.draw();
if( mSaveFrames ){
- writeImage( getHomeDirectory() + "flocking/image_" + toString( getElapsedFrames() ) + ".png", copyWindowSurface() );
+ writeImage( getHomeDirectory() / "flocking" / ("image_" + toString( getElapsedFrames() ) + ".png"), copyWindowSurface() );
}
// DRAW PARAMS WINDOW
View
4 tour/Section 2/Chapter 4/src/Particle.cpp
@@ -95,9 +95,9 @@ void Particle::draw()
void Particle::drawTail()
{
gl::color( ColorA( 1.0f, 1.0f, 1.0f, 1.0f ) );
- glVertex3fv( mPos );
+ gl::vertex( mPos );
gl::color( ColorA( 1.0f, 0.0f, 0.0f, 1.0f ) );
- glVertex3fv( mTailPos );
+ gl::vertex( mTailPos );
}
void Particle::addNeighborPos( Vec3f pos )
View
4 tour/Section 2/Chapter 4/src/ParticleController.cpp
@@ -36,7 +36,7 @@ void ParticleController::applyForce( float zoneRadius, float lowerThresh, float
} else if( percent < higherThresh ){ // Alignment
float threshDelta = higherThresh - lowerThresh;
float adjustedPercent = ( percent - lowerThresh )/threshDelta;
- float F = ( 1.0 - ( cos( adjustedPercent * twoPI ) * -0.5f + 0.5f ) ) * alignStrength;
+ float F = ( 1.0f - ( cos( adjustedPercent * twoPI ) * -0.5f + 0.5f ) ) * alignStrength;
p1->mAcc += p2->mVelNormal * F;
p2->mAcc += p1->mVelNormal * F;
@@ -44,7 +44,7 @@ void ParticleController::applyForce( float zoneRadius, float lowerThresh, float
} else { // Cohesion
float threshDelta = 1.0f - higherThresh;
float adjustedPercent = ( percent - higherThresh )/threshDelta;
- float F = ( 1.0 - ( cos( adjustedPercent * twoPI ) * -0.5f + 0.5f ) ) * attractStrength;
+ float F = ( 1.0f - ( cos( adjustedPercent * twoPI ) * -0.5f + 0.5f ) ) * attractStrength;
dir.normalize();
dir *= F;
View
2  tour/Section 2/Chapter 5/src/FlockingApp.cpp
@@ -127,7 +127,7 @@ void FlockingApp::draw()
mParticleController.draw();
if( mSaveFrames ){
- writeImage( getHomeDirectory() + "flocking/image_" + toString( getElapsedFrames() ) + ".png", copyWindowSurface() );
+ writeImage( getHomeDirectory() / "flocking" / ("image_" + toString( getElapsedFrames() ) + ".png"), copyWindowSurface() );
}
// DRAW PARAMS WINDOW
View
4 tour/Section 2/Chapter 5/src/Particle.cpp
@@ -108,9 +108,9 @@ void Particle::draw()
void Particle::drawTail()
{
glColor4f( mColor );
- glVertex3fv( mPos );
+ gl::vertex( mPos );
glColor4f( ColorA( mColor.r, mColor.g, mColor.b, 0.01f ) );
- glVertex3fv( mTailPos );
+ gl::vertex( mTailPos );
}
void Particle::addNeighborPos( Vec3f pos )
View
6 tour/Section 2/Chapter 5/src/ParticleController.cpp
@@ -40,7 +40,7 @@ void ParticleController::applyForceToParticles( float zoneRadius, float lowerThr
} else if( per < higherThresh ){ // Alignment
float threshDelta = higherThresh - lowerThresh;
float adjPer = ( per - lowerThresh )/threshDelta;
- float F = ( 1.0 - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * alignStrength;
+ float F = ( 1.0f - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * alignStrength;
p1->mAcc += p2->mVelNormal * F;
p2->mAcc += p1->mVelNormal * F;
@@ -48,7 +48,7 @@ void ParticleController::applyForceToParticles( float zoneRadius, float lowerThr
} else { // Cohesion (prep)
float threshDelta = 1.0f - higherThresh;
float adjPer = ( per - higherThresh )/threshDelta;
- float F = ( 1.0 - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * attractStrength;
+ float F = ( 1.0f - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * attractStrength;
dir.normalize();
dir *= F;
@@ -134,7 +134,7 @@ void ParticleController::applyForceToPredators( float zoneRadius, float lowerThr
} else { // Cohesion
float threshDelta = 1.0f - higherThresh;
float adjPer = ( per - higherThresh )/threshDelta;
- float F = ( 1.0 - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * 0.1f;
+ float F = ( 1.0f - ( cos( adjPer * twoPI ) * -0.5f + 0.5f ) ) * 0.1f;
dir.normalize();
dir *= F;
View
5 tour/Section 2/Chapter 5/src/Predator.cpp
@@ -105,11 +105,10 @@ void Predator::draw()
void Predator::drawTail()
{
- glVertex3fv( mPos[0] );
- glVertex3fv( mPos[1] );
+ gl::vertex( mPos[0] );
+ gl::vertex( mPos[1] );
}
-
void Predator::addNeighborPos( Vec3f pos )
{
mNeighborPos += pos;
Please sign in to comment.
Something went wrong with that request. Please try again.