WheelCollider

class in UnityEngine

/

Inherits from:Collider

Switch to Manual

Description

Специальный коллайдер для колес транспортных средств.

Wheel collider is used to model vehicle wheels. It simulates a spring and damper suspension setup, and uses a slip based tire friction model to calculate wheel contact forces.

Wheel's collision detection is performed by casting a ray from center downwards the local y-axis. The wheel has a radius and can extend downwards by suspensionDistance amount.

The wheel is controlled with motorTorque, brakeTorque and steerAngle properties.

Wheel collider computes friction separately from the rest of physics engine, using a slip based friction model. This allows for more realistic behaviour, but makes wheel colliders ignore standard PhysicMaterial settings. Simulation of different road materials is done by changing the forwardFriction and sidewaysFriction based on what material the wheel is hitting. See Also: GetGroundHit and WheelFrictionCurve.

Variables

brakeTorqueBrake torque expressed in Newton metres.
centerЦентр колеса, измеряется в локальном пространстве объекта.
forceAppPointDistanceApplication point of the suspension and tire forces measured from the base of the resting wheel.
forwardFrictionProperties of tire friction in the direction the wheel is pointing in.
isGroundedIndicates whether the wheel currently collides with something (Read Only).
massThe mass of the wheel, expressed in kilograms. Must be larger than zero. Typical values would be in range (20,80).
motorTorqueMotor torque on the wheel axle expressed in Newton metres. Positive or negative depending on direction.
radiusРадиус колеса, измеряется в локальном постранстве.
rpmCurrent wheel axle rotation speed, in rotations per minute (Read Only).
sidewaysFrictionProperties of tire friction in the sideways direction.
sprungMassThe mass supported by this WheelCollider.
steerAngleУгол поворота в градусах, всегда вращается в локальной оси-у.
suspensionDistanceMaximum extension distance of wheel suspension, measured in local space.
suspensionSpringThe parameters of wheel's suspension. The suspension attempts to reach a target position by applying a linear force and a damping force.
wheelDampingRateМасса колеса. Должна быть больше нуля.

Public Functions

ConfigureVehicleSubstepsConfigure vehicle sub-stepping parameters.
GetGroundHitПолучает данные о столкновении колеса с поверхностью.
GetWorldPoseGets the world space pose of the wheel accounting for ground contact, suspension limits, steer angle, and rotation angle (angles in degrees).

Inherited members

Variables

attachedRigidbodyRigidbody к которому присоединен коллайдер.
boundsThe world space bounding volume of the collider (Read Only).
contactOffsetОграниченный обьем коллайдера в мировых координатах.
enabledEnabled Colliders will collide with other Colliders, disabled Colliders won't.
isTriggerЯвляется ли коллайдер триггером?
materialМатериал, используемый коллайдером.
sharedMaterialОбщий физический материал данного коллайдера.
gameObjectИгровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

ClosestPointReturns a point on the collider that is closest to a given location.
ClosestPointOnBoundsБлижайшая точка на ограничивающей рамке присоединенного коллайдера.
RaycastПускает [[Ray], который игнорирует все коллайдеры, кроме этого.
BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли данный игровой объект тегом tag?
GetComponentВозвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен.
GetComponentInChildrenВозвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину.
GetComponentInParentВозвращает все компоненты типа type из GameObject'а или из любого его родителя.
GetComponentsВозвращает все компоненты типа type в GameObject.
GetComponentsInChildrenВозвращает все компоненты типа type в GameObject или любому из его потомков.
GetComponentsInParentВозвращает все компоненты типа type в GameObject или любому из его родителей.
SendMessageВызывает метод с названием methodName в каждом MonoBehaviour в этом игровом объекте.
SendMessageUpwardsВызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the GameObject.

Static Functions

DestroyУдаляет GameObject, Component или Asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

Messages

OnCollisionEnterOnCollisionEnter вызывается, когда этот collider/rigidbody начал соприкосновение с другим rigidbody/collider.
OnCollisionExitOnCollisionExit вызывается, когда collider/rigidbody прекращает контакт с другим rigidbody/collider.
OnCollisionStayOnCollisionStay вызывается один раз в кадр для каждого collider/rigidbody, который касается другого rigidbody/collider.
OnTriggerEnter OnTriggerEnter is called when the Collider other enters the trigger.
OnTriggerExitOnTriggerExit вызывается, когда Collider other перестает соприкасаться с триггером.
OnTriggerStayOnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.