Multiple objects loading

jonmiller

03-07-2008 15:09:55

I have a .mesh file with all my collision geometry in it for the bridge on my ship. Is there a way to load that file all at once creating collision cubes for everything on the bridge? Or do I need to continue loading each piece individually? Right now I have to load each piece and attach it to a scene node so that I can update it's position each frame. It seems kinda messy to me, but if that's what I have to do... I was looking into cooking briefly, is this what I want?

Thanks

betajaen

03-07-2008 16:06:30

If you turn it into a triangle mesh then you won't be able to move it around, if you use a convex, then you would have to use lots of convex to make up different parts of the bridge; walls, floor, etc. Basically what your doing now but with more detail.

Is there any chance I can see this bridge? To give my best recommendation. You can PM me with the link, if you don't want/can't to show it to the rest of the rabble on this forum.

jonmiller

03-07-2008 17:48:00


That's the geometry with the bridge.


That's all the geometry overhead view for the bridge

betajaen

03-07-2008 18:05:08

Well. You certaintly can't use a triangle mesh or a convex to represent that.

However; you can use multiple shapes per actor. So I would make the bridge one actor and have many of those cubes and convexes attached to it. (Using a ShapeGroup).

Then have a single Ogre mesh for the bridge (apart from those pieces that are movable or change in any way), that is given to the body to move around. Then for those extra pieces that do change, just create seperate scenenodes/entities each for them and add them as children to the Body's scenenode. That way, you only need to update the Body once and it will be automatically translated to the others; move the body - move the bridge.

jonmiller

03-07-2008 20:28:18

Ok that makes sense. I'll try that out and hopefully it'll go smoothly. Now I'm trying to figure out how to get my camera to stay on the ship when it's moving. I tried looking at the sample Raycast car demo and it looks like it's doing what I want. When you shoot a box at the car if it lands on the back it stays there. When I get my camera on the bridge and set the ship moving, the camera actor stays put and slides off the ship. I tried making the camera a child of the ship's node, but since the camera is following the actor that didn't work out too well.

betajaen

03-07-2008 20:38:21

You could make it part of the ships node but translate it by the difference between the characters and ship node.

jonmiller

03-07-2008 20:43:50

But how do I translate the camera actor? The only way I've been able to move it around is by adding local force to it because it's not kinematic. So should I just grab the translation vector / orientation of the ship and add that as part of the force?

betajaen

03-07-2008 21:13:43

Don't attach the Camera to the Body; infact just make it an actor. Attach the Camera to the Ship's node. Move it around as addForce like before. Then you need the coordinates of the actor relative to the ship. This is camera_actor_pos - ship_pos. You need to then set the Camera position to that. If if that's what you want. I would just attach it to the CameraActor and be done with it.

jonmiller

07-07-2008 21:57:06

I've been looking over your reply since the weekend and I'm afraid that it still doesn't make sense to me. I'm sorry that I keep going back and forth, but maybe I was a little unclear about what I want, or I just flat out don't get it. What I've been struggling over is in simplest form a moving platform. How is it possible to create a platform as a kinematic actor, because it must follow a specific path that when a dynamic actor is pushed onto it the dynamic actor travels with the platform? In my case the moving platform is the floor of the bridge on my ship and the dynamic actor is my first person camera. I've tried everything from mass, friction, dampening, and nothing works. It seems that i can either drag the actor around but then my actor doesn't collide with anything, or i can drag the camera around but then I don't stay with the ship when it moves. I hope this makes more sense and you can help, or maybe you can find a way to beat into my head the correct answer that you've been trying to tell me. :)
Thanks

betajaen

07-07-2008 22:15:54

I want to do something like this in the future with my own game. My solution was to use two scenes; interior and exterior but render them both in the same SceneManager. Perhaps you can do that.