Project Universal Cars for Orbiter (UCFO) Development Thread

Dear friends, I've restarted the UCFO project and fixed a lot of serious errors. Most of them were due to my typing errors when writing variables.

I've tested the General Vehicle code, but since I don't have @fred18 permission, I can't use it. That's why I've reverted to the code adapted from Thunder Chicken in Lua for the VW Thing.

However, I'm still getting an error because I seem to be doing the animations wrong.

This is the error. Maybe @Gondos could take a look:

Code:
Thread 1 "Orbiter" received signal SIGSEGV, Segmentation fault.
0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
(gdb)
(gdb) bt
#0  0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
#1  0x00007ffff76ccca6 in vVessel::AnimateComponent(ANIMATIONCOMP*, glm::mat<4, 4, float, (glm::qualifier)0> const&) () from Modules/Plugin/libOGLClient.so
#2  0x00007ffff76cc6c0 in vVessel::Animate(unsigned int, double, unsigned int) ()
   from Modules/Plugin/libOGLClient.so
#3  0x00007ffff76c803f in vVessel::UpdateAnimations(unsigned int) () from Modules/Plugin/libOGLClient.so
#4  0x00007ffff76c6fb7 in vVessel::Update() () from Modules/Plugin/libOGLClient.so
#5  0x00007ffff76b678c in Scene::Update() () from Modules/Plugin/libOGLClient.so
#6  0x00007ffff76b6b8f in Scene::Render() () from Modules/Plugin/libOGLClient.so
#7  0x00007ffff76fb960 in OGLClient::clbkRenderScene() () from Modules/Plugin/libOGLClient.so
#8  0x0000555555725a8b in Orbiter::Render3DEnvironment() ()
#9  0x0000555555725db6 in Orbiter::Run() ()
#10 0x000055555572255a in main ()
(gdb)
#0  0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
#1  0x00007ffff76ccca6 in vVessel::AnimateComponent(ANIMATIONCOMP*, glm::mat<4, 4, float, (glm::qualifier)0> const&) () from Modules/Plugin/libOGLClient.so
#2  0x00007ffff76cc6c0 in vVessel::Animate(unsigned int, double, unsigned int) ()
   from Modules/Plugin/libOGLClient.so
#3  0x00007ffff76c803f in vVessel::UpdateAnimations(unsigned int) () from Modules/Plugin/libOGLClient.so
#4  0x00007ffff76c6fb7 in vVessel::Update() () from Modules/Plugin/libOGLClient.so
#5  0x00007ffff76b678c in Scene::Update() () from Modules/Plugin/libOGLClient.so
#6  0x00007ffff76b6b8f in Scene::Render() () from Modules/Plugin/libOGLClient.so
#7  0x00007ffff76fb960 in OGLClient::clbkRenderScene() () from Modules/Plugin/libOGLClient.so
#8  0x0000555555725a8b in Orbiter::Render3DEnvironment() ()
#9  0x0000555555725db6 in Orbiter::Run() ()
#10 0x000055555572255a in main ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 16537] will be killed.

And this is the code for the animations:

C++:
void UCFO::MakeAnim_LeftFrontWheel(){

    unsigned int FrontLeftWheelGrp = front_left_wheel_id;

    static MGROUP_ROTATE left_front_wheel_steer(
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        front_left_wheel_axle,
        _V(0, 1, 0),
        (float)(45*RAD)
    );

    anim_left_front_wheel_steer = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_left_front_wheel_steer, 0, 1, &left_front_wheel_steer);

    auto left_front_wheel_travel = new MGROUP_TRANSLATE (
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_left_front_wheel_travel = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_front_wheel_travel, 0, 1, left_front_wheel_travel, parent);
    

    auto left_front_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        front_left_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_left_front_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_front_wheel_rotation, 0, 1, left_front_wheel_rotate, parent);

}

