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


Python Terrain.loadMesh方法代码示例

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


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

示例1: Game

# 需要导入模块: from terrain import Terrain [as 别名]
# 或者: from terrain.Terrain import loadMesh [as 别名]

#.........这里部分代码省略.........
                self.grass.mower_blade.show()
                
    def setup(self):
        self.worldNP = render.attachNewNode('World')

        # World
        self.debugNP = self.worldNP.attachNewNode(BulletDebugNode('Debug'))
        self.debugNP.hide()

        self.world = BulletWorld()
        self.world.setGravity(Vec3(0, 0, -9.81))
        self.world.setDebugNode(self.debugNP.node())

        # Plane
        #shape = BulletPlaneShape(Vec3(0, 0, 1), 0)        
        #mesh = BulletTriangleMesh()
        #geomNodes = loader.loadModel('levels/test1/collision').findAllMatches('**/+GeomNode')
        #geomNode = geomNodes.getPath(0).node()
        #geom = geomNode.getGeom(0)
        #mesh.addGeom(geom)
        #shape = BulletTriangleMeshShape(mesh, dynamic=False, bvh=True )                
        #np = self.worldNP.attachNewNode(BulletRigidBodyNode('Ground'))
        #np.node().addShape(shape)
        #np.setPos(0, 0, 20.0)
        #np.setCollideMask(BitMask32.allOn())
        #self.world.attachRigidBody(np.node())

        #sky dome
        self.sun_sky=Sky()
        self.sun_sky.setTime(17.0)
        
        #terrain
        self.ground=Terrain(self.world, self.worldNP)
        self.ground.loadMesh(path+'levels/gandg2/collision')
        self.ground.setMaps(path+'levels/gandg2/')
        self.ground.setTextures((39, 1, 2, 15, 4, 5))
        
        #grass
        self.grass=Grass()
        self.grass.setMap(path+'levels/gandg2/grass.png')     
        self.grass_to_cut=self.grass.getStatus()
        # Car
        self.car=Car(self.world, self.worldNP)
        self.car.setPos(161.0,160.0,26)
        #camera
        self.camera=FlyingCamera()
        
        #car to character scale 0.0128        
        self.char=Character(self.world, self.worldNP)        
        self.char.enterCar()
        #self.char.setPos(256, 250, 80)
        
        #filter manager, post process
        self.filters=Postprocess()        
        #self.filters.setupFxaa() 
        #no time to make it work, sorry...
        self.filters.setupFilters()
        
        
        #map objects .. hardcoded because of time
        self.object_root=render.attachNewNode('object_root')
        obj=[
            (path+'models/pyweek_wall1',0.0,(303.0,405.0,25.0980415344238),path+'models/pyweek_wall1_collision'),
            (path+'models/pyweek_wall1',0.0,(301.0,405.0,25.0980434417725),path+'models/pyweek_wall1_collision'),
            (path+'models/pyweek_wall1',0.0,(299.0,405.0,25.0980415344238),path+'models/pyweek_wall1_collision'),
            (path+'models/pyweek_wall1',0.0,(297.0,405.0,25.0980415344238),path+'models/pyweek_wall1_collision'),
开发者ID:wezu,项目名称:pyweek21,代码行数:70,代码来源:game.py


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