S&box Wiki

Revision Difference

PhysicsJoints#562967

<cat>Code.Physics</cat>⤶ <title>Joints</title>⤶ ⤶ <note>⤶ This page is a work-in-progress. It requires more sections, fact checking and screenshots.⤶ </note>⤶ ⤶ # Overview⤶ ⤶ A PhysicsJoint constrains the motion of one PhysicsBody with respect to another. When a PhysicsBody is dynamic, joints attached to the body may influence its movement. ⤶ ⤶ Take for example two cubes connected by a SpringJoint. Each cube has a BoxCollider Component that defines its shape in the PhysicsWorld, as well as a Rigidbody Component that provides a dynamic PhysicsBody for the Collider to attach to.⤶ ⤶ <note>⤶ TODO: Add a screenshot of the components.⤶ </note>⤶ ⤶ Pulling the first cube causes the second to trail behind, and vice versa.⤶ ⤶ <note>⤶ TODO: Add a diagram of a cube being pulled.⤶ </note>⤶ ⤶ When a body is static or keyframed, joints will have no effect on the motion of that body, but a dynamic body attached to the other end of the same joint may be affected.⤶ ⤶ <note>⤶ TODO: Add a diagram of a dynamic cube dangling from a static collider.⤶ </note>⤶ ⤶ # Joint Components⤶ ⤶ In the scene editor, PhysicsJoints may be created by adding to a GameObject one of several different Joint Components, each of which will be described below in further detail.⤶ ⤶ <note>⤶ TODO: Fill out sections for each type of PhysicsJoint.⤶ </note>⤶ ⤶ ## Fixed Joint⤶ ⤶ ## Spring Joint⤶ ⤶ ## Slider Joint⤶ ⤶ ## Hinge Joint⤶ ⤶ ## Ball Joint⤶