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


C# Body.AddConstraint方法代码示例

本文整理汇总了C#中JigLibX.Physics.Body.AddConstraint方法的典型用法代码示例。如果您正苦于以下问题:C# Body.AddConstraint方法的具体用法?C# Body.AddConstraint怎么用?C# Body.AddConstraint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JigLibX.Physics.Body的用法示例。


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

示例1: Initialise

        public void Initialise(Body body0, Vector3 body0Pos, Body body1, Vector3 body1Pos, float allowedDistance, float timescale)
        {
            this.body0Pos = body0Pos;
            this.body1Pos = body1Pos;
            this.body0 = body0;
            this.body1 = body1;

            this.allowedDistance = allowedDistance;
            this.timescale = timescale;

            if (timescale < JiggleMath.Epsilon)
                timescale = JiggleMath.Epsilon;

            if (body0 != null) body0.AddConstraint(this);
            if (body1 != null) body1.AddConstraint(this);
        }
开发者ID:kaoabi,项目名称:GP3_CourseworkGame,代码行数:16,代码来源:ConstraintPoint.cs

示例2: Initialise

        public void Initialise(Body body, ReferenceFrame frame, Vector3? vel, Vector3? angVel)
        {
            this.body = body;
            this.frame = frame;

            this.doVel = (vel != null);
            this.doAngVel = (angVel != null);

            if (doVel) targetVel = (Vector3)vel;
            if (doAngVel) targetAngVel = (Vector3)angVel;

            if (body != null)
            {
                vel = body.Velocity;
                angVel = body.AngularVelocity;
            }
            else
            {
                vel = Vector3.Zero;
                angVel = Vector3.Zero;
            }

            velRate = Vector3.Zero;
            angVelRate = Vector3.Zero;

            if (body != null)
                body.AddConstraint(this);
        }
开发者ID:bradleat,项目名称:trafps,代码行数:28,代码来源:ConstraintVelocity.cs

示例3: Initialise

        public void Initialise(Body body, Vector3 pointOnBody, Vector3 worldPosition)
        {
            this.body = body;
            this.pointOnBody = pointOnBody;
            this.worldPosition = worldPosition;

            if (body!=null) body.AddConstraint(this);
        }
开发者ID:kaoabi,项目名称:GP3_CourseworkGame,代码行数:8,代码来源:ConstraintWorldPoint.cs


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