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


C++ Orientation类代码示例

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


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

示例1: GetString

ZString GetString(int indent, const Orientation& orient)
{
    return
          "Orientation("
        + GetString(indent, orient.GetUp()) + ", "
        + GetString(indent, orient.GetForward()) + ")";
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:7,代码来源:value.cpp

示例2: updateCard

void ManaZoneRenderer::updateCard(CardModel* model, Card* card, int pos, int size, int hovercard)
{
	Orientation o;
	o.pos = glm::vec3(mPos.x + mWidth - CONST_CARDSEPERATION_HORI*pos - CONST_CARDSEPERATION_HORI / 2, mPos.y, mPos.z + mHeight / 2);

	if (card->mIsTapped)
		o.dir = glm::vec3(1, 0, 0);
	else
		o.dir = glm::vec3(0, 0, -1);

	if (hovercard == card->mUniqueId)
	{
		o.pos = glm::vec3(gHighlightX, gHighlightY, gHighlightZ);
		o.dir = glm::vec3(0, 0, 1);
	}

	o.up = glm::vec3(0, 1, 0);
	o.calculateQuat();

	if (hovercard == card->mUniqueId)
	{
		model->setHoverMovement(o, 1000);
	}
	else
	{
		model->setMovement(o, 1000);
	}
}
开发者ID:rianneogi,项目名称:KaijudoDuel,代码行数:28,代码来源:ManaZoneRenderer.cpp

示例3: o

void    CmodelIGC::Update(Time now)
{
    // Model motion now handled by CclusterIGC
    float   dt = (now - m_lastUpdate);
    m_lastUpdate = now;

    if (m_visibleF)
    {
        //
        // set the thing's rotation
        //
        if (m_rotation.angle() != 0.0f)
        {
            if (m_decalF) {
                m_pThingSite->Spin(m_rotation.angle() * dt);
            }
            else
            {
                Orientation o (m_pHitTest->GetOrientation());
                o.PostRotate(m_rotation.axis(), m_rotation.angle() * dt);
                o.Renormalize();

                m_pHitTest->SetOrientation(o);
                m_pThingSite->SetOrientation(o);
            }
        }
    }
}
开发者ID:borgified,项目名称:Allegiance,代码行数:28,代码来源:modelIGC.cpp

示例4: SetShadowSize

bool PoolTeeBox::Load(File* pf)
{
  // Get vertex.
  if (!pf->GetFloat(&m_teeVertex.x)  ||
      !pf->GetFloat(&m_teeVertex.y)  ||
      !pf->GetFloat(&m_teeVertex.z))
  {
    pf->ReportError("Failed to load tee box vertex.");
    return false;
  }

  m_bs.SetCentre(m_teeVertex);
  m_bs.SetRadius(TEE_BOX_DECAL_SIZE); 

  SetShadowSize(TEE_BOX_DECAL_SIZE); // TODO TEMP TEST
  CreateShadow();

  Orientation o;
  o.SetVertex(m_teeVertex);
  SetOrientation(o);

  TEE_BOX_DECAL_SIZE = Engine::Instance()->GetConfigFloat("golf_tee_size");

  return true;
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:25,代码来源:PoolTeeBox.cpp

示例5: fromev

    Matrix3e fromev(const energy xx,const energy yy,const energy zz,const Orientation& o) const {
        cout << "Converting " << o.ToString() << endl;
        Matrix3 intMatrix=o.GetAsMatrix();

        cout << "Rotation Matrix determinate:" << intMatrix.det().si << endl;;

	const static energy zero=0.0*Joules;
	Matrix3e in_eigen_frame(xx,  zero,zero, 
				zero,yy  ,zero, 
				zero,zero,zz   );
        //Undo the eigensystem decomposition
	Matrix3e result=intMatrix*in_eigen_frame*intMatrix.Inverted();
        return result;
    }
开发者ID:airvine,项目名称:spinachgui,代码行数:14,代码来源:spinsys.cpp

示例6: Collision

bool ThirdPersonCameraBase::Collision(const Orientation& before, const Orientation& after)
{
  const BoundingSphere& bs = *GetBoundingSphere();

  BoundingSphere bsBefore(before.GetVertex(), bs.GetRadius());
  BoundingSphere bsAfter(after.GetVertex(), bs.GetRadius());

  const WallPoly* pWp = m_heightServer.Intersects(bsBefore, bsAfter);
  if (pWp)
  {
    return true; // We do collide with something
  }
  return false; // No collision
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:14,代码来源:ThirdPersonCameraBase.cpp

示例7: TEST

TEST (Orientation, JSON) {
	VLOG(1) << "===Orientation JSON Test===";
	Orientation u { 20.0, -15.0, 60.0 };
	Orientation v;
	Value orient;
	
	orient = u.pack();
	VLOG_IF(orient.IsObject(), 2) << "Output JSON: " << orient;
	v.parse(orient);
	VLOG_IF(v.pack().IsObject(), 2) << "Parsed JSON: " << orient;
	EXPECT_TRUE(toleranceEquals(u.pitch, v.pitch, TOL));
	EXPECT_TRUE(toleranceEquals(u.roll, v.roll, TOL));
	EXPECT_TRUE(toleranceEquals(u.heading, v.heading, TOL));
}
开发者ID:JeremyRuhland,项目名称:hackerboat,代码行数:14,代码来源:orientation_test.cpp

示例8: main

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    OrientationView view;

    Orientation orientation;
    orientation.start();

    QObject::connect(&orientation, SIGNAL(orientation(qreal,qreal,qreal,qreal)),
                     &view, SLOT(orientation(qreal,qreal,qreal,qreal)));

    view.show();

    return app.exec();
}
开发者ID:benniven,项目名称:psmoveapi,代码行数:15,代码来源:main.cpp

示例9: result

    Position Position::operator*(const Orientation& orientation) const
    {
      Position result(*this) ;
      result.m_value = orientation.getQuaternion()*result.m_value ;

      return result ;
    }
开发者ID:BackupTheBerlios,项目名称:projet-univers-svn,代码行数:7,代码来源:position.cpp

示例10: result

 Force Force::operator*(const Orientation& i_orientation) const
 {
   Force result(*this) ;
   result.m_value = i_orientation.getQuaternion()* result.m_value ;
   return result ;
   
 }
开发者ID:BackupTheBerlios,项目名称:projet-univers-svn,代码行数:7,代码来源:force.cpp

示例11: target

int MovementComponent::turnTowards(float targetPosX, float targetPosY, float targetPosZ, float speed, bool putInQueue, const char* animName)
{	
	Vec3f target(targetPosX, targetPosY, targetPosZ);

	//if we don't want a queue, we must erase all existent movement nodes
	if(!putInQueue)
		clear();
	if(speed < 0)
		speed = m_speed; //use agent default

	//orient towards the target
	Orientation* o = new Orientation( m_eID, target, speed, false );
	o->setAnimation( (animName == 0) ? m_orientAnimName : animName );
	m_movementNodes.push_back( o );

	return o->getID();
}
开发者ID:dreamsxin,项目名称:nawia,代码行数:17,代码来源:MovementComponent.cpp

示例12: GetCamera

void EngineStatePoolShowShot::Update()
{
  if (m_time < m_maxTime)
  {
    // POOL_ONLINE:
    // DON'T call EngineStatePoolBase::Update();
    // If the timer expires, the shot will be started, but we DON'T want to update
    //  the shot in this state, for consistency with the other (user-controlled) client.

    // If a moving ball is outside of the view frustum, pull the camera back.
    ((PoolCamera*)s_pCamera.GetPtr())->SetPoolPullBackRequired(s_movingBallNotInFrustum);
    s_movingBallNotInFrustum = false;

    GetCamera()->Update();

    if (!IsBirdsEye())
    {
      // Update the camera so it is always above the ball
      float camY = GetCamera()->GetOrientation()->GetY();
      float ballY = GetBall()->GetOrientation()->GetY();
      ballY += 1.0f; // TODO CONFIG
      if (camY < ballY)
      {
        Orientation o = *(GetCamera()->GetOrientation());
        o.SetY(ballY);
        GetCamera()->SetOrientation(o);
      }
    }
    // May call TimerExpired.....
    EngineState::Update();

    if (m_time < m_maxTime)
    {
      Assert(m_pLevel.GetPtr());
////      GetEngine()->GetDayNightSky()->Update();
      m_pLevel->GetScene()->Update();
      UpdateGameObjects();
    }
  }
  else
  {
    // DON'T update game objects
    EngineState::Update();
  }
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:45,代码来源:EngineStatePoolShowShot.cpp

示例13: difference

	Orientation difference( Orientation other ) const{
		auto a = this->normalized();
		auto b = other.normalized();
		
		return { int8_t(b.rotation-a.rotation)
			,	a.flip_ver != b.flip_ver
			,	a.flip_hor != b.flip_hor
			};
	}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例14: run

void Menu::run()
{
  Navigator<ContinuousRobotDriver> navigator;
  Orientation* orientation = Orientation::getInstance();

  gUserInterface.waitForHand();
  startMelody();

  enc_left_front_write(0);
  enc_right_front_write(0);
  enc_left_back_write(0);
  enc_right_back_write(0);
  orientation->resetHeading();

  navigator.findBox(PersistantStorage::getTargetXLocation(),
                    PersistantStorage::getTargetYLocation());
  searchFinishMelody();
  navigator.findBox(0, 0);
  stopMelody();
}
开发者ID:Pitt-RAS,项目名称:micromouse,代码行数:20,代码来源:Menu.cpp

示例15: OrientViewport

static SVGImageContext
OrientViewport(const SVGImageContext& aOldContext,
               const Orientation& aOrientation)
{
  CSSIntSize viewportSize(aOldContext.GetViewportSize());
  if (aOrientation.SwapsWidthAndHeight()) {
    swap(viewportSize.width, viewportSize.height);
  }
  return SVGImageContext(viewportSize,
                         aOldContext.GetPreserveAspectRatio());
}
开发者ID:paulmadore,项目名称:luckyde,代码行数:11,代码来源:OrientedImage.cpp


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