Example #1
0
def e(eman, data):

    navMeshVisual = App().renderManager.displayMesh("navMesh")
    agentOuterNode = App().renderManager.sceneNode.createChildSceneNode("agentOuterNode")
    agent = App().agentManager.newAgent(agentOuterNode)
    agentEntity, agentNode = App().renderManager.displayMesh("agent", agent.getNode())

    agentNode.scale(2, 2, 2)  # 4,1.5)

    navMesh = NavigationMesh()
    buildFixedNavMesh(navMesh)
    navMesh.buildLinks()
    App().agentManager.setNavigationMesh(navMesh)

    import ogre.renderer.OGRE as ogre

    output = navMesh.getPointOnMesh(ogre.Vector3(0, 0, 0))
    if output != None:
        agent.getNode().setPosition(output[0])

    agentNode.pitch(ogre.Math.DegreesToRadians(90))
    agentNode.translate(0, 0.4, -0.2)

    App().eventManager.hook("agent_atGoal", agent)

    return True
Example #2
0
def e (eman, data):
  # event script...
  cam = App().renderManager.getCamera()
  cam.resetPosition()
  cam.resetOrientation()

  cam.translate(0,100,200)
  
  return True