當前位置: 首頁>>代碼示例>>C#>>正文


C# Body類代碼示例

本文整理匯總了C#中Body的典型用法代碼示例。如果您正苦於以下問題:C# Body類的具體用法?C# Body怎麽用?C# Body使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Body類屬於命名空間,在下文中一共展示了Body類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AngleJoint

 /// <summary>
 /// Constructor for AngleJoint
 /// </summary>
 /// <param name="bodyA">The first body</param>
 /// <param name="bodyB">The second body</param>
 public AngleJoint(Body bodyA, Body bodyB)
     : base(bodyA, bodyB)
 {
     JointType = JointType.Angle;
     BiasFactor = .2f;
     MaxImpulse = float.MaxValue;
 }
開發者ID:ImmortalJINX,項目名稱:Project-EGOR,代碼行數:12,代碼來源:AngleJoint.cs

示例2: BuildJointMessage

 public OscMessage BuildJointMessage(Body body, KeyValuePair<JointType, Joint> joint)
 {
     var address = String.Format("/bodies/{0}/joints/{1}", body.TrackingId, joint.Key);
     var position = joint.Value.Position;
     //System.Diagnostics.Debug.WriteLine(address);
     return new OscMessage(address, position.X, position.Y, position.Z, joint.Value.TrackingState.ToString());
 }
開發者ID:greenbaum,項目名稱:KinectV2-OSC,代碼行數:7,代碼來源:MessageBuilder.cs

示例3: Tower

 public Tower(int pozList, int x, int y, Body body, int firer, int firem, int fired, string firet, string targt, int rech, int tbi, int tti, int rr, string re, string he)
 {
     Group = -1;
     Slots = 0;
     TurretAngle = 0;
     X = x;
     Y = y;
     PozList = pozList;
     TextureBaseIndex = tbi;
     TextureTurretIndex = tti;
     HitPoints = body.HitPoints;
     Energy = body.Energy;
     Angle = body.Angle;
     Radius = body.Radius;
     Shield = body.Shield;
     Mass = body.Mass;
     RodRadius = rr;
     RodEffect = re;
     HitEffect = he;
     TargetType = targt;
     TargetMineralInd = -1;
     FireType = firet;
     FireDemage = fired;
     Recharge = rech;
     Recharged = 0;
     FireMass = firem;
     FireRang = firer;
     Powered = false;
 }
開發者ID:GazarovVlad,項目名稱:TheGame,代碼行數:29,代碼來源:Tower.cs

示例4: Format

        public void Format(Body body, Pickles.Parser.Table table)
        {
            WordTable wordTable = new WordTable();
            wordTable.Append(GenerateTableProperties());
            var headerRow = new DocumentFormat.OpenXml.Wordprocessing.TableRow();
            foreach (var cell in table.HeaderRow)
            {
                var wordCell = new DocumentFormat.OpenXml.Wordprocessing.TableCell();
                wordCell.Append(new Paragraph(new Run(new Text(cell))));
                headerRow.Append(wordCell);
            }
            wordTable.Append(headerRow);

            foreach (var row in table.DataRows)
            {
                var wordRow = new DocumentFormat.OpenXml.Wordprocessing.TableRow();

                foreach (var cell in row)
                {
                    var wordCell = new DocumentFormat.OpenXml.Wordprocessing.TableCell();
                    wordCell.Append(new Paragraph(new Run(new Text(cell))));
                    wordRow.Append(wordCell);
                }

                wordTable.Append(wordRow);
            }

            body.Append(wordTable);
        }
開發者ID:hugohaggmark,項目名稱:pickles,代碼行數:29,代碼來源:WordTableFormatter.cs

示例5: FixedAngleSpring

 public FixedAngleSpring(Body body, float springConstant, float dampingConstant)
 {
     _body = body;
     SpringConstant = springConstant;
     DampingConstant = dampingConstant;
     _targetAngle = body.TotalRotation;
 }
