Class ToxiclibsSupport

java.lang.Object
toxi.processing.ToxiclibsSupport

public class ToxiclibsSupport extends Object
In addition to providing new drawing commands, this class provides wrappers for using datatypes of the toxiclibs core package directly with Processing's drawing commands. The class can be configured to work with any PGraphics instance (incl. offscreen buffers) using a constructor argument or the setGraphics(PGraphics) method.
  • Constructor Details

    • ToxiclibsSupport

      public ToxiclibsSupport(processing.core.PApplet app)
    • ToxiclibsSupport

      public ToxiclibsSupport(processing.core.PApplet app, processing.core.PGraphics gfx)
  • Method Details

    • box

      public final void box(AABB box)
    • box

      public final void box(AABB box, boolean smooth)
    • chooseStrokeFill

      public final void chooseStrokeFill(boolean isWireframe, ReadonlyTColor stroke, ReadonlyTColor fill)
    • circle

      public final void circle(Vec2D p, float radius)
    • cone

      public final void cone(Cone cone)
    • cone

      public final void cone(Cone cone, boolean topClosed, boolean bottomClosed)
    • cone

      public final void cone(Cone cone, int res, boolean smooth)
    • cone

      public final void cone(Cone cone, int res, boolean topClosed, boolean bottomClosed, boolean smooth)
    • cylinder

      public final void cylinder(AxisAlignedCylinder cylinder)
    • cylinder

      public final void cylinder(AxisAlignedCylinder cylinder, int res, boolean smooth)
    • ellipse

      public final void ellipse(Ellipse e)
    • fill

      public final void fill(ReadonlyTColor col)
    • getGraphics

      public final processing.core.PGraphics getGraphics()
      Returns:
      the gfx
    • line

      public final void line(Line2D line)
    • line

      public final void line(Line2D l, Line2DRenderModifier modifier)
    • line

      public final void line(Line3D line)
    • line

      public final void line(ReadonlyVec2D a, ReadonlyVec2D b)
    • line

      public final void line(ReadonlyVec2D a, ReadonlyVec2D b, Line2DRenderModifier modifier)
    • line

      public final void line(ReadonlyVec3D a, ReadonlyVec3D b)
    • line

      public final void line(ReadonlyVec4D a, ReadonlyVec4D b)
    • line

      public final void line(Vec2D a, Vec2D b)
    • line

      public final void line(Vec3D a, Vec3D b)
    • line

      public final void line(Vec4D a, Vec4D b)
    • lines2D

      public final void lines2D(List<? extends Line2D> lines)
    • lines3D

      public final void lines3D(List<? extends Line3D> lines)
    • lineStrip2D

      public final void lineStrip2D(LineStrip2D strip)
    • lineStrip2D

      public final void lineStrip2D(List<? extends Vec2D> points)
      Draws a 2D line strip using all points in the given list of vectors.
      Parameters:
      points - point list
    • lineStrip2D

      public final void lineStrip2D(List<? extends Vec2D> points, float scale)
    • lineStrip3D

      public final void lineStrip3D(LineStrip3D strip)
    • lineStrip3D

      public final void lineStrip3D(List<? extends Vec3D> points)
      Draws a 3D line strip using all points in the given list of vectors.
      Parameters:
      points - point list
    • lineStrip3D

      public final void lineStrip3D(List<? extends Vec3D> points, float scale)
    • lineStrip4D

      public final void lineStrip4D(List<? extends Vec4D> points)
      Draws a 3D line strip using all points in the given list of 4D vectors. The w component of the vectors is ignored.
      Parameters:
      points - point list
    • lineStrip4D

      public final void lineStrip4D(List<? extends Vec4D> points, float scale)
    • mesh

      public final void mesh(Mesh3D mesh)
      Draws a mesh instance using flat shading.
      Parameters:
      mesh -
    • mesh

      public final void mesh(Mesh3D mesh, boolean smooth)
      Draws a mesh instance.
      Parameters:
      mesh -
      smooth - true to enable gouroud shading (uses vertex normals, which should have been computed beforehand) or false for flat shading
    • mesh

      public final void mesh(Mesh3D mesh, boolean smooth, float normalLength)
      Draws a mesh instance.
      Parameters:
      mesh -
      smooth - true to enable gouroud shading (uses vertex normals, which should have been computed beforehand) or false for flat shading
      normalLength - if >0 then face (or vertex) normals are rendered at this length
    • meshNormalMapped

      public final void meshNormalMapped(Mesh3D mesh, boolean vertexNormals)
      Draws the given mesh with each face or vertex tinted using its related normal vector as RGB color. Normals can also optionally be shown as lines.
      Parameters:
      mesh -
      vertexNormals - true, if using vertex normals (else face normals only)
    • meshNormalMapped

      public final void meshNormalMapped(Mesh3D mesh, NormalMapper mapper, boolean vertexNormals)
    • origin

      public void origin(float len)
    • origin

      public final void origin(ReadonlyVec3D o, float len)
      Draws the major axes from the given point.
      Parameters:
      o - origin point
      len - axis length
    • plane

      public final void plane(Plane plane, float size)
      Draws a square section of a plane at the given size.
      Parameters:
      plane - plane to draw
      size - edge length
    • point

      public final void point(ReadonlyVec2D v)
    • point

      public final void point(ReadonlyVec3D v)
    • point

      public final void point(ReadonlyVec4D v)
    • point

      public final void point(Vec2D v)
      Draws a 2D point at the given position.
      Parameters:
      v -
    • point

      public final void point(Vec3D v)
      Draws a 3D point at the given position.
      Parameters:
      v -
    • point

      public final void point(Vec4D v)
    • points2D

      public final void points2D(Iterator<? extends Vec2D> iterator)
    • points2D

      public final void points2D(List<? extends Vec2D> points)
    • points2D

      public final void points2D(List<? extends Vec2D> points, float scale)
    • points3D

      public final void points3D(Iterator<? extends Vec3D> iterator)
    • points3D

      public final void points3D(List<? extends Vec3D> points)
    • points3D

      public final void points3D(List<? extends Vec3D> points, float scale)
    • points4D

      public final void points4D(Iterator<? extends Vec4D> iterator)
    • points4D

      public final void points4D(List<? extends Vec4D> points)
    • points4D

      public final void points4D(List<? extends Vec4D> points, float scale)
    • polygon2D

      public final void polygon2D(Polygon2D poly)
    • processVertices2D

      public final void processVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed)
    • processVertices2D

      public final void processVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed, float scale)
    • processVertices3D

      public final void processVertices3D(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed)
    • processVertices3D

      public final void processVertices3D(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed, float scale)
    • processVertices4D

      public final void processVertices4D(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed)
    • processVertices4D

      public final void processVertices4D(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed, float scale)
    • ray

      public final void ray(Ray2D ray, float length)
    • ray

      public final void ray(Ray3D ray, float length)
    • rect

      public final void rect(Rect r)
    • rotate

      public final void rotate(float theta, ReadonlyVec3D v)
    • scale

      public final void scale(ReadonlyVec2D v)
    • scale

      public final void scale(ReadonlyVec3D v)
    • scale

      public final void scale(Vec2D v)
    • scale

      public final void scale(Vec3D v)
    • setGraphics

      public final void setGraphics(processing.core.PGraphics gfx)
      Parameters:
      gfx - the gfx to set
    • setStrokeFill

      public final void setStrokeFill(boolean isWireframe, float r, float g, float b)
    • setStrokeFill

      public final void setStrokeFill(boolean isWireframe, ReadonlyTColor col)
    • sphere

      public final void sphere(Sphere sphere, int res)
    • sphere

      public final void sphere(Sphere sphere, int res, boolean smooth)
    • stroke

      public final void stroke(ReadonlyTColor col)
    • texturedMesh

      public final void texturedMesh(Mesh3D mesh, processing.core.PImage tex, boolean smooth)
    • translate

      public final void translate(ReadonlyVec2D v)
    • translate

      public final void translate(ReadonlyVec3D v)
    • translate

      public final void translate(Vec2D v)
    • translate

      public final void translate(Vec3D v)
    • triangle

      public final void triangle(Triangle2D tri)
    • triangle

      public final void triangle(Triangle2D tri, boolean isFullShape)
    • triangle

      public final void triangle(Triangle3D tri)
    • triangle

      public final void triangle(Triangle3D tri, boolean isFullShape)
    • vertex

      public final void vertex(ReadonlyVec2D v)
    • vertex

      public final void vertex(ReadonlyVec3D v)
    • vertex

      public final void vertex(Vec2D v)
    • vertex

      public final void vertex(Vec3D v)