Skip to content

Engine settings do not survive a get/set round-trip #10

Description

@jcant0n

fromJphEngineSettings always sets normalizedTorque = nullptr, and toJphEngineSettings only assigns the curve when it is non-null.

So the natural pattern silently discards the torque curve:

JoltC_VehicleEngineSettings s = ..._GetEngine(controller);
s.maxTorque = 600.0f;
..._SetEngine(controller, s);        /* torque curve is now Jolt's default */

No diagnostic, no return code. The caller has changed one field and reset another.

Pinned by assertion in JoltC/tests/test_vehicle_extra.c so the behaviour is at least recorded, with a comment explaining why the assertion looks odd.

Two related items in vehicle.cpp:

  • VehicleTrackSettings_Init returns an uninitialised field. Upstream declares uint mDrivenWheel; with no initialiser and the wrapper copies it, so the caller receives garbage. The test asserts the other four fields and deliberately not that one.
  • JoltC_VehicleTrackSettings is write-only decoration. TrackedVehicleControllerSettings exposes only engine and transmission, so there is no way to hand tracks to it — a tracked vehicle cannot actually be configured through the C API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions