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


C# Vec2.set_Renamed方法代码示例

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


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

示例1: getReactionForce

 public override void getReactionForce(float inv_dt, Vec2 argOut)
 {
     Vec2 temp = pool.popVec2();
     temp.set_Renamed(m_axis).mulLocal(m_motorImpulse + m_impulse.z);
     argOut.set_Renamed(m_perp).mulLocal(m_impulse.x).addLocal(temp).mulLocal(inv_dt);
     pool.pushVec2(1);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:7,代码来源:PrismaticJoint.cs

示例2: getLinearVelocityFromWorldPointToOut

 public void getLinearVelocityFromWorldPointToOut(Vec2 worldPoint, Vec2 out_Renamed)
 {
     out_Renamed.set_Renamed(worldPoint).subLocal(m_sweep.c);
     Vec2.crossToOut(m_angularVelocity, out_Renamed, out_Renamed);
     out_Renamed.addLocal(m_linearVelocity);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:6,代码来源:Body.cs

示例3: getReactionForce

 public override void getReactionForce(float inv_dt, Vec2 argOut)
 {
     argOut.set_Renamed(m_uB).mulLocal(m_impulse).mulLocal(inv_dt);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:4,代码来源:PulleyJoint.cs

示例4: getXAxis

 public virtual void getXAxis(Vec2 xAxis)
 {
     xAxis.set_Renamed(c, s);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:4,代码来源:Rot.cs

示例5: getYAxis

 public virtual void getYAxis(Vec2 yAxis)
 {
     yAxis.set_Renamed(-s, c);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:4,代码来源:Rot.cs

示例6: getWitnessPoints

            public virtual void getWitnessPoints(Vec2 pA, Vec2 pB)
            {
                switch (m_count)
                {

                    case 0:
                        Debug.Assert(false);
                        break;

                    case 1:
                        pA.set_Renamed(m_v1.wA);
                        pB.set_Renamed(m_v1.wB);
                        break;

                    case 2:
                        case2.set_Renamed(m_v1.wA).mulLocal(m_v1.a);
                        pA.set_Renamed(m_v2.wA).mulLocal(m_v2.a).addLocal(case2);
                        // m_v1.a * m_v1.wA + m_v2.a * m_v2.wA;
                        // *pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB;
                        case2.set_Renamed(m_v1.wB).mulLocal(m_v1.a);
                        pB.set_Renamed(m_v2.wB).mulLocal(m_v2.a).addLocal(case2);

                        break;

                    case 3:
                        pA.set_Renamed(m_v1.wA).mulLocal(m_v1.a);
                        case3.set_Renamed(m_v2.wA).mulLocal(m_v2.a);
                        case33.set_Renamed(m_v3.wA).mulLocal(m_v3.a);
                        pA.addLocal(case3).addLocal(case33);
                        pB.set_Renamed(pA);
                        // *pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA;
                        // *pB = *pA;
                        break;

                    default:
                        Debug.Assert(false);
                        break;

                }
            }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:40,代码来源:Distance.cs

示例7: getAnchorA

 public override void getAnchorA(Vec2 argOut)
 {
     argOut.set_Renamed(m_targetA);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:4,代码来源:MouseJoint.cs

示例8: getSearchDirection

            public void getSearchDirection(Vec2 out_Renamed)
            {
                switch (m_count)
                {

                    case 1:
                        out_Renamed.set_Renamed(m_v1.w).negateLocal();
                        return;

                    case 2:
                        e12.set_Renamed(m_v2.w).subLocal(m_v1.w);
                        // use out for a temp variable real quick
                        out_Renamed.set_Renamed(m_v1.w).negateLocal();
                        float sgn = Vec2.cross(e12, out_Renamed);

                        if (sgn > 0f)
                        {
                            // Origin is left of e12.
                            Vec2.crossToOutUnsafe(1f, e12, out_Renamed);
                            return;
                        }
                        else
                        {
                            // Origin is right of e12.
                            Vec2.crossToOutUnsafe(e12, 1f, out_Renamed);
                            return;
                        }
                        goto default;

                    default:
                        Debug.Assert(false);
                        out_Renamed.setZero();
                        return;

                }
            }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:36,代码来源:Distance.cs

示例9: getClosestPoint

            /// <summary> this returns pooled objects. don't keep or modify them
            /// 
            /// </summary>
            /// <returns>
            /// </returns>
            public virtual void getClosestPoint(Vec2 out_Renamed)
            {
                switch (m_count)
                {

                    case 0:
                        Debug.Assert(false);
                        out_Renamed.setZero();
                        return;

                    case 1:
                        out_Renamed.set_Renamed(m_v1.w);
                        return;

                    case 2:
                        case22.set_Renamed(m_v2.w).mulLocal(m_v2.a);
                        case2.set_Renamed(m_v1.w).mulLocal(m_v1.a).addLocal(case22);
                        out_Renamed.set_Renamed(case2);
                        return;

                    case 3:
                        out_Renamed.setZero();
                        return;

                    default:
                        Debug.Assert(false);
                        out_Renamed.setZero();
                        return;

                }
            }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:36,代码来源:Distance.cs

示例10: computeCentroidToOut

        public void computeCentroidToOut(Vec2[] vs, int count, Vec2 out_Renamed)
        {
            Debug.Assert(count >= 3);

            out_Renamed.set_Renamed(0.0f, 0.0f);
            float area = 0.0f;

            // pRef is the reference point for forming triangles.
            // It's location doesn't change the result (except for rounding error).
            Vec2 pRef = pool1;
            pRef.setZero();

            Vec2 e1 = pool2;
            Vec2 e2 = pool3;

            float inv3 = 1.0f / 3.0f;

            for (int i = 0; i < count; ++i)
            {
                // Triangle vertices.
                Vec2 p1 = pRef;
                Vec2 p2 = vs[i];
                Vec2 p3 = i + 1 < count ? vs[i + 1] : vs[0];

                e1.set_Renamed(p2).subLocal(p1);
                e2.set_Renamed(p3).subLocal(p1);

                float D = Vec2.cross(e1, e2);

                float triangleArea = 0.5f * D;
                area += triangleArea;

                // Area weighted centroid
                e1.set_Renamed(p1).addLocal(p2).addLocal(p3).mulLocal(triangleArea * inv3);
                out_Renamed.addLocal(e1);
            }

            // Centroid
            Debug.Assert(area > Settings.EPSILON);
            out_Renamed.mulLocal(1.0f / area);
        }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:41,代码来源:PolygonShape.cs

示例11: getWorldToScreenToOut

 /// <summary>
 /// Takes the world coordinates and puts the corresponding screen
 /// coordinates in argScreen.
 /// </summary>
 /// <param name="worldX"></param>
 /// <param name="worldY"></param>
 /// <param name="argScreen"></param>
 public virtual void getWorldToScreenToOut(float worldX, float worldY, Vec2 argScreen)
 {
     argScreen.set_Renamed(worldX, worldY);
     viewportTransform.getWorldToScreen(argScreen, argScreen);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:12,代码来源:DebugDraw.cs

示例12: getScreenToWorldToOut

 /// <summary>
 /// takes the screen coordinates and puts the corresponding 
 /// world coordinates in argWorld.
 /// </summary>
 /// <param name="screenX"></param>
 /// <param name="screenY"></param>
 /// <param name="argWorld"></param>
 public virtual void getScreenToWorldToOut(float screenX, float screenY, Vec2 argWorld)
 {
     argWorld.set_Renamed(screenX, screenY);
     viewportTransform.getScreenToWorld(argWorld, argWorld);
 }
开发者ID:thdtjsdn,项目名称:box2dnet,代码行数:12,代码来源:DebugDraw.cs


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