void UCFO::MakeAnim_RightFrontWheel(){

    unsigned int FrontRightWheelGrp = front_right_wheel_id;

    static MGROUP_ROTATE right_front_wheel_steer(
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        front_right_wheel_axle,
        _V(0, 1, 0),
        (float)(45*RAD)
    );

    anim_right_front_wheel_steer = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_front_wheel_steer, 0, 1, &right_front_wheel_steer);

    auto right_front_wheel_travel = new MGROUP_TRANSLATE (
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_front_wheel_travel = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_front_wheel_travel, 0, 1, right_front_wheel_travel, parent);
    

    auto right_front_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        front_right_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_right_front_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_front_wheel_rotation, 0, 1, right_front_wheel_rotate, parent);
    
}

void UCFO::MakeAnim_LeftRearWheel(){

    unsigned int RearLeftWheelGrp = rear_left_wheel_id;

    static MGROUP_TRANSLATE left_rear_wheel_travel(
        uimesh_UCFO,
        &RearLeftWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_left_rear_wheel_travel = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_left_rear_wheel_travel, 0, 1, &left_rear_wheel_travel);
    

    auto left_rear_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &RearLeftWheelGrp,
        1,
        rear_left_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_left_rear_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_rear_wheel_rotation, 0, 1, left_rear_wheel_rotate, parent);

}

void UCFO::MakeAnim_RightRearWheel(){

    unsigned int RearRightWheelGrp = rear_right_wheel_id;

    static MGROUP_TRANSLATE right_rear_wheel_travel(
        uimesh_UCFO,
        &RearRightWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_rear_wheel_travel = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_rear_wheel_travel, 0, 1, &right_rear_wheel_travel);
    

    auto right_rear_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &RearRightWheelGrp,
        1,
        rear_right_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_right_rear_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_rear_wheel_rotation, 0, 1, right_rear_wheel_rotate, parent);

}