開發者ID:elefantstudio-se,項目名稱:todesesser,代碼行數:7,代碼來源:FixedAngleSpring.cs

示例6: Format

 public void Format(Body body, string description)
 {
     foreach (var paragraph in description.Split(new string[] {"\n", "\r"}, StringSplitOptions.RemoveEmptyEntries))
     {
         body.GenerateParagraph(paragraph, "Normal");
     }
 }
開發者ID:eduaquiles,項目名稱:pickles,代碼行數:7,代碼來源:WordDescriptionFormatter.cs

示例7: Format

        public void Format(Body body, ScenarioOutline scenarioOutline)
        {
            if (this.configuration.HasTestResults)
            {
                TestResult testResult = this.testResults.GetScenarioOutlineResult(scenarioOutline);
                if (testResult == TestResult.Passed)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult == TestResult.Failed)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(scenarioOutline.Name, "Heading2");
            if (!string.IsNullOrEmpty(scenarioOutline.Description))
            {
                body.GenerateParagraph(scenarioOutline.Description, "Normal");
            }

            foreach (Step step in scenarioOutline.Steps)
            {
                this.wordStepFormatter.Format(body, step);
            }

            foreach (var example in scenarioOutline.Examples)
            {
                body.GenerateParagraph("Examples: " + example.Description, "Heading3");
                this.wordTableFormatter.Format(body, example.TableArgument);
            }
        }
開發者ID:picklesdoc,項目名稱:pickles,代碼行數:32,代碼來源:WordScenarioOutlineFormatter.cs

示例8: Update

        /// <summary>
        /// Updates the current gesture.
        /// </summary>
        /// <param name="body">The body.</param>
        /// <returns>A GesturePartResult based on whether the gesture part has been completed.</returns>
        public GesturePartResult Update(Body body)
        {
            // //left hand in front of left Shoulder
            if (body.Joints[JointType.HandLeft].Position.Z < body.Joints[JointType.ElbowLeft].Position.Z && body.Joints[JointType.HandRight].Position.Y < body.Joints[JointType.SpineBase].Position.Y)
            {
                // Debug.WriteLine("GesturePart 1 - left hand in front of left Shoulder - PASS");
                // /left hand below shoulder height but above hip height
                if (body.Joints[JointType.HandLeft].Position.Y < body.Joints[JointType.Head].Position.Y && body.Joints[JointType.HandLeft].Position.Y > body.Joints[JointType.SpineBase].Position.Y)
                {
                    // Debug.WriteLine("GesturePart 1 - left hand below shoulder height but above hip height - PASS");
                    // //left hand left of left Shoulder
                    if (body.Joints[JointType.HandLeft].Position.X < body.Joints[JointType.ShoulderRight].Position.X && body.Joints[JointType.HandLeft].Position.X > body.Joints[JointType.ShoulderLeft].Position.X)
                    {
                        // Debug.WriteLine("GesturePart 1 - left hand left of left Shoulder - PASS");
                        return GesturePartResult.Succeeded;
                    }

                    // Debug.WriteLine("GesturePart 1 - left hand left of left Shoulder - UNDETERMINED");
                    return GesturePartResult.Undetermined;
                }

                // Debug.WriteLine("GesturePart 1 - left hand below shoulder height but above hip height - FAIL");
                return GesturePartResult.Failed;
            }

            // Debug.WriteLine("GesturePart 1 - left hand in front of left Shoulder - FAIL");
            return GesturePartResult.Failed;
        }
開發者ID:etrigger,項目名稱:Vitruvius,代碼行數:33,代碼來源:SwipeRightSegments.cs

