panda3d.core.LVecBase2i

from panda3d.core import LVecBase2i
class LVecBase2i

This is the base class for all two-component vectors and points.

Inheritance diagram

Inheritance diagram of LVecBase2i

__init__() → None
__init__(param0: LVecBase2i) → None
__init__(fill_value: int) → None
__init__(x: int, y: int) → None
operatorNew(size: size_t) → None
assign(copy: LVecBase2i) → LVecBase2i
Return type

LVecBase2i

assign(fill_value: int) → LVecBase2i
Return type

LVecBase2i

static zero() → LVecBase2i

Returns a zero-length vector.

Return type

LVecBase2i

static unitX() → LVecBase2i

Returns a unit X vector.

Return type

LVecBase2i

static unitY() → LVecBase2i

Returns a unit Y vector.

Return type

LVecBase2i

static size() → int
isNan() → bool

Returns true if any component of the vector is not-a-number, false otherwise.

getCell(i: int) → int
setCell(i: int, value: int) → None
getX() → int
getY() → int
setX(value: int) → None
setY(value: int) → None
addToCell(i: int, value: int) → None

These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages:

addX(value: int) → None
addY(value: int) → None
getData() → None

Returns the address of the first of the two data elements in the vector. The next element occupies the next position consecutively in memory.

static getNumComponents() → int
fill(fill_value: int) → None

Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero.

set(x: int, y: int) → None
dot(other: LVecBase2i) → int
lengthSquared() → int

Returns the square of the vector’s length, cheap and easy.

compareTo(other: LVecBase2i) → int

This flavor of compare_to uses a default threshold value based on the numeric type.

getHash() → size_t

Returns a suitable hash for phash_map.

Return type

size_t

addHash(hash: size_t) → size_t

Adds the vector into the running hash.

Return type

size_t

generateHash(hashgen: ChecksumHashGenerator) → None

Adds the vector to the indicated hash generator.

componentwiseMult(other: LVecBase2i) → None
fmax(other: LVecBase2i) → LVecBase2i
Return type

LVecBase2i

fmin(other: LVecBase2i) → LVecBase2i
Return type

LVecBase2i

almostEqual(other: LVecBase2i) → bool

Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.

almostEqual(other: LVecBase2i, threshold: int) → bool

Returns true if two vectors are memberwise equal within a specified tolerance.

output(out: ostream) → None
writeDatagramFixed(destination: Datagram) → None

Writes the vector to the Datagram using add_float32() or add_float64(), depending on the type of floats in the vector, regardless of the setting of Datagram.setStdfloatDouble(). This is appropriate when you want to write a fixed-width value to the datagram, especially when you are not writing a bam file.

readDatagramFixed(source: DatagramIterator) → None

Reads the vector from the Datagram using get_float32() or get_float64(). See writeDatagramFixed().

writeDatagram(destination: Datagram) → None

Writes the vector to the Datagram using add_stdfloat(). This is appropriate when you want to write the vector using the standard width setting, especially when you are writing a bam file.

readDatagram(source: DatagramIterator) → None

Reads the vector from the Datagram using get_stdfloat().

static getClassType() → TypeHandle
Return type

TypeHandle

property x

Getter Setter

Return type

int

property y

Getter Setter

Return type

int