本文整理汇总了C++中Trail::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Trail::update方法的具体用法?C++ Trail::update怎么用?C++ Trail::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trail
的用法示例。
在下文中一共展示了Trail::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateApp
//--------------------------------------------------------------
void testApp::updateApp(){
ofPoint * pos;
Trail *trail;
bool bInsideLetter;
vector<ofPoint> growings;
for(int i=0; i<trails.size(); i++){
trail = &trails[i];
pos = &trail->position;
// If trail isn't in a letter yet
if(trail->letterId == -1) {
trail->update(screenBounds);
if(!ofInsidePoly( trail->position, screenBounds.getVertices() )){
trails.erase(trails.begin()+i);
i--;
continue;
}
// look if it has found a letter now
for(int j=0; j<letters.size(); j++){
if( ofInsidePoly( *pos, letters[j].getVertices() ) ) {
trail->letterId = j;
}
}
}
else {
trail->update(letters[trail->letterId]);
if (trails[i].bActive) {
growings.push_back(trails[i].position);
}
}
}
triangle.clear();
if(growings.size()>=3)
triangle.triangulate( growings, growings.size() );
}
示例2: newPos
void Choreo3DApp::update()
{
setFrameRate(frameRate);
//DISABLE CAMERA INTERACTION IF MOUSE IS OVER UI REGION
if (getMousePos().x > 3 * getWindowWidth()/4. && camActive)
{
camActive = false;
mCamUi.disconnect();
mCamUi.disable();
cout << "disabling camera UI" << endl;
} else {
if (!camActive)
{
mCamUi.connect(getWindow());
mCamUi.enable();
}
camActive = true;
cout << "enabling camera UI" << endl;
}
mGlsl->uniform("uColor", markerColour );
if (!paused)
{
//UPDATE POSITIONS
//MAP INSTANCE DATA TO VBO
//WRITE NEW POSITIONS
//UNMAP
glm::vec3 *newPositions = (glm::vec3*)mInstanceDataVbo->mapReplace();
for( int i = 0; i < jointList.size(); ++i )
{
float instanceX = jointList[i].jointPositions[FRAME_COUNT].x;
float instanceY = jointList[i].jointPositions[FRAME_COUNT].y;
float instanceZ = jointList[i].jointPositions[FRAME_COUNT].z;
vec3 newPos(vec3(instanceX,instanceY, instanceZ)); //CREATE A NEW VEC3 FOR UPDATING THE VBO
framePositions[i] = newPos;
}
//REPLACE VEC3s IN VBO BY INCREMENTING THE POINTER
for (int i = 0; i < framePositions.size(); i++){
*newPositions++ = framePositions[i];
}
handTrail.update(framePositions[26], dancerColor);
// std::cout << framePositions[17] << std::endl;
skeleton.update(framePositions);
mInstanceDataVbo->unmap();
// std::cout << "position: " << positions[0] << std::endl;
if (ribbonsActive)updateRibbons();
//MANUALLY INCREMENT THE FRAME, IF THE FRAME_COUNT EXCEEDS TOTAL FRAMES, RESET THE COUNTER
if (FRAME_COUNT < TOTAL_FRAMES)
{
FRAME_COUNT += 1;
} else {
FRAME_COUNT = 0;
}
//std::cout << getAverageFps() << std:: endl;
// std::cout << "frame rate: " << getAverageFps() << ", frame count: " << FRAME_COUNT << std::endl;
//define changed color
// Color temp = Color(dancerColor[0],dancerColor[1],dancerColor[2]);
mCurrentFrame++; //MANUALLY ADVANCE THE CURRENT FRAME - WITH RESPECT TO THE DANCERS
}
updateGui();
}