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


C# ChipmunkSharp.cpVect类代码示例

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


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


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