WheelJoint: Allows an object to rotate around a fixed axis relative to another object, while also providing spring-like resistance along the axis for bouncing back.
Whether the component is a singleton, meaning only one instance of this type of script can be added to the same node.
Zh
是否为单例,即同一个节点只能添加此类型的脚本一次。
anchor
anchor:any[] = ...
En
Link points of joints, it is offset from the position of the upper left corner of its own rigid body. This setting is effective only on the first assignment.
Zh
[首次设置有效]关节的链接点,是相对于自身刚体的左上角位置偏移。。
angle
angle:number = 90
En
An angle value that defines the direction of elastic motion, i.e., the direction in which the wheel can compress and extend like a spring. For example, 0 degrees is along the X-axis to the right, and 90 degrees is along the Y-axis downward. This setting is effective only on the first assignment.
Zh
[首次设置有效]一个角度值,用于定义弹性运动方向,即轮子在哪个方向可以如弹簧一样压缩和伸展,例如 0 度表示沿 X 轴正方向,90 度表示沿 Y 轴负方向。
collideConnected
collideConnected:boolean = false
En
Specifies whether the two connected rigid bodies can collide with each other. Default is false. This setting is effective only on the first assignment.
The rigid body that is locally attached to the joint. This setting is effective only on the first assignment.
Zh
[首次设置有效]与关节直接相连的自身刚体。
访问器
awaked
get awaked(): boolean
返回 boolean
En
whether the component has been awakened.
Zh
组件是否已经被唤醒。
axis
get axis(): any
返回 any
已被弃用
启用约束后,刚体移动范围的上限,是距离anchor的偏移量
set axis(value): void
参数
value: any
返回 void
damping
get damping(): number
返回 number
En
The damping ratio that the body experiences when returning to the anchor point, with a recommended value range of 0 to 1.
Zh
刚体在回归到锚点过程中受到的阻尼比,建议取值范围为 0 到 1。
set damping(value): void
参数
value: number
返回 void
destroyed
get destroyed(): boolean
返回 boolean
En
whether the component has been destroyed.
Zh
组件是否已经被销毁。
enabled
get enabled(): boolean
返回 boolean
En
whether the component is enabled.
Zh
是否启用组件。
set enabled(value): void
参数
value: boolean
返回 void
enableLimit
get enableLimit(): boolean
返回 boolean
En
Whether the movement range of the connected body is limited.
Zh
是否对连接刚体的移动范围加以约束。
set enableLimit(value): void
参数
value: boolean
返回 void
enableMotor
get enableMotor(): boolean
返回 boolean
En
Whether the motor is enabled to drive the rotation of the connected body.
Zh
是否启用马达以驱动连接刚体的旋转。
set enableMotor(value): void
参数
value: boolean
返回 void
frequency
get frequency(): number
返回 number
En
The vibration frequency of the spring system, which can be considered as the spring's elasticity coefficient.The frequency should typically be less than half the time step frequency.
Zh
弹簧系统的振动频率,可以视为弹簧的弹性系数。通常频率应小于时间步长频率的一半。
set frequency(value): void
参数
value: number
返回 void
hideFlags
get hideFlags(): number
返回 number
En
The hide flags that determine the hiding behavior of the component.
Zh
确定组件隐藏行为的标志。
set hideFlags(value): void
参数
value: number
返回 void
id
get id(): number
返回 number
En
The unique identifier for the component.
Zh
组件的唯一标识。
joint
get joint(): any
返回 any
En
[read-only] Native joint object.
Zh
[只读]原生关节对象。
lowerTranslation
get lowerTranslation(): number
返回 number
En
The lower limit of the movement range when the limit is enabled, as an offset from the anchor.
Zh
启用约束后,刚体移动范围的下限,是距离锚点的偏移量。
set lowerTranslation(value): void
参数
value: number
返回 void
maxMotorTorque
get maxMotorTorque(): number
返回 number
En
The maximum torque that can be applied when the motor is enabled. Insufficient torque may result in no rotation.
Zh
启用马达后可以施加的最大扭距。如果最大扭矩太小,可能导致不旋转。
set maxMotorTorque(value): void
参数
value: number
返回 void
motorSpeed
get motorSpeed(): number
返回 number
En
The maximum rotational speed that can be achieved when the motor is enabled.
Zh
启用马达后可以达到的最大旋转速度。
set motorSpeed(value): void
参数
value: number
返回 void
upperTranslation
get upperTranslation(): number
返回 number
En
The upper limit of the movement range when the limit is enabled, as an offset from the anchor.
Checks if the component has a specific hide flag set.
Zh
检查组件是否设置了特定的隐藏标志。
isValid
isValid(): boolean
返回 boolean
onAdded
onAdded(): void
返回 void
En
Called after the component is added to a node. Unlike Awake, onAdded is called even if the node is not active.
Zh
组件被添加到节点后调用,与 onAwake 不同的是,即使节点未激活也会调用 onAdded。
Blueprint Event
onAwake
onAwake(): void
返回 void
En
Executed after the component is activated. At this point, all nodes and components have been created. This method is executed only once.
Zh
组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次。
Blueprint Event
onDestroy
onDestroy(): void
返回 void
En
Executed when the node is destroyed manually.
Zh
手动调用节点销毁时执行。
Blueprint Event
onDisable
onDisable(): void
返回 void
En
Executed when the component is disabled, such as when the node is removed from the stage.
Zh
组件被禁用时执行,比如从节点从舞台移除后。
Blueprint Event
onEnable
onEnable(): void
返回 void
En
Executed after the component is enabled, such as when the node is added to the stage.
Zh
组件被启用后执行,比如节点被添加到舞台后。
Blueprint Event
可选onLateUpdate
onLateUpdate(): void
返回 void
En
Executed every frame during the late update phase, after the update phase.
Zh
每帧更新时执行,在 late update 阶段,update 阶段之后。
Blueprint Event
可选onPostRender
onPostRender(): void
返回 void
En
Executed after rendering.
Zh
渲染之后执行。
Blueprint Event
可选onPreRender
onPreRender(): void
返回 void
En
Executed before rendering.
Zh
渲染之前执行。
Blueprint Event
可选onReset
onReset(): void
返回 void
En
Resets the component's parameters to their default values. If this function is implemented, the component will be reset and automatically recycled for future use.
If not reset, it will not be recycled for reuse.
En
WheelJoint: Allows an object to rotate around a fixed axis relative to another object, while also providing spring-like resistance along the axis for bouncing back.
Zh
轮子关节:允许一个物体在另一个物体上以固定的轴向转动,同时还能沿着轴向弹簧回弹。