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


Python BulletWorld.attach_character方法代码示例

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


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

示例1: BulletBoxShape

# 需要导入模块: from panda3d.bullet import BulletWorld [as 别名]
# 或者: from panda3d.bullet.BulletWorld import attach_character [as 别名]
It also reacts strangely to the prop box. But I think that might be my fault...
Most people seem to be making their own CCs. But I think we don't need to yet."""

# shape
shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5))

# bullect character object
node = BulletCharacterControllerNode (shape, 1)
 
# attach to the nodetree via a parent, for easier access which isn't really done
np = render.attachNewNode(node)
np.setPos(0, 0, 2)
#np.setR(10)
 
# attach to the Bullet world, as a character, note
world.attach_character(node)

# This isn't necessary anymore due to debug
## make it visible																#BUG: this model too did not match the actual shape, be careful next time
#model = loader.loadModel('models/box.egg')
#model.flattenLight()
#model.reparentTo(np)

# focus the camera at it
base.cam.setPos(0, -10, 0)
base.cam.lookAt(0, 0, 0)

# punks jump up: space
def jump():
	node.doJump()
base.accept('space', jump)
开发者ID:Hashfyre,项目名称:7dom,代码行数:33,代码来源:main.py


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