当前位置: 首页>>代码示例>>C#>>正文


C# Joint类代码示例

本文整理汇总了C#中Joint的典型用法代码示例。如果您正苦于以下问题:C# Joint类的具体用法?C# Joint怎么用?C# Joint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Joint类属于命名空间,在下文中一共展示了Joint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Gesture

 public Gesture(DateTime timestamp, double magnitude, GestureID id, Joint guestureSource)
 {
     this._timestamp = timestamp;
     this._magnitude = magnitude;
     this._id = id;
     this._guestureSource = guestureSource;
 }
开发者ID:cnirkhe,项目名称:BubbleKeyboard,代码行数:7,代码来源:Gesture.cs

示例2: KinectSkeleton

 public KinectSkeleton(Joint ankleLeft, Joint ankleRight, Joint elbowLeft, Joint elbowRight, Joint footLeft, 
                       Joint footRight, Joint handLeft, Joint handRight, Joint head, Joint hipCenter, 
                       Joint hipLeft, Joint hipRight, Joint kneeLeft, Joint kneeRight, Joint shoulderCenter, 
                       Joint shoulderLeft, Joint shoulderRight, Joint spine, Joint wristLeft, Joint wristRight)
 {
     this.ankleLeft = ankleLeft;
     this.ankleRight = ankleRight;
     this.elbowLeft = elbowLeft;
     this.elbowRight = elbowRight;
     this.footLeft = footLeft;
     this.footRight = footRight;
     this.handLeft = handLeft;
     this.handRight = handRight;
     this.head = head;
     this.hipCenter = hipCenter;
     this.hipLeft = hipLeft;
     this.hipRight = hipRight;
     this.kneeLeft = kneeLeft;
     this.kneeRight = kneeRight;
     this.shoulderCenter = shoulderCenter;
     this.shoulderLeft = shoulderLeft;
     this.shoulderRight = shoulderRight;
     this.spine = spine;
     this.wristLeft = wristLeft;
     this.wristRight = wristRight;
 }
开发者ID:dhjung,项目名称:TeleKinect,代码行数:26,代码来源:KinectSkeleton.cs

示例3: Direction

 public Direction(Joint i, Joint j)
 {
     createDirection(
         j.Position.X - i.Position.X,
         j.Position.Y - i.Position.Y,
         j.Position.Z - i.Position.Z);
 }
开发者ID:aayushssinghal,项目名称:Kinect_Controlled_Robotic_Arm_group10_cs308_2012,代码行数:7,代码来源:Direction.cs

示例4: SetUIElementPosition

        private void SetUIElementPosition(FrameworkElement element, Joint joint, int yOffset)
        {
            var scaledJoint = joint.ScaleTo(1024, 768, .99f, .99f);

            Canvas.SetLeft(element, scaledJoint.Position.X);
            Canvas.SetTop(element, scaledJoint.Position.Y - yOffset);
        }
开发者ID:NashDotNet,项目名称:Intro-to-Developing-for-the-Kinect,代码行数:7,代码来源:MainWindow.xaml.cs

示例5: detectWalking

        /// <summary>
        /// Process walking/running. Calculates how far forward the right foot
        /// is from the left foot.
        /// </summary>
        /// <param name="rightFoot"></param>
        /// <param name="leftFoot"></param>
        private void detectWalking(Joint rightFoot, Joint leftFoot) {
          
            double feetDifferential = leftFoot.Position.Z - rightFoot.Position.Z;

            // Move forward
            if (feetDifferential > walkThresh)
            {
                if (feetDifferential > runThresh)
                {
                    InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_2);
                }
                else
                {
                    InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_W);
                }

            }
            // Move backward
            else if (feetDifferential < -walkThresh)
            {
                InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_S);
            }
            else
            {
                if (InputSimulator.IsKeyDown(VirtualKeyCode.VK_W)) InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_W);
                if (InputSimulator.IsKeyDown(VirtualKeyCode.VK_S)) InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_S);
                if (InputSimulator.IsKeyDown(VirtualKeyCode.VK_2)) InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_2);
            }
        }
开发者ID:guozanhua,项目名称:kinect-earth,代码行数:35,代码来源:SuperController.cs

