Panda3D
|
This is a three-component vector distance (as opposed to a three-component point, which represents a particular point in space). More...
#include "lvector3.h"
Public Member Functions | |
LVector3f (const LVecBase3f ©) | |
LVector3f (float fill_value) | |
LVector3f (float x, float y, float z) | |
float | angle_deg (const LVector3f &other) const |
Returns the angle between this vector and the other one, expressed in degrees. | |
float | angle_rad (const LVector3f &other) const |
Returns the unsigned angle between this vector and the other one, expressed in radians. | |
LVector3f | cross (const LVecBase3f &other) const |
LVector2f | get_xy () const |
Returns a 2-component vector that shares just the first two components of this vector. | |
LVector2f | get_xz () const |
Returns a 2-component vector that shares just the first and last components of this vector. | |
LVector2f | get_yz () const |
Returns a 2-component vector that shares just the last two components of this vector. | |
LVector3f | operator* (float scalar) const |
LVecBase3f | operator+ (const LVecBase3f &other) const |
LVector3f | operator+ (const LVector3f &other) const |
LVector3f | operator- () const |
LVecBase3f | operator- (const LVecBase3f &other) const |
LVector3f | operator- (const LVector3f &other) const |
LVector3f | operator/ (float scalar) const |
LVector3f & | operator= (float fill_value) |
LVector3f & | operator= (const LVecBase3f ©) |
LVector3f | project (const LVecBase3f &onto) const |
Returns a new vector representing the projection of this vector onto another one. | |
float | relative_angle_deg (const LVector3f &other) const |
This method is deprecated. | |
float | relative_angle_rad (const LVector3f &other) const |
This method is deprecated. | |
float | signed_angle_deg (const LVector3f &other, const LVector3f &ref) const |
Returns the signed angle between two vectors. | |
float | signed_angle_rad (const LVector3f &other, const LVector3f &ref) const |
returns the signed angle between two vectors. | |
Static Public Member Functions | |
static LVector3f | back (CoordinateSystem cs=CS_default) |
Returns the back vector for the given coordinate system. | |
static LVector3f | down (CoordinateSystem cs=CS_default) |
Returns the down vector for the given coordinate system. | |
static LVector3f | forward (CoordinateSystem cs=CS_default) |
Returns the forward vector for the given coordinate system. | |
static TypeHandle | get_class_type () |
static void | init_type () |
static LVector3f | left (CoordinateSystem cs=CS_default) |
Returns the left vector for the given coordinate system. | |
static LVector3f | rfu (float right, float fwd, float up, CoordinateSystem cs=CS_default) |
Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector. | |
static LVector3f | right (CoordinateSystem cs=CS_default) |
Returns the right vector for the given coordinate system. | |
static const LVector3f & | unit_x () |
Returns a unit X vector. | |
static const LVector3f & | unit_y () |
Returns a unit Y vector. | |
static const LVector3f & | unit_z () |
Returns a unit Z vector. | |
static LVector3f | up (CoordinateSystem cs=CS_default) |
Returns the up vector for the given coordinate system. | |
static const LVector3f & | zero () |
Returns a zero-length vector. |
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.
Definition at line 94 of file lvector3.h.
float LVector3f::angle_deg | ( | const LVector3f & | other | ) | const [inline] |
Returns the angle between this vector and the other one, expressed in degrees.
Both vectors should be initially normalized.
Definition at line 420 of file lvector3.h.
Referenced by GeoMipTerrain::make_slope_image().
float LVector3f::angle_rad | ( | const LVector3f & | other | ) | const [inline] |
Returns the unsigned angle between this vector and the other one, expressed in radians.
Both vectors should be initially normalized.
Definition at line 400 of file lvector3.h.
LVector3f LVector3f::back | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the back vector for the given coordinate system.
Definition at line 601 of file lvector3.h.
Referenced by WindowFramework::load_default_model().
LVector3f LVector3f::down | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the down vector for the given coordinate system.
Definition at line 579 of file lvector3.h.
LVector3f LVector3f::forward | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the forward vector for the given coordinate system.
Definition at line 548 of file lvector3.h.
Referenced by Fog::adjust_to_camera(), WindowFramework::center_trackball(), Lens::compute_view_vector(), NodePath::do_billboard_point_eye(), ObstacleAvoidance::do_obstacle_avoidance(), Wander::do_wander(), Lens::extrude_vec_impl(), ObstacleAvoidance::obstacle_detection(), PortalClipper::prepare_portal(), CollisionSegment::set_from_lens(), CollisionRay::set_from_lens(), Fog::set_linear_range(), and WindowFramework::setup_trackball().
LVector2f LVector3f::get_xy | ( | ) | const [inline] |
Returns a 2-component vector that shares just the first two components of this vector.
Reimplemented from LVecBase3f.
Definition at line 294 of file lvector3.h.
LVector2f LVector3f::get_xz | ( | ) | const [inline] |
Returns a 2-component vector that shares just the first and last components of this vector.
Reimplemented from LVecBase3f.
Definition at line 305 of file lvector3.h.
LVector2f LVector3f::get_yz | ( | ) | const [inline] |
Returns a 2-component vector that shares just the last two components of this vector.
Reimplemented from LVecBase3f.
Definition at line 316 of file lvector3.h.
LVector3f LVector3f::left | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the left vector for the given coordinate system.
Definition at line 590 of file lvector3.h.
Referenced by PerspectiveLens::compute_projection_mat().
LVector3f LVector3f::project | ( | const LVecBase3f & | onto | ) | const [inline] |
Returns a new vector representing the projection of this vector onto another one.
The resulting vector will be a scalar multiple of onto.
Reimplemented from LVecBase3f.
Definition at line 388 of file lvector3.h.
float LVector3f::relative_angle_deg | ( | const LVector3f & | other | ) | const [inline] |
float LVector3f::relative_angle_rad | ( | const LVector3f & | other | ) | const [inline] |
LVector3f LVector3f::rfu | ( | float | right, |
float | fwd, | ||
float | up, | ||
CoordinateSystem | cs = CS_default |
||
) | [inline, static] |
Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.
Definition at line 615 of file lvector3.h.
Referenced by PGItem::mouse_to_local(), PGSliderBar::recompute(), PGSliderBar::remanage(), PGScrollFrame::setup(), PGSliderBar::setup_scroll_bar(), and PGSliderBar::setup_slider().
LVector3f LVector3f::right | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the right vector for the given coordinate system.
Definition at line 537 of file lvector3.h.
Referenced by TextPropertiesManager::set_graphic().
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.
Definition at line 457 of file lvector3.h.
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.
Definition at line 436 of file lvector3.h.
const LVector3f & LVector3f::unit_x | ( | ) | [inline, static] |
const LVector3f & LVector3f::unit_y | ( | ) | [inline, static] |
const LVector3f & LVector3f::unit_z | ( | ) | [inline, static] |
LVector3f LVector3f::up | ( | CoordinateSystem | cs = CS_default | ) | [inline, static] |
Returns the up vector for the given coordinate system.
Definition at line 510 of file lvector3.h.
Referenced by Lens::compute_view_vector(), NodePath::do_billboard_axis(), NodePath::do_billboard_point_eye(), NodePath::do_billboard_point_world(), CollisionHandlerFluidPusher::handle_entries(), GeoMipTerrain::make_slope_image(), NodePath::set_billboard_axis(), NodePath::set_billboard_point_eye(), NodePath::set_billboard_point_world(), Lens::set_frustum_from_corners(), and TextPropertiesManager::set_graphic().
const LVector3f & LVector3f::zero | ( | ) | [inline, static] |
Returns a zero-length vector.
Reimplemented from LVecBase3f.
Definition at line 253 of file lvector3.h.
Referenced by ActorNode::ActorNode(), PhysicsCollisionHandler::apply_friction(), PhysicsCollisionHandler::apply_net_shove(), PhysxUtilLib::compute_box_world_edge_normal(), CollisionEntry::get_all(), CollisionEntry::get_all_contact_info(), PhysxActor::get_angular_momentum(), PhysxActor::get_angular_velocity(), CollisionEntry::get_contact_normal(), PhysxBoxShape::get_dimensions(), PhysxBoxForceFieldShape::get_dimensions(), PhysxMaterial::get_dir_of_anisotropy(), CollisionSolid::get_effective_normal(), PhysxBoxController::get_extents(), PhysxCloth::get_external_acceleration(), PhysxJoint::get_global_axis(), PhysxScene::get_gravity(), PhysxActor::get_linear_momentum(), PhysxActor::get_linear_velocity(), PhysxActor::get_local_point_velocity(), PhysxActor::get_mass_space_inertia_tensor(), PhysxActor::get_point_velocity(), CollisionEntry::get_surface_normal(), PhysxCloth::get_wind_acceleration(), CollisionLevelStateBase::prepare_collider(), and CConstrainPosInterval::priv_step().