unity3d collider的wheelcollider轮胎锁死问题

WheelCollider 车轮碰撞器_unity3d游戏脚本制作教程-游戏蛮牛出品
Unity 脚本手册
WheelCollider 车轮碰撞器
Inherits from
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
downwards the local
y-axis. The wheel has a
and can extend downwards by
车轮的碰撞检测是由从自身y轴中心向下投射射线。车轮有一个半径和可以向下延长的数。
The wheel is controlled with ,
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
settings. Simulation of different road materials
is done by changing the
based on what material the wheel is hitting. See Also:
车轮碰撞器使用不同于物理引擎的一个基于滑动的摩擦力模型来计算摩擦力。这允许更加真实的行为。而且使车轮忽略标准的设置。通过改变车轮所碰到的和来模拟不同的道路材质。
Variables变量
The center of the wheel, measured in the object's local space.
车轮的中心,基于物体的自身坐标空间。
The radius of the wheel, measured in local space.
车轮的半径,基于物体的自身坐标空间。
Maximum extension distance of wheel suspension, measured in local space.
车轮悬挂的最大延长距离,基于自身坐标空间。
The parameters of wheel's suspension. The suspension attempts to reach a target position
车轮悬挂的参数。通过添加弹簧和阻尼力,悬挂试图达到目标位置。
The mass of the wheel. Must be larger than zero.
车轮的质量。这个值必须大于0。
Properties of tire friction in the direction the wheel is pointing in.
在车轮指向方向上的摩擦力的属性。
Properties of tire friction in the sideways direction.
轮胎侧面方向上的摩擦力的属性。
Motor torque on the wheel axle. Positive or negative depending on direction.
在轮轴上的电机力矩。根据方向正或负。
Brake torque. Must be positive.
刹车的力矩。这个值必须为正。
Steering angle in degrees, always around the local y-axis.
转向角度,总是围绕自身y轴。
Indicates whether the wheel currently collides with something (Read Only).
表示车轮当前是否碰到什么(只读)。
Current wheel axle rotation speed, in rotations per minute (Read Only).
当前轮轴旋转速度,每分钟转速(只读)。
Functions函数
Gets ground collision data for the wheel.
Inherited members继承成员
Inherited Variables继承变量
Enabled Colliders will collide with other colliders, disabled Colliders won't.
启用碰撞器将会碰撞其他碰撞器,禁用碰撞器就不会碰撞其他碰撞器。
The rigidbody the collider is attached to.
碰撞器附加的刚体。
Is the collider a trigger?
碰撞器是一个触发器? (是否可以穿越)
The material used by the collider.
撞器使用的材质。
The shared physic material of this collider.
碰撞器的共享物理材质。
The world space bounding volume of the collider.
碰撞器在世界坐标空间的边界框。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
The game object this component is attached to. A component is always attached to a game object.
组件附加的游戏物体。一个组件总是被附加到一个游戏物体。
The tag of this game object.
游戏物体的标签。
The name of the object. //物体的名字
Should the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
The closest point to the bounding box of the attached collider.
到附加碰撞器的边界框最近的点。
Casts a Ray that ignores all Colliders except this one.
投射一个光线(),它忽略所有碰撞器,除了这个。
Returns the component of Type type if the game object has one attached, null if it doesn't.
如果游戏物体有一个附加,则返回Type类型的组件,如果没有则为null。扫一扫,访问微社区
后使用快捷导航没有帐号?
签到成功!您今天第{todayrank}个签到,签到排名竞争激烈,记得每天都来签到哦!已连续签到:{constant}天,累计签到:{days}天
当前位置: &
查看: 1931|回复: 1
车轮碰撞体(wheelcollider) unity3d游戏开发手册
本帖为抢楼帖,欢迎抢楼!&
85835/10000排名<font color="#FF昨日变化6主题帖子积分
常驻蛮牛, 积分 5835, 距离下一级还需 4165 积分
常驻蛮牛, 积分 5835, 距离下一级还需 4165 积分
在线时间333 小时
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
才可以下载或查看,没有帐号?
车轮碰撞体 (wheel collider)车轮碰撞体 (wheel collider)是用于陆上交通工具的特殊碰撞体 (collider)。它具有内置碰撞检测、车轮物理和基于滑动的轮胎摩擦力模型。它可以用于车轮之外的对象,但是它专门针对具有车轮的交通工具而设计。车轮碰撞体 (wheel collider) 组件 (component)。ati technologies inc 提供的汽车模型。属性属性:功能:中心 (center)对象局部坐标空间中的车轮中心。半径 (radius)车轮半径。悬架距离 (suspension distance)车轮悬架的最大延伸距离(在局部坐标空间中测量)。悬架始终通过局部坐标 y 轴向下延伸。悬架弹簧 (suspension spring)悬架通过添加弹簧和阻尼力尝试达到的目标位置 (target position)。弹簧 (spring)弹簧力尝试达到目标位置 (target position)。较大值可使悬架较快达到目标位置 (target position)。阻尼 (damper)对悬架速率进行阻尼处理。较大值使悬架弹簧 (suspension spring)移动较慢。目标位置 (target position)悬架沿悬架距离 (suspension distance) 的静止距离。0 对应于完全延伸的悬架,1 对应于完全压缩的悬架。默认值为 0,这与常规汽车悬架的行为相符。质量 (mass)车轮质量。前向/侧向摩擦力 (forward/sideways friction)当车轮向前和向侧面滚动时的轮胎摩擦力属性。请参阅下面的部分。详细信息车轮的碰撞检测执行方法是从中心 (center)通过局部坐标 y 轴向下投射射线。车轮具有半径 (radius),可以按照悬架距离 (suspension distance)向下延伸。交通工具使用不同属性从脚本进行控制:电机扭矩 (motortorque)、制动扭矩 (braketorque)和转向角度 (steerangle)。 有关更多信息,请参阅。车轮碰撞体 (wheel collider) 使用基于滑动的摩擦力模型,与物理引擎的其余部分分开计算摩擦力。这样可实现更逼真的行为,不过也会使车轮碰撞体 (wheel collider) 忽略标准设置。车轮碰撞体 (wheel collider) 设置您不会转向或滚动车轮碰撞体 (wheelcollider) 对象来控制汽车 - 附加了车轮碰撞体 (wheelcollider) 的对象应始终相对于汽车本身固定。但是,您可能要转向和滚动图形车轮表示形式。实现此目的的最佳方式是为车轮碰撞体 (wheel collider) 和可见车轮设置单独对象:车轮碰撞体 (wheel collider) 与可见车轮模型分开碰撞几何结构因为汽车可以实现较大速率,所以应使赛道碰撞几何结构合适,这点十分重要。具体而言,不应具有组成可见模型(例如栏杆)的小碰撞或凹陷。通常赛道的碰撞网格与可见网格分别构成,从而使碰撞网格尽可能平衡。它还不应具有窄对象 - 如果具有窄赛道边界,请使其在碰撞网格中更宽(或完全消除另一边(如果汽车绝不可能到达该处))。可见几何结构(左)比碰撞几何结构(右)要复杂得多车轮摩擦力曲线轮胎摩擦力可以通过以下显示的车轮摩擦力曲线来描述。车轮的前向(滚动)方向和侧向方向有不同的曲线。在这两个方向上,会首先确定轮胎的滑动量(基于轮胎橡胶与道路之间的速度差)i。随后此滑动值用于获得在接触点上施加的轮胎力。曲线将轮胎滑动测量值作为输入并提供力作为输出。曲线通过两段式样条进行近似计算。第一段从(0 , 0)到(极端滑动 (extremumslip),极端值 (extremumvalue)),曲线的斜率在该点处为零。第二段从(滑动极值 (extremumslip),极值 (extremumvalue))到(渐近线滑动 (asymptoteslip),渐近线值 (asymptotevalue)),曲线的切线在该点处再次为零:车轮摩擦力曲线的典型形状真实轮胎的属性在于对于较低滑动,它们可以施加较大力,因为橡胶会通过伸展补偿滑动。随后在滑动变得很高时,力会减小,因为轮胎开始滑动或旋转。因而,轮胎摩擦力曲线具有类似于上图中的形状。属性:功能:极端滑动/值 (extremum slip/value)曲线的极值点。渐近线滑动/值 (asymptote slip/value)曲线的渐近线点。刚度 (stiffness)极端值 (extremum value)和渐近线值 (asymptote value)的乘数(默认为 1)。更改摩擦力的刚度。将此值设置为零会完全禁用车轮产生的所有摩擦力。通常需在运行时从脚本修改刚度以模拟各种地面材质。提示您可能需要在中减小物理时间戳长度以获得更稳定的汽车物理,尤其是在它是可以达到高速的赛车时。要防止汽车太过轻易地翻车,可以通过脚本将其质心降低一点,并应用依赖于汽车速率的“下压力”。 wheelcollider能不能加宽; 左右车轮wheelcollider.rpm不一样;
每日推荐:
19/50排名<font color="#FF昨日变化38主题帖子积分
注册看看, 积分 9, 距离下一级还需 41 积分
注册看看, 积分 9, 距离下一级还需 41 积分
在线时间2 小时
具体应该怎么放置车轮碰撞体呢?为什么放到车轮上车子直接就解体了
每日推荐:}

我要回帖

更多关于 unity3d boxcollider 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信