Package pybox2d :: Module Box2D :: Class b2Vec2
[hide private]
[frames] | no frames]

type b2Vec2

source code


A 2D column vector.

Instance Methods [hide private]
 
__getstate__(self, additional_ignore=[])
Returns a dictionary representation of self, with dict(var=value [, ...])
source code
 
__setstate__(self, dict)
Takes each variable=value pair in the dictionary and sets the attributes based on them
source code
b2Vec2
__init__(self)
__init__(self, float32 x, float32 y) -> b2Vec2 __init__(self, b2Vec2 other) -> b2Vec2
source code
 
__repr__(self) source code
 
tuple(self)
Return the vector as a tuple (x,y)
source code
 
fromTuple(self, tuple)
Set the vector to the values found in the tuple (x,y)...
source code
 
copy(self)
Return a copy of the vector.
source code
 
__iadd__(self, other) source code
 
__isub__(self, other) source code
 
__imul__(self, a) source code
 
__idiv__(self, a) source code
 
dot(self, v)
Dot product with v (list/tuple or b2Vec2)
source code
 
__swig_destroy__(...)
delete_b2Vec2(b2Vec2 self)
 
SetZero(...)
b2Vec2_SetZero(b2Vec2 self)
source code
 
Set(...)
b2Vec2_Set(b2Vec2 self, float32 x_, float32 y_)
source code
 
__neg__(...)
b2Vec2___neg__(b2Vec2 self) -> b2Vec2
source code
 
add_vector(...)
b2Vec2_add_vector(b2Vec2 self, b2Vec2 v)
source code
 
sub_vector(...)
b2Vec2_sub_vector(b2Vec2 self, b2Vec2 v)
source code
 
mul_float(...)
b2Vec2_mul_float(b2Vec2 self, float32 a)
source code
 
Length(...)
b2Vec2_Length(b2Vec2 self) -> float32
source code
 
LengthSquared(...)
b2Vec2_LengthSquared(b2Vec2 self) -> float32
source code
 
Normalize(...)
b2Vec2_Normalize(b2Vec2 self) -> float32
source code
 
IsValid(...)
b2Vec2_IsValid(b2Vec2 self) -> bool
source code
 
__div__(...)
b2Vec2___div__(b2Vec2 self, float32 a) -> b2Vec2
source code
 
__mul__(...)
b2Vec2___mul__(b2Vec2 self, float32 a) -> b2Vec2
source code
 
__add__(...)
b2Vec2___add__(b2Vec2 self, b2Vec2 other) -> b2Vec2
source code
 
__sub__(...)
b2Vec2___sub__(b2Vec2 self, b2Vec2 other) -> b2Vec2
source code
 
__rmul__(...)
b2Vec2___rmul__(b2Vec2 self, float32 a) -> b2Vec2
source code
 
__rdiv__(...)
b2Vec2___rdiv__(b2Vec2 self, float32 a) -> b2Vec2
source code
 
div_float(...)
b2Vec2_div_float(b2Vec2 self, float32 a)
source code
Properties [hide private]
  thisown
The membership flag
  x
b2Vec2_x_get(b2Vec2 self) -> float32
  y
b2Vec2_y_get(b2Vec2 self) -> float32
Method Details [hide private]

__getstate__(self, additional_ignore=[])

source code 

Returns a dictionary representation of self, with 
 dict(var=value [, ...])

additional_ignore can be specified to ignore certain
properties. 

__init__(self)
(Constructor)

source code 

__init__(self, float32 x, float32 y) -> b2Vec2 __init__(self, b2Vec2 other) -> b2Vec2

Construct using coordinates.

Returns: b2Vec2
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: object.__repr__
(inherited documentation)

fromTuple(self, tuple)

source code 

Set the vector to the values found in the tuple (x,y)
You can also use:
    value = b2Vec2(*tuple)

copy(self)

source code 

Return a copy of the vector.
Remember that the following:
    a = b2Vec2()
    b = a
Does not copy the vector itself, but b now refers to a.

SetZero(...)

source code 

b2Vec2_SetZero(b2Vec2 self)

Set this vector to all zeros.

Set(...)

source code 

b2Vec2_Set(b2Vec2 self, float32 x_, float32 y_)

Set this vector to some specified coordinates.

Length(...)

source code 

b2Vec2_Length(b2Vec2 self) -> float32

Get the length of this vector (the norm).

LengthSquared(...)

source code 

b2Vec2_LengthSquared(b2Vec2 self) -> float32

Get the length squared. For performance, use this instead of b2Vec2::Length(if possible).

Normalize(...)

source code 

b2Vec2_Normalize(b2Vec2 self) -> float32

Convert this vector into a unit vector. Returns the length.

IsValid(...)

source code 

b2Vec2_IsValid(b2Vec2 self) -> bool

Does this vector contain finite coordinates?


Property Details [hide private]

thisown

The membership flag

x

b2Vec2_x_get(b2Vec2 self) -> float32

y

b2Vec2_y_get(b2Vec2 self) -> float32