C++:
void UCFO::SetAnim_RightFrontWheel(){

    //Determine rotation speed of wheel

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    // Actualización de la rotación de la rueda
    right_front_wheel_rotation = fmod(right_front_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    //Set the rotation animation, steering animation linked to rudder

    SetAnimation(anim_right_front_wheel_rotation, right_front_wheel_rotation);

    SetAnimation(anim_right_front_wheel_steer, 0.5 + angle_right / (45*RAD));

    SetAnimation(anim_right_front_wheel_travel, 0.5 + front_right_displacement / (2.0*travel));

}

void UCFO::SetAnim_LeftFrontWheel(){

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    left_front_wheel_rotation = fmod(left_front_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    //Set the rotation animation, steering animation linked to rudder

    SetAnimation(anim_left_front_wheel_rotation, left_front_wheel_rotation);

    SetAnimation(anim_left_front_wheel_steer, 0.5 + angle_left / (45*RAD));


}

void UCFO::SetAnim_RightRearWheel(){


    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    right_rear_wheel_rotation = fmod(right_rear_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    SetAnimation(anim_right_rear_wheel_rotation, right_rear_wheel_rotation);

    SetAnimation(anim_right_rear_wheel_travel, 0.5 + rear_right_displacement / (2.0 * travel));

}

void UCFO::SetAnim_LeftRearWheel(){

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    left_rear_wheel_rotation = fmod(left_rear_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    SetAnimation(anim_left_rear_wheel_rotation, left_rear_wheel_rotation);

    SetAnimation(anim_left_rear_wheel_travel, 0.5 + rear_left_displacement / (2.0*travel));
}
 
Dear friends, I've restarted the UCFO project and fixed a lot of serious errors. Most of them were due to my typing errors when writing variables.

I've tested the General Vehicle code, but since I don't have @fred18 permission, I can't use it. That's why I've reverted to the code adapted from Thunder Chicken in Lua for the VW Thing.

However, I'm still getting an error because I seem to be doing the animations wrong.

This is the error. Maybe @Gondos could take a look:

Code:
Thread 1 "Orbiter" received signal SIGSEGV, Segmentation fault.
0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
(gdb)
(gdb) bt
#0  0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
#1  0x00007ffff76ccca6 in vVessel::AnimateComponent(ANIMATIONCOMP*, glm::mat<4, 4, float, (glm::qualifier)0> const&) () from Modules/Plugin/libOGLClient.so
#2  0x00007ffff76cc6c0 in vVessel::Animate(unsigned int, double, unsigned int) ()
   from Modules/Plugin/libOGLClient.so
#3  0x00007ffff76c803f in vVessel::UpdateAnimations(unsigned int) () from Modules/Plugin/libOGLClient.so
#4  0x00007ffff76c6fb7 in vVessel::Update() () from Modules/Plugin/libOGLClient.so
#5  0x00007ffff76b678c in Scene::Update() () from Modules/Plugin/libOGLClient.so
#6  0x00007ffff76b6b8f in Scene::Render() () from Modules/Plugin/libOGLClient.so
#7  0x00007ffff76fb960 in OGLClient::clbkRenderScene() () from Modules/Plugin/libOGLClient.so
#8  0x0000555555725a8b in Orbiter::Render3DEnvironment() ()
#9  0x0000555555725db6 in Orbiter::Run() ()
#10 0x000055555572255a in main ()
(gdb)
#0  0x00007ffff76c2f78 in OGLMesh::TransformGroup(int, glm::mat<4, 4, float, (glm::qualifier)0> const*) ()
   from Modules/Plugin/libOGLClient.so
#1  0x00007ffff76ccca6 in vVessel::AnimateComponent(ANIMATIONCOMP*, glm::mat<4, 4, float, (glm::qualifier)0> const&) () from Modules/Plugin/libOGLClient.so
#2  0x00007ffff76cc6c0 in vVessel::Animate(unsigned int, double, unsigned int) ()
   from Modules/Plugin/libOGLClient.so
#3  0x00007ffff76c803f in vVessel::UpdateAnimations(unsigned int) () from Modules/Plugin/libOGLClient.so
#4  0x00007ffff76c6fb7 in vVessel::Update() () from Modules/Plugin/libOGLClient.so
#5  0x00007ffff76b678c in Scene::Update() () from Modules/Plugin/libOGLClient.so
#6  0x00007ffff76b6b8f in Scene::Render() () from Modules/Plugin/libOGLClient.so
#7  0x00007ffff76fb960 in OGLClient::clbkRenderScene() () from Modules/Plugin/libOGLClient.so
#8  0x0000555555725a8b in Orbiter::Render3DEnvironment() ()
#9  0x0000555555725db6 in Orbiter::Run() ()
#10 0x000055555572255a in main ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 16537] will be killed.

And this is the code for the animations:

C++:
void UCFO::MakeAnim_LeftFrontWheel(){

    unsigned int FrontLeftWheelGrp = front_left_wheel_id;

    static MGROUP_ROTATE left_front_wheel_steer(
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        front_left_wheel_axle,
        _V(0, 1, 0),
        (float)(45*RAD)
    );

    anim_left_front_wheel_steer = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_left_front_wheel_steer, 0, 1, &left_front_wheel_steer);

    auto left_front_wheel_travel = new MGROUP_TRANSLATE (
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_left_front_wheel_travel = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_front_wheel_travel, 0, 1, left_front_wheel_travel, parent);
   

    auto left_front_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &FrontLeftWheelGrp,
        1,
        front_left_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_left_front_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_front_wheel_rotation, 0, 1, left_front_wheel_rotate, parent);

}

void UCFO::MakeAnim_RightFrontWheel(){

    unsigned int FrontRightWheelGrp = front_right_wheel_id;

    static MGROUP_ROTATE right_front_wheel_steer(
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        front_right_wheel_axle,
        _V(0, 1, 0),
        (float)(45*RAD)
    );

    anim_right_front_wheel_steer = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_front_wheel_steer, 0, 1, &right_front_wheel_steer);

    auto right_front_wheel_travel = new MGROUP_TRANSLATE (
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_front_wheel_travel = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_front_wheel_travel, 0, 1, right_front_wheel_travel, parent);
   

    auto right_front_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &FrontRightWheelGrp,
        1,
        front_right_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_right_front_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_front_wheel_rotation, 0, 1, right_front_wheel_rotate, parent);
   
}

