• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setOrigin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setOrigin

void ENUTracker::reset(const Vector3& pos) {
	quickCounter = 2500;
#ifndef USE_SINGLE__PRECISION_NUMBERS
	setOrigin(pos.x);
#else
	double x[3];  
	x[0] = pos[0];  x[1] = pos[1];  x[2] = pos[2];
	setOrigin(x);
#endif
	lastPosition = pos;
}
开发者ID:ig-or,项目名称:qwtw,代码行数:11,代码来源:xmcoords.cpp


示例2: setOrigin

/*!
    \property QGeoMapPolygonObject::path
    \brief This property holds the ordered list of coordinates which define the
    polygon to be drawn by this polygon object.

    The default value of this property is an empty list of coordinates.

    The coordinates should be listed in the order in which they would be
    traversed when traveling around the border of the polygon.

    Invalid coordinates in the list will be ignored, and if the list of
    coordinates contains less than 3 valid coordinates then the polygon object
    will not be displayed.

    \since 1.1
*/
void QGeoMapPolygonObject::setPath(const QList<QGeoCoordinate> &path)
{
    if (d_ptr->path != path) {
        d_ptr->path = path;
        if (path.size() != 0)
            setOrigin(path.at(0));
        else
            setOrigin(QGeoCoordinate());
        emit pathChanged(emit d_ptr->path);
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:27,代码来源:qgeomappolygonobject.cpp


示例3: d_ptr

/*!
    Constructs a new pixmap object which will draw the pixmap \a pixmap at an
    offset of \a offset pixels from the coordinate \a coordinate.
*/
QGeoMapPixmapObject::QGeoMapPixmapObject(const QGeoCoordinate &coordinate, const QPoint &offset, const QPixmap &pixmap)
    : d_ptr(new QGeoMapPixmapObjectPrivate())
{
    setOrigin(coordinate);
    d_ptr->pixmap = pixmap;
    d_ptr->offset = offset;
}
开发者ID:katealhola,项目名称:qt5location,代码行数:11,代码来源:qgeomappixmapobject.cpp


示例4: KeyText

 KeyText(const std::string& str, const sf::Font& f, float timeDuration, int l, float t)
 :sf::Text(str, f), duration(timeDuration), limb(l), timeCreated(t)
 {
     sf::FloatRect textRect =getLocalBounds();
     setOrigin(textRect.left + textRect.width/2.0f,
            textRect.top  + textRect.height/2.0f);
 }
开发者ID:StylishTriangles,项目名称:TadzikEngine,代码行数:7,代码来源:isayparty.hpp


示例5: setOrigin

int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
{
    VECTOR2D* origin = aEvent.Parameter<VECTOR2D*>();

    if( origin )
    {
        setOrigin( getView(), m_frame, m_gridOrigin, *origin );
        delete origin;
    }
    else
    {
        Activate();

        PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
        assert( picker );

        // TODO it will not check the toolbar button in module editor, as it uses a different ID..
        m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust grid origin" ) );
        picker->SetClickHandler( boost::bind( setOrigin, getView(), m_frame, m_gridOrigin, _1 ) );
        picker->Activate();
        Wait();
    }

    return 0;
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:25,代码来源:pcbnew_control.cpp


示例6: Agent

	Agent(int v, Cell& c1, Cell& c2, float speed = 1.f) : AnimatedElement(Texture("grid.png"), sf::Vector2f(), 0.f, 64, 1, GameStep::player->getStyle()*8 ), c2(c2)
		{
			setOrigin(32, 32);
			setScale(.5f, .5f);

			delta = c2.getPosition() - c1.getPosition();
			float length = sqrt( delta.x * delta.x + delta.y * delta.y );
			delta /= length;

			sf::Vector2f startPos = c1.getPosition() + delta*c1.getRadius();
			sf::Vector2f endPos = c2.getPosition() - delta*c2.getRadius();
			setPosition(startPos);

			sf::Vector2f travel = endPos - startPos;
			length = sqrt( travel.x*travel.x + travel.y*travel.y );

			value = c1.sendValue(v);

			//speed *= (value < 0 ? 1.f : .5f);
			delta *= speed;

			duration = length/speed;
			elapsed = 0;

			if(value != 0) alive = true; else setColor(sf::Color::Transparent);
			if(value < 0) sprite.setTextureRect(sf::IntRect(0, 196, 64, 64));

		}
开发者ID:Lord-Nazdar,项目名称:GameaNiaque,代码行数:28,代码来源:step3.cpp


示例7: updating

void SPlaneSlicer::updating()
{
    this->setReslicerExtent();
    this->setReslicerAxes();

    auto image                           = this->getInput< ::fwData::Image >(s_IMAGE_IN);
    vtkSmartPointer<vtkImageData> vtkimg = vtkSmartPointer<vtkImageData>::New();

    ::fwVtkIO::toVTKImage(image, vtkimg.Get());

    m_reslicer->SetInputData(vtkimg);
    m_reslicer->Update();

    auto slice = this->getInOut< ::fwData::Image >(s_SLICE_OUT);

    ::fwVtkIO::fromVTKImage(m_reslicer->GetOutput(), slice);

    // HACK: Make output slice three-dimensional.
    // We need to do so in order to visualize it with ::visuVTKAdaptor::SImageSlice.
    // This is because the adaptor uses a vtkImageActor which doesn't handle 2d images.
    auto size = slice->getSize();
    slice->setSize({{size[0], size[1], 1}});
    auto spacing = slice->getSpacing();
    slice->setSpacing({{spacing[0], spacing[1], 0 }});
    auto origin = slice->getOrigin();
    slice->setOrigin({{origin[0], origin[1], 0}});

    auto sig = slice->signal< ::fwData::Image::ModifiedSignalType >(::fwData::Image::s_MODIFIED_SIG);

    sig->asyncEmit();
}
开发者ID:fw4spl-org,项目名称:fw4spl-ext,代码行数:31,代码来源:SPlaneSlicer.cpp


示例8: clearScreen

/**
 * Clear the display and print the string s starting from (0,0)
 * @param s The string to be printed
 */
void LCD5110::printStr(String s){

  clearScreen();
  setOrigin();
  sendStr(s);

}
开发者ID:a-dma,项目名称:LCD5110,代码行数:11,代码来源:LCD5110.cpp


示例9: setOrigin

// virtual
void LLFloaterObjectWeights::onOpen()
{
	const LLRect& tools_rect = gFloaterTools->getRect();
	setOrigin(tools_rect.mRight, tools_rect.mTop - getRect().getHeight());
	refresh();
	updateLandImpacts(LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel());
}
开发者ID:abaph,项目名称:SingularityViewer,代码行数:8,代码来源:llfloaterobjectweights.cpp


示例10: getOrigin

void Camera::moveUpDiscrete() {
	Vector3 origin = getOrigin();

	origin[2] += SPEED_MOVE;

	setOrigin(origin);
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:7,代码来源:Camera.cpp


示例11: generate_shape

    // Just for testing
    static void generate_shape(EntityManager* em, float x = 4.f, float y = 1.f) {
        auto entity = em->create_entity();
        auto shape = new sf::CircleShape(1.0f);
        shape->setFillColor(sf::Color::Red);
        shape->setOrigin(1.0f, 1.0f);

        b2BodyDef body_def;
        body_def.position = b2Vec2(x, y);
        body_def.type = b2_dynamicBody;

        b2CircleShape body_shape;
        body_shape.m_p.Set(0.0f, 0.0f);
        body_shape.m_radius = 1.0f;
        b2FixtureDef fixture;
        fixture.density = 1.f;
        fixture.friction = 0.7f;
        fixture.shape = &body_shape;
        fixture.restitution = 0.1f;


        entity.add_component<rh::components::Renderable>(shape);
        entity.add_component<rh::components::Transformable>(shape);
        entity.add_component<rh::components::Physics>(body_def, fixture);

        entities.push_back(entity.id());
    }
开发者ID:davecoates,项目名称:robo-high,代码行数:27,代码来源:keyboardinput.cpp


示例12: setOrigin

void Entity::EventSetSize( Event *ev )
{
	mins = ev->GetVector( 1 );
	maxs = ev->GetVector( 2 );

	setOrigin( origin );
}
开发者ID:kingtiger01,项目名称:openmohaa-1,代码行数:7,代码来源:centity.cpp


示例13: setOrigin

LaserSource::LaserSource(char col)
{
	setOrigin(BLOCK_SIZE/2, BLOCK_SIZE/2);
	switch(col)
	{
	case 'r':
		{
			label = '1';
			color = sf::Color::Red;
			setTexture(LaserSource::redTexture);
			break;
		}
	case 'b':
		{
			label = 'j';
			color = sf::Color::Blue;
			setTexture(LaserSource::blueTexture);
			break;		
		}
	default:
		{
			label = '1';
			color = sf::Color::Red;
			setTexture(LaserSource::redTexture);
			break;		
		}
	}
}
开发者ID:qxynimo,项目名称:LaserLab_qxy,代码行数:28,代码来源:LaserSource.cpp


示例14: setTexture

void Personnage::AjustementsVisuels()
{
	setTexture(textureIddle);

	intRectsImmobile = new IntRect*[NBR_NIVEAUX];
	intRectsMouvement = new IntRect*[NBR_NIVEAUX];
	intRectsAttaque = new IntRect*[NBR_NIVEAUX];

	for (int i = 0; i < NBR_NIVEAUX; i++)
	{
		intRectsImmobile[i] = new IntRect[NBR_ANIMS_IMMOBILE];

		int largeur = textureIddle.getSize().x / NBR_ANIMS_IMMOBILE;
		int hauteur = textureIddle.getSize().y / NBR_NIVEAUX;

		for (int j = 0; j < NBR_ANIMS_IMMOBILE; j++)
		{
			intRectsImmobile[i][j].left = largeur * j;
			intRectsImmobile[i][j].top = hauteur * i;
			intRectsImmobile[i][j].width = largeur;
			intRectsImmobile[i][j].height = hauteur;
		}
	}

	for (int i = 0; i < NBR_NIVEAUX; i++)
	{
		intRectsMouvement[i] = new IntRect[NBR_ANIMS_MOUVEMENT];

		int largeur = textureMove.getSize().x / NBR_ANIMS_MOUVEMENT;
		int hauteur = textureMove.getSize().y / NBR_NIVEAUX;

		for (int j = 0; j < NBR_ANIMS_MOUVEMENT; j++)
		{
			intRectsMouvement[i][j].left = largeur * j;
			intRectsMouvement[i][j].top = hauteur * i;
			intRectsMouvement[i][j].width = largeur;
			intRectsMouvement[i][j].height = hauteur;
		}
	}

	for (int i = 0; i < NBR_NIVEAUX; i++)
	{
		intRectsAttaque[i] = new IntRect[NBR_ANIMS_ATTAQUE];

		int largeur = textureAttaque.getSize().x / NBR_ANIMS_ATTAQUE;
		int hauteur = textureAttaque.getSize().y / NBR_NIVEAUX;

		for (int j = 0; j < NBR_ANIMS_ATTAQUE; j++)
		{
			intRectsAttaque[i][j].left = largeur * j;
			intRectsAttaque[i][j].top = hauteur * i;
			intRectsAttaque[i][j].width = largeur;
			intRectsAttaque[i][j].height = hauteur;
		}
	}

	setTextureRect(intRectsImmobile[cadran][0]);

	setOrigin(intRectsImmobile[0][0].height / 2, intRectsImmobile[0][0].width / 2);
}
开发者ID:JoPet123,项目名称:TP2-1,代码行数:60,代码来源:Personnage.cpp


示例15: setOrigin

ofxCamera::ofxCamera(){
    setOrigin(OF_ORIGIN);
	perspective();
	position();
	eye();
	up();
}
开发者ID:UnforeseenOcean,项目名称:TheJanusMachine,代码行数:7,代码来源:ofxCamera.cpp


示例16: setStlFilePrefix

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void GenericExample::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
/* FILTER_WIDGETCODEGEN_AUTO_GENERATED_CODE BEGIN*/

  reader->openFilterGroup(this, index);
  setStlFilePrefix( reader->readValue("StlFilePrefix", getStlFilePrefix()) );
  setMaxIterations( reader->readValue("MaxIterations", getMaxIterations()) );
  setMisorientationTolerance( reader->readValue("MisorientationTolerance", getMisorientationTolerance()) );
  setInputFile( reader->readValue("InputFile", getInputFile()) );
  setInputPath( reader->readValue("InputPath", getInputPath()) );
  setOutputFile( reader->readValue("OutputFile", getOutputFile()) );
  setOutputPath( reader->readValue("OutputPath", getOutputPath()) );
  setWriteAlignmentShifts( reader->readValue("WriteAlignmentShifts", getWriteAlignmentShifts()) );
  setConversionType( reader->readValue("ConversionType", getConversionType()) );
  setDimensions( reader->readValue("Dimensions", getDimensions()) );
  setOrigin( reader->readValue("Origin", getOrigin()) );
  setCrystalSymmetryRotations( reader->readValue("CrystalSymmetryRotations", getCrystalSymmetryRotations()) );

  setSelectedVoxelCellArrayName( reader->readValue("SelectedVoxelCellArrayName", getSelectedVoxelCellArrayName()) );
  setSelectedVoxelFieldArrayName( reader->readValue("SelectedVoxelFieldArrayName", getSelectedVoxelFieldArrayName()) );
  setSelectedVoxelEnsembleArrayName( reader->readValue("SelectedVoxelEnsembleArrayName", getSelectedVoxelEnsembleArrayName()) );
  setSelectedSurfaceMeshPointArrayName( reader->readValue("SelectedSurfaceMeshPointArrayName", getSelectedSurfaceMeshPointArrayName()) );
  setSelectedSurfaceMeshFaceArrayName( reader->readValue("SelectedSurfaceMeshFaceArrayName", getSelectedSurfaceMeshFaceArrayName()) );
  setSelectedSurfaceMeshEdgeArrayName( reader->readValue("SelectedSurfaceMeshEdgeArrayName", getSelectedSurfaceMeshEdgeArrayName()) );
  setSelectedSolidMeshPointArrayName( reader->readValue("SelectedSolidMeshPointArrayName", getSelectedSolidMeshPointArrayName()) );
  setSelectedSolidMeshFaceArrayName( reader->readValue("SelectedSolidMeshFaceArrayName", getSelectedSolidMeshFaceArrayName()) );
  setSelectedSolidMeshEdgeArrayName( reader->readValue("SelectedSolidMeshEdgeArrayName", getSelectedSolidMeshEdgeArrayName()) );


  setStrVector( reader->readValue("StrVector", getStrVector() ) );
  reader->closeFilterGroup();
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:35,代码来源:GenericExample.cpp


示例17: setFillColor

Robby::Robby(float x, float y, float width, float height):
sf::RectangleShape(sf::Vector2f(width,height)) {
	setFillColor(sf::Color(0, 0, 0));
	setPosition(x,y);
	setOrigin(width/2,height/2);
	setRotation(90);
}
开发者ID:FlyingGraysons,项目名称:Fido,代码行数:7,代码来源:Robby.cpp


示例18: GK_ASSERT

gkCam2ViewportRay::gkCam2ViewportRay(gkScalar x, gkScalar y, gkScalar rayLength)
{
	gkScene* pScene = gkEngine::getSingleton().getActiveScene();

	GK_ASSERT(pScene);

	gkCamera* pCamera = pScene->getMainCamera();

	GK_ASSERT(pCamera);

	gkVector2 pos(x, y);
	
	gkWindow* pWindow = pScene->getDisplayWindow();
	if (pWindow == 0)
		pWindow = gkWindowSystem::getSingleton().getMainWindow();

	GK_ASSERT(pWindow);

	gkScalar width = pWindow->getWidth();

	gkScalar height = pWindow->getHeight();

	GK_ASSERT(width && height);

	Ogre::Ray ray = pCamera->getCamera()->getCameraToViewportRay(pos.x / width, pos.y / height);

	gkVector3 p0 = ray.getOrigin();

	gkVector3 p1 = p0 + ray.getDirection() * rayLength;

	setOrigin(p0);
	setDirection(p1 - p0);
}
开发者ID:guozanhua,项目名称:github,代码行数:33,代码来源:gkCam2ViewportRay.cpp


示例19: GameObject

BasicEnemy::BasicEnemy(Screen& screen)
    : GameObject(screen)
    , mCooldown(COOLDOWN)
    , mCanSee(false)
{
    mVertices.resize(4);
    getScreen().getGame().getResourceManager().loadSprite(this, 0, "enemyRed1.png", 0, 0);

    mSFX.setBuffer(*getScreen().getGame().getResourceManager().getSoundBuffer("sfx_laser1.ogg"));
    mSFX.setVolume(SFX_VOLUME);

//    mVelocity = sf::Vector2f(-50, -50);

    setOrigin(46, 35);
    setRotation(0);


    boundingPolygon.push_back(sf::Vector2f(10, 10));
    boundingPolygon.push_back(sf::Vector2f(0,  26));
    boundingPolygon.push_back(sf::Vector2f(11, 57));
    boundingPolygon.push_back(sf::Vector2f(81, 57));
    boundingPolygon.push_back(sf::Vector2f(92, 26));
    boundingPolygon.push_back(sf::Vector2f(82, 10));

    mHealthBar = new StatusBar2(getScreen());
}
开发者ID:asalahli,项目名称:Bombardier,代码行数:26,代码来源:BasicEnemy.cpp


示例20: while

void BezierCurve::createCurve(QList<QPointF>& pointList, QList<qreal>& pressureList )
{
    int p = 0;
    int n = pointList.size();
    // generate the Bezier (cubic) curve from the simplified path and mouse pressure
    // first, empty everything
    while (c1.size()>0) c1.removeAt(0);
    while (c2.size()>0) c2.removeAt(0);
    while (vertex.size()>0) vertex.removeAt(0);
    while (selected.size()>0) selected.removeAt(0);
    while (pressure.size()>0) pressure.removeAt(0);

    setOrigin( pointList.at(0) );
    selected.append(false);
    pressure.append(pressureList.at(0));

    for(p=1; p<n; p++)
    {
        c1.append(pointList.at(p));
        c2.append(pointList.at(p));
        vertex.append(pointList.at(p));
        pressure.append(pressureList.at(p));
        selected.append(false);

    }
    smoothCurve();
    //colourNumber = 0;
    feather = 0;
}
开发者ID:qbdp,项目名称:pencil,代码行数:29,代码来源:beziercurve.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setOutputStreamSRI函数代码示例发布时间:2022-05-30
下一篇:
C++ setOrientation函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap