当前位置: 首页>>代码示例>>C++>>正文


C++ setOrientation函数代码示例

本文整理汇总了C++中setOrientation函数的典型用法代码示例。如果您正苦于以下问题:C++ setOrientation函数的具体用法?C++ setOrientation怎么用?C++ setOrientation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setOrientation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setOrientation

void ViewportsSplitter::split2Up1Down(ViewportPanel * vp) 
{
	setOrientation(Qt::Vertical);

	top.setParent(this);
	first->setParent(&top);
	second->setParent(&top);

	bottom.setParent(this);
	if (vp == fourth)
	{
		third->setParent(0);
		fourth->setParent(&bottom);
	} else {
		third->setParent(&bottom);
		fourth->setParent(0);
	}
}
开发者ID:banduladh,项目名称:levelfour,代码行数:18,代码来源:ViewportsSplitter.cpp

示例2: addRotation

void BasicScreenObject::doRotate() {

  rotationspeed *= rotationdrag;

  if (rotationspeed.length() > 0) {
    addRotation(rotationspeed.x, rotationspeed.y, rotationspeed.z);
  }

  if (rotationattractionforce > 0) {
    ofQuaternion betweenquat = rotationattractionquat - getOrientationQuat();
    float betweenangle;
    ofVec3f dirvec(1, 0, 0);
    betweenquat.getRotate(betweenangle, dirvec);
    ofQuaternion nowquat = getOrientationQuat();
    nowquat.slerp(rotationattractionforce, nowquat, rotationattractionquat);
    setOrientation(nowquat);
  }
}
开发者ID:kitschpatrol,项目名称:ofxRRScenegraph,代码行数:18,代码来源:BasicScreenObject.cpp

示例3: qt_static_metacall

int GraphicsLinearLayoutObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 3)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 3;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QDeclarativeListProperty<QGraphicsLayoutItem>*>(_v) = children(); break;
        case 1: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 2: *reinterpret_cast< qreal*>(_v) = spacing(); break;
        case 3: *reinterpret_cast< qreal*>(_v) = contentsMargin(); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 1: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 2: setSpacing(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setContentsMargin(*reinterpret_cast< qreal*>(_v)); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 4;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:sensarliar,项目名称:zfcs_filesystem,代码行数:44,代码来源:moc_linearlayout.cpp

示例4: setTarget

// updateObject
// update object by frame...
void CGameCamera::updateObject()
{
	CGameObject::updateObject();

	if ( m_enable && m_targetObject )
	{
		// look target
		setTarget( m_targetObject->getPosition() );
	}
#ifdef GSEDITOR
	else
	{
		if ( getIView()->getActiveCamera() == this )
			m_targetPos = m_camera->getTarget();
	}

	// maybe modify by free animator
	core::vector3df pos = m_camera->getPosition();
	setPosition( pos );	

	if ( getIView()->getActiveCamera() == this )
		m_cameraMesh->setVisible( false );
	else
	{
		m_cameraMesh->setVisible( true );
		m_node = m_cameraMesh;

		core::vector3df rot = m_targetPos - m_position;
		setOrientation( rot );

		m_node = m_camera;
	}
#endif

#ifdef GSGAMEPLAY
	if ( m_camera->getAnimators().size() > 0 )
	{
		m_position = m_camera->getPosition();
		if ( m_targetObject == NULL )
			m_targetPos = m_camera->getTarget();
	}
#endif

}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:46,代码来源:CGameCamera.cpp

示例5: QDockWindow

/**
 * Constructs the window.
 */
LibraryWindow::LibraryWindow(Place p, QWidget* parent, const char* name,
                             WFlags f)
    : QDockWindow(p, parent, name, f)
{
    modified_ = false;

    setCloseMode(Never);
    setMovingEnabled(TRUE);
    setResizeEnabled(TRUE);

    splitter_ = new QSplitter(Qt::Vertical, this);
    setWidget(splitter_);

    modelListView_ = new LibraryListView(splitter_);
    modelListView_->addColumn(tr("Module"));
    modelListView_->setDefaultRenameAction(QListView::Accept);

    descriptionTextBrowser_ = new QTextBrowser(splitter_);
    QPalette palette = QApplication::palette();
    descriptionTextBrowser_->setFrameStyle(QFrame::NoFrame);
    descriptionTextBrowser_->setPaper
            (palette.brush(QPalette::Normal, QColorGroup::Background));

    popupMenu_ = new QPopupMenu();
    popupMenu_->insertItem(tr("Rename"), this, SLOT(renameSelected()));
    popupMenu_->insertItem(tr("Change Type"),
                           this, SLOT(changeTypeOfSelected()));
    popupMenu_->insertSeparator();
    popupMenu_->insertItem(QPixmap(Util::findIcon("editdelete.png")),
                           tr("Remove"), this, SLOT(removeSelected()));

    connect(modelListView_, SIGNAL(selectionChanged(QListViewItem *)),
            this, SLOT(setDescription(QListViewItem *)));
    connect(this, SIGNAL(orientationChanged(Orientation)),
            this, SLOT(setOrientation(Orientation)));
    connect(modelListView_,
            SIGNAL(contextMenuRequested(QListViewItem *, const QPoint &, int)),
            this, SLOT(showPopup(QListViewItem *, const QPoint &, int)));
    connect(modelListView_, SIGNAL(selectionChanged(QListViewItem *)),
            this, SLOT(selectionChanged(QListViewItem *)));

    // load items
    initialize();
}
开发者ID:BackupTheBerlios,项目名称:poa,代码行数:47,代码来源:librarywindow.cpp

示例6: QWidget

QSlidingFrame::QSlidingFrame(QWidget *parent) : QWidget(parent)
{
    setAutoFillBackground(true);
    LayoutWidget=new QWidget(this);
    setOrientation(Qt::Horizontal);
    ImgWidget=0;
    animation=new QPropertyAnimation(this);
    animation->setDuration(800);
    animation->setEasingCurve(QEasingCurve::OutQuint);
    animation->setPropertyName("pos");
    connect(animation,SIGNAL(finished()),this,SLOT(animationFinished()));
    m_ActiveWidget=-1;
    QHBoxLayout* l=new QHBoxLayout(this);
    l->setMargin(0);
    l->setSpacing(0);
    l->addWidget(LayoutWidget);
    this->setLayout(l);
    LayoutWidget->show();
}
开发者ID:vemod-,项目名称:ObjectComposerXML,代码行数:19,代码来源:qslidingframe.cpp

示例7: Object

Arrow::Arrow( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node, float shaft_length, float shaft_radius,
              float head_length, float head_radius )
: Object( scene_manager )
{
  if ( !parent_node )
  {
    parent_node = scene_manager_->getRootSceneNode();
  }

  scene_node_ = parent_node->createChildSceneNode();

  shaft_ = new Shape( Shape::Cylinder, scene_manager_, scene_node_ );
  head_ = new Shape( Shape::Cone, scene_manager_, scene_node_ );
  head_->setOffset(Ogre::Vector3(0.0f, 0.5f, 0.0f));

  set( shaft_length, shaft_radius, head_length, head_radius );

  setOrientation( Ogre::Quaternion::IDENTITY );
}
开发者ID:F34140r,项目名称:visualization-userfriendly,代码行数:19,代码来源:arrow.cpp

示例8: ofQuaternion

//----------------------------------------
void ofEasyCam::updateRotation(){
	if (bApplyInertia) {
		xRot *=drag; 
		yRot *=drag;
		zRot *=drag;
		
		if (ABS(xRot) <= minDifference && ABS(yRot) <= minDifference && ABS(zRot) <= minDifference) {
			bApplyInertia = false;
			bDoRotate = false;
		}
		curRot = ofQuaternion(xRot, getXAxis(), yRot, getYAxis(), zRot, getZAxis());
		setPosition((getGlobalPosition()-target.getGlobalPosition())*curRot +target.getGlobalPosition());
		rotate(curRot);
	}else{
		curRot = ofQuaternion(xRot, prevAxisX, yRot, prevAxisY, zRot, prevAxisZ);
		setPosition((prevPosition-target.getGlobalPosition())*curRot +target.getGlobalPosition());
		setOrientation(prevOrientation * curRot);
	}
}
开发者ID:K0j0,项目名称:openFrameworks,代码行数:20,代码来源:ofEasyCam.cpp

示例9: override_map_start

            void Opcode80A9::_run()
            {
                Logger::debug("SCRIPT") << "[80A9] [+] void override_map_start(int x, int y, int elevation, int orientation)" << std::endl;
                auto dataStack = _script->dataStack();

                auto orientation = dataStack->popInteger();
                auto elevation = dataStack->popInteger();
                auto y = dataStack->popInteger();
                auto x = dataStack->popInteger();
                auto position = y*200 + x;
                auto game = Game::Game::getInstance();
                auto player = game->player();
                auto hexagon = game->locationState()->hexagonGrid()->at(position);
                Game::getInstance()->locationState()->moveObjectToHexagon(player, hexagon);
                            //player->setPosition(position);
                player->setOrientation(orientation);
                player->setElevation(elevation);
                Game::Game::getInstance()->locationState()->centerCameraAtHexagon(player->hexagon());
            }
开发者ID:CynicRus,项目名称:falltergeist,代码行数:19,代码来源:Opcode80A9Handler.cpp

示例10: loadProperties

void Situated::load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint) {
    // General properties

    if (blueprint)
        loadProperties(*blueprint); // Blueprint
    loadProperties(instance);    // Instance


    // Specialized object properties

    if (blueprint)
        loadObject(*blueprint); // Blueprint
    loadObject(instance);    // Instance


    // Sounds

    loadSounds();

    // Position

    setPosition(instance.getDouble("X"),
                instance.getDouble("Y"),
                instance.getDouble("Z"));

    // Orientation

    float bearing = instance.getDouble("Bearing");

    float rotX = 0.0f;
    float rotY = 0.0f;
    float rotZ = 1.0f;
    float rotW = Common::rad2deg(bearing);

    if (instance.hasField("OrientationW")) {
        rotX = instance.getDouble("OrientationX");
        rotY = instance.getDouble("OrientationY");
        rotZ = instance.getDouble("OrientationZ");
        rotW = Common::rad2deg(acos(instance.getDouble("OrientationW")) * 2.0);
    }

    setOrientation(rotX, rotY, rotZ, rotW);
}
开发者ID:Glyth,项目名称:xoreos,代码行数:43,代码来源:situated.cpp

