float ReferenceMass { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The ReferenceMass property of the SpringJoint class in the Sandbox.Physics namespace represents the mass that the spring joint uses as a reference for its calculations. This property is of type System.Single (float) and is publicly accessible. It is not typically necessary to modify this property, as the default value is automatically determined based on the actual physics of the objects involved in the joint.

Usage

In most cases, you should not need to set the ReferenceMass property manually. The physics engine calculates an appropriate reference mass based on the objects connected by the spring joint. However, if you have a specific use case that requires a custom reference mass, you can set this property to a desired value.

Example

// Example of accessing the ReferenceMass property
SpringJoint springJoint = new SpringJoint();

// Accessing the ReferenceMass
float currentReferenceMass = springJoint.ReferenceMass;

// Optionally setting a custom ReferenceMass
springJoint.ReferenceMass = 5.0f; // Set to a specific value if needed