Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[Suggestion/DIY] Rockets and Missiles

gyrohero opened this issue ยท 1 comments

commented

As I see it, rockets and missiles will require the following additions to the existing bullet framework:

  • burnTime parameter: If this is non-zero, the bullet will not be affected by gravity until after this time has expired. This number will also be proportional to the turning radius. Thus, there will be a tradeoff between having a long range and being able to turn quickly. Other factors affecting turning radius will be muzzleVelocity and bullet diameter (faster and bigger bullets require more distance to turn).
  • guidanceType parameter: This would include 2 options for different styles of guidance for missiles. "seeker" will at the time of firing, find the closest entity to the player's line of sight and store a pointer to this entity so that it can constantly try to rotate towards it. "guided" will (hopefully) rotate toward whatever the player is looking at, simulating being guided by a laser designator.
  • maxOffAxis parameter: For missiles, determines how close a target needs to be to the missile's +Z axis to be acquired when firing, or for a guided missile to continue to track the player's line of sight. If outside of this, the missile will continue on it's present trajectory

Plus all of the code to implement these.

I plan on trying to flesh out this code myself, but I'm open to feedback.

commented

I'll be honest, I've never really been one to want to code homing missiles. Always felt them a bit cheap. But, I'm also not about to stop anyone who is willing to do the work and put the functionality in. Will let you take the reins on this one.