Repository navigation
Debug draw (#163, second part) - #165
Merged
Merged
Conversation
aephysics.debug_draw has the reference's b3DebugDraw, its colours and material presets; physics_world.world_draw draws a world as b3World_Draw does, each joint kind as the reference draws it; the world def's debug shape callbacks give a host its own drawable per shape, made when first drawn and given back when the shape goes, its geometry changes or the world goes, and kept through an in-place restore; the player draws a replayed frame's queries.
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.
The second and last part of #163: debug draw, as the reference's
b3DebugDraw,b3World_Draw, its joints' drawings, the debug-shape callbacks andb3RecPlayer_DrawFrameQuerieshave it. With #164 this covers #163.Closes #163.
aephysics.debug_draw(new)DebugDraw: the callbacks (user shape, segment, transform, point, sphere, capsule, bounds, box, string), the drawing bounds, the force and joint scales, and every option of the reference's.default_debug_draw: callbacks that draw nothing, bounds 100 m out every way, unit scales.COLOR_*, its material presets withmake_debug_color, andgraph_color.fixedandhexfor the labels: the reference's%.2f-style and%#Xformats.Drawing a world
physics_world.world_draw(id, draw, mask_bits):The host's drawables
create_debug_shape,destroy_debug_shapeanduser_debug_shape_context. Each shape keeps itsuser_shape, made when it is first drawn.snapshot.restore_world) keeps the drawables of the shapes still in their slot (same generation) and gives back the rest, as the reference's does. A seek in the player doesn't remake every drawable.dynamics.set_debug_shape_callbackschanges them on a live world, giving back what the old ones made first.The player
recording.player_set_debug_shape_callbacks(b3RecPlayer_SetDebugShapeCallbacks): the player's world draws with the host's drawables and rewinds to frame 0.recording.player_draw_frame_queries(p, draw, query, selected)(b3RecPlayer_DrawFrameQueries):Tests
test_debug_draw.ae, 41 checks, on a world of every kind of thing through counting callbacks:bullet (42);Pins
Aether 0.796.0 and aeb v0.325, both the latest releases.