本文整理汇总了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;
}
示例2: cpShapeMassInfo
public cpShapeMassInfo(float m, float i, cpVect cog, float area)
{
this.m = m;
this.i = i;
this.cog = cog;
this.area = area;
}
示例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;
}
示例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
);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
);
}
示例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;
}
示例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;
}
示例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;
}
示例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];
}
示例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);
}
示例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);
}