返回介绍

WheelCollider 轮碰撞器

发布于 2019-12-18 15:38:46 字数 5771 浏览 1340 评论 0 收藏 0

class in UnityEngine / Inherits from: Collider

Description 描述

A special collider for vehicle wheels.

用于车轮的特殊碰撞器。

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.

车轮的碰撞检测是由从自身y轴中心向下投射射线。车轮有一个半径和可以向下延长的suspensionDistance数。

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

车轮是由motorTorque, brakeTorque 和 steerAngle属性控制。

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.

车轮碰撞器使用不同于物理引擎的一个基于滑动的摩擦力模型来计算摩擦力。这允许更加真实的行为。而且使车轮忽略标准的PhysicMaterial设置。通过改变车轮所碰到的forwardFriction和sidewaysFriction来模拟不同的道路材质。

Variables 变量

brakeTorqueBrake torque expressed in Newton metres.
制动的扭矩。这个值必须为正。
centerThe center of the wheel, measured in the object's local space.
车轮的中心,基于物体的自身坐标空间。
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).
车轮的质量,以千克表示。该指必须大于0,通常该值的范围是20~80。
motorTorqueMotor torque on the wheel axle expressed in Newton metres. Positive or negative depending on direction.
在轮轴上的马达扭矩。根据方向正或负。
radiusThe radius of the wheel, measured in local space.
车轮的半径,基于物体的自身坐标空间。
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.
该车轮碰撞器支撑的质量。
steerAngleSteering angle in degrees, always around the local y-axis.
转向角度,总是沿自身Y轴。
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.
车轮悬挂的参数。通过应用线性力和阻尼力,悬挂试图达到目标位置。
wheelDampingRateThe damping rate of the wheel. Must be larger than zero.
车轮的阻尼率。必须大于0的值。

Public Functions 共有函数

ConfigureVehicleSubstepsConfigure vehicle sub-stepping parameters.
配置车辆子步参数。
GetGroundHitGets ground collision data for the wheel.
获取车轮的地面碰撞数据。
GetWorldPoseGets the world space pose of the wheel accounting for ground contact, suspension limits, steer angle, and rotation angle (angles in degrees).
获取世界坐标空间车轮与地面接触、悬挂限制、转向角以及选择角度的姿态。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文