示例9: DrawSkeleton

        public static void DrawSkeleton(this Canvas canvas, Body body, CoordinateMapper mapper)
        {
            if (body == null) return;

            foreach (Joint joint in body.Joints.Values)
            {
                canvas.DrawPoint(joint, mapper);
            }

            canvas.DrawLine(body.Joints[JointType.Head], body.Joints[JointType.Neck], mapper);
            canvas.DrawLine(body.Joints[JointType.Neck], body.Joints[JointType.SpineShoulder], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineShoulder], body.Joints[JointType.ShoulderLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineShoulder], body.Joints[JointType.ShoulderRight], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineShoulder], body.Joints[JointType.SpineMid], mapper);
            canvas.DrawLine(body.Joints[JointType.ShoulderLeft], body.Joints[JointType.ElbowLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.ShoulderRight], body.Joints[JointType.ElbowRight], mapper);
            canvas.DrawLine(body.Joints[JointType.ElbowLeft], body.Joints[JointType.WristLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.ElbowRight], body.Joints[JointType.WristRight], mapper);
            canvas.DrawLine(body.Joints[JointType.WristLeft], body.Joints[JointType.HandLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.WristRight], body.Joints[JointType.HandRight], mapper);
            canvas.DrawLine(body.Joints[JointType.HandLeft], body.Joints[JointType.HandTipLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.HandRight], body.Joints[JointType.HandTipRight], mapper);
            canvas.DrawLine(body.Joints[JointType.HandTipLeft], body.Joints[JointType.ThumbLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.HandTipRight], body.Joints[JointType.ThumbRight], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineMid], body.Joints[JointType.SpineBase], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineBase], body.Joints[JointType.HipLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.SpineBase], body.Joints[JointType.HipRight], mapper);
            canvas.DrawLine(body.Joints[JointType.HipLeft], body.Joints[JointType.KneeLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.HipRight], body.Joints[JointType.KneeRight], mapper);
            canvas.DrawLine(body.Joints[JointType.KneeLeft], body.Joints[JointType.AnkleLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.KneeRight], body.Joints[JointType.AnkleRight], mapper);
            canvas.DrawLine(body.Joints[JointType.AnkleLeft], body.Joints[JointType.FootLeft], mapper);
            canvas.DrawLine(body.Joints[JointType.AnkleRight], body.Joints[JointType.FootRight], mapper);
        }
開發者ID:gw-sd-2016,項目名稱:Presenting101,代碼行數:34,代碼來源:Extensions.cs

示例10: SetBody

 private void SetBody(Body body)
 {
     this.body = body;
     this.body.Tag = this;
     this.body.PositionChanged += OnPositionChanged;
     this.body.ShapeChanged += OnShapeChanged;
 }
開發者ID:bsvercl,項目名稱:physics2d,代碼行數:7,代碼來源:BodyGraphic.cs

示例11: CreateWalls

        private void CreateWalls()
        {
            var wallCoff = new Coefficients(0.8f, 0.95f);
            var wallLife = new Lifespan();

            var flrState = new PhysicsState(new ALVector2D((float)0.0, ((float)ActualWidth) * ((float)0.5), (float)ActualHeight + 100.0));
            var flrShape = new PolygonShape(VertexHelper.CreateRectangle(ActualWidth, 200), 2);
            var bdyFloor = new Body(flrState, flrShape, float.PositiveInfinity, wallCoff, wallLife);

            var ceiState = new PhysicsState(new ALVector2D((float)0.0, ((float)ActualWidth) * ((float)0.5), -100.0));
            var ceiShape = new PolygonShape(VertexHelper.CreateRectangle(ActualWidth, 200), 2);
            var bdyCeiling = new Body(ceiState, ceiShape, float.PositiveInfinity, wallCoff, wallLife);

            var lwlState = new PhysicsState(new ALVector2D((float)0.0, -100.0, ((float)ActualHeight) * ((float)0.5)));
            var lwlShape = new PolygonShape(VertexHelper.CreateRectangle(200, ActualHeight), 2);
            var bdyLeftWall = new Body(lwlState, lwlShape, float.PositiveInfinity, wallCoff, wallLife);

            var rwlState = new PhysicsState(new ALVector2D((float)0.0, (float)ActualWidth + 100.0, ((float)ActualHeight) * ((float)0.5)));
            var rwlShape = new PolygonShape(VertexHelper.CreateRectangle(200, ActualHeight), 2);
            var bdyRightWall = new Body(rwlState, rwlShape, float.PositiveInfinity, wallCoff, wallLife);

            engine.AddBody(bdyFloor);
            engine.AddBody(bdyCeiling);
            engine.AddBody(bdyLeftWall);
            engine.AddBody(bdyRightWall);
        }
開發者ID:zhuangfangwang,項目名稱:ise,代碼行數:26,代碼來源:TouchablePanel.cs

示例12: BodyGraphic

 public BodyGraphic(Body body)
     : base(GetIDrawable(body), body.Matrices.ToWorld, body.Lifetime)
 {
     SetBody(body);
     this.IsLifetimeOwner = false;
     this.isBodyOwner = true;
 }
開發者ID:bsvercl,項目名稱:physics2d,代碼行數:7,代碼來源:BodyGraphic.cs

示例13: Format

        public void Format(Body body, Scenario scenario)
        {
            if (this.configuration.HasTestResults)
            {
                TestResult testResult = this.nunitResults.GetScenarioResult(scenario);
                if (testResult.WasExecuted && testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult.WasExecuted && !testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(scenario.Name, "Heading2");
            if (!string.IsNullOrEmpty(scenario.Description))
            {
                body.GenerateParagraph(scenario.Description, "Normal");
            }

            foreach (Step step in scenario.Steps)
            {
                this.wordStepFormatter.Format(body, step);
            }
        }
開發者ID:vavavivi,項目名稱:pickles,代碼行數:26,代碼來源:WordScenarioFormatter.cs

示例14: TrackBody

 public void TrackBody(Body body)
 {
     //Vector3 position = BodySourceView.GetVector3FromJoint( body.Joints[jointToTrack]);
     //handStateVisual = body.HandRightState;
     //SetHandPosition(position);
     uıComponent.UpdateComponent(body);
 }
開發者ID:ly774508966,項目名稱:Kinect-Inputmodule,代碼行數:7,代碼來源:KinectUIInputModule.cs

示例15: Update

        /// <summary>
        /// Updates the current gesture.
        /// </summary>
        /// <param name="skeleton">The skeleton.</param>
        /// <returns>A GesturePartResult based on whether the gesture part has been completed.</returns>
        public GesturePartResult Update(Body skeleton)
        {
            JointType signalElbow;
            JointType signalShoulder;
            HandState handState;
            if (MouseMoveData.signalHand == JointType.HandRight)
            {
                signalElbow = JointType.ElbowRight;
                signalShoulder = JointType.ShoulderRight;
                handState = skeleton.HandRightState;
            }
            else
            {
                signalElbow = JointType.ElbowLeft;
                signalShoulder = JointType.ShoulderLeft;
                handState = skeleton.HandLeftState;
            }

            // Hand above elbow
            if (skeleton.Joints[MouseMoveData.signalHand].Position.Y > skeleton.Joints[signalElbow].Position.Y && handState == HandState.Lasso)
            {
                PokeGestureData.farDistance = Math.Sqrt(Math.Pow(skeleton.Joints[MouseMoveData.signalHand].Position.X - skeleton.Joints[signalShoulder].Position.X, 2) +
                                       Math.Pow(skeleton.Joints[MouseMoveData.signalHand].Position.Y - skeleton.Joints[signalShoulder].Position.Y, 2) +
                                       Math.Pow(skeleton.Joints[MouseMoveData.signalHand].Position.Z - skeleton.Joints[signalShoulder].Position.Z, 2));
                if (PokeGestureData.farDistance - PokeGestureData.startDistance > PokeGestureData.startDistance / 12)
                {
                    return GesturePartResult.Succeeded;
                }
            }

            // Hand dropped
            return GesturePartResult.Failed;
        }
開發者ID:TomWerner,項目名稱:HandsOnInterface,代碼行數:38,代碼來源:PokeGestures.cs


注:本文中的Body類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。