AddJoint() 공개 메소드

Adds a new joint to the Collider
public AddJoint ( Duality.Components.Physics.JointInfo joint, RigidBody other = null ) : void
joint Duality.Components.Physics.JointInfo
other RigidBody
리턴 void
예제 #1
0
        private void SetupFrictionJoint(RigidBody body)
        {
            // If we already have a friction joint, is it connecting the right bodies?
            if (this.frictionJoint != null)
            {
                if (this.frictionJoint.ParentBody != body ||
                    this.frictionJoint.ParentBody != this.baseObject)
                {
                    this.frictionJoint.ParentBody.RemoveJoint(this.frictionJoint);
                    this.frictionJoint = null;
                }
            }

            // Create a friction joint connecting our body to the body it is standing on
            if (this.frictionJoint == null)
            {
                this.frictionJoint = new FrictionJointInfo();
                this.frictionJoint.CollideConnected = true;
                this.frictionJoint.MaxTorque = 0.0f;
                body.AddJoint(this.frictionJoint, this.baseObject);
            }
        }