Unity - 2D the joint physical

  • This article summarizes: Analysis Unity several 2D joint assembly physical basic functionality, use, and other scenes using
  • Development Environment: Unity2019.3.0a2 / VS2017
  • Project Resource Package: 2D Joints Starter
  • Description: more than over the source project, I made the following settings on their own
    • The main scene for the Demo
    • Under the new parameters explain the new version of Unity
    • Simply do a new UI
    • Annotation and modify each script
    • Orderly classification of the scene objects: the sample object space object attributable to each component corresponding to the component name, for example, it relates to an object stored at DistanecJoint2D assembly Distance Joint 2D object or the like


Distance Joint 2D from joint

  • basic skills:
    • Two joints so that the object is limited by the distance, at a distance from
    • May be made an object to another object (the object is surrounded by and surround the object) based on the physical properties of the circulating motion
    • Note: the object itself does not rotate around the
  • Instructions:
    • Collision enable : the two objects are articulated whether collide
    • The Rigid Body Connected : definition of the object surrounded by the anchor to the specified object
    • Connected the Configure Auto : to automatically configure the anchor and the anchor match in world space (temporarily not used, but I believe you will point the Ctrl + Z)
    • Records : coordinates of the object around the anchor
    • Records Connected : coordinates of the object is surrounded by the anchor
    • The Configure Distance Auto : automatically calculate and set the distance between the two objects, i.e. objects surrounded by a drag during operation will change the Distance, Distance is always closed when a preset value
    • Distance : distance between the two objects
    • Only Distance max : the distance that the object will sink slightly in the direction of the swing joint connection to the upper position when closed, surround the object distance is always in motion Distance.
  • Implementation Use:
    • Pendulum

Spring Joint 2D spring joint

  • basic skills:
    • The spring is limited so that the two joint objects, to maintain a certain distance range
    • An object to another object may be compressed moving (sub-object and the main object) based on the physical properties of the stretched spring
    • Note: When the sub-object for an object class around the main spring movement, also rotating itself
  • Instructions:
    • Collision enable : the two objects are articulated whether collide
    • The Rigid Body Connected : a main object of the anchor point definition to the specified object
    • Connected the Configure Auto : Automatic Configuration anchor and the anchor match in world space
    • Anchor coordinates Vice object anchor:
    • Connected Anchor coordinates of the main object of the anchor:
    • The Configure Distance Auto : automatically calculate and set the distance between the two objects, i.e. objects surrounded by a drag during operation will change the Distance, Distance is always closed when a preset value
    • Distance : distance between the two objects
    • Ratio Damping This : damping ratio, the value range [0, 1]
    • Frequency : the vibration frequency in Hz, range [0,1000000], but I think [0,10] more commonly
  • Implementation Use:
    • spring
    • Catapult

Hinge Joint 2D hinge joint

  • basic skills:
    • An object rotatable about a fixed point
  • Instructions:
    • Joint Limits the Angular the Edit : manually adjusting the rotational center and the rotational angle range
    • Collision the Enable : whether the object can collide with each other (but compared to the previous two joints, where the use of temporary unknown)
    • The Rigid Body Connected : the anchor point definition of the object to the specified object
    • Connected the Configure Auto : Automatic Configuration anchor and the anchor match in world space
    • Records :. This object center of rotation is usually adjusted to a parameter representing the coordinates of the object itself anchor
    • Anchor Connected : temporarily unknown specific meaning, in short, use Edit Joint Angular Limits enough
    • Motor the Use :. Whether the motor when used, so that the hinge joint is stable rotational speed; if applicable, is simply by gravity factors pivot hinge joint
      • Speed Motor :. Rotational speed in m / s or angle / sec, depending on angle motor or a linear motor may be a negative value indicates a reverse direction.
      • Motor Force the Maximum :. The maximum torque value, the rotational speed indicates the maximum recommended default value ease
    • Limits the Use : whether to limit the rotation angle of the angle limit when using the hinge joint stops after parameters and containing Lower Angle Upper Angle..
  • Implementation Use:
    • Horizontal version of the game obstacles, jumping
    • door

Slider Joint 2D sliding joints

  • basic skills:
    • So that the object can slide (automatic or manual) in a direction
  • Instructions:
    • Collision the Enable : whether the object can collide with each other
    • The Rigid Body Connected : the anchor point definition of the object to the specified object
    • Connected the Configure Auto : Automatic Configuration anchor and the anchor match in world space
    • Records : sliding anchor object, the default object center 0
    • Anchor Connected : object slide anchor
    • Angle the Configure Auto : The coordinates in the current Scene, automatically adjust the starting angle of the object
    • Angle : Self arranged and fixed starting angle of the object
    • Motor the Use : whether to use the motor if used, may be automatically slid to the end.
      • Speed Motor : sliding speed, the unit above can be positive or negative.
      • Motor Force the Maximum : the maximum torque value, meaning as above
    • Limits the Use : whether the distance limit, limit distance that is at both ends of the slider, Connected Anchor anchor always, it slides within such a range within the ends Lower Translation and Upper Translation..
  • Implementation Use:
    • Automatic or manual slide (organ)

Wheel Joint 2D joint wheel

  • basic skills:
    • An analog implementation of the wheel motion state, i.e., as the center of rotation of the wheel to the axle
  • Instructions:
    • Collision enable : the two objects are articulated whether collide
    • The Rigid Body Connected : the anchor point definition to the wheel axle
    • Connected the Configure Auto : automatic configuration to match the anchor wheel anchor and world space
    • Records : coordinates of the anchor wheel
    • Anchor Connected : coordinate axle anchor
    • Suspension : The suspension for the wheels arranged vibration effects
      • Ratio Damping This : damping ratio, the value range [0, 1]
      • Frequency : the vibration frequency in Hz, range [0,1000000], suggested here (0,10]
      • Angle : the angle of the wheels can be adjusted, but not its specific role
    • Motor the Use : whether to use the motor if used, can be automatically rotated.
      • Speed Motor : rotational speed, the unit can be positive or negative supra.
      • Motor Force the Maximum : the maximum torque value, meaning as above
  • Implementation Use:
    • Car wheels
    • Irregular rotation
    • Some effects of rotation
  • NOTE : In the example there is a scene demo2 Wheel Joint2D detailed configuration procedure is omitted



reference

Guess you like

Origin www.cnblogs.com/SouthBegonia/p/11510854.html