Pivot points

Prophet

21-08-2008 18:33:30

Okay, first, I don't know if it's called pivot points here, but that what's I've learned so I'll stick with that for now.
I have a slight problem. When I use this code
nodes.at(i)->setPosition(actors.at(i)->getGlobalPositionAsOgreVector3());
nodes.at(i)->setOrientation(actors.at(i)->getGlobalOrientationAsOgreQuaternion());

it appears as if they have different pivot points (the anchor point, around which it rotates). Is it my code that is wrong (yeah, well...) or is that they have different pivot points and need to be calculated? The size of the mesh matches the cube, might I say.
Lastly, is this a good way to do it? I mean, linking nodes to actors, or is it a better way? I'm still learning, so any tip is useful! (Even OT-tips)
Video

mcaden

22-08-2008 03:23:43

I would suggest using bodies.

Prophet

22-08-2008 13:05:52

Well, I just can't get them to work and in the comments at NxOgre::Body, it says something like "...and should never be used seriously."

betajaen

22-08-2008 15:26:51

Bodies shouldn't be used in serious applications as they don't factor a number of things in (i.e. sound emitters, event handling, AI, etc.). But there is no reason why you can't use them now for light stuff.

How do they not work with you? Got any code?

Prophet

22-08-2008 15:52:23

Here's my code (basically)
mBody = mScene->createBody("Box01.mesh", new NxOgre::Cube (1.0f), Vector3(0, 50, 0), "mass 10");
See my other post for more details on this. Since I'm using actors now, I've deleted the code, but this was the one that was crashing. By the way, where does NxOgre look for resources?

betajaen

22-08-2008 16:13:43

It doesn't handle Ogre resources. "Box01.mesh" is short hand to tell Ogre to create a node, attach an entity with the mesh name "Box01.mesh" to it.

If it crashes, then it's because Box01.mesh can't be found by Ogre.

Prophet

22-08-2008 16:25:37

Ah. But it can be found, because if I load it from Ogre, it's visible. But since I won't use it (I guess), there's no need to anyway. Thanks, though!

Prophet

23-08-2008 16:06:04

Oh, I just had a different size in mesh and cube. But still, what is the actual point from where NxOgre (and, apparently, Ogre) gets the position of the object? Center? I'm just curious. :)

betajaen

23-08-2008 16:19:38

Yes, the center.

Prophet

23-08-2008 16:52:01

Okay, thanks! It's a really wonderful thing you've done! I expect great things from this. I absolutely love it!