本文整理汇总了C++中Quad::state方法的典型用法代码示例。如果您正苦于以下问题:C++ Quad::state方法的具体用法?C++ Quad::state怎么用?C++ Quad::state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quad
的用法示例。
在下文中一共展示了Quad::state方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintGL
void GLQuad::paintGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
setupView();
drawAxes();
drawIntercept();
glColor3f(0.8,0.5,0.5);
Quad *quad = Globals::self().simulatedQuad();
drawQuad(quad->state(), quad->propInput());
glColor3f(0.5,0.5,0.8);
drawQuad(Globals::self().imu()->lastState(), Globals::self().propellers()->input());
glColor3f(0.5,0.5,0.5);
quad = Globals::self().remoteQuad();
drawQuad(quad->state(), quad->propInput());
}
示例2: updateLabels
void Interface::updateLabels()
{
bool isSimulation = Globals::self().isSimulation();
Quad *quad;
if (isSimulation) {
quad = Globals::self().simulatedQuad();
} else {
quad = Globals::self().remoteQuad();
}
QuadState state = quad->state();
positionLabel->setText( toCoords( state.pos ) );
velocityLabel->setText( toCoords( state.vel ) );
Vector3d accel = Globals::self().imu()->lastAcceleration();
Vector3d gyro = Globals::self().imu()->lastAngularAcceleration();
accelerometersLabel->setText(toCoords(accel));
gyroLabel->setText(toCoords(gyro, 3));
// Update plot
double duration = quad->path_ != nullptr ? quad->path_->duration() : 0;
interceptPlot->setIntercept(quad->intercept, duration);
runPauseSimulationButton->setText(Globals::self().isSimulatedQuadRunning() ? "Pause" : "Run");
Vector4d propInput = Globals::self().propellers()->input();
// Update slider values
for ( int i = 0; i < 4; ++i ) {
double p = propInput[i];
int v = int(p * m_propInputs[i]->maximum());
m_propInputs[i]->setValue( v );
}
}