46 return x * x + y * y + z *
z;
62 return Vector3D(abs(x), abs(y), abs(z));
66 const float length =
Length();
68 const float k = 1.0f / length;
69 return Vector3D(x * k, y * k, z * k);
73 const float length =
Length();
74 const float k = (length > std::max(epsilon, 0.0f)) ? (1.0f / length) : 1.0f;
75 return Vector3D(x * k, y * k, z * k);
152 return (x == rhs.
x) && (y == rhs.
y) && (z == rhs.
z);
156 return !(*
this == rhs);
163 #ifdef LIBCARLA_INCLUDED_FROM_UE4 168 Vector3D(
const FVector &v) =
delete;
169 Vector3D& operator=(
const FVector &rhs) =
delete;
173 return *
this * 1e-2f;
181 FVector ToFVector()
const {
182 return FVector{
x,
y, z};
185 #endif // LIBCARLA_INCLUDED_FROM_UE4 193 template <
typename Packer>
196 clmdep_msgpack::type::make_define_array(x, y, z).msgpack_pack(pk);
200 clmdep_msgpack::type::make_define_array(x, y, z).msgpack_unpack(o);
202 template <
typename MSGPACK_OBJECT>
203 void msgpack_object(MSGPACK_OBJECT* o, clmdep_msgpack::zone& sneaky_variable_that_shadows_z)
const 205 clmdep_msgpack::type::make_define_array(x, y, z).msgpack_object(o, sneaky_variable_that_shadows_z);
Vector3D & operator*=(float rhs)
friend Vector3D operator*(Vector3D lhs, float rhs)
void msgpack_pack(Packer &pk) const
void msgpack_unpack(clmdep_msgpack::object const &o)
Vector3D & operator/=(float rhs)
friend Vector3D operator+(Vector3D lhs, const Vector3D &rhs)
float SquaredLength() const
This file contains definitions of common data structures used in traffic manager. ...
void msgpack_object(MSGPACK_OBJECT *o, clmdep_msgpack::zone &sneaky_variable_that_shadows_z) const
bool operator!=(const Vector3D &rhs) const
Vector3D(float ix, float iy, float iz)
friend Vector3D operator*(float lhs, Vector3D rhs)
friend Vector3D operator-(Vector3D lhs, const Vector3D &rhs)
#define DEVELOPMENT_ASSERT(pred)
Vector3D & operator-=(const Vector3D &rhs)
friend Vector3D operator/(Vector3D lhs, float rhs)
bool operator==(const Vector3D &rhs) const
float SquaredLength2D() const
Vector3D MakeUnitVector() const
Vector3D & operator+=(const Vector3D &rhs)
friend Vector3D operator/(float lhs, Vector3D rhs)
Vector3D MakeSafeUnitVector(const float epsilon) const
Vector3D & operator-=(const float f)