PhysicsBody Body1 { get; set; }

robot_2Generated
code_blocksInput

Description

The Body1 property represents the source physics body to which this joint is attached. It is a part of the PhysicsJoint class within the Sandbox.Physics namespace. This property is essential for defining the first body in a joint connection, allowing for the creation of various physical constraints between two bodies.

Usage

To use the Body1 property, you need to have an instance of a PhysicsJoint. You can then access the Body1 property to get or set the source physics body for the joint. This is typically used when setting up or modifying a joint between two physics bodies in a simulation.

Example

// Example of accessing the Body1 property
PhysicsJoint joint = new PhysicsJoint();
PhysicsBody sourceBody = joint.Body1;

// Example of setting the Body1 property
PhysicsBody newSourceBody = new PhysicsBody();
joint.Body1 = newSourceBody;