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


C++ scene::Path类代码示例

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


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

示例1: pre

  bool pre(const scene::Path& path, scene::Instance& instance) const
  {
    if(path.top().get().visible())
    {
      BrushInstance* brush = Instance_getBrush(instance);
      if(brush != 0)
      {
        m_test.BeginMesh(brush->localToWorld());

        for(Brush::const_iterator i = brush->getBrush().begin(); i != brush->getBrush().end(); ++i)
        {
          Face_getClosest(*(*i), m_test, m_bestIntersection, m_closestFace);
        }
      }
      else
      {
        SelectionTestable* selectionTestable = Instance_getSelectionTestable(instance);
        if(selectionTestable)
        {
          bool occluded;
          OccludeSelector selector(m_bestIntersection, occluded);
          selectionTestable->testSelect(selector, m_test);
          if(occluded)
          {
            m_closestFace = 0;
          }
        }
      }
    }
    return true;
  }
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:31,代码来源:brushmanip.cpp

示例2: post

void post( const scene::Path& path, scene::Instance& instance ) const {
	Entity* entity = Node_getEntity( path.top() );
	if ( entity != 0
		 && ( instance.childSelected() || Instance_getSelectable( instance )->isSelected() ) ) {
		entity->setKeyValue( m_key, m_value );
	}
}
开发者ID:xonotic,项目名称:netradient,代码行数:7,代码来源:entity.cpp

示例3: pre

bool pre( const scene::Path& path, scene::Instance& instance ) const {
	if ( m_entity == 0 ) {
		Entity* entity = Node_getEntity( path.top() );
		if ( entity != 0 && string_equal( m_name, entity->getKeyValue( "classname" ) ) ) {
			m_entity = entity;
		}
	}
	return true;
}
开发者ID:Triang3l,项目名称:netradiant,代码行数:9,代码来源:ufoai_level.cpp

示例4: pre

	bool pre(const scene::Path& path, scene::Instance& instance) const {
		if (path.top().get().visible() && Node_isBrush(path.top())) // this node is a floor
		{

			const AABB& aabb = instance.worldAABB();

			float floorHeight = aabb.origin.z() + aabb.extents.z();

			if (floorHeight > m_current && floorHeight < m_bestUp) {
				m_bestUp = floorHeight;
			}

			if (floorHeight < m_current && floorHeight > m_bestDown) {
				m_bestDown = floorHeight;
			}
		}

		return true;
	}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例5: pre

		bool pre (const scene::Path& path, scene::Instance& instance) const
		{
			if (path.top().get().visible()) {
				// Check if the visited instance is ComponentSnappable
				ComponentSnappable* componentSnappable = Instance_getComponentSnappable(instance);
				// Call the snapComponents() method if the instance is also a _selected_ Selectable
				if (componentSnappable != 0 && Instance_getSelectable(instance)->isSelected()) {
					componentSnappable->snapComponents(m_snap);
				}
			}
			return true;
		}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:12,代码来源:commands.cpp

示例6: pre

		bool pre (const scene::Path& path, scene::Instance& instance) const
		{
			++m_depth;
			if (m_depth == 2) { /* entity depth */
				/* traverse and select children if any one is selected */
				if (instance.childSelected())
					Instance_setSelected(instance, true);
				return Node_getEntity(path.top())->isContainer() && instance.childSelected();
			} else if (m_depth == 3) { /* primitive depth */
				Instance_setSelected(instance, true);
				return false;
			}
			return true;
		}
开发者ID:AresAndy,项目名称:ufoai,代码行数:14,代码来源:Group.cpp

示例7: pre

