On Jul 23, 12:00 am, Jonne Nauha <[email protected]> wrote:
> That would be helpful if you can give concrete use cases.

(snip)

Well, I've got two kinds of py modules that are loaded at Tundra
startup. One collects camera coordinates and rotations and sends them
to an external server. Like this, every time def update is called:

(snip)
self.p =
naali.getDefaultScene().GetEntityByNameRaw("FreeLookCamera").GetComponentRaw("EC_Placeable")

(snip)

        x = self.p.transform.position().x()
        y = self.p.transform.position().y()
        inv = self.p.transform.rotation()
        inv.invert()
        zed = inv.z()%360

The other inherits circuits/UDPServer and rotates the orientation
vector around an axis the amount that is coming in over UDP (data):

        axis = QVector3D(0, 1, 0)

       (snip)

        mov = -1.0 #if we multiply with this, moves about one degree
like a compass
        try:  #only float values are ok
            mov *= float(data)
        except:
            return
        ort = None
        if naali.getDefaultScene().Name == "TundraServer":
            L = naali.server.GetConnectionIDs()
            if L == () or L is None or len(L) == 0:
                ort =
naali.getDefaultScene().GetEntityByNameRaw("FreeLookCamera").GetComponentRaw("EC_Placeable").orientation
                if ort is not None:
                    ort = ort *
QQuaternion.fromAxisAndAngle(self.axis, mov)
naali.getDefaultScene().GetEntityByNameRaw("FreeLookCamera").GetComponentRaw("EC_Placeable").orientation
= ort

Then I've got slightly different ones for the client scene and for
moving the position vector remotely, but they use the same methods
basically. So: I'd need the circuits/UDPServer stuff, and ways to
access the camera position and orientation data.

Transform now uses float3 instead of Vector3df , and there is the Quat
class for quaternions, but there are getters and setters for them.
Just need a way to use them with py, at runtime. And yes, Scene is
very different now, isn't it? No default scenes, no active cameras?

So, I did not use the shortcuts but those long method chains. That is,
I don't need the shortcuts, just a way to call the new Qt methods via
py.

- - - - - - -

Your newer posting: I'll compile the new code on Monday and try it
out. Yes, adding the py modules I need, like the js
ones, in the startup config would be logical and proper.

-- 
http://groups.google.com/group/realxtend
http://www.realxtend.org

Reply via email to