public class MapVec
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
swigCMemOwn |
构造器和说明 |
---|
MapVec()
Constructs a MapVec object.
|
MapVec(double x,
double y)
Constructs a MapVec object from 2 coordinates.
|
MapVec(double x,
double y,
double z)
Constructs a MapVec object from 3 coordinates.
|
MapVec(long cPtr,
boolean cMemoryOwn) |
限定符和类型 | 方法和说明 |
---|---|
MapVec |
add(MapVec v)
Creates a new map vector by adding a map vector to this map vector.
|
double |
crossProduct2D(MapVec v)
Calculates the 2D cross product between this and another map vector.
|
MapVec |
crossProduct3D(MapVec v)
Creates a new map vector that's perpendicular to the plane defined by this and another map vector.
|
void |
delete() |
MapVec |
div(double divider)
Creates a new map vector by dividing this map vector with a divider.
|
double |
dotProduct(MapVec v)
Calculates the dot product between this and another map vector.
|
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
static long |
getCPtr(MapVec obj) |
MapVec |
getNormalized()
Creates a new map vector by normalizing this map vector.
|
MapVec |
getRotated2D(double sin,
double cos)
Creates a new map vector by rotating this map vector around it's back end and around z axis.
|
double |
getX()
Returns the x coordinate of this map vector.
|
double |
getY()
Returns the y coordinate of this map vector.
|
double |
getZ()
Returns the z coordinate of this map vector.
|
int |
hashCode()
Returns the hash value of this object.
|
double |
length()
Calculates the length of this map vector.
|
MapVec |
mul(double multiplier)
Creates a new map vector by multiplying this map vector with a multiplier.
|
MapVec |
sub(MapVec v)
Creates a new map vector by subtracting a map vector from this map vector.
|
java.lang.String |
toString()
Creates a string representation of this map vector, useful for logging.
|
public MapVec(long cPtr, boolean cMemoryOwn)
public MapVec()
public MapVec(double x, double y)
x
- The x coordinate.y
- The y coordinate.public MapVec(double x, double y, double z)
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.public static long getCPtr(MapVec obj)
protected void finalize()
finalize
在类中 java.lang.Object
public void delete()
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
obj
- The reference object.public int hashCode()
hashCode
在类中 java.lang.Object
public double getX()
public double getY()
public double getZ()
public MapVec add(MapVec v)
v
- The map vector to be added.public MapVec sub(MapVec v)
v
- The map vector to be subtracted.public MapVec mul(double multiplier)
multiplier
- The multiplier.public MapVec div(double divider)
divider
- The divider.public double length()
public MapVec getNormalized()
public MapVec getRotated2D(double sin, double cos)
sin
- The sine value of the rotation angle.cos
- The cosine value of the rotation angle.public double crossProduct2D(MapVec v)
v
- The other map vector.public MapVec crossProduct3D(MapVec v)
v
- The other map vector.public double dotProduct(MapVec v)
v
- The other map vector.public java.lang.String toString()
toString
在类中 java.lang.Object