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


C++ IVideoDriver::setTransform方法代码示例

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


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

示例1: sq_dorender

 void sq_dorender() const
 {
     vd->setMaterial(mat);
     vd->setTransform(ETS_WORLD, core::IdentityMatrix);
     vd->setTransform(ETS_VIEW, core::IdentityMatrix);
     vd->setTransform(ETS_PROJECTION, core::IdentityMatrix);
     vd->drawVertexPrimitiveList(vertices, 4, indices, 2, EVT_STANDARD,
                     scene::EPT_TRIANGLE_STRIP);
 }
开发者ID:Berulacks,项目名称:stk-code,代码行数:9,代码来源:screenquad.hpp

示例2: render

void RTSCamera::render()
{
   IVideoDriver* driver = SceneManager->getVideoDriver();
   if ( driver)
   {
        driver->setTransform(video::ETS_PROJECTION, ViewArea.getTransform ( video::ETS_PROJECTION) );
		driver->setTransform(video::ETS_VIEW, ViewArea.getTransform ( video::ETS_VIEW) );
   }
}
开发者ID:bpetar,项目名称:leonline,代码行数:9,代码来源:RTSCamera.cpp

示例3: render

// ----------------------------------------------------------------------------
void Terrain::render()
{
    if (!m_visible) return;

    IVideoDriver* driver = SceneManager->getVideoDriver();

    driver->setMaterial(m_material);
    driver->setTransform(video::ETS_WORLD, IdentityMatrix);

    driver->drawVertexPrimitiveList(&m_mesh.vertices[0], m_mesh.vertex_count,
                                    &m_mesh.indices[0], m_mesh.quad_count * 2,
                                    video::EVT_2TCOORDS, EPT_TRIANGLES,
                                    video::EIT_16BIT);

    if (m_highlight_mesh.vertices && m_highlight_visible)
    {
        driver->setMaterial(m_highlight_material);
        driver->drawVertexPrimitiveList(&m_highlight_mesh.vertices[0],
                                         m_highlight_mesh.vertex_count,
                                         &m_highlight_mesh.indices[0],
                                         m_highlight_mesh.quad_count * 2,
                                         video::EVT_2TCOORDS, EPT_TRIANGLES,
                                         video::EIT_16BIT);
    }

} // render
开发者ID:Boyquotes,项目名称:stk-editor,代码行数:27,代码来源:terrain.cpp

示例4: render

void Sprite::render()
{
    IVideoDriver* driver = SceneManager->getVideoDriver();
    driver->setMaterial(Material);
    driver->setTransform(ETS_WORLD, AbsoluteTransformation);
    driver->drawIndexedTriangleList(&Vertices[0], 4, &Indices[0], 4);
}
开发者ID:blaketrahan,项目名称:coquelicot,代码行数:7,代码来源:sprite.cpp

示例5: render

	//! render
	void CLightSceneNode::render()
	{
		IVideoDriver* driver = SceneManager->getVideoDriver();
		if (!driver)
			return;

		if (DebugDataVisible & EDS_BBOX)
		{
			driver->setTransform(ETS_WORLD, AbsoluteTransformation);
			SMaterial m;
			m.Lighting = false;
			driver->setMaterial(m);

			switch (LightData.Type)
			{
			case ELT_POINT:
			case ELT_SPOT:
				driver->draw3DBox(BBox, LightData.DiffuseColor);
				break;

			case ELT_DIRECTIONAL:
				driver->draw3DLine(Vector3(0.f, 0.f, 0.f),
					LightData.Direction * LightData.Radius,
					LightData.DiffuseColor);
				break;
			default:
				break;
			}
		}

		DriverLightIndex = driver->addDynamicLight(LightData);
		setVisible(LightIsOn);
	}
开发者ID:zxycode007,项目名称:Sapphire,代码行数:34,代码来源:SapphireCLightSceneNode.cpp

示例6: render

	virtual void render()
	{
		IVideoDriver* driver = SceneManager->getVideoDriver();

		driver->setMaterial(Material);
		driver->setTransform(ETS_WORLD, AbsoluteTransformation);
		driver->drawIndexedTriangleList(VertexBuffer, IndexBuffer, Descriptor, 4);
	}
开发者ID:fdejaeger,项目名称:Irrlicht,代码行数:8,代码来源:main.cpp

示例7: render

void DecalSceneNode::render()
{
u16 indices[] = { 0,1,2, 0,2,3};
IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setMaterial(Material);
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 2);
}
开发者ID:tecan,项目名称:IrrlichtDemos,代码行数:8,代码来源:decalscenenode.cpp

示例8: render

 virtual void render()
  { 
      u16 indices[] = { 0,1,3, 3,1,2, 1,0,2, 2,0,3 };
      IVideoDriver* driver = SceneManager->getVideoDriver();
      driver->setMaterial(Material);
      driver->setTransform(ETS_WORLD, AbsoluteTransformation);
      driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4);
  }
开发者ID:tecan,项目名称:IrrlichtDemos,代码行数:8,代码来源:hybridVideoTexture.cpp

示例9: render

	void CSampleSceneNode::render()
	{
		u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 };
		IVideoDriver* driver = SceneManager->getVideoDriver();

		driver->setMaterial(Material);
		driver->setTransform(ETS_WORLD, AbsoluteTransformation);
		driver->drawVertexPrimitiveList(&Vertices[0], 4, &indices[0], 4, EVT_STANDARD, EPT_TRIANGLES, EIT_16BIT);
	}
开发者ID:leonmiura,项目名称:refactirr,代码行数:9,代码来源:CSampleSceneNode.cpp

示例10: OnReload

void WorldState::OnReload(GameGraph* game)
{
  IVideoDriver* driver = game->GetVideoDriver();
  ResourceManager* resourceManager = game->GetResourceManager();
  ISceneManager* sceneManager = game->GetSceneManager();

  if (!heroSet->RegisterTextures(driver, resourceManager))
  {
    LOGE("Unable to register heros textures on reload for world.");
  }

  if (!monsterSet->RegisterTextures(driver, resourceManager))
  {
    LOGE("Unable to register monster textures on reload for world.");
  }

  if (tileSet->RegisterTileTextures(driver, resourceManager))
  {
    coordinateTranslator = currentMap->GetCoordinateTranslator();
    driver->setTransform(ETS_WORLD, matrix4());
    driver->setTransform(ETS_VIEW, matrix4());
    //Build game layer and hard code wih map
    if (NULL != currentMap)
    {
      LOGI("Map:\nDimensions(%d, %d)\nTextureName: %s", currentMap->GetMapDimensions().Width, currentMap->GetMapDimensions().Height, currentMap->GetTextureFilename().c_str());
      GameLayer* gameLayer = new GameLayer(currentMap,
          game->GetResourceManager(),
          game->GetSceneManager()->getRootSceneNode(), game->GetSceneManager(),
          1234);
    }
  }
  else
  {
    LOGE("Unable to register tile textures on reload for world.");
  }
}
开发者ID:rmaloney77,项目名称:destroy-the-core,代码行数:36,代码来源:WorldState.cpp

示例11: render