void UCFO::MakeAnim_LeftRearWheel(){

    unsigned int RearLeftWheelGrp = rear_left_wheel_id;

    static MGROUP_TRANSLATE left_rear_wheel_travel(
        uimesh_UCFO,
        &RearLeftWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_left_rear_wheel_travel = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_left_rear_wheel_travel, 0, 1, &left_rear_wheel_travel);
   

    auto left_rear_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &RearLeftWheelGrp,
        1,
        rear_left_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_left_rear_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_left_rear_wheel_rotation, 0, 1, left_rear_wheel_rotate, parent);

}

void UCFO::MakeAnim_RightRearWheel(){

    unsigned int RearRightWheelGrp = rear_right_wheel_id;

    static MGROUP_TRANSLATE right_rear_wheel_travel(
        uimesh_UCFO,
        &RearRightWheelGrp,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_rear_wheel_travel = CreateAnimation(0.5);

    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_rear_wheel_travel, 0, 1, &right_rear_wheel_travel);
   

    auto right_rear_wheel_rotate = new MGROUP_ROTATE (
        uimesh_UCFO,
        &RearRightWheelGrp,
        1,
        rear_right_wheel_axle,
        _V(1, 0, 0),
        (float)(360*RAD)
    );

    anim_right_rear_wheel_rotation = CreateAnimation(0.5);

    AddAnimationComponent(anim_right_rear_wheel_rotation, 0, 1, right_rear_wheel_rotate, parent);

}

