Tabnine Logo
FrameConvexPolygon2d.checkReferenceFrameMatch
Code IndexAdd Tabnine to your IDE (free)

How to use
checkReferenceFrameMatch
method
in
us.ihmc.robotics.geometry.FrameConvexPolygon2d

Best Java code snippets using us.ihmc.robotics.geometry.FrameConvexPolygon2d.checkReferenceFrameMatch (Showing top 20 results out of 315)

origin: us.ihmc/IHMCRoboticsToolkit

@Override
public double distance(FrameLine2d line)
{
 checkReferenceFrameMatch(line);
 return convexPolygon.distance(line.line);
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public double distance(FrameLineSegment2d lineSegment)
{
 checkReferenceFrameMatch(lineSegment);
 return convexPolygon.distance(lineSegment.lineSegment);
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public double distance(FrameConvexPolygon2d secondConvexPolygon)
{
 checkReferenceFrameMatch(secondConvexPolygon);
 return convexPolygon.distance(secondConvexPolygon.convexPolygon);
}
origin: us.ihmc/IHMCRoboticsToolkit

public int[] getLineOfSightVertexIndicesCopy(FramePoint2d observer)
{
 checkReferenceFrameMatch(observer);
 return ConvexPolygon2dCalculator.getLineOfSightVertexIndicesCopy(observer.getPoint(), convexPolygon);
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public double distance(FramePoint2d point)
{
 checkReferenceFrameMatch(point);
 return this.convexPolygon.distance(point.getPoint());
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public void orthogonalProjection(FramePoint2d point)
{
 checkReferenceFrameMatch(point);
 convexPolygon.orthogonalProjection(point.getPoint());
}
origin: us.ihmc/IHMCRoboticsToolkit

public boolean getLineOfSightVertexIndices(FramePoint2d observer, int[] idicesToPack)
{
 checkReferenceFrameMatch(observer);
 return ConvexPolygon2dCalculator.getLineOfSightVertexIndices(observer.getPoint(), idicesToPack, convexPolygon);
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Scale this convex polygon about pointToScaleAbout.
* @param pointToScaleAbout
* @param scaleFactor
*/
public void scale(FramePoint2d pointToScaleAbout, double scaleFactor)
{
 checkReferenceFrameMatch(pointToScaleAbout);
 scale(pointToScaleAbout.getPoint(), scaleFactor);
}
origin: us.ihmc/IHMCRoboticsToolkit

public void getClosestEdge(FrameLineSegment2d closestEdgeToPack, FramePoint2d point)
{
 checkReferenceFrameMatch(point);
 closestEdgeToPack.referenceFrame = referenceFrame;
 convexPolygon.getClosestEdge(closestEdgeToPack.lineSegment, point.getPoint());
}
origin: us.ihmc/IHMCRoboticsToolkit

  public static boolean combineDisjointPolygons(FrameConvexPolygon2d polygon1, FrameConvexPolygon2d polygon2, FrameConvexPolygon2d combinedPolygonToPack,
     FrameLineSegment2d connectingEdge1ToPack, FrameLineSegment2d connectingEdge2ToPack)
  {
   combinedPolygonToPack.clear(polygon1.getReferenceFrame());
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge1ToPack);
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge2ToPack);

   boolean success = combineDisjointPolygons(polygon1.convexPolygon, polygon2.convexPolygon, combinedPolygonToPack.convexPolygon,
      connectingEdge1ToPack.lineSegment, connectingEdge2ToPack.lineSegment);

   if (!success)
     return false;

//      combinedPolygonToPack.updateFramePoints();
   combinedPolygonToPack.update();

   return true;
  }

origin: us.ihmc/IHMCRoboticsToolkit

@Override
public FramePoint2d[] intersectionWith(FrameLineSegment2d lineSegment)
{
 //TODO: Memory inefficient. Don't create new objects...
 checkReferenceFrameMatch(lineSegment);
 Point2d[] intersection = this.convexPolygon.intersectionWith(lineSegment.lineSegment);
 if (intersection == null)
   return null;
 FramePoint2d[] ret = new FramePoint2d[intersection.length];
 for (int i = 0; i < intersection.length; i++)
 {
   ret[i] = new FramePoint2d(lineSegment.referenceFrame, intersection[i]);
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* @deprecated Creates garbage. Use an instance of FrameConvexPolygonWithLineIntersector.
*/
@Override
public FramePoint2d[] intersectionWith(FrameLine2d line)
{
 checkReferenceFrameMatch(line);
 Point2d[] intersection = this.convexPolygon.intersectionWith(line.line);
 if (intersection == null)
   return null;
 FramePoint2d[] ret = new FramePoint2d[intersection.length];
 for (int i = 0; i < intersection.length; i++)
 {
   ret[i] = new FramePoint2d(line.referenceFrame, intersection[i]);
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

public void setFrameConvexPolygon2d(FrameConvexPolygon2d polygon)
{
 if (polygon == null)
 {
   hide();
   setToNaN();
   return;
 }
 try
 {
   polygon.checkReferenceFrameMatch(referenceFrame);
   convexPolygon2dForWriting.setAndUpdate(polygon);
   getYoValuesFromFrameConvexPolygon2d();
 }
 catch (Exception e)
 {
   System.err.println("In YoFrameConvexPolygon2d.java: " + e.getClass().getSimpleName() + " while calling setConvexPolygon2d(FrameConvexPolygon2d).");
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public FrameConvexPolygon2d intersectionWith(FrameConvexPolygon2d secondConvexPolygon)
{
 checkReferenceFrameMatch(secondConvexPolygon);
 ConvexPolygon2d intersection = this.convexPolygon.intersectionWith(secondConvexPolygon.convexPolygon);
 if (intersection == null)
   return null;
 return new FrameConvexPolygon2d(secondConvexPolygon.getReferenceFrame(), intersection);
}
origin: us.ihmc/IHMCRoboticsToolkit

public FrameLineSegment2d getClosestEdgeCopy(FramePoint2d point)
{
 checkReferenceFrameMatch(point);
 return new FrameLineSegment2d(referenceFrame, convexPolygon.getClosestEdgeCopy(point.getPoint()));
}
origin: us.ihmc/IHMCRoboticsToolkit

public boolean intersectionWith(FrameConvexPolygon2d secondConvexPolygon, FrameConvexPolygon2d intersectionToPack)
{
 checkReferenceFrameMatch(secondConvexPolygon);
 intersectionToPack.clear(secondConvexPolygon.getReferenceFrame());
 boolean success = convexPolygon.intersectionWith(secondConvexPolygon.convexPolygon, intersectionToPack.convexPolygon);
 return success;
}
origin: us.ihmc/IHMCRoboticsToolkit

public FramePoint2d[] intersectionWithRayCopy(FrameLine2d ray)
{
 checkReferenceFrameMatch(ray);
 Point2d[] intersections = convexPolygon.intersectionWithRayCopy(ray.getLine2dCopy());
 if (intersections == null)
   return null;
 FramePoint2d[] ret = new FramePoint2d[intersections.length];
 for (int i = 0; i < intersections.length; i++)
 {
   ret[i] = new FramePoint2d(referenceFrame, intersections[i]);
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public FramePoint2d orthogonalProjectionCopy(FramePoint2d point)
{
 checkReferenceFrameMatch(point);
 Point2d projected = convexPolygon.orthogonalProjectionCopy(point.getPoint());
 if (projected == null)
 {
   return null;
 }
 return new FramePoint2d(point.getReferenceFrame(), projected);
}
origin: us.ihmc/IHMCRoboticsToolkit

public FramePoint2d[] getLineOfSightVerticesCopy(FramePoint2d observer)
{
 checkReferenceFrameMatch(observer);
 Point2d[] vertices = ConvexPolygon2dCalculator.getLineOfSightVerticesCopy(observer.getPoint(), convexPolygon);
 FramePoint2d point1 = new FramePoint2d(getReferenceFrame(), vertices[0]);
 FramePoint2d point2 = new FramePoint2d(getReferenceFrame(), vertices[1]);
 return new FramePoint2d[] {point1, point2};
}
origin: us.ihmc/IHMCRoboticsToolkit

public void intersectionWith(FrameLine2d otherLine, Pair<FramePoint2d, FramePoint2d> intersection)
{
 checkReferenceFrameMatch(otherLine);
 int numberOfIntersections = ConvexPolygon2dCalculator.intersectionWithLine(otherLine.getLine2d(), intersection.getFirst().getPoint(),
                                       intersection.getSecond().getPoint(), convexPolygon);
 if (numberOfIntersections < 2)
 {
   intersection.getSecond().setToNaN();
   if (numberOfIntersections < 1)
    intersection.getFirst().setToNaN();
 }
}
us.ihmc.robotics.geometryFrameConvexPolygon2dcheckReferenceFrameMatch

Popular methods of FrameConvexPolygon2d

  • <init>
    Creates an empty convex polygon attached to a reference frame, adds N new vertices using an array of
  • getNumberOfVertices
  • changeFrameAndProjectToXYPlane
  • getFrameVertex
  • isPointInside
    isPointInside Determines whether a point is inside the convex polygon (point in polygon test). Uses
  • getConvexPolygon2d
  • getVertex
  • intersectionWith
  • setIncludingFrameAndUpdate
    This method does: 1- clear(referenceFrame); 2- addVertices(vertices); 3- update().
  • addVertex
    Add a vertex to this polygon. Note that this method recycles memory.
  • addVertexByProjectionOntoXYPlane
    Add a vertex to this polygon after doing newVertex2d.changeFrameAndProjectToXYPlane(this.referenceFr
  • addVertices
  • addVertexByProjectionOntoXYPlane,
  • addVertices,
  • clear,
  • getCentroid,
  • getReferenceFrame,
  • isEmpty,
  • orthogonalProjection,
  • scale,
  • update,
  • addVertexAndChangeFrame

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ImageIO (javax.imageio)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now