本文整理汇总了C++中ogre::MovableObject::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::isVisible方法的具体用法?C++ MovableObject::isVisible怎么用?C++ MovableObject::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MovableObject
的用法示例。
在下文中一共展示了MovableObject::isVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processPickResult
void PolygonPointPickListener::processPickResult(bool& continuePicking, Ogre::RaySceneQueryResultEntry& entry, Ogre::Ray& cameraRay, const MousePickerArgs& mousePickerArgs)
{
if (entry.movable) {
Ogre::MovableObject* pickedMovable = entry.movable;
if (pickedMovable->isVisible() && pickedMovable->getUserAny().getType() == typeid(PolygonPointUserObject*)) {
//TODO: make sure that it's a point which belongs to our polygon
mPickedUserObject = Ogre::any_cast<PolygonPointUserObject*>(pickedMovable->getUserAny());
continuePicking = false;
}
}
}
示例2: isVisible
bool Actor::isVisible() const
{
assert(mNode);
Ogre::SceneNode::ObjectIterator it = mNode->getAttachedObjectIterator();
while(it.hasMoreElements())
{
Ogre::MovableObject* obj = static_cast<Ogre::MovableObject*>(it.getNext());
if(!obj->isVisible())
{
return false;
}
}
return true;
}
示例3: _markDbvt
bool gkPhysicsController::_markDbvt(bool v)
{
if (m_suspend)
return false;
bool result = false;
if (m_dbvtMark != v)
{
m_dbvtMark = v;
if ( m_object->getType() == GK_ENTITY && !m_object->getProperties().isInvisible())
{
Ogre::MovableObject* mov = m_object->getMovable();
if (mov)
{
result = mov->isVisible() != m_dbvtMark;
mov->setVisible(m_dbvtMark);
}
}
}
return result;
}
示例4: preRenderTargetUpdate
void ReflectionTextureListener::preRenderTargetUpdate(const RenderTargetEvent& evt)
{
// Hide plane and objects below the water
mWater->setVisible(false);
/*list<Ogre::Entity*> entList = Level::getSingleton()->getEntityList();
list<Ogre::Entity*>::iterator it;
for (it = entList.begin();it != entList.end();it++){
if ((*it)->isVisible()){
Ogre::AxisAlignedBox box = (*it)->getWorldBoundingBox();
if (box.getMinimum().y < mWater->getSceneNode()->_getDerivedPosition().y){
(*it)->setVisible(false);
belowWaterEnts.push_back((*it));
}
}
}*/
/*std::vector<Entity*>::iterator i, iend;
iend = belowWaterEnts.end();
for (i = belowWaterEnts.begin(); i != iend; ++i)
{
(*i)->setVisible(false);
}*/
Ogre::SceneManager::MovableObjectIterator it = Level::getSingleton()->getSceneManager()->getMovableObjectIterator("Entity");
while(it.hasMoreElements()){
Ogre::MovableObject *m = it.getNext();
if (m->isVisible() && m->getParentSceneNode()->_getDerivedPosition().y < mWater->getSceneNode()->_getDerivedPosition().y){
m->setVisible(false);
belowWaterEnts.push_back(m);
}
}
Ogre::Camera* cam = Level::getSingleton()->getCurrentSegment()->getActiveCamera()->getCamera();
cam->enableReflection(mWater->getReflectionPlane());
}
示例5: processPickResult
void EntityWorldPickListener::processPickResult(bool& continuePicking, Ogre::RaySceneQueryResultEntry& entry, Ogre::Ray& cameraRay, const MousePickerArgs& mousePickerArgs)
{
if (!mContinuePickingThisContext) {
return;
}
if (entry.worldFragment) {
//this is terrain
//a position of -1, -1, -1 is not valid terrain
Ogre::SceneQuery::WorldFragment* wf = entry.worldFragment;
static const Ogre::Vector3 invalidPos(-1, -1, -1);
if (wf->singleIntersection != invalidPos) {
if (mFurthestPickingDistance == 0 || mResult.empty()) {
EntityPickResult result;
result.entity = findTerrainEntity();
result.position = wf->singleIntersection;
result.distance = entry.distance;
result.isTransparent = false;
mResult.push_back(result);
mContinuePickingThisContext = false;
} else {
if (entry.distance < mResult[mResult.size() - 1].distance) {
//If the last result is transparent, add another result, but if it's not replace it.
if (mResult.size() && !mResult[mResult.size() - 1].isTransparent) {
mResult.pop_back();
}
EntityPickResult result;
result.entity = findTerrainEntity();
result.position = wf->singleIntersection;
result.distance = entry.distance;
result.isTransparent = false;
mResult.push_back(result);
mContinuePickingThisContext = false;
}
}
}
/* std::stringstream ss;
ss << wf->singleIntersection;
S_LOG_VERBOSE("Picked in terrain: " << ss.str() << " distance: " << mResult.distance);*/
} else if (entry.movable) {
Ogre::MovableObject* pickedMovable = entry.movable;
if (pickedMovable->isVisible() && pickedMovable->getUserObjectBindings().getUserAny().getType() == typeid(EmberEntityUserObject::SharedPtr)) {
EmberEntityUserObject* anUserObject = Ogre::any_cast<EmberEntityUserObject::SharedPtr>(pickedMovable->getUserObjectBindings().getUserAny()).get();
//refit the opcode mesh to adjust for changes in the mesh (for example animations)
anUserObject->refit();
ICollisionDetector* collisionDetector = anUserObject->getCollisionDetector();
if (collisionDetector) {
CollisionResult collisionResult;
collisionResult.collided = false;
collisionResult.isTransparent = false;
collisionDetector->testCollision(cameraRay, collisionResult);
if (collisionResult.collided) {
if (mFurthestPickingDistance == 0) {
//If the current collision is transparent, also check for entities which are further away.
if (!collisionResult.isTransparent) {
//test all objects that fall into this distance
mFurthestPickingDistance = (pickedMovable->getParentNode()->_getDerivedPosition() - cameraRay.getOrigin()).length() + pickedMovable->getBoundingRadius();
}
} else {
if (collisionResult.distance > mFurthestPickingDistance) {
mContinuePickingThisContext = false;
return;
} else {
if (!mResult.empty() && mResult[mResult.size() - 1].distance > collisionResult.distance) {
//If the last result is transparent, add another result, but if it's not replace it.
if (!mResult[mResult.size() - 1].isTransparent) {
mResult.pop_back();
}
} else {
return;
}
}
}
EmberEntity& pickedEntity = anUserObject->getEmberEntity();
std::list<EmberEntity*> entities;
entities.push_front(&pickedEntity);
EmberEntity* entity = pickedEntity.getEmberLocation();
while (entity) {
if (entity->getCompositionMode() == EmberEntity::CM_COMPOSITION) {
entities.push_front(entity);
} else if (entity->getCompositionMode() == EmberEntity::CM_COMPOSITION_EXCLUSIVE) {
entities.clear();
entities.push_front(entity);
}
entity = entity->getEmberLocation();
}
for (std::list<EmberEntity*>::const_iterator I = entities.begin(); I != entities.end(); ++I) {
EntityPickResult result;
result.entity = *I;
result.position = collisionResult.position;
result.distance = collisionResult.distance;
result.isTransparent = collisionResult.isTransparent;
mResult.push_back(result);
}
}
//.........这里部分代码省略.........