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

C++ setRotation函数代码示例

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

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



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

示例1: ASSERT_LOG

	SceneObjectPtr LinearGradient::createRenderable()
	{
		ASSERT_LOG(color_stops_.size() >= 2, "Must be at least two color stops.");
		//ASSERT_LOG(std::abs(color_stops_.front().length) < FLT_EPSILON, "First stop must be at 0");
		//ASSERT_LOG(std::abs(color_stops_.back().length - 1.0f) < FLT_EPSILON, "Last stop must be at 1");
		// attempt one.
		int number_strips = color_stops_.size() - 1;

		auto gr = std::make_shared<GradientRenderable>();
		gr->setRotation(-angle_, z_axis);
		//auto clip_mask = std::make_shared<SimpleClipShape>();
		//clip_mask->setRotation(angle_, z_axis);
		//gr->setClipSettings(get_stencil_mask_settings(), clip_mask);
		
		std::vector<KRE::vertex_color> vc;
		vc.reserve(6 * number_strips);

		// assume a box size from 0 -> 1, 0 -> 1
		for(int strip = 0; strip < number_strips; ++strip) {
			
			const float vx1 = -0.5f;
			const float vy1 = color_stops_[strip].length - 0.5f;
			const float vx2 = 0.5f;
			const float vy2 = color_stops_[strip + 1].length - 0.5f;

			vc.emplace_back(glm::vec2(vx1, vy1), color_stops_[strip].color.as_u8vec4());
			vc.emplace_back(glm::vec2(vx1, vy2), color_stops_[strip + 1].color.as_u8vec4());
			vc.emplace_back(glm::vec2(vx2, vy2), color_stops_[strip + 1].color.as_u8vec4());

			vc.emplace_back(glm::vec2(vx1, vy1), color_stops_[strip].color.as_u8vec4());
			vc.emplace_back(glm::vec2(vx2, vy2), color_stops_[strip + 1].color.as_u8vec4());
			vc.emplace_back(glm::vec2(vx2, vy1), color_stops_[strip].color.as_u8vec4());
		}
		
		gr->update(&vc);

		return gr;
	}
开发者ID:sweetkristas,项目名称:hex_test,代码行数:38,代码来源:Gradients.cpp


示例2: setRotation

void PowerUp::updateSelf( const double & delta )
{
	mRotationAngle += delta * 100.0f;
	setRotation( QQuaternion::fromAxisAndAngle( 0,1,0, mRotationAngle ) );

	QSharedPointer<Player> player = mLandscape->world()->player();

	float dist = ( player->worldPosition() - worldPosition() ).length();

	if( mRespawning )
	{
		mRespawnCoolDown -= delta;
		if( mRespawnCoolDown < 0.0f )
		{
			mRespawnCoolDown = 0.0f;
			mRespawning = false;
		}
	}
	else
	{
		if( dist <= 2.0f )
		{
			switch( mPowerType )
			{
				case HEALTH:
					player->setLife( qMin( player->life() + 25, 100 ) );
					break;
				case ARMOR:
					player->setArmor( qMin( player->armor() + 40, 100 ) );
					break;
				case WEAPON_LASER:
					player->giveWeapon( QSharedPointer<AWeapon>( new Laser( world() ) ) );
					break;
			}
			respawn();
		}
	}
}
开发者ID:splatterlinge,项目名称:Ununoctium,代码行数:38,代码来源:PowerUp.cpp


示例3: setPosition

void EnPlayer::spawn()
{
    osg::Quat  rotation;
    osg::Vec3f position;

    // check if the level has spawn points
    EnSpawnPoint* p_spwanEntity = static_cast< EnSpawnPoint* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_SPAWNPOINT ) );
    if ( p_spwanEntity )
    {
        if ( !EnSpawnPoint::getNextSpawnPoint( position, rotation ) )
        {
            log_error << "EnPlayer: all spawn points are occupied, taking default position and rotation!" << std::endl;
        }
    }
    else
    {
        position = _attributeContainer._pos;
        rotation = osg::Quat( osg::DegreesToRadians( _attributeContainer._rot ), osg::Vec3f( 0.0f, 0.0f, 1.0f ) );
    }
    // set initial rotation and position
    setPosition( position );
    setRotation( rotation );
}
开发者ID:BackupTheBerlios,项目名称:yag2002-svn,代码行数:23,代码来源:vrc_player.cpp


