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

C# ChipmunkSharp.cpVect类代码示例

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

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



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

示例1: cpPivotJoint

 public cpPivotJoint(cpBody a, cpBody b, cpVect anchorA, cpVect anchorB)
     : base(a, b)
 {
     this.anchorA = anchorA;
     this.anchorB = anchorB;
     this.jAcc = cpVect.Zero;
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:7,代码来源:cpPivotJoint.cs


示例2: cpShapeMassInfo

 public cpShapeMassInfo(float m, float i, cpVect cog, float area)
 {
     this.m = m;
     this.i = i;
     this.cog = cog;
     this.area = area;
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:7,代码来源:cpShape.cs


示例3: PointQueryContext

 public PointQueryContext(cpVect point1, float maxDistance1, cpShapeFilter filter1, Action<cpShape, cpVect, float, cpVect, object> func1)
 {
     // TODO: Complete member initialization
     this.point = point1;
     this.maxDistance = maxDistance1;
     this.filter = filter1;
     this.func = func1;
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:8,代码来源:cpSpaceQuery.cs


示例4: BoneScale

 public static cpTransform BoneScale(cpVect v0, cpVect v1)
 {
     cpVect d = cpVect.cpvsub(v1, v0);
     return NewTranspose(
       d.x, -d.y, v0.x,
       d.y, d.x, v0.y
     );
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:8,代码来源:cpTransform.cs


示例5: CCRayCastCallbackInfo

		public CCRayCastCallbackInfo(CCPhysicsWorld world, Func<CCPhysicsWorld, CCPhysicsRayCastInfo, object, bool> func, cpVect p1, cpVect p2, object data)
		{
			this.world = world;
			this.func = func;
			this.p1 = p1;
			this.p2 = p2;
			this.data = data;

		}
开发者ID:netonjm,项目名称:CocosSharp,代码行数:9,代码来源:CCPhysicsWorld.cs


示例6: cpCircleShapeMassInfo

 public static cpShapeMassInfo cpCircleShapeMassInfo(float mass, float radius, cpVect center)
 {
     var info = new cpShapeMassInfo(
             mass, cp.MomentForCircle(1.0f, 0.0f, radius, cpVect.Zero),
     center,
     cp.AreaForCircle(0.0f, radius)
         );
     return info;
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:9,代码来源:cpShape.cs


示例7: cpPointQueryExtendedInfo

 public cpPointQueryExtendedInfo(cpShape tShape)
 {
     /// The nearest shape, NULL if no shape was within range.
     this.shape = tShape;
     /// The closest point on the shape's surface. (in world space coordinates)
     this.d = cp.Infinity;
     /// The distance to the point. The distance is negative if the point is inside the shape.
     this.n = cpVect.Zero;
 }
开发者ID:kfazi,项目名称:AgarIo,代码行数:9,代码来源:cpQueryInfo.cs


示例8: cpSlideJoint

        public cpSlideJoint(cpBody a, cpBody b, cpVect anchorA, cpVect anchorB, float min, float max)
            : base(a, b)
        {
            this.anchorA = anchorA;
            this.anchorB = anchorB;
            this.min = min;
            this.max = max;

            this.jnAcc = 0.0f;
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:10,代码来源:cpSlideJoint.cs


示例9: AxialScale

        public static cpTransform AxialScale(cpVect axis, cpVect pivot, float scale)
        {
            float A = axis.x * axis.y * (scale - 1.0f);
            float B = cpVect.cpvdot(axis, pivot) * (1.0f - scale);

            return NewTranspose(
              scale * axis.x * axis.x + axis.y * axis.y, A, axis.x * B,
              A, axis.x * axis.x + scale * axis.y * axis.y, axis.y * B
            );
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:10,代码来源:cpTransform.cs


示例10: cpSegmentQueryInfo

        public cpSegmentQueryInfo(cpShape shape, cpVect point, cpVect normal, float alpha)
        {
            /// The shape that was hit, NULL if no collision occured.
            this.shape = shape;
            /// The normalized distance along the query segment in the range [0, 1].
            this.alpha = alpha;
            /// The normal of the surface hit.
            this.normal = normal;

            this.point = point;
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:11,代码来源:cpQueryInfo.cs


示例11: cpPointQueryInfo

        public cpPointQueryInfo(cpShape shape, cpVect point, float distance, cpVect gradient)
        {
            /// The nearest shape, NULL if no shape was within range.
            this.shape = shape;
            /// The closest point on the shape's surface. (in world space coordinates)
            this.point = point;
            /// The distance to the point. The distance is negative if the point is inside the shape.
            this.distance = distance;

            this.gradient = gradient;
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:11,代码来源:cpSpace.cs


示例12: cpPolyShapeMassInfo

        public static cpShapeMassInfo cpPolyShapeMassInfo(float mass, int count, cpVect[] verts, float radius)
        {
            cpVect centroid = cp.CentroidForPoly(count, verts);

            var info = new cpShapeMassInfo(
                mass,
                cp.MomentForPoly(1.0f, count, verts, cpVect.cpvneg(centroid), radius),
                centroid,
                cp.AreaForCircle(0.0f, radius)
            );
            return info;
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:12,代码来源:cpShape.cs


示例13: b2dJsonImage

        public b2dJsonImage()
        {
            Body = null;
            Center = cpVect.Zero;

            Angle = 0; Scale = 1;
            Flip = false;

            Filter = _b2dJsonImagefilterType.FT_LINEAR;

            ColorTint = new int[4];
            m_corners = new cpVect[4];
        }
开发者ID:netonjm,项目名称:RubeLoader,代码行数:13,代码来源:Nb2dJsonImage.cs


示例14: ToShape

        public cpPolyShape ToShape(cpBody body, float radius, cpVect size, int shapeIdx = 0)
        {
            var source = Shapes[shapeIdx];
            var vertices = new cpVect[source.Length];

            for (int i = 0, count = source.Length; i < count; i++)
            {
                var sourceVect = source[i];
                var vect = cpVect.cpv(sourceVect.x * size.x, sourceVect.y * size.y);
                vertices[i] = vect;
            }

            return new cpPolyShape(body, vertices.Length, vertices, radius);
        }
开发者ID:nikita-sky,项目名称:SkidiKit,代码行数:14,代码来源:BodySettings.cs


示例15: cpPolyShape

        public cpPolyShape(cpBody body, int count, cpVect[] verts,
			cpTransform transform, float radius)
            : base(body, new cpShapeMassInfo())
        {
            cpVect[] hullVerts = new cpVect[count];

            // Transform the verts before building the hull in case of a negative scale.
            for (int i = 0; i < count; i++)
                hullVerts[i] = cpTransform.Point(transform, verts[i]);

            int hullCount = cp.ConvexHull(count, hullVerts, ref hullVerts, null, 0.0f);

            InitRaw(hullCount, hullVerts, radius);
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:14,代码来源:cpPolyShape.cs


示例16: CCPointsTocpVects

        internal static cpVect[] CCPointsTocpVects (CCPoint[] points)
        {
            var len = points.Length;
            cpVect[] pointscp = new cpVect[len];
            var wrkPoint = CCPoint.Zero;

            for (int i = 0; i< len; i++)
            {
                wrkPoint = points[i];
                pointscp[i] = new cpVect(wrkPoint.X, wrkPoint.Y);

            }
            return pointscp;
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:14,代码来源:PhysicsHelper.cs


示例17: cpVertArray2ccpArrayN

		static CCPoint[] cpVertArray2ccpArrayN(cpVect[] cpVertArray, int count)
		{
			if (count == 0)
				return null;

			CCPoint[] pPoints = new CCPoint[count];

			for (int i = 0; i < count; ++i)
			{
				pPoints[i].X = cpVertArray[i].x;
				pPoints[i].Y = cpVertArray[i].y;
			}
			return pPoints;
		}
开发者ID:h7ing,项目名称:CocosSharp,代码行数:14,代码来源:CCPhysicsDebugNode+.cs


示例18: cpVectsTpCCPoints

        internal static CCPoint[] cpVectsTpCCPoints (cpVect[] points)
        {
            var len = points.Length;
            var pointscp = new CCPoint[len];
            var wrkPoint = cpVect.Zero;

            for (int i = 0; i< len; i++)
            {
                wrkPoint = points[i];
                pointscp[i] = new CCPoint(wrkPoint.x, wrkPoint.y);

            }
            return pointscp;
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:14,代码来源:PhysicsHelper.cs


示例19: cpGrooveJoint

        public cpGrooveJoint(cpBody a, cpBody b, cpVect groove_a, cpVect groove_b, cpVect anchorB)
            : base(a, b)
        {
            this.grv_a = groove_a;
            this.grv_b = groove_b;
            this.grv_n = cpVect.cpvperp(cpVect.cpvnormalize(cpVect.cpvsub(groove_b, groove_a)));
            this.anchorB = anchorB;

            this.grv_tn = null;
            this.clamp = 0.0f;
            this.r1 = this.r2 = null;

            this.jAcc = cpVect.Zero;
            this.bias = null;
        }
开发者ID:kfazi,项目名称:AgarIo,代码行数:15,代码来源:cpGrooveJoint.cs


示例20: CCPhysicsRayCastInfo

		public CCPhysicsRayCastInfo(CCPhysicsShape shape,
								  cpVect start,
								  cpVect end,
								  cpVect contact,
								  cpVect normal,
								  float fraction,
								  object data)
		{
			this.shape = shape;
			this.start = start;
			this.end = end;          //< in lua, it's name is "ended"
			this.contact = contact;
			this.normal = normal;
			this.fraction = fraction;
			this.data = data;
		}
开发者ID:netonjm,项目名称:CocosSharp,代码行数:16,代码来源:CCPhysicsWorld.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Mercurial.FileInRevision类代码示例发布时间:2022-05-24
下一篇:
C# Chess.Piece类代码示例发布时间: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