示例11: setOrientation

  void Camera::orientate(float xRel, float yRel)
  {
    spdlog::get("console")->debug() << "Orientate: xRel = " << xRel << ", yRel = " << yRel;

    phi_ += - yRel * sensibility_;
    theta_ += - xRel * sensibility_;

    phi_ = Utils::clamp(phi_);

    float phiRad = Utils::degreeToRad(phi_);
    float thetaRad = Utils::degreeToRad(theta_);

    setOrientation(phiRad, thetaRad);

    lateralMove_ = glm::cross(verticalAxis_, orientation_);
    lateralMove_ = glm::normalize(lateralMove_);

    updateEyeTarget();
  }
开发者ID:gaultier,项目名称:Simulation_Stars_OpenGL,代码行数:19,代码来源:Camera.cpp

示例12: rotateToAngle

// This function makes the robot rotate to a specific angle. The input is the angle measured in radians, where 0 is East/right and positive values are anticlockwise.
void rotateToAngle(double angle){
	//Calculate the angle to rotate
	double difference = theta - angle;
	//Don't rotate if we are at the correct angle
	if (difference == 0.0){
		return;
	}

	//Check for overflow
	if(difference>M_PI){ 
		difference = (difference-(M_PI*2));
	}else if(difference<(M_PI*-1)){
		difference = difference + (M_PI*2);
	}

	// Infrastructure
	ros::Rate loop_rate(loopRate);
	ros::NodeHandle n;
	geometry_msgs::Twist RobotNode_cmdvel;
	ros::Publisher RobotNode_stage_pub = n.advertise<geometry_msgs::Twist>("robot_11/cmd_vel",1000);
	
	//Calculate the shortest angle velocity to rotate
	if(difference>0){
		angular_z = -M_PI/2;
		
	}else{
		angular_z = M_PI/2;
		
	}

	//Rotate to the specified angle
	while(theta!=angle){

		// Infrastructure
		RobotNode_cmdvel.linear.x = linear_x;
		RobotNode_cmdvel.angular.z = angular_z;
		RobotNode_stage_pub.publish(RobotNode_cmdvel);
		setOrientation();
		ros::spinOnce();
		loop_rate.sleep();
	}
	angular_z = 0;
}
开发者ID:rfen347,项目名称:swarm-robotics,代码行数:44,代码来源:friend2.cpp

