Unity3d-physics-visualization-
Unity3d-physics-visualization- copied to clipboard
Tool to help you visualize 2d physics colliders and joints. You can track their transform at runtime. Just add the proper component to GameObject with a Collider2D or Joint2D.
Unity3d Physics2d Visualizer
Tool to help you visualize 2d physics colliders and joints. You can track their transform at runtime. Just add the proper component to GameObject with a Collider2D. Supported Unity 5.6 and higher.
Warning: Objects with scaled parent can render incorrectly.
You can visualize colliders in two ways: rendering them as mesh and using editor gizmos. Frist method needs more steps to get result, second - is very simple but works only in Editor and need to attach different components for each type of Collider2D. Also, this package includes GUI tools to batch some operations with both types of visualizers.
Collider2dRenderer:
New version supports visualizing through Collider2dRenderer which renders colliders shape to standard mesh. This type of visualization lacks most features of the gizmos-based visualizers but it works in standalone builds, can be batched in one draw call to minimize graphics overhead impact.
AlwaysUpdate- updates mesh every frameMeshColor- vertex color of the meshUseMaterialPropertyBlock- Set color by material property blockSetVertexColors- Set vertices colors withMeshColorvalueUseCircleProximity- use a custom number of segments created for circular areas of CircleCollider2D and CapsuleColldier2D. If not checked default value will be used (20). You can set the default value by accessing static variable Collider2dPointsGetter::CircleProximity.CustomCircleProximity- use a custom number of segmentsThickness- the thickness of shape in Unity points. If a camera is Orthogonal andUsePixelSizeis true it will be in pixel sizeUsePixelSize- to set mesh thickness in pixels
You can automate routine operations for you visualizers with the new manager which can be found at "Tools/Physics2dVisualizer/Open Manager" menu.
Gizmos visualizers:
Currently supports:
AnchoredJoint2DVisualizer- forDistanceJoint2D,FixedJoint2D,FrictionJoint2D,HingeJoint2D,SliderJoint2D,SpringJoint2D,WheelJoint2DBox2dVisualizerforBoxCollider2D(EdgeRadius not supported)Capsule2dVisualizerforCapsuleCollider2DCircle2dVisualizerforCircleCollider2DEdge2dVisualizerforEdgeCollider2DPolygon2dVisualizerforPolygonCollider2D(Multiple polygon Paths not supported)MovementLoggerfor tracking object's position and transform
Warning:
- Don't forget to enable Gizmos visibility
You can manipulate with 3 params:
IsVisibleEnables or disables rendering of collider.DynamicBoundsUpdates bounds of collider every time OnDrawGizmos calls. Useful when you changing Offset, Size, Radius, e.t. of the collider. If you don't just disable to increase performance.ColorColor of rendered collider.
Use MovementLogger to track objects transform at runtime. You can manipultate with 8 params:
BufferSizelimit number of records, set 0 if unlimitedRecordIntervallimit time of data storing, set 0 if you wat to do it every UpdateColorColor of visualizationRecordenable recordingDrawPointsenable visualizing of position pointsDrawLinesenable visualizing of pathRecordObjectStateRecords collider visualizer state, requires class inherited from BaseVisualizerRecordUnmovedrecord state even when the object wasn't movedDrawStateDraws collider visualizer state
Example:
Tools:
This tools can help you to automate some routine operations without opening manager window.
Remove all visualizers- removes all gizmos visualizers found in the sceneAdd visualizers for all Colliders2d- automatically adds relevant gizmos visualizers for all Collider2D found in the sceneRemove all Collider2dRenderer- removes all Collider2DRenderer found in the sceneAdd the Collider2dRenderer for all Colliders2d- automatically adds Collider2Renderer visualizer for all Collider2D found in the sceneAdd default sprites material for all Colliders2d- sets shared material based on "Sprites/Default" shader for all Collider2Renderer found in the scene