示例4: acquireTarget

void Samsquamptch::updateCurrent(sf::Time dt, sf::Vector2f target, sf::Vector2f bounds)
{
    acquireTarget(target,bounds);

    m_velocity *= dt.asSeconds()*m_aggressionLevel;

    if(getPosition().y >= m_target.y
            && getPosition().y < m_target.y + m_bounds.y
            && getPosition().x >= m_target.x
            && getPosition().x < m_target.x + m_bounds.y)
    {
        //achieved goal - target acquired
    }
    else
    {
        //work towards goal
        setRotation(toDegree(m_angle) + 90.f);
        move(m_velocity);
        m_rect.setPosition(getPosition());
        m_rect.setRotation(getRotation());
        //std::cout<<"Chasing..."<<std::endl;
    }
}
开发者ID:pushbuttonreceivecode,项目名称:Top-Down-Shooter-Mechanics-Part-2,代码行数:23,代码来源:Samsquamptch.cpp


示例5: setMapUnits

void QgsMapCanvas::readProject( const QDomDocument & doc )
{
  QDomNodeList nodes = doc.elementsByTagName( "mapcanvas" );
  if ( nodes.count() )
  {
    QDomNode node = nodes.item( 0 );

    QgsMapSettings tmpSettings;
    tmpSettings.readXML( node );
    setMapUnits( tmpSettings.mapUnits() );
    setCrsTransformEnabled( tmpSettings.hasCrsTransformEnabled() );
    setDestinationCrs( tmpSettings.destinationCrs() );
    setExtent( tmpSettings.extent() );
    setRotation( tmpSettings.rotation() );
    mSettings.datumTransformStore() = tmpSettings.datumTransformStore();

    clearExtentHistory(); // clear the extent history on project load
  }
  else
  {
    QgsDebugMsg( "Couldn't read mapcanvas information from project" );
  }
}
开发者ID:stevenmizuno,项目名称:QGIS,代码行数:23,代码来源:qgsmapcanvas.cpp


示例6: updateGeometry

void FaceModel::simulate(float deltaTime, bool fullUpdate) {
    updateGeometry();
    Avatar* owningAvatar = static_cast<Avatar*>(_owningHead->_owningAvatar);
    glm::vec3 neckPosition;
    if (!owningAvatar->getSkeletonModel().getNeckPosition(neckPosition)) {
        neckPosition = owningAvatar->getPosition();
    }
    setTranslation(neckPosition);
    glm::quat neckParentRotation;
    if (!owningAvatar->getSkeletonModel().getNeckParentRotationFromDefaultOrientation(neckParentRotation)) {
        neckParentRotation = owningAvatar->getOrientation();
    }
    setRotation(neckParentRotation);
    setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningHead->getScale());
    
    setPupilDilation(_owningHead->getPupilDilation());
    setBlendshapeCoefficients(_owningHead->getBlendshapeCoefficients());
    
    if (isActive()) {
        setOffset(-_geometry->getFBXGeometry().neckPivot);
        Model::simulateInternal(deltaTime);
    }
}
开发者ID:RyanDowne,项目名称:hifi,代码行数:23,代码来源:FaceModel.cpp


示例7: setFlag

void
TrackMoveHandle::registerLowSlot(TrackComponent *trackComponent)
{
    lowSlot_ = trackComponent;

    // Observer //
    //
    lowSlot_->attachObserver(this);

    // Transformation //
    //
    if (!highSlot_) // do not set pos twice
    {
        setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
        setPos(lowSlot_->getGlobalPoint(lowSlot_->getSEnd()));
        setRotation(lowSlot_->getGlobalHeading(lowSlot_->getSEnd()));
        setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
    }

    // Degrees Of Freedom Fries //
    //
    updateDOF();
}
开发者ID:nixz,项目名称:covise,代码行数:23,代码来源:trackmovehandle.cpp


示例8: PrimitiveTextGraphicsItem

