org.jbox2d.common
Class Vec2

java.lang.Object
  extended by org.jbox2d.common.Vec2

public class Vec2
extends java.lang.Object


Field Summary
static int creationCount
           
static boolean watchCreations
           
 float x
           
 float y
           
 
Constructor Summary
Vec2()
           
Vec2(float x, float y)
           
 
Method Summary
 Vec2 abs()
           
static Vec2 abs(Vec2 a)
           
 Vec2 add(Vec2 v)
           
 Vec2 addLocal(Vec2 v)
           
 Vec2 clone()
           
static Vec2 cross(float s, Vec2 a)
           
static Vec2 cross(Vec2 a, float s)
           
static float cross(Vec2 a, Vec2 b)
           
static float dot(Vec2 a, Vec2 b)
           
 boolean isValid()
           
 float length()
           
 float lengthSquared()
           
static Vec2 max(Vec2 a, Vec2 b)
           
static Vec2 min(Vec2 a, Vec2 b)
           
 Vec2 mul(float a)
           
 Vec2 mulLocal(float a)
           
 Vec2 negate()
           
 Vec2 negateLocal()
           
 float normalize()
           
 void set(float x, float y)
           
 void set(Vec2 v)
           
 void setZero()
           
 Vec2 sub(Vec2 v)
           
 Vec2 subLocal(Vec2 v)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

watchCreations

public static final boolean watchCreations
See Also:
Constant Field Values

creationCount

public static int creationCount

x

public float x

y

public float y
Constructor Detail

Vec2

public Vec2()

Vec2

public Vec2(float x,
            float y)
Method Detail

setZero

public void setZero()

set

public void set(float x,
                float y)

set

public void set(Vec2 v)

add

public Vec2 add(Vec2 v)

sub

public Vec2 sub(Vec2 v)

mul

public Vec2 mul(float a)

negate

public Vec2 negate()

negateLocal

public Vec2 negateLocal()

addLocal

public Vec2 addLocal(Vec2 v)

subLocal

public Vec2 subLocal(Vec2 v)

mulLocal

public Vec2 mulLocal(float a)

length

public float length()

lengthSquared

public float lengthSquared()

normalize

public float normalize()

isValid

public boolean isValid()

abs

public Vec2 abs()

clone

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

toString

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

abs

public static Vec2 abs(Vec2 a)

dot

public static float dot(Vec2 a,
                        Vec2 b)

cross

public static float cross(Vec2 a,
                          Vec2 b)

cross

public static Vec2 cross(Vec2 a,
                         float s)

cross

public static Vec2 cross(float s,
                         Vec2 a)

min

public static Vec2 min(Vec2 a,
                       Vec2 b)

max

public static Vec2 max(Vec2 a,
                       Vec2 b)