本文整理汇总了Python中terrain.Terrain.setTextures方法的典型用法代码示例。如果您正苦于以下问题:Python Terrain.setTextures方法的具体用法?Python Terrain.setTextures怎么用?Python Terrain.setTextures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类terrain.Terrain
的用法示例。
在下文中一共展示了Terrain.setTextures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Game
# 需要导入模块: from terrain import Terrain [as 别名]
# 或者: from terrain.Terrain import setTextures [as 别名]
#.........这里部分代码省略.........
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'),
(path+'models/pyweek_wall1',0.0,(295.0,405.0,25.0980415344238),path+'models/pyweek_wall1_collision'),
(path+'models/pyweek_wall1',0.0,(293.0,405.0,25.0980434417725),path+'models/pyweek_wall1_collision'),