本文整理汇总了Python中panda3d.bullet.BulletRigidBodyNode.getNumChildren方法的典型用法代码示例。如果您正苦于以下问题:Python BulletRigidBodyNode.getNumChildren方法的具体用法?Python BulletRigidBodyNode.getNumChildren怎么用?Python BulletRigidBodyNode.getNumChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.bullet.BulletRigidBodyNode
的用法示例。
在下文中一共展示了BulletRigidBodyNode.getNumChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeSB
# 需要导入模块: from panda3d.bullet import BulletRigidBodyNode [as 别名]
# 或者: from panda3d.bullet.BulletRigidBodyNode import getNumChildren [as 别名]
def makeSB():
body = BulletRigidBodyNode('...')
geomNodeCollection = loader.loadModel('out2.egg').findAllMatches('**/+GeomNode')
for geomNP in geomNodeCollection:
geomNode = geomNP.node()
ts = geomNode.getTransform()
mesh = BulletTriangleMesh()
for geom in geomNode.getGeoms():
mesh.addGeom(geom)
shape = BulletTriangleMeshShape(mesh, dynamic=True)
body.addShape(shape, ts)
body.addChild(geomNode)
#world.attachRigidBody(node)
#body.copyTo(np)
body.setMass(100.0)
world.attachRigidBody(body)
np1 = render.attachNewNode(body)
np1.setPos(0, 0, 10)
np1.setHpr(0,0,90)
np1.setScale(0.5,0.5,0.5)
print(body.getNumChildren())
return body
#body = makeSB()
# Update
#taskMgr.add(update, 'update')
#run()