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


Python BulletRigidBodyNode.setTransform方法代码示例

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


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

示例1: genHand

# 需要导入模块: from panda3d.bullet import BulletRigidBodyNode [as 别名]
# 或者: from panda3d.bullet.BulletRigidBodyNode import setTransform [as 别名]
 def genHand(self, handz=100.0):
     # fgr0
     boxx = 5.0
     boxy = 2.0
     boxz = 20.0
     boxpx = 0.0
     boxpy = 10.0
     boxpz = handz
     shape = BulletBoxShape(Vec3(boxx, boxy, boxz))  # the parameters are half extends
     node = BulletRigidBodyNode('fgr0')
     node.addShape(shape)
     node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
     self.bltWorld.attachRigidBody(node)
     pg.plotBox(self.base.render, pos=[boxpx, boxpy, boxpz], x=boxx * 2.0, y=boxy * 2.0, z=boxz * 2.0, rgba=None)
     # fgr1
     boxx = 5.0
     boxy = 2.0
     boxz = 20.0
     boxpx = 0.0
     boxpy = -10.0
     boxpz = handz
     shape = BulletBoxShape(Vec3(boxx, boxy, boxz))  # the parameters are half extends
     node = BulletRigidBodyNode('fgr1')
     node.addShape(shape)
     node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
     self.bltWorld.attachRigidBody(node)
     pg.plotBox(self.base.render, pos=[boxpx, boxpy, boxpz], x=boxx * 2.0, y=boxy * 2.0, z=boxz * 2.0, rgba=None)
开发者ID:wanweiwei07,项目名称:pyhiro,代码行数:29,代码来源:dropblt.py

示例2: addWalls

# 需要导入模块: from panda3d.bullet import BulletRigidBodyNode [as 别名]
# 或者: from panda3d.bullet.BulletRigidBodyNode import setTransform [as 别名]
    def addWalls(self):
        """
        add walls

        :return:
        """

        # x+
        boxx = 2.0
        boxy = 50.0
        boxz = 100.0
        boxpx = 50.0
        boxpy = 0.0
        boxpz = 50.0
        shape = BulletBoxShape(Vec3(boxx, boxy, boxz)) # the parameters are half extends
        node = BulletRigidBodyNode('Wallx+')
        node.addShape(shape)
        node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
        self.bltWorld.attachRigidBody(node)
        pg.plotBox(self.base.render, pos = [boxpx, boxpy, boxpz], x = boxx*2.0, y = boxy*2.0, z = boxz*2.0, rgba=None)
        # x-
        boxx = 2.0
        boxy = 50.0
        boxz = 100.0
        boxpx = -50.0
        boxpy = 0.0
        boxpz = 50.0
        shape = BulletBoxShape(Vec3(boxx, boxy, boxz)) # the parameters are half extends
        node = BulletRigidBodyNode('Wallx-')
        node.addShape(shape)
        node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
        self.bltWorld.attachRigidBody(node)
        pg.plotBox(self.base.render, pos = [boxpx, boxpy, boxpz], x = boxx*2.0, y = boxy*2.0, z = boxz*2.0, rgba=None)
        # y+
        boxx = 50.0
        boxy = 2.0
        boxz = 100.0
        boxpx = 0.0
        boxpy = 50.0
        boxpz = 50.0
        shape = BulletBoxShape(Vec3(boxx, boxy, boxz))  # the parameters are half extends
        node = BulletRigidBodyNode('Wally+')
        node.addShape(shape)
        node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
        self.bltWorld.attachRigidBody(node)
        pg.plotBox(self.base.render, pos=[boxpx, boxpy, boxpz], x=boxx * 2.0, y=boxy * 2.0, z=boxz * 2.0, rgba=None)
        # y-
        boxx = 50.0
        boxy = 2.0
        boxz = 100.0
        boxpx = 0.0
        boxpy = -50.0
        boxpz = 50.0
        shape = BulletBoxShape(Vec3(boxx, boxy, boxz))  # the parameters are half extends
        node = BulletRigidBodyNode('Wally-')
        node.addShape(shape)
        node.setTransform(TransformState.makePos(VBase3(boxpx, boxpy, boxpz)))
        self.bltWorld.attachRigidBody(node)
        pg.plotBox(self.base.render, pos=[boxpx, boxpy, boxpz], x=boxx * 2.0, y=boxy * 2.0, z=boxz * 2.0, rgba=None)

        # shape = BulletPlaneShape(Vec3(0, 0, 1), 0.0)
        # node = BulletRigidBodyNode('Ground')
        # node.addShape(shape)
        # np = self.base.render.attachNewNode(node)
        # np.setPos(0, 0, 0)
        # self.bltWorld.attachRigidBody(node)
        self.handz = 200.0
开发者ID:wanweiwei07,项目名称:pyhiro,代码行数:69,代码来源:dropblt.py


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