panda3d.core.LVecBase3i

from panda3d.core import LVecBase3i
class LVecBase3i

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

Inheritance diagram

Inheritance diagram of LVecBase3i

__init__() → None
__init__(copy: LVecBase2i, z: int) → None
__init__(param0: LVecBase3i) → None
__init__(fill_value: int) → None
__init__(x: int, y: int, z: int) → None
addHash(hash: size_t) → size_t

Adds the vector into the running hash.

Return type

size_t

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
addZ(value: int) → None
almostEqual(other: LVecBase3i) → bool

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

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

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

assign(copy: LVecBase3i) → LVecBase3i
Return type

LVecBase3i

assign(fill_value: int) → LVecBase3i
Return type

LVecBase3i

compareTo(other: LVecBase3i) → int

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

componentwiseMult(other: LVecBase3i) → None
cross(other: LVecBase3i) → LVecBase3i
Return type

LVecBase3i

crossInto(other: LVecBase3i) → None
dot(other: LVecBase3i) → 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.

fmax(other: LVecBase3i) → LVecBase3i
Return type

LVecBase3i

fmin(other: LVecBase3i) → LVecBase3i
Return type

LVecBase3i

generateHash(hashgen: ChecksumHashGenerator) → None

Adds the vector to the indicated hash generator.

getCell(i: int) → int
static getClassType() → TypeHandle
Return type

TypeHandle

getData() → None

Returns the address of the first of the three data elements in the vector. The remaining elements occupy the next positions consecutively in memory.

getHash() → size_t

Returns a suitable hash for phash_map.

Return type

size_t

static getNumComponents() → int
getX() → int
getXy() → LVecBase2i

Returns a 2-component vector that shares just the first two components of this vector.

Return type

LVecBase2i

getXz() → LVecBase2i

Returns a 2-component vector that shares just the first and last components of this vector.

Return type

LVecBase2i

getY() → int
getYz() → LVecBase2i

Returns a 2-component vector that shares just the last two components of this vector.

Return type

LVecBase2i

getZ() → int
isNan() → bool

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

lengthSquared() → int

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

operatorNew(size: size_t) → None
output(out: ostream) → None
readDatagram(source: DatagramIterator) → None

Reads the vector from the Datagram using get_stdfloat().

readDatagramFixed(source: DatagramIterator) → None

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

set(x: int, y: int, z: int) → None
setCell(i: int, value: int) → None
setX(value: int) → None
setY(value: int) → None
setZ(value: int) → None
static size() → int
static unitX() → LVecBase3i

Returns a unit X vector.

Return type

LVecBase3i

static unitY() → LVecBase3i

Returns a unit Y vector.

Return type

LVecBase3i

static unitZ() → LVecBase3i

Returns a unit Z vector.

Return type

LVecBase3i

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.

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.

property x

Getter Setter

Return type

int

property xy

Returns a 2-component vector that shares just the first two components of this vector.

Return type

LVecBase2i

property xz

Returns a 2-component vector that shares just the first and last components of this vector.

Return type

LVecBase2i

property y

Getter Setter

Return type

int

property yz

Returns a 2-component vector that shares just the last two components of this vector.

Return type

LVecBase2i

property z

Getter Setter

Return type

int

static zero() → LVecBase3i

Returns a zero-length vector.

Return type

LVecBase3i