ok so i have been thinking about this for a quite of time, some people said that i should convert given vector to euler angles, it may be the solution but i tried to check the raw results
i know this drawing is not really helpfull but at least it shows the inital axes for the simulation for now. and those other lines which should show the direction in which force is acting additionally they are placedin the proper positions of force acting) welp only rudder force is translated way to high my mistake on the drawing sorry
Firstly simple explenation i have an aircraft that should get rotations when defflecting some surfaces
after deflecting one of surfaces i will call something like
var t3dpoint Torque = D * F; //RxF R - the position relative to center of mass, F the froce vector
var t3dpoint AngAcc = Torque / MOI; //get the angular acceleration
var double dt = 0.10; // time between frames
var t3dpoint AngVel = AngAcc * dt; //ang velocity
var t3dpoint AngMov = AngVel * dt; //actual change in angle
i checked it for elevator placed at the tail it returns the vector X, 0, 0 which is a correct result (as far as i understand that)
i checked rudder too and it returns 0 Y 0 vector which is correct too since x component of vector represents rotation around x axis, y around y axis, and z around z axis
problems occurs when i try to simulate airlieron on left wing it returns 0 Y Z instead of 0 0 Z and this is my problem maybe i am doing everything wrong and i was lucky to get these past two correct values.
they key are these two variables:
var t3dpoint D = <>(); which is R <- position relative to center of mass
and
var t3dpoint F = <>(); which is F <- force acting vector
code may be hard to read this is because i used my script for that (it saves a lot of time to check some things) instead i will have to recompile the project over and over and over even to change a vector which would take too long syntax is horrible too but keep in mind that i wrote that scripting lang in fw hours.
void ELEVATOR_CHECK()
{
//this function simulates one elevator on the tail where center of pressure is on the tail 45
degree deflection in the direction of front and up if that returns x component to be non zero then
the pitching moment is around x axis
var t3dpoint D = <>(0#0#10);
exec[CALC_MOI];
var t3dpoint F = <>(0#2#-2);
}
void AIRLIERON_CHECK()
{
//this function simulates one airlieron on the left side 45 deg deflecction front up direction
roll moment should be returned around z axis
var t3dpoint D = <>(-10.0#0.0#0.0);
exec[CALC_MOI];
var t3dpoint F = <>(0#2#-2);
}
void RUDDER_CHECK()
{
//this function simulates one rudder on the tail 45 deg deflection front left direction
yaw moment should be returned around y axis
var t3dpoint D = <>(0.0#0.0#10);
exec[CALC_MOI];
var t3dpoint F = <>(-2#0#-2);
}
void CALC_MOI()
{
var double R = magnitude(D);
var double R^2 = R * R;
var double MOI = mass * R^2;
}
void main()
{
var double mass = 1.0;
?exec[ELEVATOR_CHECK]; returns ok vector 0.019 0 0
exec[AIRLIERON_CHECK]; returns 0 0.019 0.019 should return 0 0 0.019
?exec[RUDDER_CHECK]; returns ok vector 0 0.019 0
// ? actually means a comment not //
var t3dpoint Torque = D * F; //RxF
var t3dpoint AngAcc = Torque / MOI;
var double dt = 0.10;
var t3dpoint AngVel = AngAcc * dt;
var t3dpoint AngMov = AngVel * dt;
var double result = ShowMessage(AngMov);
}