Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setup_wall_collision(self,playerob):
- self.b.cTrav=CollisionTraverser() #ok so because this is the defautl
- #I don't have to call some "traverse" method
- self.CHP=CollisionHandlerPusher() #which means this should be filled
- self.col_Node=CollisionNode("sphere")
- self.col_NodeNP=playerob.attachNewNode(self.col_Node)# I think char object/geom goes here with attachNode
- self.col_NodeNP.set_tag("player_col_tag","player_col_tag_value")
- self.col_Node.setFromCollideMask(BitMask32.bit(3))
- self.col_Node.setIntoCollideMask(BitMask32.bit(0))
- self.col_body=CollisionSphere((0,0,0),2)
- self.col_Node.addSolid(self.col_body)
- self.CHP.addCollider(self.col_NodeNP,playerob)
- self.CHP.addInPattern("wall in")
- self.CHP.addOutPattern("wall out")
- self.CHP.addAgainPattern("wall again")
- self.b.cTrav.addCollider(self.col_NodeNP,self.CHP)
- self.event_handler.accept("wall in",self.wall_in)
- self.event_handler.accept("wall out",self.wall_out)
- self.event_handler.accept("wall again",self.wall_again)
- def wall_again(self,*args):
- print("wall again")
- print(args)
- for x in args:
- print(x)
- a=1
- output
- wall again
- (render/AvatarArm/sphere into render/Object at 0.471405 5 0,)
- CollisionEntry:
- from render/AvatarArm/sphere
- into render/Object [wall]
- at 0.471405 5 0
- normal 0 -1 0
- interior 0.471405 5.1214 0 (depth 0.121405)
- respect_prev_transform = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement