About Camera

crioto

26-10-2008 09:56:39

So, i have a camera with attached camera node;
I want thats my camera don't move throw walls and any geometry. So i think i must make a body for my camera scene node. When i do this - my camera is just falling on floor and i can't move it. How can i do movement of my camera (and other nodes in the future?)

betajaen

26-10-2008 10:41:33

Have a look at Cake4 that has a magically floaty camera.

crioto

27-10-2008 05:42:57

Thank you, betajaen! I'll look

crioto

29-10-2008 05:47:45

Cake 4 is for 1.0'22 only? Because i have some compile errors when i try to compile Cake.

betajaen

29-10-2008 09:16:04

You don't have to compile it to view the source code.

crioto

29-10-2008 10:55:45

You don't have to compile it to view the source code.
Yep, i can see the code, but i can't understand the following code:
mActor = scene->createBody<Body>("CakeSmartCamera", new NxOgre::Sphere(0.25f), Vector3(0,15,22), renderableParams, actorParams);
Compiler can't understand "Body" in this expression!
I can't understand: Instead of an actor I need to use the body? If that so, i have one more question:
Can i move my CameraNode using Ogre SceneNode methods(translate) instead NxOgre (moveTo)? Or i should do movement only via NxOgre?

betajaen

29-10-2008 11:08:04

Remove <Body> part then, obviously it's not in your NxOgre so it isn't needed.

Let NxOgre do the moving, it's far better at it.

crioto

29-10-2008 11:10:18

Remove <Body> part then, obviously it's not in your NxOgre so it isn't needed.

Let NxOgre do the moving, it's far better at it.

OK, i got it!

crioto

30-10-2008 05:00:14

Ok, now i create camera, assign movement to it, but i have new problem:
My camera is waving like on the sea. So, i search the forum and found the DisableGravity parameter. When i assign it to my camera node - ny camera now can fly, but i want it walk on the ground! How can i solve it?

betajaen

30-10-2008 10:17:55

You never said about walking. A Character would be more suitable for that; otherwise some people have posted on how to create a Character with a standard Actor.

First enable gravity, play with the damping, and frozen flags that should start you of a little.

nargil

30-10-2008 12:25:02

Talking about characters: I just wonder if it's better to create a character using 2 actors + 1 joint like here http://www.ogre3d.org/wiki/index.php/Og ... _Character , or use PhysX directly NxBoxControllerDesc desc;
NxController* c;

NxUserAllocatorDefault* myAllocator;
myAllocator = new NxUserAllocatorDefault;

NxControllerManager* gManager = NxCreateControllerManager(myAllocator);
desc.extents = NxVec3(1.0, 1.0, 3.0);
desc.upDirection = NX_Z;
desc.stepOffset = 1.0;
desc.slopeLimit = cosf(NxMath::degToRad(60.0f));
c = gManager->createController(gScene, desc);
NxReleaseControllerManager(gManager);


hmmm ? Or maybe is the 3rd option the best (waiting till betajean finishes his character code). But nobody knows when that will happen