示例13: setPosition

void Waypoint::load(const Aurora::GFF3Struct &waypoint) {
	// Tag
	_tag = waypoint.getString("Tag");

	// Group
	_group = waypoint.getSint("Group", -1);

	// Map Note
	_hasMapNote     = waypoint.getBool("HasMapNote");
	_enabledMapNote = waypoint.getBool("MapNoteEnabled");

	waypoint.getLocString("MapNote", _mapNote);

	// Type
	_type = (uint32) ((int32) waypoint.getSint("MapNoteType", -1));

	// Position
	const float position[3] = {
		(float) waypoint.getDouble("XPosition"),
		(float) waypoint.getDouble("YPosition"),
		(float) waypoint.getDouble("ZPosition")
	};

	setPosition(position[0], position[1], position[2]);

	// Orientation
	const float orientation[4] = {
		(float) waypoint.getDouble("XOrientation"),
		(float) waypoint.getDouble("YOrientation"),
		(float) waypoint.getDouble("ZOrientation"),
		(float) Common::rad2deg(acos(waypoint.getDouble("WOrientation")) * 2.0)
	};

	setOrientation(orientation[0], orientation[1], orientation[2], orientation[3]);

	const Aurora::GDAFile &gda = getMGDA(kWorksheetWaypoints);

	// Icon
	_icon = gda.getString(_type, "Icon");

	// Variables
	readVarTable(waypoint);
}
开发者ID:Siltala,项目名称:xoreos,代码行数:43,代码来源:waypoint.cpp

示例14: qt_static_metacall

int QDialogButtonBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 6)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 1: *reinterpret_cast<int*>(_v) = QFlag(standardButtons()); break;
        case 2: *reinterpret_cast< bool*>(_v) = centerButtons(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 1: setStandardButtons(QFlag(*reinterpret_cast<int*>(_v))); break;
        case 2: setCenterButtons(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:unni07,项目名称:RecommenderSystem,代码行数:43,代码来源:moc_qdialogbuttonbox.cpp

示例15: value

    EnergyMeter::EnergyMeter(const sf::Sprite &overlay, const float &maximumValue)
        : value(maximumValue)
        , maximumValue(maximumValue)
        , orientation(-1)
        , overlay(overlay)
        , primaryColor(DEFAULT_PRIMARY_COLOR)
        , secondaryColor(DEFAULT_SECONDARY_COLOR)
        , fillColor(DEFAULT_FILL_COLOR)
    {
        setVisible(true);

        foreground.setSize(
            sf::Vector2f(
                overlay.getLocalBounds().width,
                overlay.getLocalBounds().height
            )
        );

        primaryBackground.setSize(foreground.getSize());

        secondaryBackground.setSize(
            sf::Vector2f(
                2.0f,
                foreground.getSize().y
            )
        );

        setFillColor(fillColor);
        setPrimaryColor(primaryColor);
        setSecondaryColor(secondaryColor);

        setPosition(
            sf::Vector2i(
                static_cast<int>(overlay.getPosition().x),
                static_cast<int>(overlay.getPosition().y)
            )
        );

        setOrientation(VERTICAL_ORIENTATION);

        updateFill();
    }
开发者ID:Faianca,项目名称:hikari,代码行数:42,代码来源:EnergyMeter.cpp


注:本文中的setOrientation函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。