TextGraphicsItem::TextGraphicsItem(Text&                           text,
                                   const IF_GraphicsLayerProvider& lp,
                                   QGraphicsItem* parent) noexcept
  : PrimitiveTextGraphicsItem(parent), mText(text), mLayerProvider(lp) {
  setFont(TextGraphicsItem::Font::SansSerif);
  setPosition(mText.getPosition());
  setRotation(mText.getRotation());
  setText(mText.getText());
  setHeight(mText.getHeight());
  setAlignment(mText.getAlign());
  setLayer(mLayerProvider.getLayer(*mText.getLayerName()));
  setFlag(QGraphicsItem::ItemIsSelectable, true);
  setZValue(5);

  // add origin cross
  mOriginCrossGraphicsItem.reset(new OriginCrossGraphicsItem(this));
  mOriginCrossGraphicsItem->setSize(UnsignedLength(1000000));
  mOriginCrossGraphicsItem->setLayer(
      mLayerProvider.getLayer(GraphicsLayer::sSchematicReferences));  // TODO

  // register to the text to get attribute updates
  mText.registerObserver(*this);
}
开发者ID:LibrePCB,项目名称:LibrePCB,代码行数:23,代码来源:textgraphicsitem.cpp


示例9: sprintf

void RenderTextureSave::saveImage(cocos2d::Ref *sender)
{
    static int counter = 0;

    char png[20];
    sprintf(png, "image-%d.png", counter);
    
    auto callback = [&](RenderTexture* rt, const std::string& path)
    {
        auto sprite = Sprite::create(path);
        addChild(sprite);
        sprite->setScale(0.3f);
        sprite->setPosition(Vec2(40, 40));
        sprite->setRotation(counter * 3);
    };
    
    _target->saveToFile(png, Image::Format::PNG, true, callback);
    //Add this function to avoid crash if we switch to a new scene.
    Director::getInstance()->getRenderer()->render();
    CCLOG("Image saved %s", png);

    counter++;
}
开发者ID:SPUDevelopers,项目名称:Naturalize,代码行数:23,代码来源:RenderTextureTest.cpp


示例10: switch

void GameScene::addEnemyTankBullet(Node* node)
{
    auto* enemyTankGun = (EnemyTankGun*)node;
    auto etankbullet = Sprite::create(enemyName[enemyTankGun->getEnemyTankIndex()-1].c_str());
    switch (enemyTankGun->getEnemyTankIndex()) {
        case 1:
        case 2:
            enemyBullet->addChild(etankbullet);
            break;
        case 3:
        case 4:
            enemyBazooka->addChild(etankbullet);
            break;
        default:
            break;
    }
    
    float enemyTankGunRotation = enemyTankGun->getRotation();
    etankbullet->setRotation(enemyTankGunRotation);
    enemyTankGunRotation = enemyTankGunRotation*pi/180.0f;
    
    Vec2 enemyTankGunPos = enemyTankGun->getPosition();
    enemyTankGunPos = enemyTankGun->convertToWorldSpaceAR(enemyTankGunPos);
    etankbullet->setPosition(enemyTankGunPos.x+40*sin(enemyTankGunRotation),enemyTankGunPos.y+40*cos(enemyTankGunRotation));
    
    auto moveAct = MoveTo::create(8, Vec2(enemyTankGunPos.x+1600*sin(enemyTankGunRotation),enemyTankGunPos.y+1200*cos(enemyTankGunRotation)));

    if (enemyTankGun->getEnemyTankIndex() < 3) {
        auto funcAct = CallFuncN::create(CC_CALLBACK_1(GameScene::removeEnemyTankBullet, this));
        etankbullet->runAction(Sequence::create(moveAct,funcAct, NULL));
    }
    else
    {
        auto funcAct = CallFuncN::create(CC_CALLBACK_1(GameScene::removeEnemyTankBazooka, this));
        etankbullet->runAction(Sequence::create(moveAct,funcAct, NULL));
    }
}
开发者ID:wuwenjuan,项目名称:Tank1,代码行数:37,代码来源:GameScene.cpp


示例11: lineToCenter

