Paradigm: I understand somewhat that you have said, but not being much of a mathmetician I need it more layman.
How do I calculate the dot product of my normalised facing (which I believe is my ships angle) and how do I calculate the dot product of the vector to my target (which I believe is the angle of the target from me?)
Once done I am assuming from what you said, this gives the angle from the enemy vector to my facing vector. Once I have that angle, I can then allow "fire" once that angle falls within a certain value. And am I correct in saying that this would mean that once I am facing the enemy, the value of the angle between my facing direction and the target direction will be = to 0
no the cone isn't for range, it merely looks like a cone because of the lines etc.
the lines are just imaginary they do are drawn, it's just showing the vectors of the limits of your firing arc, merely to show the width of the arc I was seeking.
So basically its a front arc. If the target is in front of you, only then can you fire. Its top down 2d view. the 'camera' is focused on your ship which remains at the centre of the screen. You can fly about the game world, and rotate, similar to asteroids, but your ship remains drawn at the centre of your screen even tho u are moving, so unline asteroids in that aspect.
So imagine asteroids, imagine that you could only fire if the enemy was in front of you.
But I realise I think I have over complicated it and kind of fooled myself. Since it doesn't make sense to only be ABLE to fire if an enemy is in front of you. You should be able to fire all the time from the front guns on your ship.
What really complicated this is that at first I am using the mouse pointer as the aimer. So I can getting the angle of the mouse pointer relative to your ship, and offsetting it with your current direction of facing. So if the mouse pointer falls within your frontal firing arc, you can fire in that direction, which is the front. So the front of the ship has a 60 degree arc. -30 to the left and 30 to the right. So the angle of the mouse cursor to my ship + the offset of my current ship angle was being calculated and held in a variable. I then stipulated that if that value is = within a certain range you can fire. These range is = to a small 60 degree arc.
So now I changed it to be independent of the mouse pointer, but instead to calculate where the enemy ship angle is relative to your ship, and if the enemy ship falls within those specified arcs to the front, then you can fire. Which really is a work around, because this means you cannot fire AT ALL unless an enemy ship is in front.
What I could do is allow you to fire all the time if the enemy is out of arc, but set the projectile to go straight ahead.
THen if the enemy is within the arc, the projectile is aimed at the vector of the enemy from your ship. So your allowed to fire all the time, whether a target is directly in front of you or not, just that the projectile will go straight. Now once an enemy peeps his little nose in front of your ship, the projectile will go for him.
Thank you guys all for your help, regardless of whether I rap my head around it I do understand more. Sorry to waste your times.