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


Python Engine._createWorld方法代码示例

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


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

示例1: _createWorld

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import _createWorld [as 别名]
 def _createWorld(self):
     Engine._createWorld(self)
     bot = Person(self, "b1")
     bot.setPosition(self.spawnLocation())
     self.objects += [bot]
开发者ID:cradle,项目名称:manic,代码行数:7,代码来源:server.py

示例2: _createScene

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import _createWorld [as 别名]
    def _createScene(self):
        Engine._createWorld(self)
        self.sceneManager.setAmbientLight((1.0, 1.0, 1.0, 1.0))
##        self.sceneManager.setShadowTechnique(ogre.SHADOWTYPE_NONE)
##        self.sceneManager.setShadowColour((0.5, 0.5, 0.5))
##        self.sceneManager.setShadowTextureSize(1024)
##        self.sceneManager.setShadowTextureCount(2)

        light = self.sceneManager.createLight("sunlight")
        light.setType(ogre.Light.LT_DIRECTIONAL)   # or .type
        light.setDirection((0.4,-0.4,-1))
        light.setDiffuseColour(0.85,0.85,0.85)
        #light.setCastShadows(True)
        
        entity = self.sceneManager.createEntity('bgE', 'Scene.mesh')
        #entity.setCastShadows(False)
        node = self.sceneManager.getRootSceneNode().createChildSceneNode('bgN')
        node.attachObject(entity)
        node.setVisible(True)
##        node.setDirection(0,0,-1)
##        node.setScale(0.05,0.05,0.05)
##        tempWorld = OgreOde.World(self.sceneManager)
##        self.createStaticTriangleMesh(entity, self.space)
##        geom = self.createStaticTriangleMesh(entity, self.space) 
##        print type(geom)

        self.createLogo()
##        self.createMenu()

        # Setup Audio 
        self.soundManager  = OgreAL.SoundManager()
        self.soundManager.getListener().setDirection((0,25,75))
        self.sfx = SFX(self.soundManager)
        
        ## setup GUI system
        self.GUIRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, 
            ogre.RENDER_QUEUE_OVERLAY, False, 3000, self.sceneManager) 

        self.GUIsystem = CEGUI.System(self.GUIRenderer)
        
        logger = CEGUI.Logger.getSingleton()
        logger.setLoggingLevel( CEGUI.Informative )

        winMgr = CEGUI.WindowManager.getSingleton()
        ## load scheme and set up defaults
        CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLook.scheme")
        
        self.GUIsystem.setDefaultMouseCursor("TaharezLook",  "MouseArrow")
        CEGUI.MouseCursor.getSingleton().setVisible(False)

        CEGUI.ImagesetManager.getSingleton().createImageset("menu.imageset")
        
        winMgr.loadWindowLayout("menu.layout")
        
        winMgr.loadWindowLayout("hud.layout")

        sheet = winMgr.getWindow("Background")
        #self.GUIsystem.setGUISheet(winMgr.getWindow("Menu"))
        self.GUIsystem.setGUISheet(sheet)
        
        font = CEGUI.FontManager.getSingleton().createFont("tuffy.font")
            
        textwnd = winMgr.getWindow("TextWindow")
        self._scoreWindow = winMgr.getWindow("ScoreWindow")
        self._debugWindow = winMgr.getWindow("DebugWindow")
        self._vitalsWindow = winMgr.getWindow("VitalsWindow")

        # Materials
        myMaterial = ogre.MaterialManager.getSingleton().create("bullets","a")
        myMaterial.setLightingEnabled(False)
        myMaterial.setDepthWriteEnabled(False)
        myMaterial.setSceneBlending(ogre.SBT_TRANSPARENT_ALPHA)
##        myMaterial.getTechnique(0).getPass(0).setVertexColourTracking(ogre.TVC_DIFFUSE)

        myMaterial = ogre.MaterialManager.getSingleton().create("cursor","b")
        myMaterial.setLightingEnabled(False)
        myMaterial.setDepthWriteEnabled(False)
        myMaterial.setSceneBlending(ogre.SBT_TRANSPARENT_ALPHA)
        myMaterial.getTechnique(0).getPass(0).setVertexColourTracking(ogre.TVC_AMBIENT | ogre.TVC_DIFFUSE)

        myMaterial = ogre.MaterialManager.getSingleton().create("grenade","c")
开发者ID:cradle,项目名称:manic,代码行数:83,代码来源:client.py

示例3: _createScene

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import _createWorld [as 别名]
 def _createScene(self):
     Engine._createWorld(self)
     self.sceneManager.setAmbientLight((1.0, 1.0, 1.0, 1.0))
     self.createLogo()    
开发者ID:cradle,项目名称:manic,代码行数:6,代码来源:assaultvector.py


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