void obj::advance(int step)
{
    if (!step)
        return;
    // Don't move too far away
    QLineF lineToCenter(QPointF(0, 0), mapFromScene(0, 0));
    if (lineToCenter.length() > 150) {
        qreal angleToCenter = ::acos(lineToCenter.dx() / lineToCenter.length());
        if (lineToCenter.dy() < 0)
            angleToCenter = TwoPi - angleToCenter;
        angleToCenter = normalizeAngle((Pi - angleToCenter) + Pi / 2);

        if (angleToCenter < Pi && angleToCenter > Pi / 4) {
            // Rotate left
            angle += (angle < -Pi / 2) ? 0.25 : -0.25;
        } else if (angleToCenter >= Pi && angleToCenter < (Pi + Pi / 2 + Pi / 4)) {
            // Rotate right
            angle += (angle < Pi / 2) ? 0.25 : -0.25;
        }
    } else if (::sin(angle) < 0) {
        angle += 0.25;
    } else if (::sin(angle) > 0) {
        angle -= 0.25;
    }

    if (qrand() % 1)
        angle += (qrand() % 100) / 500.0;
    else
        angle -= (qrand() % 100) / 500.0;

    speed += (-50 + qrand() % 100) / 100.0;

    qreal dx = ::sin(angle) * 10;

    setRotation(rotation() + dx);
    setPos(mapToParent(0, -(3 + sin(speed) * 3)));
}
开发者ID:Batyan,项目名称:Eliminator,代码行数:37,代码来源:obj.cpp


示例12: setEnabled

void Widget::copyProperties(Widget *widget)
{
    setEnabled(widget->isEnabled());
    setVisible(widget->isVisible());
    setBright(widget->isBright());
    setTouchEnabled(widget->isTouchEnabled());
    _touchPassedEnabled = false;
    setLocalZOrder(widget->getLocalZOrder());
    setTag(widget->getTag());
    setName(widget->getName());
    setActionTag(widget->getActionTag());
    _ignoreSize = widget->_ignoreSize;
    _size = widget->_size;
    _customSize = widget->_customSize;
    copySpecialProperties(widget);
    _sizeType = widget->getSizeType();
    _sizePercent = widget->_sizePercent;
    _positionType = widget->_positionType;
    _positionPercent = widget->_positionPercent;
    setPosition(widget->getPosition());
    setAnchorPoint(widget->getAnchorPoint());
    setScaleX(widget->getScaleX());
    setScaleY(widget->getScaleY());
    setRotation(widget->getRotation());
    setRotationSkewX(widget->getRotationSkewX());
    setRotationSkewY(widget->getRotationSkewY());
    setFlippedX(widget->isFlippedX());
    setFlippedY(widget->isFlippedY());
    setColor(widget->getColor());
    setOpacity(widget->getOpacity());
    Map<int, LayoutParameter*>& layoutParameterDic = widget->_layoutParameterDictionary;
    for (auto iter = layoutParameterDic.begin(); iter != layoutParameterDic.end(); ++iter)
    {
        setLayoutParameter(iter->second->clone());
    }
    onSizeChanged();
}
开发者ID:1007650105,项目名称:RockChipmunk2D,代码行数:37,代码来源:UIWidget.cpp


示例13: setEnable

void	PhysShape::unpack(BitStream* stream)
{
    bool enabled = stream->readFlag();
    if (isEnabled()!=enabled)
        setEnable(enabled);
    if (enabled)
    {
        bool active = stream->readFlag();
        bool toInactive = false;
        if (!active)
        {
            toInactive = stream->readFlag();
            if (!toInactive)
                return;
        }

        if (!isActive())
            setActive(true);
        QuatF q;
        VectorF vec;
        mathRead(*stream, &vec);
        setPosition(vec);
        mathRead(*stream, &q);
        setRotation(q);
        mathRead(*stream, &vec);
        setForce(vec);
        mathRead(*stream, &vec);
        setTorque(vec);
        mathRead(*stream, &vec);
        setLinVelocity(vec);
        mathRead(*stream, &vec);
        setAngVelocity(vec);

        if (toInactive)
            setActive(false);
    }
}
开发者ID:Bloodknight,项目名称:GMK,代码行数:37,代码来源:physShape.cpp


示例14: getSize

