本文整理汇总了C++中Tween::getTweenDelta方法的典型用法代码示例。如果您正苦于以下问题:C++ Tween::getTweenDelta方法的具体用法?C++ Tween::getTweenDelta怎么用?C++ Tween::getTweenDelta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tween
的用法示例。
在下文中一共展示了Tween::getTweenDelta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleRequest
int Worker::handleRequest(queue<double> &inData) {
double d;
int status = readDouble(coordSocketFd, d);
if (status == 0) {
inData.push(d);
}
if (inData.size() >= 3) {
int frameNumber = (int)inData.front();
inData.pop();
int column = (int)inData.front();
inData.pop();
int numWorkers = (int)inData.front();
inData.pop();
// cerr << "BEFORE " << mView << endl;
// cerr << "FRAME NUMBER " << frameNumber << endl;
for (list<Tween*>::iterator it = mTweens.begin(); it != mTweens.end(); it++) {
Tween* tween = *it;
tween->init();
// cerr << "FRAME NUMBER1 " << frameNumber << endl;
// cerr << "FRAME NUMBER2 " << frameNumber << endl;
if (tween->type == Tween::TRANSLATE) {
Vector3D translateDelta = tween->getTweenDelta(frameNumber);
// cerr << "translateDelta " << translateDelta << endl;
mEye = mEye + translateDelta;
} else if (tween->type == Tween::ROTATE) {
// cerr << "BEFORE " << mView << endl;
Vector3D rotateDelta = tween->getTweenDelta(frameNumber);
// cerr << "DELTA " << rotateDelta << endl;
mView = mView + rotateDelta;
mSide = mView.cross(mUp);
// cerr << "AFTER " << mView << endl;
}
}
WorkPool workPool;
for (int i = column; i < this->width; i += numWorkers) {
workPool.addJob(i);
}
pthread_mutex_t lock;
pthread_mutex_init(&lock, NULL);
struct worker_thread_args args;
args.sendLock = &lock;
args.workPool = &workPool;
args.renderer = this->r;
args.height = this->height;
args.coordSocketFd = coordSocketFd;
vector<pthread_t *> workerThreads;
int numThreads = numCPUs;
for (int i = 0; i < numThreads; i++) {
pthread_t *thread = new pthread_t();
pthread_create(thread, NULL, &testMethod, &args);
workerThreads.push_back(thread);
}
for (int i = 0; i < numThreads; i++) {
pthread_t *thread = workerThreads[i];
pthread_join(*thread, NULL);
delete thread;
}
return 1;
}
return status;
}