Class iicm.utils3d.PickUtil
All Packages Class Hierarchy This Package Previous Next Index
Class iicm.utils3d.PickUtil
java.lang.Object
|
+----iicm.utils3d.PickUtil
- public class PickUtil
- extends Object
PickUtil - collection of simple picking functions
Copyright (c) 1997 IICM
-
rayhitsconeside(Ray, float, float, boolean, Hitpoint)
- pick a cone's side.
-
rayhitscube(Ray, float[], float[], Hitpoint, boolean)
- pick a cube.
-
rayhitscube(Ray, Vec3f, Vec3f, Hitpoint)
- pick a cube from outside.
-
rayhitscylinderside(Ray, float, float, boolean, Hitpoint)
- pick a cylinder's side.
-
rayhitsdisk(Ray, float, float, boolean, boolean, Hitpoint, boolean)
- pick a disk.
-
rayhitsplane(Ray, Hitpoint)
- pick a plane.
-
rayhitssphere(Ray, float, boolean, Hitpoint)
- pick a sphere.
rayhitscube
public static boolean rayhitscube(Ray ray,
Vec3f min,
Vec3f max,
Hitpoint hitpoint)
- pick a cube from outside. See below.
rayhitscube
public static boolean rayhitscube(Ray ray,
float min[],
float max[],
Hitpoint hitpoint,
boolean inside)
- pick a cube. test whether ray hits an axis-aligned cube given by (min, max)
at a hittime (strict) within near/far ranges of ray. In this case, hitpoint.hittime_
(and normal_ if non-null) is/are updated. The ray itself is not changed.
- Parameters:
- inside - flag whether to pick the inner (on true) or outer side of the cube
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
rayhitssphere
public static boolean rayhitssphere(Ray ray,
float radius,
boolean twosided,
Hitpoint hitpoint)
- pick a sphere. test whether ray hits a sphere, centered at origin
with given radius; twosided if flag set.
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
rayhitsdisk
public static boolean rayhitsdisk(Ray ray,
float y,
float r,
boolean top,
boolean bottom,
Hitpoint hitpoint,
boolean sens)
- pick a disk. test whether ray hits a disk parallel to the xz
plane at height y with radius r from top or bottom (according to
these flags).
if flag sens is true the radius is infinitely large
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
- See Also:
- rayhitscube
rayhitsconeside
public static boolean rayhitsconeside(Ray ray,
float height,
float radius,
boolean twosided,
Hitpoint hitpoint)
- pick a cone's side. test whether ray hits the side wall of a cone
(given by height and radius). to pick a complete cone also check
bottom disk at y = - height/2.
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
- See Also:
- rayhitsdisk
rayhitscylinderside
public static boolean rayhitscylinderside(Ray ray,
float height,
float radius,
boolean twosided,
Hitpoint hitpoint)
- pick a cylinder's side. test whether ray hits a cylinder (given
by height and radius). to pick a complete cylinder also check top
and bottom disks at y = +/- height/2.
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
- See Also:
- rayhitsdisk
rayhitsplane
public static boolean rayhitsplane(Ray ray,
Hitpoint hitpoint)
- pick a plane. test whether ray hits the xy plane (z = 0) from
either side at a hittime > 0.
In this case, hitpoint.hittime_ (and normal_ if non-null) is/are
updated. The ray itself is not changed.
- Returns:
- flag whether a hit occured (hitpoint updated in this case)
All Packages Class Hierarchy This Package Previous Next Index