Okay, I have looked at some of the grappling hook cogs (including the ones posted in this thread by Hell Raiser), trying to make sense of them.
Most of the hook cogs use some variant of 'pushing' the player toward the hook once it attaches, and not much else.
Quib Mask's cogs are also worthy of mention, but I am focusing on the swinging physics, for now.
HR's cogs seem to be the first real attempt at simulating swinging. (Yay!) HR's method disables the engine's physics for the player and simulates the swinging physics all in the cog.
Impressive as the swinging code is, I am hoping to figure out something more general that will allow easier integration of other physics effects. I have a theory that uses the engine's calculations of gravity and air resistance to our advantage, potentially shrinking the code and providing a very accurate simulation of real-world physics of swinging. I have not tested the theory in code yet, but I should be testing it by this weekend.
Here is the theory:
1. After hook has attached and player is in a position that will cause him to swing...
2. within a fast pulse
3. let the engine drop the player
4. move the player horizontally to the correct position (because engine moves player straight down, but player should be moving along an arc)
5. at the equilibrium point (under the hook), push player up with the speed the engine was giving the player when he reached the point
6. on the way up, just move player horizontally as when going down
7. continue until player stops.
Assumptions:
A. Engine calculates gravity and air resistance effects well enough.
B. Repositioning the player will not affect the engine's handling of the player's velocity.
C. This will make other effects easier to implement.
(If I remember the tests for my space station physics correctly, A and B are valid.)
Of course, if my theory fails the tests, then I will continue to build off of what Hell Raiser and Quib Mask have begun.
Looking forward to SpiderMan mods,
[Edit: one -> ones]