示例6: SetGrapple

    void SetGrapple(GameObject targ, int grappleType)
    {
        if (targ == null) return;

        if (curTarget != null) FreeGrapple ();

        swinging = true;
        curTarget = targ;
        Rigidbody targRigid = curTarget.GetComponent<Rigidbody> ();
        if (targRigid != null) {

            if (grappleType == 0) {
                HingeJoint target_hinge = targRigid.gameObject.AddComponent <HingeJoint> ();
                target_hinge.connectedBody = rigid;
        //				parentRigid.isKinematic = true;
                target_hinge.autoConfigureConnectedAnchor = false;
                target_hinge.connectedAnchor = targRigid.transform.position;
                hingeTarget = target_hinge;

        //				target_hinge.maxDistance = 50;
        //				target_hinge.minDistance = 45;
            } else if (grappleType == 1) {
                SpringJoint target_spring = targRigid.gameObject.AddComponent <SpringJoint> ();
                target_spring.connectedBody = rigid;
                target_spring.autoConfigureConnectedAnchor = false;
                target_spring.connectedAnchor = targRigid.transform.position;
                target_spring.maxDistance = 50;
                target_spring.minDistance = 5;
                hingeTarget = target_spring;
            }
        }
    }
开发者ID:benmirath,项目名称:shaderTest1,代码行数:32,代码来源:HookShot.cs

示例7: release

 public void release()
 {
     Joint oldGrip = grip;
     grip = null;
     Object.Destroy(oldGrip);
     grabee = null;
 }
开发者ID:rusticgames,项目名称:rts,代码行数:7,代码来源:Grabber.cs

示例8: Grammar

        public Grammar()
        {
            Options     = RuntimeOptions.Default;

            Productions = new ProductionCollection(this);
            Symbols     = new SymbolCollection(this);
            Conditions  = new ConditionCollection(this);
            Matchers    = new MatcherCollection(this);
            Mergers     = new MergerCollection(this);
            Contexts    = new ForeignContextCollection(this);
            Reports     = new ReportCollection();
            GlobalContextProvider = new ForeignContextProvider { Owner = this.Contexts };
            Joint       = new Joint();

            for (int i = PredefinedTokens.Count; i != 0; --i)
            {
                Symbols.Add(null); // stub
            }

            Symbols[PredefinedTokens.Propagated]      = new Symbol("#");
            Symbols[PredefinedTokens.Epsilon]         = new Symbol("$eps");
            Symbols[PredefinedTokens.AugmentedStart]  = new Symbol("$start");
            Symbols[PredefinedTokens.Eoi]             = new Symbol("$")
                                          {
                                              Categories = SymbolCategory.DoNotInsert
                                                         | SymbolCategory.DoNotDelete
                                          };
            Symbols[PredefinedTokens.Error]           = new Symbol("$error");

            AugmentedProduction = Productions.Define((Symbol)Symbols[PredefinedTokens.AugmentedStart], new Symbol[] { null });
        }
开发者ID:bkushnir,项目名称:IronTextLibrary,代码行数:31,代码来源:Grammar.cs

示例9: NullCanBeAddedAndHasNoEffect

 public void NullCanBeAddedAndHasNoEffect()
 {
     var target = new Joint();
     target.Add(null);
     Assert.IsFalse(target.Has<object>());
     Assert.IsNull(target.Get<object>());
     Assert.Throws<InvalidOperationException>(() => target.The<object>());
 }
开发者ID:bkushnir,项目名称:IronTextLibrary,代码行数:8,代码来源:JointTest.cs

示例10: vectorFromJoint

 public static Vector3D vectorFromJoint(Joint j)
 {
     Vector3D v = new Vector3D();
     v.X = j.Position.X;
     v.Y = j.Position.Y;
     v.Z = j.Position.Z;
     return v;
 }
开发者ID:omanamos,项目名称:kinect-nao,代码行数:8,代码来源:Util.cs

示例11: OnCollisionEnter

 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name == "BrickNew (5)")
     {
         theJoint = gameObject.AddComponent<FixedJoint>();
         theJoint.connectedBody = col.rigidbody;
     }
 }
