def newclient(self, clientid, pos): #self.clients.add() ent = r.createEntity("Jack.mesh", self.previd) self.previd += 1 ent.placeable.Position = Vec3(pos[0], pos[1], SPAWNPOS[2]) print "New entity for web socket presence at", ent.placeable.Position self.clientavs[clientid] = ent
def worldpos(x, y): wx = 120 + (x * DISTANCE) wy = 120 - (y * DISTANCE) wz = HEIGHT return Vec3(wx, wy, wz)
gettext.install("pychess", unicode=1) from pychess.Utils.const import * #for EMPTY and such in board making from PythonQt.QtGui import QVector3D as Vec3 from PythonQt.QtGui import QQuaternion as Quat import circuits import rexviewer as r DISTANCE = 1.5 #between the pieces on the board HEIGHT = 23 #on world.realxtend.org:8002 - will probably be relateive to the entity which runs this AVROT = Quat(1, 1, 0, 0) piecevis = { PAWN: ('axis1.mesh', Vec3(0.5, 0.5, 0.7), None), KNIGHT: ('axis1.mesh', Vec3(0.6, 0.6, 0.85), None), BISHOP: ('rotate1.mesh', Vec3(0.5, 0.5, 1.0), None), ROOK: ('scale1.mesh', Vec3(0.5, 0.5, 0.92), None), QUEEN: ('avatar.mesh', Vec3(1.0, 1.0, 1.0), AVROT), KING: ('Jack.mesh', Vec3(1.0, 1.0, 1.0), AVROT) } def index2pos(cord): return cord / 8, cord % 8 def worldpos(x, y): wx = 120 + (x * DISTANCE) wy = 120 - (y * DISTANCE)
else: print "not" if 0: #log level visibility r.logDebug("Debug") #r.logWarning("Warning") #not implement now, should add i guess r.logInfo("Info") if 0: #local object creation, testing if local previews of .scenes would work from PythonQt.QtGui import QVector3D as Vec3 from PythonQt.QtGui import QQuaternion as Quat print "hep" e = r.createEntity("Jack.mesh", 1515) print e e.placeable.Position = Vec3(128, 128, 60) e.placeable.Scale = Vec3(5, 5, 5) e.placeable.Orientation = Quat(0, 0, 0, 1) if 0: #running localscene dotscene loader import localscene.loader localscene.loader = reload(localscene.loader) filename = "pymodules/localscene/test.scene" localscene.loader.load_dotscene(filename) #avatar = r.getEntity(r.getUserAvatarId()) #print avatar.placeable.Position.toString() if 0: #loadurl handler import test import loadurlhandler
print a.SetAnimationTimePosition(animname, r.t % 1) if 0: #log level visibility r.logDebug("Debug") #r.logWarning("Warning") #not implement now, should add i guess r.logInfo("Info") if 0: #local object creation, testing if local previews of .scenes would work from PythonQt.QtGui import QVector3D as Vec3 from PythonQt.QtGui import QQuaternion as Quat print "hep" e = naali.createMeshEntity("Jack.mesh") print e e.placeable.position = Vec3(128, 128, 60) e.placeable.scale = Vec3(5, 5, 5) e.placeable.orientation = Quat(0, 0, 0, 1) if 0: #createentity directly from the c++ scenemanager where it's a qt slot now #s = naali.getDefaultScene() #id = s.NextFreeId() #ent = s.CreateEntityRaw(id) ent = naali.createEntity() print "new entity created:", ent, ent.id if 0: #running localscene dotscene loader import localscene.loader localscene.loader = reload(localscene.loader) filename = "pymodules/localscene/test.scene"
def updateclient(self, clientid, pos): ent = self.clientavs[clientid] ent.placeable.Position = Vec3(pos[0], pos[1], SPAWNPOS[2])