本文整理汇总了C++中QVector3D::y方法的典型用法代码示例。如果您正苦于以下问题:C++ QVector3D::y方法的具体用法?C++ QVector3D::y怎么用?C++ QVector3D::y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVector3D
的用法示例。
在下文中一共展示了QVector3D::y方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressEvent
/*!
* \brief GLWidget::mousePressEvent
* Pobiera pozycję kursora na ekranie. Jeśli dodatkowo jest włączony tryb PointMode, dodaje
* do okna dialogowa współrzędne wskazanego punktu.
* \param event
*/
void GLWidget::mousePressEvent(QMouseEvent *event)
{
point_ = event->pos();
if (addPointMode) {
QVector3D pos = getPos(point_.x(), point_.y());
d_->addPoint(pos.x(), pos.y());
addPointMode = false;
}
}
示例2: setPosition
void OgreLightNode::setPosition(QVector3D p)
{
m_position.x = p.x();
m_position.y = p.y();
m_position.z = p.z();
//m_node->resetOrientation();
m_light->setPosition(m_position);// * (1 / m_zoom));
updateRotation();
}
示例3: setPosition
void QSoundSourcePrivate::setPosition(const QVector3D& position)
{
if (!m_alSource)
return;
alSource3f(m_alSource, AL_POSITION, position.x(), position.y(), position.z());
#ifdef DEBUG_AUDIOENGINE
QAudioEnginePrivate::checkNoError("source set position");
#endif
}
示例4: convertQtIRS
PXCPoint3DF32 IRSHandlerBase::convertQtIRS(const QVector3D &qtVector)
{
PXCPoint3DF32 irsVector;
irsVector.x = qtVector.x();
irsVector.y = qtVector.y();
irsVector.z = qtVector.z();
return irsVector;
}
示例5: toString
Ogre::String toString(const QVector3D &v)
{
Ogre::String s="<QVector3D ";
s+="x="+Ogre::StringConverter::toString((float)v.x())+", ";
s+="y="+Ogre::StringConverter::toString((float)v.y())+", ";
s+="z="+Ogre::StringConverter::toString((float)v.z());
s+=">";
return s;
}
示例6: setVelocity
void QSoundSourcePrivate::setVelocity(const QVector3D& velocity)
{
if (!m_alSource)
return;
alSource3f(m_alSource, AL_VELOCITY, velocity.x(), velocity.y(), velocity.z());
#ifdef DEBUG_AUDIOENGINE
QAudioEnginePrivate::checkNoError("source set velocity");
#endif
}
示例7: setDirection
void QSoundSourcePrivate::setDirection(const QVector3D& direction)
{
if (!m_alSource)
return;
alSource3f(m_alSource, AL_DIRECTION, direction.x(), direction.y(), direction.z());
#ifdef DEBUG_AUDIOENGINE
QAudioEnginePrivate::checkNoError("source set direction");
#endif
}
示例8:
void SS3DWidget::camMoveCenter(const QVector3D& tt)
{
QVector3D xv = QVector3D::crossProduct((m_cam_center - m_cam_eye), m_cam_up).normalized();
QVector3D yv = QVector3D::crossProduct(xv, (m_cam_center - m_cam_eye)).normalized();
QVector3D zv = (m_cam_center - m_cam_eye).normalized();
QVector3D trans = xv * tt.x() + yv * tt.y() + zv * tt.z();
m_cam_eye += trans;
m_cam_center += trans;
}
示例9: paintROI
void SurfaceSet::paintROI(){
glColor3f(0,0,0);
glPointSize(15);
glBegin(GL_POINTS);
for (int i = 0; i < afnis.at(0)->nodes.length(); i++){
QVector3D p = afnis.at(cs)->nodes.at(i);
if (roi->contains(i)) glVertex3f(p.x(),p.y(),p.z());
}
glEnd();
}
示例10: renderPS
/* render particle system */
void Quiddiards::renderPS(){
glDisable(GL_LIGHTING);
for (vector<Particle>::iterator it = ps->getParticles().begin(); it != ps->getParticles().end(); it++){
float alpha = 1 - it->age / it->life; //calculate alpha according to particle age
if (alpha <= 0){
continue;
}
QVector3D pos = it->getCenter();
QVector3D color = it->color;
glColor4f(color.x(), color.y(), color.z(), alpha);
//glColor3f(color.x(), color.y(), color.z());
glPushMatrix();
glTranslatef(pos.x(), pos.y(), pos.z());
gluSphere(quad, it->size, 6, 6);
glPopMatrix();
}
glColor3f(1.0f, 1.0f, 1.0f);
glEnable(GL_LIGHTING);
}
示例11: distancePointToRay
float Quality::distancePointToRay(const QVector3D& origin, const QVector3D& dir, const QVector3D& point)
{
QVector3D dirToPoint = QVector3D(point.x() - origin.x(), point.y() - origin.y(), point.z() - origin.z());
float scalarP = dir.x() * dirToPoint.x() + dir.y() * dirToPoint.y() + dir.z() * dirToPoint.z();
float norm = sqrt(dir.x() * dir.x() + dir.y() * dir.y() + dir.z() * dir.z()) *
sqrt(dirToPoint.x() * dirToPoint.x() + dirToPoint.y() * dirToPoint.y() + dirToPoint.z() * dirToPoint.z());
float angle = acos(scalarP / norm);
return sin(angle) * Quality::distancePointToPoint(origin, point);
}
示例12: gratingInPosition
bool REIXSSpectrometer::gratingInPosition() const
{
if(currentGrating_ < 0 || currentGrating_ >= gratingCount())
return false;
QVector3D xyz = calibration_.hexapodXYZ(currentGrating_);
QVector3D rst = calibration_.hexapodRST(currentGrating_);
QVector3D uvw = calibration_.hexapodUVW(currentGrating_);
return hexapod_->x()->withinTolerance(xyz.x()) &&
hexapod_->y()->withinTolerance(xyz.y()) &&
hexapod_->z()->withinTolerance(xyz.z()) &&
hexapod_->r()->withinTolerance(rst.x()) &&
hexapod_->s()->withinTolerance(rst.y()) &&
hexapod_->t()->withinTolerance(rst.z()) &&
hexapod_->u()->withinTolerance(uvw.x()) &&
hexapod_->v()->withinTolerance(uvw.y()) &&
hexapod_->w()->withinTolerance(uvw.z());
}
示例13: fromTwoVectors
/* Build a unit quaternion representing the rotation
* from u to v. The input vectors need not be normalised. */
QQuaternion fromTwoVectors(QVector3D u, QVector3D v)
{
float norm_u_norm_v = sqrt(QVector3D::dotProduct(u, u) * QVector3D::dotProduct(v, v));
float real_part = norm_u_norm_v + QVector3D::dotProduct(u, v);
QVector3D w;
if (real_part < 1.e-6f * norm_u_norm_v)
{
/* If u and v are exactly opposite, rotate 180 degrees
* around an arbitrary orthogonal axis. Axis normalisation
* can happen later, when we normalise the quaternion. */
real_part = 0.0f;
w = fabs(u.x()) > fabs(u.z()) ? QVector3D(-u.y(), u.x(), 0.f)
: QVector3D(0.f, -u.z(), u.y());
} else {
/* Otherwise, build quaternion the standard way. */
w = QVector3D::crossProduct(u, v);
}
return QQuaternion(real_part, w).normalized();
}
示例14: add
void GLRasterTexture::add(const QVector3D &v, const QVector2D &tc)
{
GLfloat *p = m_data.data() + m_count;
*p++ = v.x();
*p++ = v.y();
*p++ = v.z();
*p++ = tc.x();
*p++ = tc.y();
m_count += DATA_DIMENSIONS;
}
示例15:
/**
* Get polygon oriented bounding box
**/
void Polygon3D::getLoopOBB(Loop3D &pin, QVector3D &size, QMatrix4x4 &xformMat){
float alpha = 0.0f;
float deltaAlpha = 0.05*3.14159265359f;
float bestAlpha;
Loop3D rotLoop;
QMatrix4x4 rotMat;
QVector3D minPt, maxPt;
QVector3D origMidPt;
QVector3D boxSz;
QVector3D bestBoxSz;
float curArea;
float minArea = FLT_MAX;
rotLoop = pin;
Polygon3D::getLoopAABB(rotLoop, minPt, maxPt);
origMidPt = 0.5f*(minPt + maxPt);
//while(alpha < 0.5f*_PI){
int cSz = pin.size();
QVector3D difVec;
for(int i=0; i<pin.size(); ++i){
difVec = (pin.at((i+1)%cSz) - pin.at(i)).normalized();
alpha = atan2(difVec.x(), difVec.y());
rotMat.setToIdentity();
rotMat.rotate(57.2957795f*(alpha), 0.0f, 0.0f, 1.0f);//57.2957795 rad2degree
transformLoop(pin, rotLoop, rotMat);
boxSz = Polygon3D::getLoopAABB(rotLoop, minPt, maxPt);
curArea = boxSz.x() * boxSz.y();
if(curArea < minArea){
minArea = curArea;
bestAlpha = alpha;
bestBoxSz = boxSz;
}
//alpha += deltaAlpha;
}
xformMat.setToIdentity();
xformMat.rotate(57.2957795f*(bestAlpha), 0.0f, 0.0f, 1.0f);//57.2957795 rad2degree
xformMat.setRow(3, QVector4D(origMidPt.x(), origMidPt.y(), origMidPt.z(), 1.0f));
size = bestBoxSz;
}//