public class Segment
extends java.lang.Object
Constructor and Description |
---|
Segment(Point3 a,
Point3 b)
Constructs a segment with the specified endpoints.
|
Segment(Segment ls)
Constructs a copy of the specified segment.
|
Modifier and Type | Method and Description |
---|---|
Point3 |
getA()
Gets the endpoint A of this segment.
|
Point3 |
getB()
Gets the endpoint B of this segment.
|
Point3 |
intersectWithTriangle(double xa,
double ya,
double za,
double xb,
double yb,
double zb,
double xc,
double yc,
double zc)
Tests this segment for intersection with the specified triangle.
|
double |
length()
Returns the length of this segment.
|
void |
transform(Matrix44 m)
Transforms this segment, given the specified transform matrix.
|
public Segment(Point3 a, Point3 b)
a
- the endpoint A.b
- the endpoint B.public Segment(Segment ls)
ls
- the segment.public Point3 getA()
public Point3 getB()
public double length()
public void transform(Matrix44 m)
m
- the transform matrix.public Point3 intersectWithTriangle(double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc)
xa
- x coordinate of triangle vertex a.ya
- y coordinate of triangle vertex a.za
- z coordinate of triangle vertex a.xb
- x coordinate of triangle vertex b.yb
- y coordinate of triangle vertex b.zb
- z coordinate of triangle vertex b.xc
- x coordinate of triangle vertex c.yc
- y coordinate of triangle vertex c.zc
- z coordinate of triangle vertex c.