Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: aldo_14 on November 12, 2002, 06:05:17 am
-
I was actually thinking about this in the shower.... and although Bob's already working on it, I decided I might as well get some opinions on my thinking 'ere. I know sod all of the FS2 code, and less of C++ so correct me please :)
Ok, assumptions;
1/ FS2 uses some sort of animation 'trigger' when starting the mission to start rotations. Hoepfully, this can also be halted. Also, this function (hopefully, again) is setup to use a 360 rotation - which can hoepfully be altered whent eh function is adapted. Also, that the rotations in an FS2 model can be reversed in-mission.
My 'idea' (probably not original)
Firstly, rotations are specified by a 3rd value in the tbl for the physcial subsystem entry, defining a clockwise roatation in degrees (can be negative). If this entry is present and correct (< +360 || >-360 degrees), the ship is 'flagged' as using special rotation when it is loaded into a mission.
The actual rotations are defined by a new funciton, which effectively rotaets the object for xx degrees (as defined in the tbl entry). A single bit / value integer is used as a 'flag', to indicate the current status of the rotation. I.e. it's set to 0 when the object is at the start, and 1 when it is at the end of the rotation path. this is used to define the 'next' rotation (so objects can go 'back' into position). This is so the system can't be broken by using seperate methods to rotate forward and back.
The standard properties for rot time, etc, defined in the pof are used for the speed of this movement.
(It could be that FOV could be used instead of the previously mentioned tbl entry for the rotation params..depends on relative parsing speed, i guess).
An SEXP is 'hooked' onto the new function, to call rotations (using ship name and subsys name, and only when the subobject is not destroyed). I'm not sure on the logistics of stopping a rotation and reversing it before it 'finishes' - some protection may be needed here.
Still obviosuly thinking of technical details, though.... not looked at the actual rotation code in FS2 yet, so I'm just throwing out ideas.
I should say, I'm just wanting opinions on my thinking here.... I'm not looking to step on anyones toes.
-
:confused: Lamens terms? :confused:
-
Faustus panels spin left, Faustus panels spin right.
Faustus panels spin fast, Faustus panels spin slow.
Or expanded:
Faustus panels spin left, then Faustus panels spin forward.
Faustus panels spin fast, then Faustus panels spin slow.
-
X-Wings 1 and 3 rotate clockwise, wings 2 and 4 rotate counter clockwise. Wings stop. ;7
-
Originally posted by Joey_21
:confused: Lamens terms? :confused:
i thought that was laymans terms.........
-
Eh.... I just can't visualize the concept... oh well... :doubt:
-
Originally posted by Joey_21
Eh.... I just can't visualize the concept... oh well... :doubt:
You can write this:
Originally posted by Joey_21
Bored with Window's Calculator? Click Here. (http://jgmart.tripod.com/Calcu/)
But you can't visualise THIS:
Originally posted by GalacticEmperor
X-Wings 1 and 3 rotate clockwise, wings 2 and 4 rotate counter clockwise. Wings stop. ;7
:wtf:
-
I actually downloaded that calculator. Loads more help than the windows one when I froget to bring home by regular calculator.
-
What hes getting at is adding contorllable S-Foils or whatever you want to the FS2 Engine (rotations are in pof data btw) :lol:
-
The game controls turret rotations, so making rotations you can control by SEXP should be possible. I haven't taken a look at the code to see how hard it would be to do though.
-
Might I add that the calculator wasn't programmed with a real programming language. :rolleyes:
I did it in Visual Basic, sorry guys...... :D
Don't bother trying to explain it to me though, you'll just end up banging your head on the desk, so it's not worth the trouble. Just tell me if it ever gets in the source and I'll definately check it out. :D
-
from what I've looked into adding stuff to the object properties string isn't very hard, but the model animation system is quite conveluted, look at the OBJ2 section of the reading code
thing to remember the angs of a model subsytems are in radians (I think, 0-6.25)
-
Originally posted by Bobboau
from what I've looked into adding stuff to the object properties string isn't very hard, but the model animation system is quite conveluted, look at the OBJ2 section of the reading code
thing to remember the angs of a model subsytems are in radians (I think, 0-6.25)
That's 0 to 2pi isn't it? 6.28. Angle from degrees to radians is:
rads = degs*pi/180.
rads = 360*pi/180
360/180 = 2
2*pi = 2pi
rads = 2pi
-
yes
-
Just a little note, it's real easy to use angles in FS2 due to the following:
#define PI 3.141592654f
#define PI2 (3.141592654f*2.0f) // PI*2
#define ANG_TO_RAD(x) ((x)*PI/180)
You just use:
ANG_TO_RAD(angle)
The rotational code, particularly for turrets, is very complex though. The code seems to support continuous rotation and "stepped" rotation though. (The latter I'm not sure how to use yet as I've never heard of it in FS2 before.)
-
look at the rahu (shivan gas miner) for an example of steped rotation