⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simplescenes_trimesh.h

📁 赫赫大名的 OGRE 游戏引擎
💻 H
字号:
/*
SimpleScenes_TriMesh.h
---------------------
A reimplementation of the ODE triangle mesh collision
demo using Ogre and the OgreOde wrapper.
*/
#ifndef _SIMPLESCENES_TRIMESH_H_
#define _SIMPLESCENES_TRIMESH_H_

/*
The box stacking test extends the box stacking demo, but adds a trimesh!
*/
class SimpleScenes_TriMesh:public SimpleScenes_BoxStack
{
public:
	// Standard constructor, but create a triangle mesh
	SimpleScenes_TriMesh()
	{
		// Create the visual entity and scene node
		Entity* entity = _mgr->createEntity("Landscape","landscape.mesh");
		entity->setNormaliseNormals(true);
		entity->setCastShadows(false);

		SceneNode* node = _mgr->getRootSceneNode()->createChildSceneNode(entity->getName());
		node->attachObject(entity);
		node->setScale(Vector3(0.4,0.3,0.4));
		node->setPosition(Vector3(0,3,0));
		node->setOrientation(Quaternion(Degree(30),Vector3::UNIT_Y));
		
		// Turn it into a triangle mesh static geometry
		_geoms.push_back(OgreOde::MeshInformer::createStaticTriangleMesh(node,_space));
	}

	// Destructor, manually destroy the entity and node, since they're 
	// not associated with a body they won't get deleted automatically
	virtual ~SimpleScenes_TriMesh()
	{
		_mgr->destroySceneNode("Landscape");
		_mgr->removeEntity("Landscape");
	}

	// Return our name for the test application to display
	virtual const String& getName()
	{
		static String name = "Test Triangle Mesh";
		return name;
	}
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -