Physics Data
Like what your seeing?
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!
Introduction
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.
Fields and Attributes
Debug
Only used in editor, when enabled this will cause the gizmo system to drag bounding information and velocity information in the scene window.
Hull Geometry
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.
Mass
The mass of the object as seen on the attached rigidbody
Linear Drag Coefficient
The linear drag as seen on the attached rigidbody. This is used to calculate quadratic drag effects.
Angular Drag Coefficient
The angular drag as seen on the attached rigidbody. This is used to calculate quadratic drag effects.
Density
The average density of the body e.g. Mass / Volume
Volume
The volume of the geometry that makes up the body. This is calculated when hull geometry is calculated.
Area
The surface area of the hull geometry. This is calculated when hull geometry is calculated.
X Cross Section
The effective cross section as seen from the X axis. This is calculated when hull geometry is calculated.
Y Cross Section
The effective cross section as seen from the Y axis. This is calculated when hull geometry is calculated.
Z Cross Section
The effective cross section as seen from the Z axis. This is calculated when hull geometry is calculated.
Linear Heading
The direction of travel as seen from the rigidbody.
Linear Speed
The speed of travel as seen from the rigidbody;
Linear Velocity
The linear velocity as seen from the rigidbody; This is the same as LinearSpeed * LinearHeading
Angular Heading
The angular heading as seen from the rigidbody;
Angular Speed
The angular speed as seen from the rigidbody;
Angular Velocity
The angualge velocity as seen form the rigidbody; This is the same as AngularSpeed * AngularHeading;
Bounds
The bounds of the hull geometry.
Attached Rigidbody
The attached rigidbody
Methods
Register Geometry
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.
Cross Section
Estimates the effective cross section as viewed from this direction.
Get Bound Corners
Gets the corners of the bounding box around the body based on the hull mesh
Last updated