I'm spawning an item using [wiki]A_SpawnItemEx[/wiki] using the players momentum. This only works properly if it's using SXF_ABSOLUTEMOMENTUM, and that's fine, but I want to fire off the object at an angle from the player.
So, the idea would be to use the player's current angle, and add that to the objects spawning momentum somehow. So, the question is, how? What equation could be used to do that?
My code, presently, is this:
Code: Select all
A_SpawnItemEx ("Casing", random(1,4), 0, random(2,4)+32, velx, vely, velz, 0, SXF_NOCHECKPOSITION|SXF_ABSOLUTEMOMENTUM)