S&box Wiki

Revision Difference

phys_hinge#547182

<title>phys_hinge</title> # phys_hinge A physically simulated hinge that restricts the rotation of its attached entities to a given axis. Use the helper to define the axis of rotation. ### Keyvalues + Name (targetname) ⤶ + Tags (tags) + Friction (friction) ⤶ + Min Rotation Limit (min_rotation) + Max Rotation Limit (max_rotation) ⤶ + Initial rotation (initial_rotation) + Hinge Axis (hingeaxis) ⤶ + Motor Frequency (motorfrequency) + Motor damping ratio (motordampingratio) ⤶ + Entity 1 (attach1) + Entity 2 (attach2) ⤶ + Impulse Limit to Break (kg) (forcelimit) + Angular Impulse Limit to Break (kg* distance) (torquelimit) + Play Sound on Break (breaksound) ⤶ ### Flags⤶ + Enable Collision (enablecollision) + Name (`targetname`) > The name that other entities refer to this entity by. + Tags (`tags`) > A list of general purpose tags for this entity, for interactions with other entities such as triggers. + Friction (`friction`) > Resistance/friction in the constraint. + Min Rotation Limit (`min_rotation`) > Minimum rotation limit around hinge axis. + Max Rotation Limit (`max_rotation`) > Maximum rotation limit around hinge axis. + Initial rotation (`initial_rotation`) > Initial rotation of the hinge (values -1 to 1 where -1 mean open at minimum limit and 1 means open at maximum limit) + Hinge Axis (`hingeaxis`) + Motor Frequency (`motorfrequency`) > Range 0 - 30 (only used when driving the relative angle through the angle input) ⤶ + Motor damping ratio (`motordampingratio`) > Range 0 - 1 (only used when driving the relative angle through the angle input) ⤶ ⤶ ⤶ ⤶ + Entity 1 (`attach1`) ⤶ > The source entity to constrain from. Leave empty to constrain from the world entity.⤶ ⤶ + Entity 2 (`attach2`) ⤶ > The entity we constrain to. ⤶ ⤶ + Impulse Limit to Break (kg) (`forcelimit`)⤶ > The amount of impulse an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. ⤶ ⤶ ⤶ + Angular Impulse Limit to Break (kg* distance) (`torquelimit`)⤶ > The amount of angular impulse required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint.⤶ ⤶ + Play Sound on Break (`breaksound`)⤶ > A sound played when the constraint is broken.⤶ ⤶ ⤶ ### Flags⤶ ⤶ + Enable Collision (`enablecollision`) ⤶ > Constraints disable collision between the attached entities. In some rare cases we want to enable this collision.