Class ParametricCurvePtr


  • public class ParametricCurvePtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • ParametricCurvePtr

        public ParametricCurvePtr​(long cPtr,
                                  boolean cMemoryOwn)
      • ParametricCurvePtr

        public ParametricCurvePtr()
        Default constructor yielding a NULL-pointer.
      • ParametricCurvePtr

        public ParametricCurvePtr​(ParametricCurve ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • obr

        public OBB obr()
      • CurveEqual

        public boolean CurveEqual​(CurveCPtr curve,
                                  double eps)
      • x

        public Vector3D x​(double t)
        Evaluate a point on the curve.
        Parameters:
        t - [in] the parameter to find point for.
        Returns:
        the vector p \in \mathbb{R}^3 .
      • dx

        public Vector3D dx​(double t)
        Evaluate the derivative in a point on the curve.
        Parameters:
        t - [in] the parameter to find derivative for.
        Returns:
        a derivative vector p \in \mathbb{R}^3 .
      • ddx

        public Vector3D ddx​(double t)
        Evaluate the second derivative in a point on the curve.
        Parameters:
        t - [in] the parameter to find second derivative for.
        Returns:
        a second derivative vector p \in \mathbb{R}^3 .
      • call

        public Vector3D call​(double in)
      • hasLimits

        public boolean hasLimits()
        Check if the curve is limited.
        Returns:
        true if curve is limited, false otherwise.
      • limits

        public pair_d_d limits()
        Get the limits of the curve segment.

        The returned values are only valid when hasLimits() returns true.

        Returns:
        the minimum and maximum parameter values on the curve.
      • inLimits

        public boolean inLimits​(double t)
        Check if the parameter t is inside the limits set for the curve.
        Parameters:
        t - [in] the parameter to check.
        Returns:
        true if inside limits, false otherwise.
      • setLimits

        public void setLimits​(pair_d_d limits)
        Set parameter limits for the curve.
        Parameters:
        limits - [in] the minimum and maximum parameter values on the curve.
      • curvature

        public double curvature​(double t)
        The curvature in a given point on the curve.

        This function does not take the limits into account.

        Parameters:
        t - [in] the parameter to evaluate the curvature for.
        Returns:
        the curvature.
      • closestTimes

        public vector_d closestTimes​(Vector3D p)
        Get the parameter values where the curve is closest to a point p.

        Notice that the limits are taken into account.

        Parameters:
        p - [in] the point to find closest values for.
        Returns:
        a list of parameter values.
      • closestTime

        public double closestTime​(Vector3D p)
        Get the parameter value where the curve is closest to a point p.

        Notice that the limits are taken into account.

        Parameters:
        p - [in] the point to find closest values for.
        Returns:
        the point on the curve closest to p. If multiple points are equally close to
        p, only one of those points are returned.