C++:
void UCFO::SetAnim_RightFrontWheel(){

    //Determine rotation speed of wheel

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    // Actualización de la rotación de la rueda
    right_front_wheel_rotation = fmod(right_front_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    //Set the rotation animation, steering animation linked to rudder

    SetAnimation(anim_right_front_wheel_rotation, right_front_wheel_rotation);

    SetAnimation(anim_right_front_wheel_steer, 0.5 + angle_right / (45*RAD));

    SetAnimation(anim_right_front_wheel_travel, 0.5 + front_right_displacement / (2.0*travel));

}

void UCFO::SetAnim_LeftFrontWheel(){

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    left_front_wheel_rotation = fmod(left_front_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    //Set the rotation animation, steering animation linked to rudder

    SetAnimation(anim_left_front_wheel_rotation, left_front_wheel_rotation);

    SetAnimation(anim_left_front_wheel_steer, 0.5 + angle_left / (45*RAD));


}

void UCFO::SetAnim_RightRearWheel(){


    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    right_rear_wheel_rotation = fmod(right_rear_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    SetAnimation(anim_right_rear_wheel_rotation, right_rear_wheel_rotation);

    SetAnimation(anim_right_rear_wheel_travel, 0.5 + rear_right_displacement / (2.0 * travel));

}

void UCFO::SetAnim_LeftRearWheel(){

    VECTOR3 speed;
    GetGroundspeedVector(FRAME_LOCAL, speed);

    double rotation_speed = speed.z / (2 * PI * wheel_radius);

    left_rear_wheel_rotation = fmod(left_rear_wheel_rotation + oapiGetSimStep() * rotation_speed, 1.0);

    SetAnimation(anim_left_rear_wheel_rotation, left_rear_wheel_rotation);

    SetAnimation(anim_left_rear_wheel_travel, 0.5 + rear_left_displacement / (2.0*travel));
}
Can you post an Orbiter.log? You may wish to disable the animations and re-enable them one by one to localize the problem.
 
Can you post an Orbiter.log? You may wish to disable the animations and re-enable them one by one to localize the problem.
Code:
**** /tmp/Orbiter.log
000000.000: Finished setting up render state
000000.000:
000000.000: **** Creating simulation session
000000.000: VSOP87(E) Sun: Precision 1.0e-06, Terms 554/6634
000000.000: VSOP87(B) Mercury: Precision 1.0e-05, Terms 167/7123
000000.000: VSOP87(B) Venus: Precision 1.0e-05, Terms 79/1710
000000.000: VSOP87(B) Earth: Precision 1.0e-08, Terms 2564/2564
000000.000: ELP82: Precision 1.0e-05, Terms 116/829
000000.000: VSOP87(B) Mars: Precision 1.0e-05, Terms 405/6400
000000.000: VSOP87(B) Jupiter: Precision 1.0e-06, Terms 1624/3625
000000.000: VSOP87(B) Saturn: Precision 1.0e-06, Terms 2904/6365
000000.000: SATSAT Mimas: Terms 113
000000.000: SATSAT Enceladus: Terms 33
000000.000: SATSAT Tethys: Terms 101
000000.000: SATSAT Dione: Terms 59
000000.000: SATSAT Rhea: Terms 68
000000.000: SATSAT Titan: Terms 100
000000.000: SATSAT Iapetus: Terms 605
000000.000: VSOP87(B) Uranus: Precision 1.0e-06, Terms 1827/5269
000000.000: VSOP87(B) Neptune: Precision 1.0e-06, Terms 391/2024
000000.000: Finished initialising world
000000.000: t: Mesh: Ford_Taunus
000000.000: t: Size: 4.000000
000000.000: t: Mass: 1250.000000
000000.000: t: FrontLeftWheelID: 13
000000.000: t: FrontRightWheelID: 1
000000.000: t: RearRightWheelID: 15
000000.000: t: RearLeftWheelID: 14
000000.000: FrontLeftWheelPosition -0.668700, 0.290800, 1.447500
000000.000: FrontRightWheelPosition 0.634500, 0.290800, 1.447500
000000.000: RearLeftWheelPosition -0.668700, 0.290800, -0.994700
000000.000: RearRightWheelPosition 0.631100, 0.290800, -0.994700
000000.000: LeftHeadlightPosition -0.571300, 0.580100, 2.080200
000000.000: RightHeadlightPosition 0.536600, 0.580100, 2.080200
000000.000: LeftTailLightPosition -0.670500, 0.638300, -1.847800
000000.000: RightTailLightPosition 0.635800, 0.638300, -1.847800
000000.000: LeftBackupLightPosition 0.541000, 0.668800, -1.848600
000000.000: RightBackupLightPosition 0.664800, 0.700600, -1.848500
000000.000: CameraPosition -0.942200, 3.000000, 0.413600
000000.000: FrontRightWheelAxle 0.634500, 0.290800, 1.447500
000000.000: FrontLeftWheelAxle -0.668700, 0.290800, 1.447500
000000.000: RearRightWheelAxle 0.631100, 0.290800, -0.994700
000000.000: RearLeftWheelAxle -0.668700, 0.290800, -0.994700
000000.000: FrontRightWheelContact 0.630400, 0.004100, 1.447500
000000.000: FrontLeftWheelContact -0.669600, 0.004100, 1.447500
000000.000: RearRightWheelContact 0.630400, 0.004100, -1.002500
000000.000: RearLeftWheelContact -0.669600, 0.004100, -1.002500
000000.000: TouchdownPoint1 -0.669600, 0.437600, 2.179100
000000.000: TouchdownPoint2 0.630400, 0.437600, 2.179100
000000.000: TouchdownPoint3 -0.469600, 1.264300, 0.429300
000000.000: TouchdownPoint4 1.403800, 1.605400, -5.500300
000000.000: TouchdownPoint5 0.430400, 1.264300, 0.429300
000000.000: TouchdownPoint6 0.430400, 1.288400, -0.774600
000000.000: TouchdownPoint7 0.630400, 0.472400, -1.965200
000000.000: TouchdownPoint8 -0.669600, 0.472400, -1.965200
000000.000: Finished initialising status
000000.000: Finished initialising camera
000000.000: Finished setting up render state
000000.000: Finished initialising panels

Thanks for your suggestion. I have several battle lines open due to my own coding ineptitude.
What I'm going to do is what you previously recommended: rewrite UCFO, following the VW Thing from Lua to C++, and then gradually change the components to make it more universal.
 
Universal Cars is now more universal!
I managed to fix the animations, although I still need to tidy them up. But they no longer produce segfaults.

UCFO now correctly reads the configuration file and applies it.
All that remains is to add the lights, beacons, and brake light, fix the wheel animations, and fix the TouchdownPoints (the car is hovering).
I have a pre-alpha release ready:

https://github.com/MatiasSaibene/UniversalCarsForOrbiter/releases/tag/pre-alpha
 
Last edited:
As you can see in the "Gallery of add-ons in development" thread, I am pleased to announce that I am working on adding UACS to UCFO so that we can transport passengers and cargo in our cars, trucks, Rovers, etc. The only limit is our imagination.

I would also like to thank @Abdullah Radwan for the wonderful contribution he made to the Orbiter community by programming UACS. It is a wonderful framework and its API is very practical.
Screenshot_2025abril13162526.jpeg
 
Hi friends,
I'm working with UCFO again, and I need to fix this bug that's causing the wheels to move off their axis of rotation.
I had read in Thunder Chicken's thread that it was an animation order issue. But even though I changed the animation order, I couldn't find a solution.

I have no idea what to do.

This is my code for the front right wheel:
C++:
void UCFO::MakeAnim_RightFrontWheel() {
    
    right_front_wheel_rotate = new MGROUP_ROTATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        front_right_wheel_pos,
        _V(1, 0, 0),
        (float)(360 * RAD)
    );

    anim_right_front_wheel_rotation = CreateAnimation(0.0);
    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_front_wheel_rotation, 0, 1, right_front_wheel_rotate);

    right_front_wheel_travel = new MGROUP_TRANSLATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_front_wheel_travel = CreateAnimation(0.5);
     AddAnimationComponent(anim_right_front_wheel_travel, 0, 1, right_front_wheel_travel, parent);

    right_front_wheel_steer = new MGROUP_ROTATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        front_right_wheel_pos,
        _V(0, 1, 0),
        (float)(45 * RAD)
    );

    anim_right_front_wheel_steer = CreateAnimation(0.5);
    AddAnimationComponent(anim_right_front_wheel_steer, 0, 1, right_front_wheel_steer, parent);   
}

