|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.curves.CubicBezierSpline
public class CubicBezierSpline
A cubic Bezier Curve (degree 3)
| Constructor Summary | |
|---|---|
CubicBezierSpline(Tuple3f[] points)
Constructs a Bézier Spline with composed of cubic Bézier curves. |
|
CubicBezierSpline(Tuple3f[] basePoints,
Tuple3f[] controlPoints)
Constructs a Bézier Spline with composed of cubic Bézier curves. |
|
| Method Summary | ||
|---|---|---|
void |
addBasePoint(int index,
Tuple3f point)
Adds a new Point at the specified index and shifts the already exiting points one index further. |
|
void |
addBasePoint(Tuple3f point)
Adds a new Point into the nearest spline segment. |
|
float |
closestParameter(float x,
float y,
float z)
Computes the paramter that would give the closest point on this spline to the given point. |
|
float |
closestParameter(Tuple3f p)
Computes the paramter that would give the closest point on this spline to the given point. |
|
int |
closestPoint(float x,
float y,
float z,
Tuple3f resultPoint)
Computes the point on this spline that is closest to the given point. |
|
int |
closestPoint(float x,
float y,
float z,
Tuple3f resultPoint,
Tuple2f resultParams)
Computes the point on this spline that is closest to the given point. |
|
int |
closestPoint(Tuple3f point,
Tuple3f resultPoint)
Computes the point on this spline that is closest to the given point. |
|
int |
closestPoint(Tuple3f point,
Tuple3f resultPoint,
Tuple2f resultParams)
Computes the point on this spline that is closest to the given point. |
|
int |
closestSubcurve(float x,
float y,
float z)
Finds the index of the subcurve with the point, that is closest to the given point. |
|
int |
closestSubcurve(Tuple3f point)
Finds the index of the subcurve with the point, that is closest to the given point. |
|
static Point3f |
evalPoint(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
float t)
|
|
static
|
evalPoint(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
float t,
P p)
|
|
static Point3f[] |
evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
int numPoints)
|
|
static Point3f[] |
evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
Point3f[] result)
|
|
static Tuple3f[] |
evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
Tuple3f[] result)
|
|
void |
generateControlPoints(int start,
int end)
Generates control points for the given base point range. |
|
Point3f |
getBasePoint(int n)
|
|
Point3f[] |
getBasePoints()
|
|
Point3f |
getControlPoint(int n)
|
|
Point3f[] |
getControlPoints()
|
|
float |
getLength()
|
|
java.util.List<Point3f> |
getPoints()
|
|
Point3f |
samplePoint(float t)
|
|
|
samplePoint(float s,
P p)
|
|
Point3f[] |
samplePoints(int numPoints)
|
|
Point3f[] |
samplePoints(Point3f[] result)
|
|
Tuple3f[] |
samplePoints(Tuple3f[] result)
|
|
float |
squaredDistanceTo(float x,
float y,
float z)
Computes the nearest distance between this spline and a point |
|
float |
squaredDistanceTo(Tuple3f p)
Computes the nearest distance between this spline and a point |
|
void |
update()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CubicBezierSpline(Tuple3f[] points)
points -
public CubicBezierSpline(Tuple3f[] basePoints,
Tuple3f[] controlPoints)
basePoints - controlPoints - | Method Detail |
|---|
public float getLength()
public final Point3f[] getBasePoints()
public Point3f getBasePoint(int n)
public void addBasePoint(Tuple3f point)
point - the coordinates of the new point
public void addBasePoint(int index,
Tuple3f point)
index - the index to add the pointpoint - the coordinates of the new pointpublic final Point3f[] getControlPoints()
public Point3f getControlPoint(int n)
public java.util.List<Point3f> getPoints()
public static <P extends Tuple3f> P evalPoint(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
float t,
P p)
public static Point3f evalPoint(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
float t)
public static Tuple3f[] evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
Tuple3f[] result)
result - result.length Point3fs from the Bézier Curve
public static final Point3f[] evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
Point3f[] result)
result - result.length Point3fs from the Bézier Curve
public static Point3f[] evalPoints(Tuple3f p0,
Tuple3f p1,
Tuple3f p2,
Tuple3f p3,
int numPoints)
numPoints -
public <P extends Tuple3f> P samplePoint(float s,
P p)
s - with 0 <= s <= 1p - the point output object to write the calculated point on the Bézier Spline topublic final Point3f samplePoint(float t)
t - with 0 < t < 1
public Tuple3f[] samplePoints(Tuple3f[] result)
result - result.length Point3fs from the Bézier Curvepublic final Point3f[] samplePoints(Point3f[] result)
result - result.length Point3fs from the Bézier Curvepublic Point3f[] samplePoints(int numPoints)
numPoints -
public void update()
public void generateControlPoints(int start,
int end)
start - the first basePoint to generate control points forend - the first basePoint _not_ to generate control points for
public int closestPoint(float x,
float y,
float z,
Tuple3f resultPoint,
Tuple2f resultParams)
x - X coordinate of the point to testy - Y coordinate of the point to testz - Z coordinate of the point to testresultPoint - will contain the point on this spline that is closest to the given pointresultParams - will contain the spline-equation parameter as x and the squared distance as y
public int closestPoint(Tuple3f point,
Tuple3f resultPoint,
Tuple2f resultParams)
point - the point to testresultPoint - will contain the point on this spline that is closest to the given pointresultParams - will contain the spline-equation parameter as x and the squared distance as y
public int closestPoint(float x,
float y,
float z,
Tuple3f resultPoint)
x - X coordinate of the point to testy - Y coordinate of the point to testz - Z coordinate of the point to testresultPoint - will contain the point on this spline that is closest to the given point
public int closestPoint(Tuple3f point,
Tuple3f resultPoint)
point - the point to testresultPoint - will contain the point on this spline that is closest to the given point
public int closestSubcurve(float x,
float y,
float z)
x - X coordinate of the point to testy - Y coordinate of the point to testz - Z coordinate of the point to test
public int closestSubcurve(Tuple3f point)
point - the point to test
public float closestParameter(float x,
float y,
float z)
x - X coordinate of a pointy - Y coordinate of a pointz - Z coordinate of a point
public float closestParameter(Tuple3f p)
p - the coordinates of a point
public float squaredDistanceTo(float x,
float y,
float z)
x - X coordinate of a pointy - Y coordinate of a pointz - Z coordinate of a point
public float squaredDistanceTo(Tuple3f p)
p - the coordinates of a point
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||