• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Joint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getDisplayPosition

        /**********************************la fonction du skeletons*************************************************************/

        private Point getDisplayPosition(Joint joint)
        {
            float depthX, depthY;
            _nui.SkeletonEngine.SkeletonToDepthImage(joint.Position, out depthX, out depthY);
            depthX = Math.Max(0, Math.Min(depthX * 320, 320));
            depthY = Math.Max(0, Math.Min(depthY * 240, 240));
            int colorX, colorY;
            ImageViewArea iv = new ImageViewArea();
            _nui.NuiCamera.GetColorPixelCoordinatesFromDepthPixel(ImageResolution.Resolution640x480, iv, (int)depthX, (int)depthY, (short)0, out colorX, out colorY);
            return new Point((int)(skeleton.Width * colorX / 640.0), (int)(skeleton.Height * colorY / 480));
        }
开发者ID:Psykoangel,项目名称:csharp_projects-repo,代码行数:13,代码来源:MainWindow.xaml.cs


示例17: SayGoodbye

 public void SayGoodbye(Joint joint)
 {
     if (test._mouseJoint == joint)
     {
         test._mouseJoint = null;
     }
     else
     {
         test.JointDestroyed(joint);
     }
 }
开发者ID:GretelF,项目名称:squircle,代码行数:11,代码来源:Test.cs


示例18: Grip

	/// <summary>
	/// Grip a rigidbody with a hand
	/// </summary>
	/// <param name="target">Target rigidbody</param>
	/// <param name="hand">Which hand to grip with, "left" or "right"</param>
	public void Grip(Joint target, string hand) {
		_ragdoller.ragdolled = true;
        IsGripped = true;


        if (hand == "left") {
			target.connectedBody = this._leftHand;
		} else {
			target.connectedBody = this._rightHand;
		}
	}
开发者ID:ferdbold,项目名称:littleawfuljam2016,代码行数:16,代码来源:Snapper.cs


示例19: compute

        private void compute(Joint shoulder, Joint elbow, Joint wrist)
        {
            Vector3D shoulderVec = Util.vectorFromJoint(shoulder);
            Vector3D elbowVec = Util.vectorFromJoint(elbow);
            Vector3D wristVec = Util.vectorFromJoint(wrist);

            Vector3D elbowToShoulder = shoulderVec - elbowVec;
            Vector3D elbowToWrist = wristVec - elbowVec;

            Yaw = Util.degToRad(Vector3D.AngleBetween(elbowToWrist, elbowToShoulder));
        }
开发者ID:omanamos,项目名称:kinect-nao,代码行数:11,代码来源:HumanElbow.cs


示例20: Flip

        public void Flip(Joint activeHand)
        {
            double scaleX = activeHand.JointType == JointType.HandRight ? 1.0 : -1.0;

            ScaleTransform transform = root.RenderTransform as ScaleTransform;

            if (transform.ScaleX != scaleX)
            {
                transform.ScaleX = scaleX;
            }
        }
开发者ID:etrigger,项目名称:Vitruvius,代码行数:11,代码来源:KinectCursor.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# JointType类代码示例发布时间:2022-05-24
下一篇:
C# JoinType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap