Moving "down" from the bottom of the Z plane to 0x,0y,0z.
Posted: 2012-09-12, 08:39
Doing this would allow a person to make a map as spherical "planet", where objects fall toward the center of the sphere, rather than down the Z plane. The way I would use this is really quite simple actually,
1. Make a pretty big spherical shape.
2. Move the sphere's center to 0x,0y,0z.
3. Build a sky box around the sphere, with ample room for tall objects.
4. Put a starry sky texture on the sky box.
5. Build the content of the game/project on the surface of the sphere.
6. Rejoice in having a nifty seamless "world"!
I'm willing to try to code this myself, but I was looking at the physics.cpp code from what I can tell, it doesn't work in the simple terms that I was thinking. Before I looked at the code, I assumed that the code would tell all objects, at all times, that their natural state is to fall down the Z plane. That way they would always drop "down" when not supported (much like an object on Earth). If that was the case, then making the change I want would be as simple as changing the code so that it tells all objects that their natural state is to fall toward 0x,0y,0z instead of down the Z plane. Then to use this feature, all one would need to do in the world editor is simply stick a polygon between the movable objects and 0x,0y,0z. Voila, you've got a planet that things fall down onto! Alas, the code itself does not seem to be organized in this manner.
I think this something worth figuring out and fundamentally, it's not a complicated problem to solve. It's really just a matter of applying the concept to the code base. And that's where I am not sure where to begin.
So my questions are,
- What chunks of code in Cafu are used to tell objects where "down" is?
- If Cafu was not made with the concept of "down", how was gravity emulated in Cafu? Can it's center of mass simply be moved as per my desire?
- Are all objects (players, items, etc) treated the same with respect to the movement toward "down"?
- After making "down" 0x,0y,0z, would character models automatically stand upright on any surface that is between them and 0x,0y,0z (rather than still standing as upright in relation to the Z plane)? If not, what code tells objects how to orient themselves in relation to the ground (ie. "I am standing on a slanted root, so I bent my ankles to make sure I am still standing straight up in relation to the ground")?
I think this would be a fun (and potentially useful, for orbital simulations, etc.) feature to have in the Cafu engine. Let me know what you think!
1. Make a pretty big spherical shape.
2. Move the sphere's center to 0x,0y,0z.
3. Build a sky box around the sphere, with ample room for tall objects.
4. Put a starry sky texture on the sky box.
5. Build the content of the game/project on the surface of the sphere.
6. Rejoice in having a nifty seamless "world"!
I'm willing to try to code this myself, but I was looking at the physics.cpp code from what I can tell, it doesn't work in the simple terms that I was thinking. Before I looked at the code, I assumed that the code would tell all objects, at all times, that their natural state is to fall down the Z plane. That way they would always drop "down" when not supported (much like an object on Earth). If that was the case, then making the change I want would be as simple as changing the code so that it tells all objects that their natural state is to fall toward 0x,0y,0z instead of down the Z plane. Then to use this feature, all one would need to do in the world editor is simply stick a polygon between the movable objects and 0x,0y,0z. Voila, you've got a planet that things fall down onto! Alas, the code itself does not seem to be organized in this manner.
I think this something worth figuring out and fundamentally, it's not a complicated problem to solve. It's really just a matter of applying the concept to the code base. And that's where I am not sure where to begin.
So my questions are,
- What chunks of code in Cafu are used to tell objects where "down" is?
- If Cafu was not made with the concept of "down", how was gravity emulated in Cafu? Can it's center of mass simply be moved as per my desire?
- Are all objects (players, items, etc) treated the same with respect to the movement toward "down"?
- After making "down" 0x,0y,0z, would character models automatically stand upright on any surface that is between them and 0x,0y,0z (rather than still standing as upright in relation to the Z plane)? If not, what code tells objects how to orient themselves in relation to the ground (ie. "I am standing on a slanted root, so I bent my ankles to make sure I am still standing straight up in relation to the ground")?
I think this would be a fun (and potentially useful, for orbital simulations, etc.) feature to have in the Cafu engine. Let me know what you think!