Package com.openinventor.inventor
Class SbVec2s
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbVec2s
-
public class SbVec2s extends SbBasic
2D vector class. 2D vector class used to store 2D integer vectors and points. This class is used throughout Open Inventor for arguments and return values.
-
-
Field Summary
Fields Modifier and Type Field Description short[]
array
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SbVec2s u)
Component-wise vector addition operator.void
divide(double d)
Component-wise scalar division operator.void
divide(int d)
Component-wise scalar division operator.int
dot(SbVec2s v)
Returns dot (inner) product of vector and another vector.boolean
equals(java.lang.Object obj)
short[]
getValue()
short
getValueAt(int index)
short
getX()
short
getY()
SbVec2s
minus(SbVec2s v2)
Component-wise binary vector subtraction operator.void
multiply(double d)
Component-wise scalar multiplication operator.void
multiply(int d)
Component-wise scalar multiplication operator.void
negate()
Negates each component of vector in place.SbVec2s
over(double d)
Component-wise binary scalar division operator.SbVec2s
over(int d)
Component-wise binary scalar division operator.SbVec2s
plus(SbVec2s v2)
Component-wise binary vector addition operator.SbVec2s
setValue(short[] components)
SbVec2s
setValue(short[] components, int startIndex)
SbVec2s
setValue(short c0, short c1)
void
setValue(SbVec2s copyFrom)
void
setValueAt(int index, short value)
void
setX(short value)
void
setY(short value)
void
substract(SbVec2s u)
Component-wise vector subtraction operator.SbVec2s
times(double d)
Component-wise binary scalar multiplication operator.SbVec2s
times(int d)
Component-wise binary scalar multiplication operator.static SbVec2s[]
toArray(long nativeArray, long length)
-
-
-
Method Detail
-
setValue
public void setValue(SbVec2s copyFrom)
-
getValue
public short[] getValue()
-
setValue
public SbVec2s setValue(short[] components)
-
setValue
public SbVec2s setValue(short[] components, int startIndex)
-
setValueAt
public void setValueAt(int index, short value)
-
getValueAt
public short getValueAt(int index)
-
setValue
public SbVec2s setValue(short c0, short c1)
-
getX
public short getX()
-
setX
public void setX(short value)
-
getY
public short getY()
-
setY
public void setY(short value)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
negate
public void negate()
Negates each component of vector in place.
-
dot
public int dot(SbVec2s v)
Returns dot (inner) product of vector and another vector.
-
toArray
public static SbVec2s[] toArray(long nativeArray, long length)
-
times
public SbVec2s times(int d)
Component-wise binary scalar multiplication operator.
-
multiply
public void multiply(double d)
Component-wise scalar multiplication operator.
-
times
public SbVec2s times(double d)
Component-wise binary scalar multiplication operator.
-
divide
public void divide(int d)
Component-wise scalar division operator.
-
add
public void add(SbVec2s u)
Component-wise vector addition operator.
-
substract
public void substract(SbVec2s u)
Component-wise vector subtraction operator.
-
divide
public void divide(double d)
Component-wise scalar division operator.
-
over
public SbVec2s over(double d)
Component-wise binary scalar division operator.
-
multiply
public void multiply(int d)
Component-wise scalar multiplication operator.
-
over
public SbVec2s over(int d)
Component-wise binary scalar division operator.
-
-