1 from panda3d
.bullet
import BulletBoxShape
, BulletRigidBodyNode
, BulletGhostNode
2 from pmachines
.items
.item
import Item
7 def __init__(self
, world
, plane_node
, cb_inst
, curr_bottom
, repos
, mass
=1, pos
=(0, 0, 0), r
=0, count
=0):
8 super().__init
__(world
, plane_node
, cb_inst
, curr_bottom
, repos
, 'assets/gltf/box/box.gltf', mass
=mass
, pos
=pos
, r
=r
, count
=count
)
11 self
.node
.add_shape(BulletBoxShape((.5, .5, .5)))
16 def __init__(self
, hit_by
, node
, world
):
21 def win_condition(self
):
22 for contact
in self
._world
.contact_test(self
._node
).get_contacts():
23 other
= contact
.get_node1() if contact
.get_node0() == self
._node
else contact
.get_node0()
24 if other
== self
._hit
_by
.node
: