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