P-152: Virtual World Concept Update 147: Planet-sized Terrain: Part 26
The next major goal with P-152 will hopefully be the last really difficult task in MS2. This objective is to add not just 3D gravity (which has already been implemented) but to orient the player correctly regardless of their position in the world.
I have modified gravity to point towards the center of the world, and I have previous implemented a resource that replaces the existing player rotation, which only allows rotation about the Z-axis, with a quaternion, which allows rotation about all axes.
I now need to calculate a value for this quaternion that changes the players orientation so that their feet always point towards the terrain surface, regardless of their position. This will be complex, since my knowledge of Quaternion mathematics is not as good as it probably should be (Quaternions are used a lot in computer graphics).

03/08/2016 , 06:58:12 PM
Torque 3D MIT – P152

02/08/2016 , 06:39:42 PM
Torque 3D MIT – P152
I have also run into a slight issue with the collision code, which I have temporarily worked around by adding all visible nodes to the collision list. This will need to be fixed properly later, since the current workaround is far too slow for production use.
P152_DEBUG
01/08/2016 , 03:09:32 AM
Torque 3D MIT – P152
I have created a testing scenario for the orientation problem, which is basically just a cube, with collision, and the center of gravity set to the center of the cube. I can now easily see whether the player is aligned correctly to the surface or not.
I have discovered that when the player is standing on the surface of the terrain, a “contactnormal” is generated which should describe the facing of that polygon of the terrain. I can hopefully use these contact normals to form the orientation quaternion, if I can figure out the math involved. Quaternion math is not nearly as intuitive as Euler math.

03/08/2016 , 08:56:42 PM
Torque 3D MIT – P152

03/08/2016 , 08:57:06 PM
Torque 3D MIT – P152

