public class MouseOnLine extends MouseConstrained
Given a mouse event with pixel (x,y) coordinates, a mouse-on-line computes a constrained point. When the mouse pixel coordinates equal those used to construct the mouse-on-line, the constrained point equals the specified origin point.
Constructor and Description |
---|
MouseOnLine(java.awt.event.MouseEvent event,
Point3 origin,
Vector3 vector,
Matrix44 localToPixel)
Constructs a mouse constrained by a line.
|
Modifier and Type | Method and Description |
---|---|
Point3 |
getPoint(java.awt.event.MouseEvent event)
Gets the point in local coordinates for the specified event.
|
getMouseSegment
public MouseOnLine(java.awt.event.MouseEvent event, Point3 origin, Vector3 vector, Matrix44 localToPixel)
event
- the mouse event.origin
- the origin point, in local coordinates.vector
- the vector parallel to the line of constraint.localToPixel
- the transform from local to pixel coordinates.public Point3 getPoint(java.awt.event.MouseEvent event)
getPoint
in class MouseConstrained
event
- the mouse event.