Atavism Version 2018.1AGIS API

atavism.server.math
Class IntVector3

java.lang.Object
  extended by atavism.server.math.IntVector3
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class IntVector3
extends java.lang.Object
implements java.io.Externalizable

this object is not thread safe

See Also:
Serialized Form

Field Summary
static float epsilon
           
static IntVector3 UnitZ
           
static IntVector3 Zero
           
 
Constructor Summary
IntVector3()
           
IntVector3(int x, int y, int z)
           
IntVector3(IntVector3 other)
           
 
Method Summary
 IntVector3 add(int x, int y, int z)
           
 IntVector3 add(IntVector3 other)
           
static IntVector3 add(IntVector3 p1, IntVector3 p2)
           
 IntVector3 add(Point other)
           
 void assign(IntVector3 source)
           
 java.lang.Object clone()
           
 IntVector3 cloneAOVector()
           
static boolean counterClockwisePoints(IntVector3 v0, IntVector3 v1, IntVector3 v2)
           
static IntVector3 cross(IntVector3 u, IntVector3 v)
           
static int distanceTo(IntVector3 p1, IntVector3 p2)
          returns distance from p1 to p2 on the XZ plane
static int distanceToSquared(IntVector3 p1, IntVector3 p2)
          returns the square of the distance from p1 to p2 on the XZ plane
 int dotProduct(IntVector3 v)
           
 boolean equals(java.lang.Object obj)
           
 Quaternion getRotationTo(IntVector3 destination)
          Gets the shortest arc quaternion to rotate this vector to the destination vector.
 int getX()
           
 int getY()
           
 int getZ()
           
 boolean isZero()
           
 int length()
           
 int lengthXZ()
           
static void main(java.lang.String[] args)
           
 IntVector3 minus(IntVector3 other)
          Returns the result of the subtraction of the other vector from this vector.
 IntVector3 multiply(int factor)
           
 IntVector3 negate()
           
 IntVector3 normalize()
           
 IntVector3 plus(IntVector3 other)
          Returns the result of the addition of this vector and the other vector.
 void readExternal(java.io.ObjectInput in)
           
 IntVector3 scale(int s)
           
 void setX(int x)
           
 void setY(int y)
           
 void setZ(int z)
           
 IntVector3 sub(int x, int y, int z)
           
 IntVector3 sub(IntVector3 other)
           
 IntVector3 sub(Point other)
           
 IntVector3 times(int factor)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UnitZ

public static final IntVector3 UnitZ

Zero

public static final IntVector3 Zero

epsilon

public static float epsilon
Constructor Detail

IntVector3

public IntVector3()

IntVector3

public IntVector3(int x,
                  int y,
                  int z)

IntVector3

public IntVector3(IntVector3 other)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

cloneAOVector

public IntVector3 cloneAOVector()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

assign

public void assign(IntVector3 source)

distanceTo

public static int distanceTo(IntVector3 p1,
                             IntVector3 p2)
returns distance from p1 to p2 on the XZ plane


distanceToSquared

public static int distanceToSquared(IntVector3 p1,
                                    IntVector3 p2)
returns the square of the distance from p1 to p2 on the XZ plane


add

public static IntVector3 add(IntVector3 p1,
                             IntVector3 p2)

isZero

public boolean isZero()

normalize

public IntVector3 normalize()

add

public IntVector3 add(IntVector3 other)

add

public IntVector3 add(Point other)

add

public IntVector3 add(int x,
                      int y,
                      int z)

sub

public IntVector3 sub(IntVector3 other)

sub

public IntVector3 sub(Point other)

sub

public IntVector3 sub(int x,
                      int y,
                      int z)

multiply

public IntVector3 multiply(int factor)

plus

public IntVector3 plus(IntVector3 other)
Returns the result of the addition of this vector and the other vector. This returns a new vector, and leaves this vector unchanged.

Parameters:
other -
Returns:

minus

public IntVector3 minus(IntVector3 other)
Returns the result of the subtraction of the other vector from this vector. This returns a new vector, and leaves this vector unchanged.

Parameters:
other -
Returns:

times

public IntVector3 times(int factor)

negate

public IntVector3 negate()

length

public int length()

lengthXZ

public int lengthXZ()

dotProduct

public int dotProduct(IntVector3 v)

scale

public IntVector3 scale(int s)

getRotationTo

public Quaternion getRotationTo(IntVector3 destination)
Gets the shortest arc quaternion to rotate this vector to the destination vector. Don't call this if you think the dest vector can be close to the inverse of this vector, since then ANY axis of rotation is ok.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getX

public int getX()

getY

public int getY()

getZ

public int getZ()

setX

public void setX(int x)

setY

public void setY(int y)

setZ

public void setZ(int z)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

cross

public static IntVector3 cross(IntVector3 u,
                               IntVector3 v)

counterClockwisePoints

public static boolean counterClockwisePoints(IntVector3 v0,
                                             IntVector3 v1,
                                             IntVector3 v2)

main

public static void main(java.lang.String[] args)


Copyright © 2018 Dragonsan Studios Sp. z o.o.