Physics Data
Last updated
Last updated
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!
Creates and syncs physics data for an object beyond what is found in Unity's RigidBody. In particular the PhysicsData component will inspect all child mesh objects and create a related hull. Hull geometry is then used to calculate cross section, volumetric density, total volume and more.
Only used in editor, when enabled this will cause the gizmo system to drag bounding information and velocity information in the scene window.
The hull geometry created by the Physics Data object. This is calculated from the child meshes of the object or when the Register Geometry method is called.
The mass of the object as seen on the attached rigidbody
The linear drag as seen on the attached rigidbody. This is used to calculate quadratic drag effects.
The angular drag as seen on the attached rigidbody. This is used to calculate quadratic drag effects.
The average density of the body e.g. Mass / Volume
The volume of the geometry that makes up the body. This is calculated when hull geometry is calculated.
The surface area of the hull geometry. This is calculated when hull geometry is calculated.
The effective cross section as seen from the X axis. This is calculated when hull geometry is calculated.
The effective cross section as seen from the Y axis. This is calculated when hull geometry is calculated.
The effective cross section as seen from the Z axis. This is calculated when hull geometry is calculated.
The direction of travel as seen from the rigidbody.
The speed of travel as seen from the rigidbody;
The linear velocity as seen from the rigidbody; This is the same as LinearSpeed * LinearHeading
The angular heading as seen from the rigidbody;
The angular speed as seen from the rigidbody;
The angualge velocity as seen form the rigidbody; This is the same as AngularSpeed * AngularHeading;
The bounds of the hull geometry.
The attached rigidbody
Calculates a hull based on 1 or more MeshFilters and uses the resulting hull to calculate volume, surface area and other related features of the system.
Note that this does not respect the ignored meshes field. you are expected to hand this method only what should be calculated.
This method is called automatically on awake but can be called manually to force and update or for procedural bodies.
Estimates the effective cross section as viewed from this direction.
Gets the corners of the bounding box around the body based on the hull mesh