用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:jointlimits:jointlimits

JointLimits 关节限制

struct in UnityEngine

Description 描述

JointLimits is used by the HingeJoint to limit the joints angle.

关节限制用于铰链关节去限制关节角度。

JavaScript:

function Start() {
	// Set the hinge limits for a door.
	var hinge = GetComponent.<HingeJoint>();
 
	var limits = hinge.limits;
	limits.min = 0;
	limits.max = 90;
	limits.bounciness = 0;
	limits.bounceMinVelocity = 0;
	hinge.limits = limits;
}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Start() {
        HingeJoint hinge = GetComponent<HingeJoint>();
        JointLimits limits = hinge.limits;
        limits.min = 0;
        limits.max = 90;
        limits.bounciness = 0;
        limits.bounceMinVelocity = 0;
        hinge.limits = limits;
    }
}

Variables 变量

bounceMinVelocityThe minimum impact velocity which will cause the joint to bounce.
引起关节反弹的最小碰撞速度
bouncinessDetermines the size of the bounce when the joint hits it's limit. Also known as restitution.
当关节触及它的限制条件时确定反弹力大小。也称为返还力。
contactDistanceDistance inside the limit value at which the limit will be considered to be active by the solver.
限制值内部的距离,该限制将会考虑通过解算机激活。
maxThe upper angular limit (in degrees) of the joint.
关节的上限。
minThe lower angular limit (in degrees) of the joint.
关节下限(单位度)。
script/unityengine/classes/jointlimits/jointlimits.txt · 最后更改: 2016/08/02 05:36 (外部编辑)