--- /dev/null
+from panda3d.bullet import BulletSphereShape, BulletRigidBodyNode, BulletGhostNode
+from pmachines.items.item import Item
+
+
+class Basketball(Item):
+
+ def __init__(self, world, plane_node, count, cb_inst, curr_bottom, repos):
+ super().__init__(world, plane_node, count, cb_inst, curr_bottom, repos, 'assets/gltf/basketball/basketball.gltf', .4)
+
+ def _set_phys(self):
+ super()._set_phys()
+ self._shape = BulletSphereShape(1)
class Item:
- def __init__(self, world, plane_node, count, cb_inst, curr_bottom, scene_repos, model_path):
+ def __init__(self, world, plane_node, count, cb_inst, curr_bottom, scene_repos, model_path, model_scale=1):
self._world = world
self._plane_node = plane_node
self._count = count
self.repos_done = False
self._curr_bottom = curr_bottom
self._scene_repos = scene_repos
+ self._model_scale = model_scale
self._model_path = model_path
self._commands = []
self._command_idx = -1
self._model.flatten_light()
self._model.reparent_to(self._np)
self._set_outline_model()
+ self._np.set_scale(model_scale)
set_srgb(self._outline_model)
self._model.hide(BitMask32(0x01))
self._outline_model.hide(BitMask32(0x01))
self._model.reparent_to(self._np)
self._np.set_pos(pos)
self._set_outline_model()
+ self._np.set_scale(self._model_scale)
self._model.show(BitMask32(0x01))
self._outline_model.hide(BitMask32(0x01))
self._instantiated = True
from pmachines.items.box import Box
from pmachines.items.shelf import Shelf
from pmachines.items.domino import Domino
+from pmachines.items.basketball import Basketball
from pmachines.sidepanel import SidePanel
from lib.engine.gui.cursor import MouseCursor
from lib.lib.p3d.gfx import P3dGfxMgr
self.items = [Box(self._world, self._mouse_plane_node, 3, self.cb_inst, self.current_bottom, self.repos)]
self.items += [Shelf(self._world, self._mouse_plane_node, 3, self.cb_inst, self.current_bottom, self.repos)]
self.items += [Domino(self._world, self._mouse_plane_node, 3, self.cb_inst, self.current_bottom, self.repos)]
+ self.items += [Basketball(self._world, self._mouse_plane_node, 3, self.cb_inst, self.current_bottom, self.repos)]
self._commands = []
self._command_idx = 0
* issues
* todo
** implement other items
-*** basketball
*** teeter_tooter
+** move the overlapping object a bit farther
** create one level per item, then levels with more items
*** e.g. item1, item2, item1+2, item3, item1+2+3, ...
** refactoring