当前位置: 首页>>代码示例>>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;未经允许,请勿转载。