And you can find the rest of the code here:
https://github.com/MatiasSaibene/UniversalCarsForOrbiter/blob/master/src_Linux/make_anim.cpp
 
How does it look like if you make the wheel rotation the last animation?

Also, you apply all animations to the same group, I would maybe consider applying the steering and suspension to a dummy vertex and not a mesh group.

(And how I can set the other parameters of the suspension, like camber, caster or toe-in? :devilish: Sorry, I maintained a database with car setup parameters at work once. )
 
It can be really hard to tell, one little error can throw everything off (does look like the axis are getting mixed up), I'd probably have to test it to see. Otherwise (as always), break it down and build it back up again...
camber, caster or toe-in
Used to mod GTR2, these make a huge difference to handling.
 
Hi friends,
I'm working with UCFO again, and I need to fix this bug that's causing the wheels to move off their axis of rotation.
I had read in Thunder Chicken's thread that it was an animation order issue. But even though I changed the animation order, I couldn't find a solution.

I have no idea what to do.

This is my code for the front right wheel:
C++:
void UCFO::MakeAnim_RightFrontWheel() {
  
    right_front_wheel_rotate = new MGROUP_ROTATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        front_right_wheel_pos,
        _V(1, 0, 0),
        (float)(360 * RAD)
    );

    anim_right_front_wheel_rotation = CreateAnimation(0.0);
    ANIMATIONCOMPONENT_HANDLE parent = AddAnimationComponent(anim_right_front_wheel_rotation, 0, 1, right_front_wheel_rotate);

    right_front_wheel_travel = new MGROUP_TRANSLATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        _V(0, 2.0 * travel, 0)
    );

    anim_right_front_wheel_travel = CreateAnimation(0.5);
     AddAnimationComponent(anim_right_front_wheel_travel, 0, 1, right_front_wheel_travel, parent);

    right_front_wheel_steer = new MGROUP_ROTATE(
        uimesh_UCFO,
        (unsigned int *)front_right_wheel_id,
        1,
        front_right_wheel_pos,
        _V(0, 1, 0),
        (float)(45 * RAD)
    );

    anim_right_front_wheel_steer = CreateAnimation(0.5);
    AddAnimationComponent(anim_right_front_wheel_steer, 0, 1, right_front_wheel_steer, parent); 
}

