// Filename: lvector4.h // Created by: drose (08Mar00) // //////////////////////////////////////////////////////////////////// #ifndef LVECTOR4_H #define LVECTOR4_H #include #include "lvecBase4.h" //////////////////////////////////////////////////////////////////// // Class : LVector4 // Description : This is a four-component vector distance. //////////////////////////////////////////////////////////////////// template class LVector4 : public LVecBase4 { public: INLINE LVector4(); INLINE LVector4(const LVecBase4 ©); INLINE LVector4 &operator = (const LVecBase4 ©); INLINE LVector4 &operator = (NumType fill_value); INLINE LVector4(NumType fill_value); INLINE LVector4(NumType x, NumType y, NumType z, NumType w); INLINE static LVector4 zero(); INLINE static LVector4 unit_x(); INLINE static LVector4 unit_y(); INLINE static LVector4 unit_z(); INLINE static LVector4 unit_w(); INLINE LVector4 operator - () const; INLINE LVecBase4 operator + (const LVecBase4 &other) const; INLINE LVector4 operator + (const LVector4 &other) const; INLINE LVecBase4 operator - (const LVecBase4 &other) const; INLINE LVector4 operator - (const LVector4 &other) const; INLINE NumType length() const; INLINE NumType length_squared() const; INLINE bool normalize(); INLINE LVector4 operator * (NumType scalar) const; INLINE LVector4 operator / (NumType scalar) const; public: static TypeHandle get_class_type() { return _type_handle; } static void init_type(); private: static TypeHandle _type_handle; }; template INLINE LVector4 lcast_to(NumType2 *type, const LVector4 &source); #include "lvector4.I" EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, LVector4) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, LVector4) #endif