本文整理汇总了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)