Exemplo n.º 1
0
    def load(self):
        DistributedEntityAI.load(self)

        self.setModel("models/cage.bam", True)
        self.setModelScale(self.getEntityValueVector("scale"))
        self.optimizeModel()
        self.enableModelCollisions()
Exemplo n.º 2
0
    def load(self):
        DistributedEntityAI.load(self)

        from panda3d.core import VirtualFileSystem
        vfs = VirtualFileSystem.getGlobalPtr()
        self.scriptSrc = vfs.readFile(self.scriptFilename, True)

        self.target = self.bspLoader.getPyEntityByTargetName(
            self.getEntityValue("scriptTarget"))
Exemplo n.º 3
0
    def load(self):
        DistributedEntityAI.load(self)
        self.setHpr(self.cEntity.getAngles())
        self.setPos(self.cEntity.getOrigin())

        self.setModel("phase_9/models/cogHQ/square_stomper.bam")
        self.setModelScale(self.scale)
        self.getModelNP().find("**/shaft").setSy(self.height / 16.0)

        self.optimizeModel()

        box = BulletBoxShape((self.scale[1], 1.0, self.scale[0]))
        gh = BulletGhostNode('trigger_hurt')
        gh.addShape(box, TransformState.makePos((0, -0.5, 0)))
        self.floorColl = self.getModelNP().attachNewNode(gh)
        self.floorColl.setCollideMask(CIGlobals.WallGroup
                                      | CIGlobals.CharacterGroup)

        self.enableModelCollisions()

        for bNP in self.getModelNP().findAllMatches("**/+BulletRigidBodyNode"):
            bNP.setSurfaceProp("metal")

        self.b_setEntityState(self.StateUp)