本文整理汇总了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);
}
示例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) );
}
}
示例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
示例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);
}
示例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);
}
示例6: render
virtual void render()
{
IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setMaterial(Material);
driver->setTransform(ETS_WORLD, AbsoluteTransformation);
driver->drawIndexedTriangleList(VertexBuffer, IndexBuffer, Descriptor, 4);
}
示例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);
}
示例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);
}
示例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);
}
示例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.");
}
}
示例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
}
示例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));
}
}
示例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) );
}
}
示例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);
}
}
示例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) );
}
}