RollingStock wheels position
Posted: Mon Nov 13, 2023 8:52 pm
How are the positions for the wheels of a rolling-stock determined?
My current implementation uses the joint_distance and then rotates that according to the orientation of the entity but I seem to be missing some vertical offset (and the horizontal offset also seems to not fit perfectly).
+ flipping the offset & orientation for the second wheel

also see the vertical render, not included since it is so long.
I guess the proper shifts will also include additional offsets from the rolling-stocks draw_data but boskid explained how that works on discord a while ago.
However I will probably not need those train head dependent offsets since I only plan to render entities from blueprints and afaik it would be fine without it for that purpose.
My current implementation uses the joint_distance and then rotates that according to the orientation of the entity but I seem to be missing some vertical offset (and the horizontal offset also seems to not fit perfectly).
Code: Select all
let offset: Vector = (Direction::North.get_offset() * (self.joint_distance / 2.0)).rotate(orientation);

also see the vertical render, not included since it is so long.
I guess the proper shifts will also include additional offsets from the rolling-stocks draw_data but boskid explained how that works on discord a while ago.
However I will probably not need those train head dependent offsets since I only plan to render entities from blueprints and afaik it would be fine without it for that purpose.