本文整理汇总了C++中RenderObject::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderObject::GetType方法的具体用法?C++ RenderObject::GetType怎么用?C++ RenderObject::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderObject
的用法示例。
在下文中一共展示了RenderObject::GetType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTrianglesForLodLayer
int32 NodesPropertyControl::GetTrianglesForLodLayer(LodComponent::LodData *lodData)
{
int32 trianglesCount = 0;
for(int32 n = 0; n < (int32)lodData->nodes.size(); ++n)
{
Vector<Entity *> meshes;
lodData->nodes[n]->GetChildNodes(meshes);
meshes.push_back(lodData->nodes[n]);
for(int32 m = 0; m < (int32)meshes.size(); ++m)
{
RenderObject *ro = GetRenerObject(meshes[m]);
if(!ro || ro->GetType() != RenderObject::TYPE_MESH) continue;
uint32 count = ro->GetRenderBatchCount();
for(uint32 r = 0; r < count; ++r)
{
RenderBatch *batch = ro->GetRenderBatch(r);
PolygonGroup *pg = batch->GetPolygonGroup();
if(pg)
{
trianglesCount += pg->GetIndexCount() / 3;
}
}
}
}
return trianglesCount;
}
示例2: GetSkybox
SkyboxRenderObject * GetSkybox(const Entity * fromEntity)
{
RenderObject *ro = GetRenderObject(fromEntity);
if(ro && ro->GetType() == RenderObject::TYPE_SKYBOX)
{
return (static_cast<SkyboxRenderObject *>(ro));
}
return NULL;
}
示例3: GetLandscape
Landscape * GetLandscape( Entity * fromEntity )
{
if(NULL != fromEntity)
{
RenderObject * object = GetRenderObject(fromEntity);
if(object && object->GetType() == RenderObject::TYPE_LANDSCAPE)
{
Landscape *landscape = static_cast<Landscape *>(object);
return landscape;
}
}
return NULL;
}
示例4: FindRenderObjectsRecursive
void SwitchToRenerObjectConverter::FindRenderObjectsRecursive(Entity * fromEntity, Vector<std::pair<Entity*, RenderObject*> > & entityAndObjectPairs)
{
RenderObject * ro = GetRenderObject(fromEntity);
if(ro && ro->GetType() == RenderObject::TYPE_MESH)
{
entityAndObjectPairs.push_back(std::make_pair(fromEntity, ro));
}
int32 size = fromEntity->GetChildrenCount();
for(int32 i = 0; i < size; ++i)
{
Entity * child = fromEntity->GetChild(i);
FindRenderObjectsRecursive(child, entityAndObjectPairs);
}
}
示例5: GetEmitter
ParticleEmitter * GetEmitter(Entity * fromEntity)
{
ParticleEmitter * emitter = 0;
if(NULL != fromEntity)
{
RenderObject * object = GetRenderObject(fromEntity);
if(object && object->GetType() == RenderObject::TYPE_PARTICLE_EMTITTER)
{
emitter = static_cast<ParticleEmitter*>(object);
}
}
return emitter;
}
示例6: RecursiveProcessMeshNode
void RecursiveProcessMeshNode(Entity * curr, void * userData, void(*process)(Entity*, void *))
{
RenderComponent * comp = (RenderComponent*)curr->GetComponent(Component::RENDER_COMPONENT);
if (comp)
{
RenderObject * renderObject = comp->GetRenderObject();
if (renderObject->GetType() == RenderObject::TYPE_MESH)
{
process(curr, userData);
}
}
else
{
for (int32 i = 0; i < curr->GetChildrenCount(); i++)
RecursiveProcessMeshNode(curr->GetChild(i), userData, process);
}
}
示例7: ValidateRenderComponent
void SceneValidator::ValidateRenderComponent(Entity *ownerNode, Set<String> &errorsLog)
{
RenderComponent *rc = static_cast<RenderComponent *>(ownerNode->GetComponent(Component::RENDER_COMPONENT));
if(!rc) return;
RenderObject *ro = rc->GetRenderObject();
if(!ro) return;
uint32 count = ro->GetRenderBatchCount();
for(uint32 b = 0; b < count; ++b)
{
RenderBatch *renderBatch = ro->GetRenderBatch(b);
ValidateRenderBatch(ownerNode, renderBatch, errorsLog);
}
if(ro->GetType() == RenderObject::TYPE_LANDSCAPE)
{
Landscape *landscape = static_cast<Landscape *>(ro);
ValidateLandscape(landscape, errorsLog);
ValidateCustomColorsTexture(ownerNode, errorsLog);
}
}
示例8: CheckNodes
void EditorScene::CheckNodes(Entity * curr)
{
if(NULL != curr)
{
bool newDebugComp = false;
DebugRenderComponent *dbgComp = NULL;
BaseObject *bulletObject = NULL;
BulletComponent * bulletComponent = (BulletComponent*)curr->GetComponent(Component::BULLET_COMPONENT);
if(NULL != bulletComponent)
{
bulletObject = bulletComponent->GetBulletObject();
}
// create debug render component for all nodes
dbgComp = (DebugRenderComponent *) curr->GetComponent(Component::DEBUG_RENDER_COMPONENT);
if(NULL == dbgComp)
{
dbgComp = new DebugRenderComponent();
newDebugComp = true;
curr->AddComponent(dbgComp);
}
// check other debug settings
// is camera?
CameraComponent *camComp = (CameraComponent *) curr->GetComponent(Component::CAMERA_COMPONENT);
if(NULL != camComp)
{
// set flags to show it
if(newDebugComp)
{
dbgComp->SetDebugFlags(dbgComp->GetDebugFlags() | DebugRenderComponent::DEBUG_DRAW_CAMERA);
}
// create bullet object for camera (allow selecting it)
/*
if(NULL == bulletComponent)
{
bulletComponent = (BulletComponent*) curr->GetOrCreateComponent(Component::BULLET_COMPONENT);
bulletComponent->SetBulletObject(new BulletObject(this, collisionWorld, camComp->GetCamera(), camComp->GetCamera()->GetMatrix()));
}
*/
}
// is light?
if(NULL != curr->GetComponent(Component::LIGHT_COMPONENT))
{
if(newDebugComp)
{
dbgComp->SetDebugFlags(dbgComp->GetDebugFlags() | DebugRenderComponent::DEBUG_DRAW_LIGHT_NODE);
}
if(NULL == bulletComponent || NULL == bulletObject)
{
BulletObject *bObj = new BulletObject(this, collisionWorld, curr, AABBox3(Vector3(), 2.5f), curr->GetWorldTransform());
bulletComponent = (BulletComponent*) curr->GetOrCreateComponent(Component::BULLET_COMPONENT);
bulletComponent->SetBulletObject(bObj);
SafeRelease(bObj);
}
}
// is user node
if(NULL != curr->GetComponent(Component::USER_COMPONENT))
{
if(newDebugComp)
{
dbgComp->SetDebugFlags(dbgComp->GetDebugFlags() | DebugRenderComponent::DEBUG_DRAW_USERNODE);
}
if(NULL == bulletComponent || NULL == bulletObject)
{
BulletObject *bObj = new BulletObject(this, collisionWorld, curr, AABBox3(Vector3(), 2.5f), curr->GetWorldTransform());
bulletComponent = (BulletComponent*) curr->GetOrCreateComponent(Component::BULLET_COMPONENT);
bulletComponent->SetBulletObject(bObj);
SafeRelease(bObj);
}
}
// is render object?
RenderComponent * renderComponent = (RenderComponent*) curr->GetComponent(Component::RENDER_COMPONENT);
if(NULL != renderComponent)
{
RenderObject *rObj = renderComponent->GetRenderObject();
if(NULL != rObj && rObj->GetType() != RenderObject::TYPE_LANDSCAPE && curr->IsLodMain(0))
{
if(NULL == bulletComponent || NULL == bulletObject)
{
BulletObject *bObj = new BulletObject(this, collisionWorld, curr, curr->GetWorldTransform());
bulletComponent = (BulletComponent*) curr->GetOrCreateComponent(Component::BULLET_COMPONENT);
bulletComponent->SetBulletObject(bObj);
SafeRelease(bObj);
}
}
}
}
int size = curr->GetChildrenCount();
//.........这里部分代码省略.........