# panda3d.core.LVector3f¶

class LVector3f

Bases: LVecBase3f

This is a three-component vector distance (as opposed to a three-component point, which represents a particular point in space). Some of the methods are slightly different between LPoint3 and LVector3; in particular, subtraction of two points yields a vector, while addition of a vector and a point yields a point.

Inheritance diagram

__init__() → None
__init__(copy: LVecBase2f, z: float) → None
__init__(copy: LVecBase3f) → None
__init__(param0: LVector3f) → None
__init__(fill_value: float) → None
__init__(x: float, y: float, z: float) → None
angleDeg(other: LVector3f) → float

Returns the angle between this vector and the other one, expressed in degrees. Both vectors should be initially normalized.

angleRad(other: LVector3f) → float

Returns the unsigned angle between this vector and the other one, expressed in radians. Both vectors should be initially normalized.

static back(cs: CoordinateSystem) → LVector3f

Returns the back vector for the given coordinate system.

Return type

LVector3f

cross(other: LVecBase3f) → LVector3f
Return type

LVector3f

static down(cs: CoordinateSystem) → LVector3f

Returns the down vector for the given coordinate system.

Return type

LVector3f

static forward(cs: CoordinateSystem) → LVector3f

Returns the forward vector for the given coordinate system.

Return type

LVector3f

static getClassType() → TypeHandle
Return type

TypeHandle

getXy() → LVector2f

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

Return type

LVector2f

getXz() → LVector2f

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

Return type

LVector2f

getYz() → LVector2f

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

Return type

LVector2f

static left(cs: CoordinateSystem) → LVector3f

Returns the left vector for the given coordinate system.

Return type

LVector3f

normalized() → LVector3f

Normalizes the vector and returns the normalized vector as a copy. If the vector was a zero-length vector, a zero length vector will be returned.

Return type

LVector3f

project(onto: LVecBase3f) → LVector3f

Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto.

Return type

LVector3f

relativeAngleDeg(other: LVector3f) → float

Deprecated: Do not use.

relativeAngleRad(other: LVector3f) → float

Deprecated: Do not use.

static rfu(right: float, fwd: float, up: float, cs: CoordinateSystem) → LVector3f

Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.

Return type

LVector3f

static right(cs: CoordinateSystem) → LVector3f

Returns the right vector for the given coordinate system.

Return type

LVector3f

signedAngleDeg(other: LVector3f, ref: LVector3f) → float

Returns the signed angle between two vectors. The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

signedAngleRad(other: LVector3f, ref: LVector3f) → float

returns the signed angle between two vectors. The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

static unitX() → LVector3f

Returns a unit X vector.

Return type

LVector3f

static unitY() → LVector3f

Returns a unit Y vector.

Return type

LVector3f

static unitZ() → LVector3f

Returns a unit Z vector.

Return type

LVector3f

static up(cs: CoordinateSystem) → LVector3f

Returns the up vector for the given coordinate system.

Return type

LVector3f

property xy

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

Return type

LVector2f

property xz

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

Return type

LVector2f

property yz

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

Return type

LVector2f

static zero() → LVector3f

Returns a zero-length vector.

Return type

LVector3f