From 1ca551066a4872b1029f88d358def558ff3e13a9 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 14 Jan 2012 21:37:48 -0800 Subject: j3dcore: adjust set/get upper/lower to use Point3d helpers They match the signature of the caller exactly, allowing the VM to inline them completely. Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/BoundingBox.java | 117 +++++++++------------ 1 file changed, 50 insertions(+), 67 deletions(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/BoundingBox.java b/src/classes/share/javax/media/j3d/BoundingBox.java index 86cadd3..9ccb4d8 100644 --- a/src/classes/share/javax/media/j3d/BoundingBox.java +++ b/src/classes/share/javax/media/j3d/BoundingBox.java @@ -263,78 +263,61 @@ public BoundingBox(Bounds[] bounds) { updateBoundsStates(); } - /** - * Gets the lower corner of this bounding box. - * @param p1 a Point to receive the lower corner of the bounding box - */ - public void getLower(Point3d p1) { - p1.x = lower.x; - p1.y = lower.y; - p1.z = lower.z; - } - - /** - * Sets the lower corner of this bounding box. - * @param xmin minimum x value of boundining box - * @param ymin minimum y value of boundining box - * @param zmin minimum z value of boundining box - */ - public void setLower(double xmin, double ymin, double zmin ) { - lower.x = xmin; - lower.y = ymin; - lower.z = zmin; - - updateBoundsStates(); - } - - /** - * Sets the lower corner of this bounding box. - * @param p1 a Point defining the new lower corner of the bounding box - */ - public void setLower(Point3d p1) { - - lower.x = p1.x; - lower.y = p1.y; - lower.z = p1.z; - - updateBoundsStates(); - } +/** + * Gets the lower corner of this bounding box. + * @param p1 a Point to receive the lower corner of the bounding box + */ +public void getLower(Point3d p1) { + p1.set(lower); +} - /** - * Gets the upper corner of this bounding box. - * @param p1 a Point to receive the upper corner of the bounding box - */ - public void getUpper(Point3d p1) { - p1.x = upper.x; - p1.y = upper.y; - p1.z = upper.z; - } +/** + * Sets the lower corner of this bounding box. + * @param xmin minimum x value of bounding box + * @param ymin minimum y value of bounding box + * @param zmin minimum z value of bounding box + */ +public void setLower(double xmin, double ymin, double zmin) { + lower.set(xmin, ymin, zmin); + updateBoundsStates(); +} - /** - * Sets the upper corner of this bounding box. - * @param xmax max x value of boundining box - * @param ymax max y value of boundining box - * @param zmax max z value of boundining box - */ - public void setUpper(double xmax, double ymax, double zmax ) { - upper.x = xmax; - upper.y = ymax; - upper.z = zmax; +/** + * Sets the lower corner of this bounding box. + * @param p1 a Point defining the new lower corner of the bounding box + */ +public void setLower(Point3d p1) { + lower.set(p1); + updateBoundsStates(); +} - updateBoundsStates(); - } +/** + * Gets the upper corner of this bounding box. + * @param p1 a Point to receive the upper corner of the bounding box + */ +public void getUpper(Point3d p1) { + p1.set(upper); +} - /** - * Sets the upper corner of this bounding box. - * @param p1 a Point defining the new upper corner of the bounding box - */ - public void setUpper(Point3d p1) { - upper.x = p1.x; - upper.y = p1.y; - upper.z = p1.z; +/** + * Sets the upper corner of this bounding box. + * @param xmax max x value of bounding box + * @param ymax max y value of bounding box + * @param zmax max z value of bounding box + */ +public void setUpper(double xmax, double ymax, double zmax) { + upper.set(xmax, ymax, zmax); + updateBoundsStates(); +} - updateBoundsStates(); - } +/** + * Sets the upper corner of this bounding box. + * @param p1 a Point defining the new upper corner of the bounding box + */ +public void setUpper(Point3d p1) { + upper.set(p1); + updateBoundsStates(); +} /** * Sets the the value of this BoundingBox -- cgit v1.2.3