And you can find the rest of the code here:
https://github.com/MatiasSaibene/UniversalCarsForOrbiter/blob/master/src_Linux/make_anim.cpp
It seems that you are using the same parent animation for both follow on animations. In my VW Thing Lua script there are two parents:

Code:
    anim_right_front_wheel_steer = vi:create_animation(0.5)
    right_front_wheel_steer = 
    {
        type =  'rotation',
        mesh = 0,
        grp =   {82},
        ref = front_right_wheel_axle,
        axis =  {x=0,y=1,z=0},
        angle = 45*RAD
    }
    anim_right_front_wheel_travel = vi:create_animation(0.5)
    right_front_wheel_travel =
    {
        type =  'translation',
        mesh = 0,
        grp =   {83},
        shift = {x=0,y=2.0*travel,z=0}
    }
    anim_right_front_wheel_rotation = vi:create_animation(0)
    right_front_wheel_rotate =
    {
        type =  'rotation',
        mesh = 0,
        grp =   {84,85,86},
        ref = front_right_wheel_axle,
        axis =  {x=1,y=0,z=0},
        angle = 360*RAD
    }

    local parent1 = vi:add_animationcomponent(anim_right_front_wheel_steer,0,1,oapi.create_animationcomponent(right_front_wheel_steer))

    local parent2 = vi:add_animationcomponent(anim_right_front_wheel_travel,0,1,oapi.create_animationcomponent(right_front_wheel_travel), parent1)

    vi:add_animationcomponent(anim_right_front_wheel_rotation,0,1,oapi.create_animationcomponent(right_front_wheel_rotate), parent2)
 
Last edited:
First: thank you all very much for your responses.

How does it look like if you make the wheel rotation the last animation?

Also, you apply all animations to the same group, I would maybe consider applying the steering and suspension to a dummy vertex and not a mesh group.
1. I'm going to try making the wheel rotation the last option.
2. I saw something about this in Thunder Chicken's thread. I don't have much of an idea how to do it because I can't differentiate mesh groups from vertices. I don't know if Blender Mesh Tools exports vertices. And also, if I apply the rotation to just one vertex, will it be applied to the entire wheel?
I'd like to know about this because it worked for Thunder Chicken (I think). And if it works in UCFO, I'll have to include it in the documentation (WIP).

It seems that you are using the same parent animation for both follow on animations. In my VW Thing Lua script there are two parents:

Code:
    anim_right_front_wheel_steer = vi:create_animation(0.5)
    right_front_wheel_steer =
    {
        type =  'rotation',
        mesh = 0,
        grp =   {82},
        ref = front_right_wheel_axle,
        axis =  {x=0,y=1,z=0},
        angle = 45*RAD
    }
    anim_right_front_wheel_travel = vi:create_animation(0.5)
    right_front_wheel_travel =
    {
        type =  'translation',
        mesh = 0,
        grp =   {83},
        shift = {x=0,y=2.0*travel,z=0}
    }
    anim_right_front_wheel_rotation = vi:create_animation(0)
    right_front_wheel_rotate =
    {
        type =  'rotation',
        mesh = 0,
        grp =   {84,85,86},
        ref = front_right_wheel_axle,
        axis =  {x=1,y=0,z=0},
        angle = 360*RAD
    }

    local parent1 = vi:add_animationcomponent(anim_right_front_wheel_steer,0,1,oapi.create_animationcomponent(right_front_wheel_steer))

    local parent2 = vi:add_animationcomponent(anim_right_front_wheel_travel,0,1,oapi.create_animationcomponent(right_front_wheel_travel), parent1)

    vi:add_animationcomponent(anim_right_front_wheel_rotation,0,1,oapi.create_animationcomponent(right_front_wheel_rotate), parent2)