开发者ID:aslanyesim,项目名称:CSCW,代码行数:8,代码来源:TouchBrick.cs

示例12: Awake

	public new void Awake() {
		base.Awake();

		_path = transform.Find("Path").GetComponent<BoxCollider>();
		_cursor = transform.Find("Path/Cursor").GetComponent<Joint>();

		_slothSnapper = GameObject.FindGameObjectWithTag("SlothNinja").GetComponent<Snapper>();
	}
开发者ID:ferdbold,项目名称:littleawfuljam2016,代码行数:8,代码来源:Rope.cs

示例13: OnCollisionEnter

 // OnCollisionEnter is called when this
 // collider/rigidbody has begun touching
 // another rigidbody/collider.
 void OnCollisionEnter(Collision collision)
 {
     Linkable linkee = collision.gameObject.GetComponent<Linkable>();
     if (linkee != null) {
         joint = this.gameObject.AddComponent<FixedJoint>();
         joint.connectedBody = linkee.gameObject.rigidbody;
     }
 }
开发者ID:rusticgames,项目名称:rts,代码行数:11,代码来源:LinkingCollider.cs

示例14: NetworkLink

    public static List<GameObject> NetworkLink(Vector3 currentPosition, Vector3 finalPosition, Joint hook, Rigidbody anchor, bool gravity)
    {
        List<GameObject> links = new List<GameObject>();

        GameObject link = ResourceFactory.GetInstance().GetPrefab(Registry.Prefab.ChainLink);
        float linkHeight = link.GetComponent<Renderer>().bounds.max.y * 2;

        // Get any vector perpindicular to the direction towards the bird in order to get the Quaternion
        Vector3 direction = finalPosition - currentPosition;
        Vector3 forward = Vector3.RotateTowards(direction, -direction, Mathf.PI/2f, 0);
        Quaternion linkRotation = Quaternion.LookRotation(forward, direction);

        GameObject currentLink = null;
        ConfigurableJoint prevBody = null;
        while(Vector3.Distance(currentPosition, finalPosition) > linkHeight)
        {
            if(uLink.Network.isServer)
            {
                currentLink = uLink.Network.Instantiate(uLink.Network.player, Registry.Prefab.ProxyChainLink, Registry.Prefab.ServerChainLink,
                                                        Registry.Prefab.ServerChainLink, currentPosition, linkRotation, 0);
            }
            else
            {
                currentLink = uLink.Network.Instantiate(uLink.Network.player, Registry.Prefab.ProxyChainLink, Registry.Prefab.ServerChainLink,
                                                        Registry.Prefab.ProxyChainLink, currentPosition, linkRotation, 0);
            }
            currentLink.transform.parent = hook.transform;

            currentPosition += currentLink.transform.up * linkHeight;

            links.Add(currentLink);

            Rigidbody currentBody = currentLink.GetComponent<Rigidbody>();
            currentBody.useGravity = gravity;
            if(hook.connectedBody == null)
            {
                hook.connectedBody = currentBody;
            }
            else
            {
                ConnectJoint(prevBody, currentBody);
            }
            prevBody = currentLink.GetComponent<ConfigurableJoint>();
        }

        if(anchor != null)
        {
            ConnectJoint(currentLink.GetComponent<ConfigurableJoint>(), anchor);
        }
        else
        {
            currentLink.GetComponent<ConfigurableJoint>().connectedAnchor = finalPosition;
        }
        currentLink.GetComponent<ConfigurableJoint>().autoConfigureConnectedAnchor = true;

        return links;
    }
开发者ID:davidsiekut,项目名称:BirdSimulator2015,代码行数:57,代码来源:ChainLinker.cs

示例15: Plane

 /*
      Constructor: Plane
      Initializes x,y,z.
 */
 public Plane(Joint a, Joint b, Joint c)
 {
     Direction d1 = new Direction(a, b);
     Direction d2 = new Direction(a, c);
     Direction per = Mathematics.crossProduct(d1, d2);
     x = per.x;
     y = per.y;
     z = per.z;
 }
开发者ID:aayushssinghal,项目名称:Kinect_Controlled_Robotic_Arm_group10_cs308_2012,代码行数:13,代码来源:Plane.cs


注:本文中的Joint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。