Repository navigation
ariadne: a pose entity's model hangs its stand height below its chassis - #1447
Merged
Merged
Conversation
A fitted model's base was the grid's ground under the chassis, relative to it, taken when the vehicle view was built, and it is rebuilt whenever an entity comes or goes. A plant's chassis rides on the grid's ground, but a pose entity's is wherever an outside simulation puts it, on that simulation's terrain, which the grid may not match (a flat grid, or a coarser one): its model floated or sank by whatever lay between them at the last rebuild, and moved at every spawn or removal. stand_height(vehicle_desc) is now public: half the box's height plus the front wheels' radius, where a kinematic box and a pose entity with no z stand. A pose entity's model hangs that far below its chassis, drawn (vehicle_view) and sent to a relay's clients (room_entities_of). Plants are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
poseentity drawn with a fitted model (look: { model: ... }, a fitted file, a data look) could float above its terrain or sink into it, by different amounts after each spawn or removal.Cause
sync_vehicle_markersset the model's base atground_z - z: the grid's ground under the chassis, relative to it, taken when the vehicle view was built. The view is rebuilt whenever an entity comes or goes.room_entities_ofsends the same value to a relay's clients.poseentity: its chassis is wherever an outside simulation puts it, on that simulation's own terrain, which the grid may not match (a flat grid, a coarser one, or none of its heights). Its model hung by whatever lay between the two at the last rebuild.In one host whose world grid was flat (z 0) but whose terrain wasn't, the models were drawn 1.35 m above the ground. That offset was fixed at the rebuild and only changed when an entity came or went.
Fix
stand_height(vehicle_desc)(world_vehicles.h): half the box's height plus the front wheels' radius (0.4 m with no axles). It's now public, and the kinematic box's placement andstand_zuse it: where a kinematic box stands, and where a pose with nozstands.A pose entity's model hangs
stand_heightbelow its chassis, wherever its poses put it:vehicle_view.cpp;room_entities_of,room_entity::base_z.A pose with no
zstands at the same height over the ground, so that model's base is the ground. With az, the model's wheels are where the outside simulation's chassis puts them.Plants are unchanged.
docs/ARIADNE.md: the pose table'szrow says where the model is drawn.Tests
cvcgl_ariadne_physics,test_vehicle_pose_model_base:-stand_height(-0.92 m for the Humvee).Without the fix, its 3 base checks fail (-6 m, then the rebuild's values).
ariadne_scene_world_test,AriadneWorldVehicles.APoseEntitysModelHangsItsStandHeightBelowIt:room_entities_ofgivesbase_z = -stand_heightat z 6 and 2.5;Ran on Linux (Release, Jolt):
cvcgl_ariadne_physicsall OK, and the 41AriadneWorldVehicles.*andAriadneOneWorld.*tests pass. The full suite wasn't run here.