/// Creds to http://chess.eecs.berkeley.edu/eecs149/documentation/differentialDrive.pdf
double Robby::go(int motLeft,int motRight,double speed,double deltaTime) {
	double mLeft = -(((double)motLeft)/200)*speed;
	double mRight = -(((double)motRight)/200)*speed;

	double xprime,yprime,rprime;
	double length = getSize().x;

	double rX = getPosition().x;
	double rY = getPosition().y;
	double rTheta = getRotation()*0.0174532925;
	double omega = (mRight-mLeft)/length;

	if (mLeft == mRight) {
		xprime = rX + mLeft*cos(rTheta)*deltaTime;
		yprime = rY + mLeft*sin(rTheta)*deltaTime;
		rprime = rTheta;
	} else {
		double radius = (length/2)*(mLeft+mRight)/(mRight-mLeft);

		double iccX = rX - radius*sin(rTheta);
		double iccY = rY + radius*cos(rTheta);

		xprime = iccX + (cos(omega*deltaTime)*(rX-iccX)+
						 -sin(omega*deltaTime)*(rY-iccY));
		yprime = iccY + (sin(omega*deltaTime)*(rX-iccX)+
						 cos(omega*deltaTime)*(rY-iccY));
		rprime = rTheta + omega*deltaTime;
	}

	setPosition(xprime,yprime);
	setRotation(rprime*57.2957795);

	m1Last = motLeft;
	m2Last = motRight;

	return omega*10000;
}
开发者ID:FlyingGraysons,项目名称:Fido,代码行数:38,代码来源:Robby.cpp


示例15: setTag

bool RoleEmemyBig::init() {
	//////////////////////////////
	// 1. super init first
	if (!Sprite::initWithSpriteFrameName("hero1.png")) {
		return false;
	}

	setTag(TAG_ENEMY_PLANE);
	auto body = PhysicsBody::createBox(getContentSize());
	body->setGroup(PHYSICAL_BODY_ENEMY_GROUP);
	body->setCategoryBitmask(PHYSICAL_BODY_ENEMY_BITMASK_CATEGORY);
	body->setContactTestBitmask(PHYSICAL_BODY_ENEMY_BITMASK_CONTACT_TEST);
	body->setCollisionBitmask(PHYSICAL_BODY_ENEMY_BITMASK_COLLISION);
	setPhysicsBody(body);
	setRotation(-90);

	Point endPos = Point(0, 100);
	runAction(
			Sequence::create(MoveTo::create(3.0, endPos),
					CallFunc::create(
							CC_CALLBACK_0(RoleEmemyBig::doRemoveSelf, this, this)),
					NULL));
	return true;
}
开发者ID:sangdev90,项目名称:CollisionDetection,代码行数:24,代码来源:RoleEmemyBig.cpp


示例16: setImageSize

    void USBCamera::setup(kerberos::StringMap &settings)
    {
        int width = std::atoi(settings.at("captures.USBCamera.frameWidth").c_str());
        int height = std::atoi(settings.at("captures.USBCamera.frameHeight").c_str());
        int deviceNumber = std::atoi(settings.at("captures.USBCamera.deviceNumber").c_str());
        int angle = std::atoi(settings.at("captures.USBCamera.angle").c_str());
        int delay = std::atoi(settings.at("captures.USBCamera.delay").c_str());
        std::string fourcc = settings.at("captures.USBCamera.fourcc");

        // Initialize executor (update the usb camera at specific times).
        tryToUpdateCapture.setAction(this, &USBCamera::update);
        tryToUpdateCapture.setInterval("thrice in 10 functions calls");

        // Save width and height in settings
        Capture::setup(settings, width, height, angle);
        setImageSize(width, height);
        setRotation(angle);
        setDelay(delay);
        setDeviceNumber(deviceNumber);
        setFourcc(fourcc);

        // Initialize USB Camera
        open();
    }
开发者ID:kerberos-io,项目名称:machinery,代码行数:24,代码来源:USBCamera.cpp


示例17: ShapeAnnotation

/*!
 * \brief BitmapAnnotation::BitmapAnnotation
 * Used by OMSimulator FMU ModelWidget\n
 * We always make this shape as inherited shape since its not allowed to be modified.
 * \param classFileName
 * \param pGraphicsView
 */
BitmapAnnotation::BitmapAnnotation(QString classFileName, GraphicsView *pGraphicsView)
  : ShapeAnnotation(true, pGraphicsView, 0)
{
  mpComponent = 0;
  mClassFileName = classFileName;
  // set the default values
  GraphicItem::setDefaults();
  ShapeAnnotation::setDefaults();
  // set users default value by reading the settings file.
  ShapeAnnotation::setUserDefaults();
  QList<QPointF> extents;
  extents << QPointF(-100, -100) << QPointF(100, 100);
  setExtents(extents);
  setPos(mOrigin);
  setRotation(mRotation);
  setShapeFlags(true);

  setFileName(mClassFileName);
  if (!mFileName.isEmpty() && QFile::exists(mFileName)) {
    mImage.load(mFileName);
  } else {
    mImage = QImage(":/Resources/icons/bitmap-shape.svg");
  }
}
开发者ID:OpenModelica,项目名称:OMEdit,代码行数:31,代码来源:BitmapAnnotation.cpp


示例18: setRotation

	//----------------------------------------------------------------------
	void SpaceGameActor::update( double deltaTime )
	{
		Actor::update( deltaTime );
		m_wasSpawnedLastFrame = false;

		float dt = static_cast< float >( deltaTime );

		setRotation( mat3f::createMatrixFromQuaternion( quatf::makeQuaternionFromAxisAngle( MathFuncs<float>::degreesToRadians( m_rotation ), vec3f( 0.0f, 0.0f, 1.0f ) ) ) );

		//vec3f impulseInDirOfShip = transformVector( vec3f( 0.0f, IMPULSE_POWER, 0.0f ), getLocalRotation() );
		//impulseInDirOfShip *= m_forwardImpulse;
		//
		//m_vel += vec2f( impulseInDirOfShip.x, impulseInDirOfShip.y );
		m_frames[ m_currentFrame ].position += m_vel*dt;	
		m_vel -= m_vel * m_drag * dt;
		//m_forwardImpulse = 0.0f;

		m_frames[ m_currentFrame ].position.x = (float)MathFuncs<int>::wrap( (int)m_frames[ m_currentFrame ].position.x, 0, SCREEN_WIDTH );
		m_frames[ m_currentFrame ].position.y = (float)MathFuncs<int>::wrap( (int)m_frames[ m_currentFrame ].position.y, 0, SCREEN_HEIGHT );

		vec3f tempDir = transformVector( vec3f( 0.0f, 1.0f, 0.0f ), getLocalRotation() );
		tempDir.normalize();
		m_dir = vec2f( tempDir.x, tempDir.y );
	}
开发者ID:hulcyp,项目名称:GuildhallProjects,代码行数:25,代码来源:SpaceGameActor.cpp


示例19: setStatus

void ITank::reborn()
{
    setStatus(NORMAL);
    _mini_map_tank->setVisible(true);

    _frame_animation_dead = 0;
    _frame_animation_level_up = 39;

    //se le asigna el ángulo inicial
    setRotation(0);
    setTurretRotation(0);

    setCurrentLive(_max_live, this, false);
    setCurrentMana(_max_mana, false);

    //se le asignan los estados del movimiento
    _move_forward = false;
    _move_backward = false;

    //se le asignan los estados de la rotación
    _rotate_left = false;
    _rotate_right = false;

    //indica que todos las habilidades están desactivadas
    setHurledSkill(1,false);
    setHurledSkill(2,false);
    setHurledSkill(3,false);

    _info_bar->setLiveBarData(_current_live, _max_live);
    _info_bar->setManaBarData(_current_mana, _max_mana);
    _info_bar->show();

    _last_tank_cause_damage = NULL;

    emit notifyReborn();
}
开发者ID:patadejaguar,项目名称:GuerraDeTanques,代码行数:36,代码来源:itank.cpp


示例20: updateGeometry

void FaceModel::simulate(float deltaTime, bool fullUpdate) {
    updateGeometry();

    Avatar* owningAvatar = static_cast<Avatar*>(_owningHead->_owningAvatar);
    glm::vec3 neckPosition;
    if (!owningAvatar->getSkeletonModel().getNeckPosition(neckPosition)) {
        neckPosition = owningAvatar->getPosition();
    }
    setTranslation(neckPosition);
    glm::quat neckParentRotation = owningAvatar->getOrientation();
    setRotation(neckParentRotation);
    setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningHead->getScale());

    setPupilDilation(_owningHead->getPupilDilation());
    setBlendshapeCoefficients(_owningHead->getBlendshapeCoefficients());

    // FIXME - this is very expensive, we shouldn't do it if we don't have to
    //invalidCalculatedMeshBoxes();

    if (isActive()) {
        setOffset(-_geometry->getFBXGeometry().neckPivot);
        Model::simulateInternal(deltaTime);
    }
}
开发者ID:JamesLinus,项目名称:hifi,代码行数:24,代码来源:FaceModel.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setRowCount函数代码示例发布时间:2022-05-30
下一篇:
C++ setRootIsDecorated函数代码示例发布时间: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