public IntPtr AcquireDebugDrawOptions(IDebugDraw debugDraw, DebugDrawFlags flags, DebugDrawColors colors) { this.flags = (int)flags; collisionPointColor = colors.CollisionPoint; constraintColor = colors.Constraint; shapeOutlineColor = colors.ShapeOutline; drawCircle = spaceDebugDrawCircleCallback.ToFunctionPointer(); drawSegment = spaceDebugDrawSegmentCallback.ToFunctionPointer(); drawFatSegment = spaceDebugDrawFatSegmentCallback.ToFunctionPointer(); drawPolygon = spaceDebugDrawPolygonCallback.ToFunctionPointer(); drawDot = spaceDebugDrawDotCallback.ToFunctionPointer(); colorForShape = spaceDebugDrawColorForShapeCallback.ToFunctionPointer(); data = NativeInterop.RegisterHandle(debugDraw); return(ToPointer()); }
private static void SpaceDebugDrawCircleCallback(Vect pos, double angle, double radius, DebugColor outlineColor, DebugColor fillColor, voidptr_t data) { IDebugDraw debugDraw = NativeInterop.FromIntPtr <IDebugDraw>(data); debugDraw.DrawCircle(pos, angle, radius, outlineColor, fillColor); }
private static void SpaceDebugDrawDotCallback(double size, Vect pos, DebugColor color, voidptr_t data) { IDebugDraw debugDraw = NativeInterop.FromIntPtr <IDebugDraw>(data); debugDraw.DrawDot(size, pos, color); }
private static void SpaceDebugDrawPolygonCallback(int count, cpVertPointer verts, double radius, DebugColor outlineColor, DebugColor fillColor, voidptr_t data) { IDebugDraw debugDraw = NativeInterop.FromIntPtr <IDebugDraw>(data); Vect[] vectors = NativeInterop.PtrToStructureArray <Vect>(verts, count); debugDraw.DrawPolygon(vectors, radius, outlineColor, fillColor); }
private static void SpaceDebugDrawFatSegmentCallback(Vect a, Vect b, double radius, DebugColor outlineColor, DebugColor fillColor, voidptr_t data) { IDebugDraw debugDraw = NativeInterop.FromIntPtr <IDebugDraw>(data); debugDraw.DrawFatSegment(a, b, radius, outlineColor, fillColor); }
private static void SpaceDebugDrawSegmentCallback(Vect a, Vect b, DebugColor color, voidptr_t data) { IDebugDraw debugDraw = NativeInterop.FromIntPtr <IDebugDraw>(data); debugDraw.DrawSegment(a, b, color); }