I'm going to try this too and as a last resort, the vertices.
 
Last edited:
First: thank you all very much for your responses.


1. I'm going to try making the wheel rotation the last option.
2. I saw something about this in Thunder Chicken's thread. I don't have much of an idea how to do it because I can't differentiate mesh groups from vertices. I don't know if Blender Mesh Tools exports vertices. And also, if I apply the rotation to just one vertex, will it be applied to the entire wheel?
I'd like to know about this because it worked for Thunder Chicken (I think). And if it works in UCFO, I'll have to include it in the documentation (WIP).


I'm going to try this too and as a last resort, the vertices.
The dummy mesh groups are only triangles with 3 vertices. These are needed because the methods require a mesh group specification. In theory only one dummy mesh group would be needed to accept all the parent transformations. It's a cheat to allow the animations in the existing framework in Orbiter.
 
The dummy mesh groups are only triangles with 3 vertices. These are needed because the methods require a mesh group specification. In theory only one dummy mesh group would be needed to accept all the parent transformations. It's a cheat to allow the animations in the existing framework in Orbiter.

Actually, you can even use less.

Just pass an array of vector objects instead of a list of meshgroup ids and set the id of the mesh to LOCALVERTEXLIST (in C++, I am sure it also exists in Lua). And remember, one vector in a list is already enough - useless maybe, but enough. 😉

I use this for example for faking engine gimbals, but here it should also fit.
 
Actually, you can even use less.

Just pass an array of vector objects instead of a list of meshgroup ids and set the id of the mesh to LOCALVERTEXLIST (in C++, I am sure it also exists in Lua). And remember, one vector in a list is already enough - useless maybe, but enough. 😉

I use this for example for faking engine gimbals, but here it should also fit.
What is the benefit of doing this vs. using a dummy mesh group? It's confusing enough of a hack as it is without changing the anticipated argument type. This isn't helping the folks who are just trying to understand what already exists.
 
What is the benefit of doing this vs. using a dummy mesh group? It's confusing enough of a hack as it is without changing the anticipated argument type. This isn't helping the folks who are just trying to understand what already exists.

You don't need a to create a dummy mesh group, either in the mesh file or by creating it by SDK? Also it is a classic Orbiter SDK feature and the anticipated argument type if you RTFM consult the OrbiterSDK documentation for the animation components.

PS: Yes, it is a semantic hack, since this kind of animation component is supposed to be used for forward kinematics like the Space Shuttle Remote Manipulator System or positioning cameras on such arms. But works for 22 years without problems.
 
Last edited:
You don't need a to create a dummy mesh group, either in the mesh file or by creating it by SDK? Also it is a classic Orbiter SDK feature and the anticipated argument type if you RTFM.
Can you please mind the tone of your responses? There is no need for this.

Folks are trying to sort out what I did. How about we help them try to understand that first, then they might better understand potential improvements?
 
Eh, don't really want to jump in here... Just like to say that I've experienced that the use of english profanity in Germany is generally misused/misunderstood (underestimated- have had some horror business experiences!), I don't think it was intentional (it's a standard english abr.).
The information is still valid/interesting, even if over complicating the issue a little. I value both your inputs, and have learned a lot from you guys.
Just my 2 cents, do not wish to speak for anybody else.
 
I apologize for using implicit profanity here, that was inadequate and nothing to be proud of. It happened in a lot of stress, but the better solution would have been not posting at all in that moment.
 
Eh, don't really want to jump in here... Just like to say that I've experienced that the use of english profanity in Germany is generally misused/misunderstood (underestimated- have had some horror business experiences!), I don't think it was intentional (it's a standard english abr.).

Actually, Germans have less inhibitations on using profanity in general compared to most English speaking countries. But that doesn't make it any better if you do it in English towards an English speaking audience. Its at least highly unprofessional.
 
Back
Top