def loadVirtualSuit(self): dna = SuitDNA.SuitDNA() dna.newSuit(self.getSuitName()) self.virtualSuit = Suit.Suit() self.virtualSuit.reparentTo(self) self.virtualSuit.setDNA(dna) self.virtualSuit.setPos(self, 0.0, 2.5, 0.0) self.virtualSuit.makeSkeleton(wantNameInfo=False) self.virtualSuit.makeVirtual() self.virtualSuit.hideName() anims = self.generateSuitAnimDict() self.virtualSuit.loadAnims(anims) self.virtualSuit.loop('walk', 0) synergyBox = CollisionBox(0, 3.5, 10, 1) synergyBox.setTangible(0) synergyNode = CollisionNode(self.uniqueName('SynergyAttack')) synergyNode.setTag('damage', '10') synergyNode.addSolid(synergyBox) synergyNode.setIntoCollideMask(WallBitmask) self.synergyColl = self.virtualSuit.attachNewNode(synergyNode) self.synergyColl.setPos(0.0, 9.0, 0.0) self.synergyColl.stash() self.synergySfx = loader.loadSfx('phase_5/audio/sfx/SA_synergy.ogg') self.teeOffSfx = loader.loadSfx('phase_5/audio/sfx/SA_tee_off.ogg') self.writeOffSfx = loader.loadSfx( 'phase_5/audio/sfx/SA_writeoff_pen_only.ogg') self.dingSfx = loader.loadSfx( 'phase_5/audio/sfx/SA_writeoff_ding_only.ogg')
def _base_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(-.2, 0, 0.04), x=.16 + radius, y=.2 + radius, z=.04 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(-.24, 0, 0.24), x=.12 + radius, y=.125 + radius, z=.24 + radius) collision_node.addSolid(collision_primitive_c1) collision_primitive_c2 = CollisionBox(Point3(-.07, 0, 0.4), x=.075 + radius, y=.125 + radius, z=.06 + radius) collision_node.addSolid(collision_primitive_c2) collision_primitive_l0 = CollisionBox(Point3(0, 0.145, 0.03), x=.135 + radius, y=.055 + radius, z=.03 + radius) collision_node.addSolid(collision_primitive_l0) collision_primitive_r0 = CollisionBox(Point3(0, -0.145, 0.03), x=.135 + radius, y=.055 + radius, z=.03 + radius) collision_node.addSolid(collision_primitive_r0) return collision_node
def loadVirtualSuit(self): dna = SuitDNA.SuitDNA() dna.newSuit(self.getSuitName()) self.virtualSuit = Suit.Suit() self.virtualSuit.reparentTo(self) self.virtualSuit.setDNA(dna) self.virtualSuit.setPos(self, 0.0, 2.5, 0.0) self.virtualSuit.makeSkeleton(wantNameInfo=False) self.virtualSuit.makeVirtual() self.virtualSuit.hideName() anims = self.generateSuitAnimDict() self.virtualSuit.loadAnims(anims) self.virtualSuit.loop('walk', 0) synergyBox = CollisionBox(0, 3.5, 10, 1) synergyBox.setTangible(0) synergyNode = CollisionNode(self.uniqueName('SynergyAttack')) synergyNode.setTag('damage', '10') synergyNode.addSolid(synergyBox) synergyNode.setIntoCollideMask(WallBitmask) self.synergyColl = self.virtualSuit.attachNewNode(synergyNode) self.synergyColl.setPos(0.0, 9.0, 0.0) self.synergyColl.stash() self.synergySfx = loader.loadSfx('phase_5/audio/sfx/SA_synergy.ogg') self.teeOffSfx = loader.loadSfx('phase_5/audio/sfx/SA_tee_off.ogg') self.writeOffSfx = loader.loadSfx('phase_5/audio/sfx/SA_writeoff_pen_only.ogg') self.dingSfx = loader.loadSfx('phase_5/audio/sfx/SA_writeoff_ding_only.ogg')
def _base_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(.0, 0.0, 0.225), x=.14 + radius, y=.14 + radius, z=.225 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(0.031, 0.0, 0.73), x=.0855 + radius, y=.0855 + radius, z=.27 + radius) collision_node.addSolid(collision_primitive_c1) return collision_node
def _waist_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(-.183, 0, -1.68), x=.3 + radius, y=.3 + radius, z=.26 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(-.183, 0, -1.28), x=.3 + radius, y=.135 + radius, z=.15 + radius) collision_node.addSolid(collision_primitive_c1) collision_primitive_c2 = CollisionBox(Point3(0, 0, -.93), x=.06 + radius, y=.06 + radius, z=.2 + radius) collision_node.addSolid(collision_primitive_c2) return collision_node
def _base_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(-0.1, 0.0, 0.14 - 0.82), x=.35 + radius, y=.3 + radius, z=.14 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(0.0, 0.0, -.3), x=.112 + radius, y=.112 + radius, z=.3 + radius) collision_node.addSolid(collision_primitive_c1) return collision_node
def _chest_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(-.0505, 0, .45), x=.136 + radius, y=.12 + radius, z=.09 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(-.028, 0, .3), x=.1 + radius, y=.07 + radius, z=.05 + radius) collision_node.addSolid(collision_primitive_c1) collision_primitive_l0 = CollisionBox(Point3(0.005, 0.16, .515), x=.037 + radius, y=.055 + radius, z=.02 + radius) collision_node.addSolid(collision_primitive_l0) collision_primitive_r0 = CollisionBox(Point3(0.005, -0.16, .515), x=.037 + radius, y=.055 + radius, z=.02 + radius) collision_node.addSolid(collision_primitive_r0) return collision_node
def addImage(self, filename='../Artwork/022waVoF8tbU.jpg', name='NAME', id=0): cm = CardMaker('card_' + str(id)) max_width = 120 with Image.open(filename) as img: width, height = img.size cm.setFrame(0, max_width, 0, height * max_width * 1. / width) card = self.render.attachNewNode(cm.generate()) card.setPos(-270, 100 - id * max_width * 1.5, (300 - height * max_width * 1. / width) * 0.5) # card.setPos(-5, 100, 125) card.setHpr(90, 0, 0) box = CollisionBox(Point3(), max_width, 1, height * max_width * 1. / width) cnodePath = card.attachNewNode(CollisionNode('cnode')) cnodePath.node().addSolid(box) # cnodePath.show() card.setTag('myObjectTag', str(id)) tex = loader.loadTexture(filename) # tex = self.loader.loadTexture('maps/noise.rgb') card.setTexture(tex)
def __init__(self, services: Services, base: ShowBase, map_data: MapData, name: Optional[str] = None): self.__services = services self.__services.ev_manager.register_listener(self) self.__base = base self.__name = name if name is not None else (map_data.name + "_picker") self.__map = map_data self.__data = map_data.data # collision traverser & queue self.__ctrav = CollisionTraverser(self.name + '_ctrav') self.__cqueue = CollisionHandlerQueue() # collision boxes self.__cn = CollisionNode(self.name + '_cn') self.__cn.set_collide_mask(MapPicker.COLLIDE_MASK) self.__cnp = self.__map.root.attach_new_node(self.__cn) self.__ctrav.add_collider(self.__cnp, self.__cqueue) self.__points = [] z_offset = 1 if self.__map.dim == 3 else self.__map.depth for idx in np.ndindex(self.__data.shape): if bool(self.__data[idx] & MapData.TRAVERSABLE_MASK): p = Point(*idx) self.__points.append(p) idx = self.__cn.add_solid(CollisionBox(idx, Point3(p.x+1, p.y+1, p.z-z_offset))) assert idx == (len(self.__points) - 1) # mouse picker self.__pn = CollisionNode(self.name + '_pray') self.__pnp = self.__base.cam.attach_new_node(self.__pn) self.__pn.set_from_collide_mask(MapPicker.COLLIDE_MASK) self.__pray = CollisionRay() self.__pn.add_solid(self.__pray) self.__ctrav.add_collider(self.__pnp, self.__cqueue)
def getObjectsInBox(self, mins, maxs): objects = [] # Create a one-off collision box, traverser, and queue to test against all MapObjects box = CollisionBox(mins, maxs) node = CollisionNode("selectToolCollBox") node.addSolid(box) node.setFromCollideMask(self.Mask) node.setIntoCollideMask(BitMask32.allOff()) boxNp = self.doc.render.attachNewNode(node) queue = CollisionHandlerQueue() base.clickTraverse(boxNp, queue) queue.sortEntries() key = self.Key entries = queue.getEntries() # Select every MapObject our box intersected with for entry in entries: np = entry.getIntoNodePath().findNetPythonTag(key) if not np.isEmpty(): obj = np.getPythonTag(key) actual = self.getActualObject(obj, entry) if isinstance(actual, list): for a in actual: if not any(a == x[0] for x in objects): objects.append((a, entry)) else: objects.append((actual, entry)) boxNp.removeNode() return objects
def create(parent: NodePath, car: Car) -> NodePath: """Create actor for given `car` and reparent it to `parent`.""" model_filename = resource_filename('tsim', 'data/models/car') node_path = p3d.loader.load_model(model_filename) node_path.name = f'car-{car.id}' node_path.tags['id'] = str(car.id) collision_solid = CollisionBox((0.0, 0.0, 0.0), 1.0, 1.0, 1.0) collision_np = node_path.attach_new_node(CollisionNode('cnode')) collision_np.node().add_solid(collision_solid) if car.position is not None: node_path.set_pos(*car.position, 0.0) node_path.look_at(*(car.position + car.direction), 0.0) node_path.set_color(*hsv_to_rgb(random() * 360.0, 0.7, 1.0, 1.0)) node_path.reparent_to(parent) # light = PointLight(f'car-{car.id}-light') # light.set_color((1.0, 1.0, 0.6, 1.0)) # light.set_attenuation((1.0, 0.5, 0.0)) # light_np = node_path.attach_new_node(light) # light_np.set_pos((0.0, 3.0, 1.0)) # p3d.render.set_light(light_np) return node_path
def initActor(self): faEmpty = self.stage.find("**/{}_{}".format(self.name, self.indexNumber)) faPos = faEmpty.getPos() self.actor = Actor( "{}".format(self.modelName), { "idle": "{}-idle".format(self.modelName), "walk": "{}-walk".format(self.modelName) }) self.actor.reparentTo(self.stage) self.actor.setPos(faPos) cNode = CollisionNode("{}_{}".format(self.name, self.indexNumber)) cNode.addSolid(CollisionBox(0, 1.5, 1.5, 1)) faCollision = self.actor.attachNewNode(cNode) ##################################################### # faCollision.show() ##################################################### base.pusher.addCollider(faCollision, self.actor, base.drive.node()) base.cTrav.addCollider(faCollision, base.pusher) self.actorsList.append(self) AIchar = AICharacter("{}_{}".format(self.name, self.indexNumber), self.actor, 100, 0.05, 5) base.AIworld.addAiChar(AIchar) self.AIbehaviors = AIchar.getAiBehaviors()
def CreateBasement( self ): # it will create basement object, just for case that nothing is drawn to be not lost # Load the environment model. self.cube = self.base.loader.loadModel( "models/cube") # /media/Data/Data/Panda3d/ # Reparent the model to render. self.cube.reparentTo(self.render) # Apply scale and position transforms on the model. self.cube.setScale(10, 10, 10) self.cube.setPos(-8, -40, 0) self.cube.setColor(1.0, 0, 0, 1.0) self.cube.setRenderModeThickness(5) self.cube.setRenderModeFilledWireframe(LColor(0, 0, 0, 1.0)) # COLLISION collBox = CollisionBox(self.cube.getPos(), 10.0, 10.0, 10.0) cnodePath = self.cube.attachNewNode(CollisionNode("cnode")) cnodePath.node().addSolid(collBox) self.cube.setTag("clickable", "1")
def __init__(self, widget, axis): NodePath.__init__(self, "transformWidgetAxis") self.reparentTo(widget) self.widget = widget vec = Vec3(0) vec[axis] = 1.0 self.direction = vec self.defaultColor = Vec4(vec[0], vec[1], vec[2], 1.0) self.rolloverColor = Vec4(vec + 0.5, 1.0) self.downColor = Vec4(vec - 0.5, 1.0) self.lookAt(vec) self.setTransparency(1) self.axisIdx = axis box = CollisionBox(*self.getClickBox()) cnode = CollisionNode("pickBox") cnode.addSolid(box) cnode.setIntoCollideMask(LEGlobals.ManipulatorMask) cnode.setFromCollideMask(BitMask32.allOff()) self.pickNp = self.attachNewNode(cnode) self.pickNp.setPythonTag("widgetAxis", self) self.state = Ready self.setState(Ready)
def recalcBoundingBox(self): if not self.np: return # Don't have the picker box or selection visualization contribute to the # calculation of the bounding box. if self.collNp: self.collNp.stash() self.hideBoundingBox() # Calculate a bounding box relative to ourself mins, maxs = self.getBounds(self.np) invalid, mins, maxs = self.fixBounds(mins, maxs) if invalid: mins = Point3(-8) maxs = Point3(8) self.boundingBox = BoundingBox(mins, maxs) self.boundsBox.setMinMax(mins, maxs) if self.selected: self.showBoundingBox() if self.collNp: self.collNp.unstash() self.collNp.node().clearSolids() self.collNp.node().addSolid(CollisionBox(mins, maxs)) self.collNp.hide(~VIEWPORT_3D_MASK) self.send('mapObjectBoundsChanged', [self])
def setWalkable(self, value): if value == False: self.collisionTube = CollisionBox(LPoint3f(0,0,0),LPoint3f(1,1,1)) self.collisionNode = CollisionNode('unwalkable') self.collisionNode.addSolid(self.collisionTube) self.collisionNodeNp = self.groundnode.attachNewNode(self.collisionNode)
def gen_cylindrical_cdnp(pdnp, name='cdnp_cylinder', radius=0.01): """ :param trimeshmodel: :param name: :param radius: :return: author: weiwei date: 20200108 """ bottom_left, top_right = pdnp.getTightBounds() center = (bottom_left + top_right) / 2.0 # enlarge the bounding box bottomleft_adjustvec = bottom_left - center bottomleft_adjustvec[2] = 0 bottomleft_adjustvec.normalize() bottom_left += bottomleft_adjustvec * radius topright_adjustvec = top_right - center topright_adjustvec[2] = 0 topright_adjustvec.normalize() top_right += topright_adjustvec * radius bottomleft_pos = da.pdv3_to_npv3(bottom_left) topright_pos = da.pdv3_to_npv3(top_right) collision_node = CollisionNode(name) for angle in np.nditer(np.linspace(math.pi / 10, math.pi * 4 / 10, 4)): ca = math.cos(angle) sa = math.sin(angle) new_bottomleft_pos = np.array([bottomleft_pos[0] * ca, bottomleft_pos[1] * sa, bottomleft_pos[2]]) new_topright_pos = np.array([topright_pos[0] * ca, topright_pos[1] * sa, topright_pos[2]]) new_bottomleft = da.npv3_to_pdv3(new_bottomleft_pos) new_topright = da.npv3_to_pdv3(new_topright_pos) collision_primitive = CollisionBox(new_bottomleft, new_topright) collision_node.addSolid(collision_primitive) return collision_node
def _torso_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c2 = CollisionBox(Point3(0.195, 0.0, 0.1704), x=.085 + radius, y=.101 + radius, z=.09 + radius) collision_node.addSolid(collision_primitive_c2) return collision_node
def __init__(self, entity, center=(0,0,0), size=(1,1,1)): super().__init__() size = [e/2 for e in size] size = [max(0.001, e) for e in size] # collider needs to have thickness self.shape = CollisionBox(Vec3(center[0], center[2], center[1]), size[0], size[2], size[1]) # self.remove() self.node_path = entity.attachNewNode(CollisionNode('CollisionNode')) self.node_path.node().addSolid(self.shape) self.visible = False
def createInvisibleSquareCollider(self, px,pz, w, h, collisionNodeName, nodeName , mask ): obj = self.scene.attachNewNode(nodeName) hitBox = CollisionBox( Point3(0,0,0), w, 5, h ) cNodePath = obj.attachNewNode( CollisionNode(collisionNodeName) ) cNodePath.node().addSolid(hitBox) cNodePath.node().setIntoCollideMask(mask) cNodePath.node().setFromCollideMask(mask) #cNodePath.show() base.cTrav.addCollider(cNodePath, self.collisionHandlerEvent) obj.setPos(px,0,pz)
def setupBoxCollider(self , node, px, py, pz, w,d,h, nm, colliderEventHandler , fromCollisionMask=0, intoCollisionMask=0 ): hitBox = CollisionBox( Point3(px,py,pz) , w,d,h) cnodePath = node.attachNewNode( CollisionNode(nm) ) cnodePath.node().addSolid(hitBox) cnodePath.node().setIntoCollideMask(intoCollisionMask) cnodePath.node().setFromCollideMask(fromCollisionMask) # cnodePath.show() self.showCollision(cnodePath) base.cTrav.addCollider(cnodePath, colliderEventHandler)
def setup_collision_handling(self): node = CollisionNode('entity collision node') box = CollisionBox(self.pos, 1, .2, 1) node.addSolid(box) nodepath = self.ref_node.attachNewNode(node) nodepath.setTag('canCollide', '1') nodepath.setPythonTag('callback', self.on_click) if self.base.verbose: nodepath.show()
def initKeyDoors(self): i = 0 for keyDoor in self.KeyDoorLogic: for door, value in self.doorControls.iteritems(): if keyDoor == door.getParent().getName(): c = Point3(0,0,0) p1 = Point3(c.getX()-1, c.getY()-0.8, c.getZ()) p2 = Point3(c.getX()+1, c.getY()+0.8, c.getZ()+2) keyDoorBox = CollisionBox(p1, p2) keyDoorBox.setTangible(False) keyDoorColNP = door.getParent().attachNewNode(CollisionNode('keyDoorActivation%d'%i)) keyDoorColNP.node().addSolid(keyDoorBox) keyDoorName = door.getParent().getName() self.accept("playerCollision-in-keyDoorActivation%d"%i, self.__setActivateElement, extraArgs=[True, keyDoorName, "door"]) self.accept("playerCollision-out-keyDoorActivation%d"%i, self.__setActivateElement, extraArgs=[False, keyDoorName, "door"]) i+=1
def _base_combined_cdnp(name, radius): collision_node = CollisionNode(name) collision_primitive_c0 = CollisionBox(Point3(0.18, 0.0, 0.105), x=.61 + radius, y=.41 + radius, z=.105 + radius) collision_node.addSolid(collision_primitive_c0) collision_primitive_c1 = CollisionBox(Point3(0.0, 0.0, 0.4445), x=.321 + radius, y=.321 + radius, z=.2345 + radius) collision_node.addSolid(collision_primitive_c1) collision_primitive_c2 = CollisionBox(Point3(0.0, 0.0, 0.8895), x=.05 + radius, y=.05 + radius, z=.6795 + radius) collision_node.addSolid(collision_primitive_c2) collision_primitive_c3 = CollisionBox(Point3(0.0, 0.0, 1.619), x=.1 + radius, y=.275 + radius, z=.05 + radius) collision_node.addSolid(collision_primitive_c3) collision_primitive_l0 = CollisionBox(Point3(0.0, 0.300, 1.669), x=.1 + radius, y=.029 + radius, z=.021 + radius) collision_node.addSolid(collision_primitive_l0) collision_primitive_r0 = CollisionBox(Point3(0.0, -0.300, 1.669), x=.1 + radius, y=.029 + radius, z=.021 + radius) collision_node.addSolid(collision_primitive_r0) return collision_node
def __init__(self): self.flyBot = base.loader.loadModel('models/flyBot') self.flyBot.setScale(1, 1, 1) self.flyBot.setPos(0, 0, 4) self.flyBot.setHpr(0, 0, 0) self.flyBot.reparentTo(render) self.moved = False self.playerCollide = CollisionBox(0, 3, 1.5, 1.5) self.playerNode = CollisionNode('player') self.playerNode.addSolid(self.playerCollide) self.playerNode.setFromCollideMask(CollideMask.bit(0)) self.playerNode.setIntoCollideMask(CollideMask.allOff()) self.playerCollider = self.flyBot.attachNewNode(self.playerNode)
def setupCollision(self): base.cTrav = CollisionTraverser() self.collisionHandlerEvent = CollisionHandlerEvent() self.collisionHandlerEvent.addInPattern('into-%in') self.collisionHandlerEvent.addOutPattern('outof-%in') hitBox = CollisionBox( Point3(7,0,-4.5) , 0.5,5,0.5) cnodePath = self.player.attachNewNode( CollisionNode('marioHitBox') ) cnodePath.node().addSolid(hitBox) cnodePath.show() base.cTrav.addCollider(cnodePath, self.collisionHandlerEvent) stairs1 = self.scene.find("root/bottomstair") hitBox = CollisionBox( Point3(-6.8,0,-3.0) , 0.5,5,2.5) cnodePath = stairs1.attachNewNode( CollisionNode('stairsHitBox') ) cnodePath.node().addSolid(hitBox) cnodePath.show() self.accept('into-stairsHitBox', self.enableStair) self.accept('outof-stairsHitBox', self.disableStair) base.cTrav.showCollisions(self.render)
def setupCollision(self): cs = CollisionSphere(0, 0, 0, 10) cnodePath = self.player.attachNewNode(CollisionNode('cnode')) cnodePath.node().addSolid(cs) cnodePath.show() for o in self.OBS: ct = CollisionBox(0, 1, 1, 0.5) cn = o.attachNewNode(CollisionNode('ocnode')) cn.node().addSolid(ct) cn.show() pusher = CollisionHandlerPusher() pusher.addCollider(cnodePath, self.player) self.cTrav = CollisionTraverser() self.cTrav.addCollider(cnodePath, pusher) self.cTrav.showCollisions(render)
def CreateGfx( self, loader, idx ): # idx is neccesary to be able to track it down for mouse picking self.__node = loader.loadModel("models/cube") self.__node.setPos(0, 0, 0) self.__node.setScale(0.5, 0.5, 0.5) self.__node.setTag("clickable", str(idx)) # to be able to click on it self.__node.setName("cell") # COLLISION collBox = CollisionBox(self.__node.getPos(), 1.0, 1.0, 1.0) cnodePath = self.__node.attachNewNode(CollisionNode("cnode")) cnodePath.node().addSolid(collBox) self.UpdateState(False, False)
def CreateGfx(self, loader, idx): self.__node = loader.loadModel("models/cube") #self.__node.setRenderModeFilledWireframe(LColor(0, 0, 0, 1.0)) self.__node.setPos(0, 0, 0) self.__node.setScale(0.5, 0.5, 0.5) self.__node.setTag("clickable", str(idx)) # to be able to click on it self.__node.setName("inputBit") # COLLISION collBox = CollisionBox(self.__node.getPos(), 1.0, 1.0, 1.0) cnodePath = self.__node.attachNewNode(CollisionNode("cnode")) cnodePath.node().addSolid(collBox) self.UpdateState()
def gen_box_cdnp(pdnp, name='cdnp_box', radius=0.01): """ :param obstacle: :return: author: weiwei date: 20180811 """ bottom_left, top_right = pdnp.getTightBounds() center = (bottom_left + top_right) / 2.0 # enlarge the bounding box bottom_left -= (bottom_left - center).normalize() * radius top_right += (top_right - center).normalize() * radius collision_primitive = CollisionBox(bottom_left, top_right) collision_node = CollisionNode(name) collision_node.addSolid(collision_primitive) return collision_node
def __init__(self, parent, name): self.chars = [] self.enemies = [] self.parent = parent self.name = name self.angle = 0 self.cells = 2 # rest zone collisions # used to detect pointing the Rest Zone by mouse col_node = CollisionNode(name) col_node.setFromCollideMask(NO_MASK) col_node.setIntoCollideMask(MOUSE_MASK) col_node.addSolid( CollisionBox(Point3(-0.09, -0.36, 0.15), Point3(0.09, -0.17, 0.27)) ) parent.attachNewNode(col_node)