Package org.vrspace.server.obj
Class Point
java.lang.Object
org.vrspace.server.obj.Entity
org.vrspace.server.obj.Embedded
org.vrspace.server.obj.Point
A point (3D coordinate) in space. Embedded in VRObject during serialization,
does not exist on its own.
- Author:
- joe
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
double
getDistance
(double x, double y, double z) double
getX()
double
getY()
double
getZ()
int
hashCode()
boolean
Utility method, confirms that coordinates of this point match the coordinates of the other point.boolean
isInRange
(double x, double y, double z, double range) boolean
minus
(double val) plus
(double val) void
setX
(double x) void
setY
(double y) void
setZ
(double z) toString()
Methods inherited from class org.vrspace.server.obj.Entity
dispose, getObjectId, setId
-
Constructor Details
-
Point
-
Point
public Point() -
Point
public Point(double x, double y, double z)
-
-
Method Details
-
getDistance
public double getDistance(double x, double y, double z) -
isInRange
-
isInRange
public boolean isInRange(double x, double y, double z, double range) -
copy
-
plus
-
minus
-
isEqual
Utility method, confirms that coordinates of this point match the coordinates of the other point. Method equals() can't be used for that purpose as it includes object id - requirement for persistence.- Parameters:
p
- Point to compare- Returns:
- true if all coordinates are equal
-
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
setX
public void setX(double x) -
setY
public void setY(double y) -
setZ
public void setZ(double z) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-