Version: 2018.2

WheelHit

struct in UnityEngine

Switch to Manual

Description

Contact information for the wheel, reported by WheelCollider.

Friction for the WheelCollider is computed separately from the rest of the physics, using a slip based tire friction model. This allows for more realistic behaviour, but makes wheel colliders ignore standard PhysicMaterial settings.

The way to simulate different ground materials is to query WheelCollider for its collision information (see WheelCollider.GetGroundHit). Usually, you get the other collider the wheel is hitting, and modify the wheel's WheelCollider.forwardFriction and WheelCollider.sidewaysFriction based on the physic material of the ground.

The other members of the WheelHit structure are usually queried for information purposes or special effects. For example, a "slipping tire" sound can be played if forwardSlip or sidewaysSlip exceed some threshold.

See Also: WheelCollider.GetGroundHit.

Variables

colliderThe other Collider the wheel is hitting.
forceThe magnitude of the force being applied for the contact.
forwardDirThe direction the wheel is pointing in.
forwardSlipTire slip in the rolling direction. Acceleration slip is negative, braking slip is positive.
normalНормаль в точке контакта.
pointТочка контакта между колесом и землей.
sidewaysDirБоковое направление колеса.
sidewaysSlipСкольжения шин в боковом направлении.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961