//! does nothing.
void CGameParticleContainerSceneNode::render()
{
	IVideoDriver *driver = getIView()->getDriver();

	#ifdef GSEDITOR
	CGameObject::EObjectState state = m_owner->getObjectState();
	
	// draw bbox on select
	if (
			state == CGameObject::Move ||
			state == CGameObject::Review		
		)
		setDebugDataVisible( EDS_BBOX );
	else
		setDebugDataVisible( 0 );

	// call object draw
	m_owner->drawObject();

#endif
	
	if ( DebugDataVisible & scene::EDS_BBOX )
	{		
		driver->setTransform(video::ETS_WORLD, getAbsoluteTransformation() );
		video::SMaterial deb_m;
		deb_m.Lighting = false;
		driver->setMaterial(deb_m);
		
		driver->draw3DBox( Box, video::SColor(255,255,255,255));
	}

#ifdef GSEDITOR	
	// draw move
	if ( 
			state == CGameObject::Move || 
			state == CGameObject::Rotation ||
			state == CGameObject::Scale
		)
		m_owner->drawFrontUpLeftVector();	
	
	if ( state == CGameObject::Rotation )
		m_owner->drawCircleAroundObject();	
#endif

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

示例12: render

//! does nothing.
void CGameContainerSceneNode::render()
{
	if ( m_owner == NULL )
		return;

	IVideoDriver *driver = getIView()->getDriver();

	if ( DebugDataVisible & scene::EDS_BBOX )
	{
		driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
		video::SMaterial deb_m;
		deb_m.Lighting = false;
		driver->setMaterial(deb_m);

		core::aabbox3d<f32> tbox = Box;
		getAbsoluteTransformation().transformBoxEx(tbox);

		driver->draw3DBox( tbox, video::SColor(255,255,0,255));
	}
}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:21,代码来源:CGameContainerSceneNode.cpp

示例13: drawObject

// drawObject	
void CWayPoint::drawObject()
{
	if ( m_visible && m_next )
	{
		IVideoDriver *driver = getIView()->getDriver();

		// set material
		SMaterial debug_mat;	
		debug_mat.Lighting = false;
		debug_mat.AntiAliasing=0;
		driver->setMaterial(debug_mat);

		// reset transform
		core::matrix4 mat;
		mat.makeIdentity();
		driver->setTransform(video::ETS_WORLD, mat);

		// draw up
		driver->draw3DLine( m_position, m_next->getPosition(), SColor(255, 0, 255, 0) );
	}
}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:22,代码来源:CWayPoint.cpp

示例14: render

void GrassNode::render()
{
    IVideoDriver* driver = SceneManager->getVideoDriver();
    driver->setMaterial(Material);
    driver->setTransform(ETS_WORLD, AbsoluteTransformation);
    float Z = -5;
    for (int i = 0; i < particle.size(); i++)
    {

        Vertices[0].Pos = vector3df(particle[i]->pos.X + -fx, particle[i]->pos.Y + -fy,Z);//, 0,0,0,SColor(255,255,255,255),0,1);
        Vertices[1].Pos = vector3df(particle[i]->pos.X +  fx, particle[i]->pos.Y + -fy,Z);//, 0,0,0,SColor(255,255,255,255),1,1);
        Vertices[2].Pos = vector3df(particle[i]->pos.X +  fx, particle[i]->pos.Y +  fy,Z);//, 0,0,0,SColor(255,255,255,255),1,0);
        Vertices[3].Pos = vector3df(particle[i]->pos.X + -fx, particle[i]->pos.Y +  fy,Z);//, 0,0,0,SColor(255,255,255,255),0,0);
        if (particle[i]->dir <= 0) {
            float x = (particle[i]->crntFrm % stepww)*fWidth;
            float y = (particle[i]->crntFrm / stepww)*fHeight;
            Vertices[0].TCoords.X = x;
            Vertices[0].TCoords.Y = y+fHeight;
            Vertices[1].TCoords.X = x+fWidth;
            Vertices[1].TCoords.Y = y+fHeight;
            Vertices[2].TCoords.X = x+fWidth;
            Vertices[2].TCoords.Y = y;
            Vertices[3].TCoords.X = x;
            Vertices[3].TCoords.Y = y;
        } else if (particle[i]->dir > 0)
        {
            float x = (particle[i]->crntFrm % stepww)*fWidth;
            float y = (particle[i]->crntFrm / stepww)*fHeight;
            Vertices[1].TCoords.X = x;
            Vertices[1].TCoords.Y = y+fHeight;
            Vertices[0].TCoords.X = x+fWidth;
            Vertices[0].TCoords.Y = y+fHeight;
            Vertices[3].TCoords.X = x+fWidth;
            Vertices[3].TCoords.Y = y;
            Vertices[2].TCoords.X = x;
            Vertices[2].TCoords.Y = y;
        }
        driver->drawIndexedTriangleList(&Vertices[0], 4, &Indices[0], 4);
    }
}
开发者ID:blaketrahan,项目名称:King,代码行数:40,代码来源:grass.cpp

示例15: drawObject

// drawObject
void CGameCamera::drawObject()
{
	if ( m_visible && m_objectID != -1  && getIView()->getActiveCamera() != this )
	{
		IVideoDriver *driver = getIView()->getDriver();

		// set material
		SMaterial debug_mat;	
		debug_mat.Lighting = false;
		debug_mat.AntiAliasing=0;
		driver->setMaterial(debug_mat);

		// reset transform
		core::matrix4 mat;
		mat.makeIdentity();
		driver->setTransform(video::ETS_WORLD, mat);

		// draw up
		core::vector3df ray = (m_targetPos - m_position).normalize();

		driver->draw3DLine( m_position, m_position + ray*100, SColor(255, 255, 255, 0) );
	}
}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:24,代码来源:CGameCamera.cpp


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