bool PlaneSelectableSelectPlanes::pre(const scene::Path& path, scene::Instance& instance) const {
    if(path.top().get().visible())
    {
      Selectable* selectable = Instance_getSelectable(instance);
      if(selectable != 0 && selectable->isSelected())
      {
        PlaneSelectable* planeSelectable = Instance_getPlaneSelectable(instance);
        if(planeSelectable != 0)
        {
          planeSelectable->selectPlanes(_selector, _test, _selectedPlaneCallback);
        }
      }
    }
    return true;
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:15,代码来源:Planes.cpp

示例8: pre

bool ClosestTexturableFinder::pre (const scene::Path& path, scene::Instance& instance) const
{
	// Check if the node is filtered
	if (path.top().get().visible()) {
		// Test the instance for a brush
		BrushInstance* brush = Instance_getBrush(instance);

		if (brush != NULL) {
			// Construct the selectiontest
			_selectionTest.BeginMesh(brush->localToWorld());

			// Cycle through all the faces
			for (Brush::const_iterator i = brush->getBrush().begin(); i != brush->getBrush().end(); i++) {
				// Test the face for selection
				SelectionIntersection intersection;
				(*i)->testSelect(_selectionTest, intersection);

				// Any intersection found / is it better than the previous one?
				if (intersection.valid() && SelectionIntersection_closer(intersection, _bestIntersection)) {
					// Yes, store this as new best intersection
					_bestIntersection = intersection;

					// Save the face and the parent brush
					_texturable.face = (*i);
					_texturable.brush = &brush->getBrush();
				}
			}
		} else {
			// No brush, test for a patch
			SelectionTestable* selectionTestable = Instance_getSelectionTestable(instance);

			if (selectionTestable != NULL) {
				bool occluded;
				OccludeSelector selector(_bestIntersection, occluded);
				selectionTestable->testSelect(selector, _selectionTest);

				if (occluded) {
					_texturable = Texturable();
				}
			}
		}
	}

	return true;
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:45,代码来源:Texturable.cpp

示例9: pre

			// Visit function
			virtual bool pre (const scene::Path& path, scene::Instance& instance) const
			{
				Entity* entity = Node_getEntity(path.top());
				if (entity != NULL) {
					// Get the entity name
					std::string entName = entity->getKeyValue("targetname");

					// if not targetname is set, ignore it
					if (!entName.empty()) {
						// Append the name to the list store
						GtkTreeIter iter;
						gtk_list_store_append(GTK_LIST_STORE(_store), &iter);
						gtk_list_store_set(GTK_LIST_STORE(_store), &iter, 0, entName.c_str(), -1);
					}

					return false; // don't traverse children if entity found
				}

				return true; // traverse children otherwise
			}
开发者ID:AresAndy,项目名称:ufoai,代码行数:21,代码来源:EntityPropertyEditor.cpp

示例10: post

void post( const scene::Path& path, scene::Instance& instance ) const {
	Entity* entity = Node_getEntity( path.top() );
	if ( entity != 0 && ( instance.childSelected() || Instance_getSelectable( instance )->isSelected() ) ) {
		if( path.top().get_pointer() == m_world ){ /* do not want to convert whole worldspawn entity */
			if( instance.childSelected() && !m_2world ){ /* create an entity from world brushes instead */
				EntityClass* entityClass = GlobalEntityClassManager().findOrInsert( m_classname, true );
				if( entityClass->fixedsize )
					return;

				//is important to have retexturing here; if doing in the end, undo doesn't succeed; //don't do this extra now, as it requires retexturing, working for subgraph
//				if ( string_compare_nocase_n( m_classname, "trigger_", 8 ) == 0 ){
//					Scene_PatchSetShader_Selected( GlobalSceneGraph(), GetCommonShader( "trigger" ).c_str() );
//					Scene_BrushSetShader_Selected( GlobalSceneGraph(), GetCommonShader( "trigger" ).c_str() );
//				}

				NodeSmartReference node( GlobalEntityCreator().createEntity( entityClass ) );
				Node_getTraversable( GlobalSceneGraph().root() )->insert( node );

				scene::Path entitypath( makeReference( GlobalSceneGraph().root() ) );
				entitypath.push( makeReference( node.get() ) );
				scene::Instance& entityInstance = findInstance( entitypath );

				if ( g_pGameDescription->mGameType == "doom3" ) {
					Node_getEntity( node )->setKeyValue( "model", Node_getEntity( node )->getKeyValue( "name" ) );
				}

				//Scene_parentSelectedBrushesToEntity( GlobalSceneGraph(), node );
				Scene_parentSubgraphSelectedBrushesToEntity( GlobalSceneGraph(), node, path );
				Scene_forEachChildSelectable( SelectableSetSelected( true ), entityInstance.path() );
			}
			return;
		}
		else if( m_2world ){ /* ungroupSelectedEntities */ //condition is skipped with world = 0, so code next to this may create multiple worldspawns; todo handle this very special case?
			if( node_is_group( path.top() ) ){
				parentBrushes( path.top(), *m_world );
				Path_deleteTop( path );
			}
			return;
		}

		EntityClass* eclass = GlobalEntityClassManager().findOrInsert( m_classname, node_is_group( path.top() ) );
		NodeSmartReference node( GlobalEntityCreator().createEntity( eclass ) );

		if( entity->isContainer() && eclass->fixedsize ){ /* group entity to point one */
			char value[64];
			sprintf( value, "%g %g %g", instance.worldAABB().origin[0], instance.worldAABB().origin[1], instance.worldAABB().origin[2] );
			entity->setKeyValue( "origin", value );
		}

		EntityCopyingVisitor visitor( *Node_getEntity( node ) );
//		entity->forEachKeyValue( visitor );

		NodeSmartReference child( path.top().get() );
		NodeSmartReference parent( path.parent().get() );
//		Node_getTraversable( parent )->erase( child );
		if ( Node_getTraversable( child ) != 0 && node_is_group( node ) ) { /* group entity to group one */
			parentBrushes( child, node );
		}
		Node_getTraversable( parent )->insert( node );

		entity->forEachKeyValue( visitor ); /* must do this after inserting node, otherwise problem: targeted + having model + not loaded b4 new entities aren't selectable normally + rendered only while 0 0 0 is rendered */

		if( !entity->isContainer() && !eclass->fixedsize ){ /* point entity to group one */
			AABB bounds( g_vector3_identity, Vector3( 16, 16, 16 ) );
			if ( !string_parse_vector3( entity->getKeyValue( "origin" ), bounds.origin ) ) {
				bounds.origin = g_vector3_identity;
			}
			Brush_ConstructPlacehoderCuboid( node.get(), bounds );
			Node_getEntity( node )->setKeyValue( "origin", "" );
		}

		Node_getTraversable( parent )->erase( child );
	}
}
开发者ID:Garux,项目名称:netradiant-custom,代码行数:74,代码来源:entity.cpp

示例11: EntityGroupSelected

EntityGroupSelected( const scene::Path &p ) : group( p.top().get() ), worldspawn( Map_FindOrInsertWorldspawn( g_map ) ){
}
开发者ID:xonotic,项目名称:netradient,代码行数:2,代码来源:entity.cpp


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