self.cameraPos = p
        self.cameraRot = r
        self.cameraFrustum = fr
        self._updateInternalActiveAndVisibleChunksCache()


if __name__ == "__main__":
    cameraPos = Vector3(0,0,0)
    cameraRot = Quaternion.fromAxisAngle(Vector3(0,1,0), 0)
    cameraSpeed = 5.0
    cameraRotSpeed = 1.0
    cameraFrustum = Frustum()
    cameraEye = Vector3(0,0,0)
    cameraCenter = Vector3(0,0,0)
    cameraUp = Vector3(0,0,0)

    cameraEye, cameraCenter, cameraUp = \
        math3D.getCameraEyeCenterUp(cameraPos, cameraRot)
    cameraFrustum.setCamInternals(65, 640.0/480.0, .1, 1000)
    cameraFrustum.setCamDef(cameraEye, cameraCenter, cameraUp)

    chunkStore = ChunkStore(0)
    chunkStore.setCamera(cameraPos, cameraRot, cameraFrustum)

    print "A chunk at the origin:", chunkStore.getChunk(cameraPos)
    chunkStore.prefetchChunk(Vector3(0.0, 0.0, 0.0))
    print "Active Chunks:", chunkStore.activeChunks
    print "Visible Chunks:", chunkStore.visibleChunks

    chunkStore.sync()
Пример #2
0
def updateCameraLookVectors():
    "Update the cached camera look vectors"
    global cameraEye, cameraCenter, cameraUp
    cameraEye, cameraCenter, cameraUp = \
        math3D.getCameraEyeCenterUp(cameraPos, cameraRot)