added more thoughts/notes
This commit is contained in:
+23
-24
@@ -23,7 +23,7 @@ var direction = (jet.target.global_position - jet.global_position).normalized()
|
||||
Can we normalize rotation and from that treat slices of the circle as specific command zones?
|
||||
I.E if target a jet in front and and to the right by 45 degrees we yaw instead of roll?
|
||||
|
||||
Imagine the current situation is us observing our CPU controlled jet from
|
||||
Imagining the current situation is us observing our CPU controlled jet from
|
||||
the 3rd person view from behind. The jet is level to the horizon of our world.
|
||||
The target jet position is behind and slightly to the right corner of the screen.
|
||||
____________________________________________
|
||||
@@ -37,6 +37,28 @@ ____________________________________________
|
||||
| X |
|
||||
____________________________________________
|
||||
|
||||
-- SOHCAHTOA
|
||||
|
||||
-- sin = Opposite/Hypotenuse
|
||||
-- cos = Adjacent/Hypotenuse
|
||||
-- tan = Opposite/Adjacent
|
||||
|
||||
Maybe aha moment, if I create a right angled triangles per plane then we can figure out radians from the aquired angles.
|
||||
=O ^
|
||||
|
||||
We already have a hypotenuse value based on the 'distance'.
|
||||
We have the target position and our position.
|
||||
Thus, if certain target values are above or below we use one or the other to gague the 90 degree angle point
|
||||
|
||||
let x1 = 5;
|
||||
let y1 = 5;
|
||||
let rotation = 8; // in degrees
|
||||
let magnitude = 7; // our distance
|
||||
// got bellow from AI during 500 lines challenge; not sure what this is doing just yet
|
||||
let radians = (rotation + 180) % 360;
|
||||
const x2 = x1 + magnitude * Math.cos(radians);
|
||||
const y2 = y1 + magnitude * Math.sin(radians);
|
||||
|
||||
We must roll the jet to +90 degrees left or -90 right and then pitch up
|
||||
in order to turn towards target. OR yaw left or right to turn.
|
||||
What conditions should we use to determin which to use? Distance from and to?
|
||||
@@ -47,29 +69,6 @@ how do we confirm what set of actions to do/maintain? A queue and check over tim
|
||||
Can we able to get the 'delta' in cpu_controller utside of '_process'/'_physics_process'?
|
||||
|
||||
If queue do we push "rotate towards using xyz pattern" as a command/state to check until met?
|
||||
|
||||
|
||||
If in rotate towards
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user