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


Python WorldEditor.changeToCamera方法代码示例

本文整理汇总了Python中WorldEditor.changeToCamera方法的典型用法代码示例。如果您正苦于以下问题:Python WorldEditor.changeToCamera方法的具体用法?Python WorldEditor.changeToCamera怎么用?Python WorldEditor.changeToCamera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WorldEditor的用法示例。


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

示例1: onHideOrthoMode

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import changeToCamera [as 别名]
def onHideOrthoMode( item ):
		WorldEditor.setOptionInt( "camera/ortho", 0 )
		WorldEditor.changeToCamera(0)
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIExt.py

示例2: onStart

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import changeToCamera [as 别名]

#.........这里部分代码省略.........

		# create alpha tool
		self.alphaTool = WorldEditor.Tool()
		self.alphaTool.functor = Functor.TerrainTextureFunctor()
		self.alphaTool.locator = Locator.TerrainToolLocator()
		self.alphaToolTextureView = View.TerrainTextureToolView( "resources/maps/gizmo/alphatool.tga" )
		self.alphaTool.addView( self.alphaToolTextureView, "stdView" )
		self.alphaTool.size = 30
		self.alphaTool.strength = 1000

		# create height filter tool
		self.heightFunctor = Functor.TerrainHeightFilterFunctor()
		self.heightFunctor.index = 0 # this index must match the filters.xml file
		self.heightFunctor.strengthMod = 1
		self.heightFunctor.framerateMod = 1
		self.heightFunctor.constant = 1.0
		self.heightFunctor.falloff = 2

		self.setHeightFunctor = Functor.TerrainSetHeightFunctor()
		self.setHeightFunctor.height = 0
		self.setHeightFunctor.relative = 0
		
		self.heightView = View.TerrainTextureToolView( "resources/maps/gizmo/heighttool.tga" )
		self.setHeightView = View.TerrainTextureToolView( "resources/maps/gizmo/squaretool.dds" )

		self.heightTool = WorldEditor.Tool()
		self.heightTool.locator = Locator.TerrainToolLocator()
		self.heightTool.functor = Functor.TeeFunctor( self.heightFunctor, self.setHeightFunctor, KEY_LCONTROL )
		self.heightToolTextureView = View.TeeView( self.heightView, self.setHeightView, KEY_LCONTROL )
		self.heightTool.addView( self.heightToolTextureView, "stdView" )
		self.heightTool.size = 30

		# create general filter tool
		self.filterTool = WorldEditor.Tool()
		self.filterTool.locator = Locator.TerrainToolLocator()
		self.filterTool.functor = Functor.TerrainHeightFilterFunctor()
		self.filterTool.functor.strengthMod = 1
		self.filterTool.functor.constant = 0.0
		self.filterToolTextureView = View.TerrainTextureToolView( "resources/maps/gizmo/filtertool.tga" )
		self.filterTool.addView( self.filterToolTextureView, "stdView" )
		self.filterTool.size = 30

		# create a hole cutter
		self.holeTool = WorldEditor.Tool()		
		self.holeTool.locator = Locator.TerrainHoleToolLocator()
		view = View.TerrainTextureToolView( "resources/maps/gizmo/squaretool.dds" )
		view.showHoles = True
		self.holeTool.addView( view, "stdView" )
		self.holeTool.functor = Functor.TerrainHoleFunctor()
		self.holeTool.size = 30

		# create the item tool
		self.itemTool = WorldEditor.Tool()
		self.itemToolXZLocator = Locator.ItemToolLocator()
		self.itemTool.locator = Locator.TerrainToolLocator()
		self.itemToolTextureView = View.TerrainTextureToolView( "resources/maps/gizmo/cross2.dds" )
		self.itemToolModelView = View.ModelToolView( "resources/models/pointer.model" )
		self.itemToolPlaneView = View.ModelToolView( "resources/models/freepointer.model" )
		self.itemTool.addView( self.itemToolTextureView, "stdView" )
		# This changes our locator to a ChunkItemLocator
		self.itemTool.functor = Functor.ScriptedFunctor( ChunkItemFunctor( self.itemTool, self.objInfo ) )
		# Setup the correct subLocator for the ChunkItemLocator
		self.itemTool.locator.subLocator = self.itemToolXZLocator
		self.itemTool.size = 1

		# Make the closed captions commentary viewer
		self.cc = GUI.ClosedCaptions( WorldEditor.getOptionInt( "consoles/numMessageLines", 5 ) )
		self.cc.addAsView()
		self.cc.visible = 1

		if ( WorldEditor.getOptionInt( "tools/showChunkVisualisation" ) == 1 ):
			WorldEditor.setOptionInt( "render/chunk/vizMode", 1)
		self.enterChunkVizMode()

		self.enterMode( self.modeName, 1 )

		# initialise the mouse move camera
		# load up the start position from space.localsettings
		startPos = (0,1.85,0)
		startDir = (0,0,0)

		dir = WorldEditor.getOptionString( "space/mru0" )
		dirDS = ResMgr.openSection( dir )
		ds = dirDS["space.localsettings"]
		if ds != None:
			startPos = ds.readVector3( "startPosition", startPos )
			startDir = ds.readVector3( "startDirection", startDir )

		m = WorldEditor.camera(0).view
		m.setIdentity()
		m.setRotateYPR( (startDir[2], startDir[1], startDir[0]) )
		m.translation = startPos
		m.invert()
		WorldEditor.camera(0).view = m

		# select the camera as specified in the options
		WorldEditor.changeToCamera( WorldEditor.getOptionInt( "camera/ortho" ) )

		# read the initial item snap mode
		self.updateItemSnaps();
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:104,代码来源:WorldEditorDirector.py

示例3: onShowOrthoMode

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import changeToCamera [as 别名]
def onShowOrthoMode( item ):
		WorldEditor.setOptionInt( "camera/ortho", 1 )
		WorldEditor.changeToCamera(1)
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIExt.py


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