merge changes for bug-1044
commit
413d29d3ee
|
|
@ -330,6 +330,8 @@ Cron Stardust
|
|||
VWR-25120
|
||||
STORM-1075
|
||||
STORM-1919
|
||||
STORM-1920
|
||||
STORM-2017
|
||||
Cypren Christenson
|
||||
STORM-417
|
||||
Dante Tucker
|
||||
|
|
@ -679,6 +681,7 @@ Jonathan Yap
|
|||
STORM-1953
|
||||
STORM-1957
|
||||
STORM-1993
|
||||
STORM-2017
|
||||
STORM-1980
|
||||
OPEN-113
|
||||
STORM-1975
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ const F32 F_E = 2.71828182845904523536f;
|
|||
const F32 F_SQRT2 = 1.4142135623730950488016887242097f;
|
||||
const F32 F_SQRT3 = 1.73205080756888288657986402541f;
|
||||
const F32 OO_SQRT2 = 0.7071067811865475244008443621049f;
|
||||
const F32 OO_SQRT3 = 0.577350269189625764509f;
|
||||
const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
|
||||
const F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
|
||||
const F32 F_APPROXIMATELY_ZERO = 0.00001f;
|
||||
|
|
|
|||
|
|
@ -72,17 +72,22 @@ class LLVector3d
|
|||
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
|
||||
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
|
||||
|
||||
inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clearVec(); // deprecated
|
||||
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
|
||||
inline const LLVector3d& zeroVec(); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec);
|
||||
inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const LLVector3 &vec);
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 *vec); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
|
||||
|
||||
F64 magVec() const; // Returns magnitude of LLVector3d
|
||||
F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
|
||||
inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
|
||||
F64 magVec() const; // deprecated
|
||||
F64 magVecSquared() const; // deprecated
|
||||
inline F64 normVec(); // deprecated
|
||||
|
||||
F64 length() const; // Returns magnitude of LLVector3d
|
||||
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
|
||||
|
|
@ -101,25 +106,25 @@ class LLVector3d
|
|||
F64 operator[](int idx) const { return mdV[idx]; }
|
||||
F64 &operator[](int idx) { return mdV[idx]; }
|
||||
|
||||
friend LLVector3d operator+(const LLVector3d &a, const LLVector3d &b); // Return vector a + b
|
||||
friend LLVector3d operator-(const LLVector3d &a, const LLVector3d &b); // Return vector a minus b
|
||||
friend F64 operator*(const LLVector3d &a, const LLVector3d &b); // Return a dot b
|
||||
friend LLVector3d operator%(const LLVector3d &a, const LLVector3d &b); // Return a cross b
|
||||
friend LLVector3d operator*(const LLVector3d &a, const F64 k); // Return a times scaler k
|
||||
friend LLVector3d operator/(const LLVector3d &a, const F64 k); // Return a divided by scaler k
|
||||
friend LLVector3d operator*(const F64 k, const LLVector3d &a); // Return a times scaler k
|
||||
friend bool operator==(const LLVector3d &a, const LLVector3d &b); // Return a == b
|
||||
friend bool operator!=(const LLVector3d &a, const LLVector3d &b); // Return a != b
|
||||
friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b
|
||||
friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b
|
||||
friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b
|
||||
friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b
|
||||
friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k
|
||||
friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k
|
||||
friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k
|
||||
friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b
|
||||
friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b
|
||||
|
||||
friend const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b); // Return vector a + b
|
||||
friend const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b); // Return vector a minus b
|
||||
friend const LLVector3d& operator%=(LLVector3d &a, const LLVector3d &b); // Return a cross b
|
||||
friend const LLVector3d& operator*=(LLVector3d &a, const F64 k); // Return a times scaler k
|
||||
friend const LLVector3d& operator/=(LLVector3d &a, const F64 k); // Return a divided by scaler k
|
||||
friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b
|
||||
friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b
|
||||
friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b
|
||||
friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k
|
||||
friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k
|
||||
|
||||
friend LLVector3d operator-(const LLVector3d &a); // Return vector -a
|
||||
friend LLVector3d operator-(const LLVector3d& a); // Return vector -a
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& s, const LLVector3d &a); // Stream a
|
||||
friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a
|
||||
|
||||
static BOOL parseVector3d(const std::string& buf, LLVector3d* value);
|
||||
|
||||
|
|
@ -127,7 +132,15 @@ class LLVector3d
|
|||
|
||||
typedef LLVector3d LLGlobalVec;
|
||||
|
||||
const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
mdV[2] = vec.mV[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
|
|
@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
|
|||
|
||||
// Clear and Assignment Functions
|
||||
|
||||
inline const LLVector3d& LLVector3d::clear(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
mdV[1] = 0.f;
|
||||
mdV[2]= 0.f;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::clearVec(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
|
|
@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
|
|||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
mdV[VY] = y;
|
||||
mdV[VZ] = z;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
|
||||
{
|
||||
mdV[0] = vec.mdV[0];
|
||||
mdV[1] = vec.mdV[1];
|
||||
mdV[2] = vec.mdV[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 *vec)
|
||||
{
|
||||
mdV[0] = vec[0];
|
||||
mdV[1] = vec[1];
|
||||
mdV[2] = vec[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
|
|
@ -298,59 +343,59 @@ inline F64 LLVector3d::lengthSquared(void) const
|
|||
return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2];
|
||||
}
|
||||
|
||||
inline LLVector3d operator+(const LLVector3d &a, const LLVector3d &b)
|
||||
inline LLVector3d operator+(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d c(a);
|
||||
return c += b;
|
||||
}
|
||||
|
||||
inline LLVector3d operator-(const LLVector3d &a, const LLVector3d &b)
|
||||
inline LLVector3d operator-(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d c(a);
|
||||
return c -= b;
|
||||
}
|
||||
|
||||
inline F64 operator*(const LLVector3d &a, const LLVector3d &b)
|
||||
inline F64 operator*(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
return (a.mdV[0]*b.mdV[0] + a.mdV[1]*b.mdV[1] + a.mdV[2]*b.mdV[2]);
|
||||
}
|
||||
|
||||
inline LLVector3d operator%(const LLVector3d &a, const LLVector3d &b)
|
||||
inline LLVector3d operator%(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
return LLVector3d( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1] );
|
||||
}
|
||||
|
||||
inline LLVector3d operator/(const LLVector3d &a, const F64 k)
|
||||
inline LLVector3d operator/(const LLVector3d& a, const F64 k)
|
||||
{
|
||||
F64 t = 1.f / k;
|
||||
return LLVector3d( a.mdV[0] * t, a.mdV[1] * t, a.mdV[2] * t );
|
||||
}
|
||||
|
||||
inline LLVector3d operator*(const LLVector3d &a, const F64 k)
|
||||
inline LLVector3d operator*(const LLVector3d& a, const F64 k)
|
||||
{
|
||||
return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
|
||||
}
|
||||
|
||||
inline LLVector3d operator*(F64 k, const LLVector3d &a)
|
||||
inline LLVector3d operator*(F64 k, const LLVector3d& a)
|
||||
{
|
||||
return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
|
||||
}
|
||||
|
||||
inline bool operator==(const LLVector3d &a, const LLVector3d &b)
|
||||
inline bool operator==(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
return ( (a.mdV[0] == b.mdV[0])
|
||||
&&(a.mdV[1] == b.mdV[1])
|
||||
&&(a.mdV[2] == b.mdV[2]));
|
||||
}
|
||||
|
||||
inline bool operator!=(const LLVector3d &a, const LLVector3d &b)
|
||||
inline bool operator!=(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
return ( (a.mdV[0] != b.mdV[0])
|
||||
||(a.mdV[1] != b.mdV[1])
|
||||
||(a.mdV[2] != b.mdV[2]));
|
||||
}
|
||||
|
||||
inline const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b)
|
||||
inline const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
a.mdV[0] += b.mdV[0];
|
||||
a.mdV[1] += b.mdV[1];
|
||||
|
|
@ -358,7 +403,7 @@ inline const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b)
|
|||
return a;
|
||||
}
|
||||
|
||||
inline const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b)
|
||||
inline const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
a.mdV[0] -= b.mdV[0];
|
||||
a.mdV[1] -= b.mdV[1];
|
||||
|
|
@ -366,14 +411,14 @@ inline const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b)
|
|||
return a;
|
||||
}
|
||||
|
||||
inline const LLVector3d& operator%=(LLVector3d &a, const LLVector3d &b)
|
||||
inline const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d ret( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1]);
|
||||
a = ret;
|
||||
return a;
|
||||
}
|
||||
|
||||
inline const LLVector3d& operator*=(LLVector3d &a, const F64 k)
|
||||
inline const LLVector3d& operator*=(LLVector3d& a, const F64 k)
|
||||
{
|
||||
a.mdV[0] *= k;
|
||||
a.mdV[1] *= k;
|
||||
|
|
@ -381,7 +426,7 @@ inline const LLVector3d& operator*=(LLVector3d &a, const F64 k)
|
|||
return a;
|
||||
}
|
||||
|
||||
inline const LLVector3d& operator/=(LLVector3d &a, const F64 k)
|
||||
inline const LLVector3d& operator/=(LLVector3d& a, const F64 k)
|
||||
{
|
||||
F64 t = 1.f / k;
|
||||
a.mdV[0] *= t;
|
||||
|
|
@ -390,12 +435,12 @@ inline const LLVector3d& operator/=(LLVector3d &a, const F64 k)
|
|||
return a;
|
||||
}
|
||||
|
||||
inline LLVector3d operator-(const LLVector3d &a)
|
||||
inline LLVector3d operator-(const LLVector3d& a)
|
||||
{
|
||||
return LLVector3d( -a.mdV[0], -a.mdV[1], -a.mdV[2] );
|
||||
}
|
||||
|
||||
inline F64 dist_vec(const LLVector3d &a, const LLVector3d &b)
|
||||
inline F64 dist_vec(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
F64 x = a.mdV[0] - b.mdV[0];
|
||||
F64 y = a.mdV[1] - b.mdV[1];
|
||||
|
|
@ -403,7 +448,7 @@ inline F64 dist_vec(const LLVector3d &a, const LLVector3d &b)
|
|||
return (F32) sqrt( x*x + y*y + z*z );
|
||||
}
|
||||
|
||||
inline F64 dist_vec_squared(const LLVector3d &a, const LLVector3d &b)
|
||||
inline F64 dist_vec_squared(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
F64 x = a.mdV[0] - b.mdV[0];
|
||||
F64 y = a.mdV[1] - b.mdV[1];
|
||||
|
|
@ -411,14 +456,14 @@ inline F64 dist_vec_squared(const LLVector3d &a, const LLVector3d &b)
|
|||
return x*x + y*y + z*z;
|
||||
}
|
||||
|
||||
inline F64 dist_vec_squared2D(const LLVector3d &a, const LLVector3d &b)
|
||||
inline F64 dist_vec_squared2D(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
F64 x = a.mdV[0] - b.mdV[0];
|
||||
F64 y = a.mdV[1] - b.mdV[1];
|
||||
return x*x + y*y;
|
||||
}
|
||||
|
||||
inline LLVector3d lerp(const LLVector3d &a, const LLVector3d &b, const F64 u)
|
||||
inline LLVector3d lerp(const LLVector3d& a, const LLVector3d& b, const F64 u)
|
||||
{
|
||||
return LLVector3d(
|
||||
a.mdV[VX] + (b.mdV[VX] - a.mdV[VX]) * u,
|
||||
|
|
@ -450,7 +495,7 @@ inline F64 angle_between(const LLVector3d& a, const LLVector3d& b)
|
|||
return angle;
|
||||
}
|
||||
|
||||
inline BOOL are_parallel(const LLVector3d &a, const LLVector3d &b, const F64 epsilon)
|
||||
inline BOOL are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 epsilon)
|
||||
{
|
||||
LLVector3d an = a;
|
||||
LLVector3d bn = b;
|
||||
|
|
@ -465,11 +510,22 @@ inline BOOL are_parallel(const LLVector3d &a, const LLVector3d &b, const F64 eps
|
|||
|
||||
}
|
||||
|
||||
inline LLVector3d projected_vec(const LLVector3d &a, const LLVector3d &b)
|
||||
inline LLVector3d projected_vec(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d project_axis = b;
|
||||
project_axis.normalize();
|
||||
return project_axis * (a * project_axis);
|
||||
}
|
||||
|
||||
inline LLVector3d inverse_projected_vec(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3d normalized_b = b;
|
||||
F64 b_length = normalized_b.normalize();
|
||||
|
||||
F64 dot_product = normalized_a * normalized_b;
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
#endif // LL_V3DMATH_H
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
|
|||
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
|
||||
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
|
||||
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
|
||||
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
|
||||
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
|
||||
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
|
||||
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
|
||||
|
|
@ -495,6 +496,18 @@ inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
|
|||
return project_axis * (a * project_axis);
|
||||
}
|
||||
|
||||
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
|
||||
{
|
||||
LLVector3 normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3 normalized_b = b;
|
||||
F32 b_length = normalized_b.normalize();
|
||||
|
||||
F32 dot_product = normalized_a * normalized_b;
|
||||
//NB: if a _|_ b, then returns an infinite vector
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
|
||||
{
|
||||
return projected_vec(a, b);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
#include "llglheaders.h"
|
||||
#include "lltrans.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llhudrender.h"
|
||||
|
||||
const F32 RADIUS_PIXELS = 100.f; // size in screen space
|
||||
const F32 SQ_RADIUS = RADIUS_PIXELS * RADIUS_PIXELS;
|
||||
|
|
@ -452,6 +453,9 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
|
|||
// Route future Mouse messages here preemptively. (Release on mouse up.)
|
||||
setMouseCapture( TRUE );
|
||||
LLSelectMgr::getInstance()->enableSilhouette(FALSE);
|
||||
|
||||
mHelpTextTimer.reset();
|
||||
sNumTimesHelpTextShown++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1111,6 +1115,31 @@ void LLManipRotate::renderSnapGuides()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// render help text
|
||||
if (mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
|
||||
{
|
||||
if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText)
|
||||
{
|
||||
LLVector3 selection_center_start = LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent();
|
||||
|
||||
LLVector3 offset_dir = LLViewerCamera::getInstance()->getUpAxis();
|
||||
|
||||
F32 line_alpha = gSavedSettings.getF32("GridOpacity");
|
||||
|
||||
LLVector3 help_text_pos = selection_center_start + (mRadiusMeters * 3.f * offset_dir);
|
||||
const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
|
||||
|
||||
std::string help_text = LLTrans::getString("manip_hint1");
|
||||
LLColor4 help_text_color = LLColor4::white;
|
||||
help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
|
||||
help_text = LLTrans::getString("manip_hint2");
|
||||
help_text_pos -= offset_dir * mRadiusMeters * 0.4f;
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns TRUE if center of sphere is visible. Also sets a bunch of member variables that are used later (e.g. mCenterToCam)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -51,6 +51,13 @@ typedef enum e_scale_manipulator_type
|
|||
SCALE_MANIP_FACE
|
||||
} EScaleManipulatorType;
|
||||
|
||||
typedef enum e_snap_regimes
|
||||
{
|
||||
SNAP_REGIME_NONE = 0, //!< The cursor is not in either of the snap regimes.
|
||||
SNAP_REGIME_UPPER = 0x1, //!< The cursor is, non-exclusively, in the first of the snap regimes. Prefer to treat as bitmask.
|
||||
SNAP_REGIME_LOWER = 0x2 //!< The cursor is, non-exclusively, in the second of the snap regimes. Prefer to treat as bitmask.
|
||||
} ESnapRegimes;
|
||||
|
||||
|
||||
class LLManipScale : public LLManip
|
||||
{
|
||||
|
|
@ -96,7 +103,7 @@ private:
|
|||
void renderSnapGuides( const LLBBox& local_bbox );
|
||||
|
||||
void revert();
|
||||
|
||||
|
||||
inline void conditionalHighlight( U32 part, const LLColor4* highlight = NULL, const LLColor4* normal = NULL );
|
||||
|
||||
void drag( S32 x, S32 y );
|
||||
|
|
@ -135,33 +142,35 @@ private:
|
|||
};
|
||||
|
||||
|
||||
F32 mBoxHandleSize; // The size of the handles at the corners of the bounding box
|
||||
F32 mScaledBoxHandleSize; // handle size after scaling for selection feedback
|
||||
F32 mBoxHandleSize; //!< The size of the handles at the corners of the bounding box.
|
||||
F32 mScaledBoxHandleSize; //!< Handle size after scaling for selection feedback.
|
||||
LLVector3d mDragStartPointGlobal;
|
||||
LLVector3d mDragStartCenterGlobal; // The center of the bounding box of all selected objects at time of drag start
|
||||
LLVector3d mDragStartCenterGlobal; //!< The center of the bounding box of all selected objects at time of drag start.
|
||||
LLVector3d mDragPointGlobal;
|
||||
LLVector3d mDragFarHitGlobal;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
BOOL mSendUpdateOnMouseUp;
|
||||
U32 mLastUpdateFlags;
|
||||
typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
|
||||
minpulator_list_t mProjectedManipulators;
|
||||
typedef std::set<ManipulatorHandle*, compare_manipulators> manipulator_list_t;
|
||||
manipulator_list_t mProjectedManipulators;
|
||||
LLVector4 mManipulatorVertices[14];
|
||||
F32 mScaleSnapUnit1; // size of snap multiples for axis 1
|
||||
F32 mScaleSnapUnit2; // size of snap multiples for axis 2
|
||||
LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera
|
||||
LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera
|
||||
LLVector3 mSnapGuideDir1;
|
||||
LLVector3 mSnapGuideDir2;
|
||||
LLVector3 mSnapDir1;
|
||||
LLVector3 mSnapDir2;
|
||||
F32 mSnapRegimeOffset;
|
||||
F32 mScaleSnapUnit1; //!< Size of snap multiples for the upper scale.
|
||||
F32 mScaleSnapUnit2; //!< Size of snap multiples for the lower scale.
|
||||
LLVector3 mScalePlaneNormal1; //!< Normal of plane in which scale occurs that most faces camera.
|
||||
LLVector3 mScalePlaneNormal2; //!< Normal of plane in which scale occurs that most faces camera.
|
||||
LLVector3 mSnapGuideDir1; //!< The direction in which the upper snap guide tick marks face.
|
||||
LLVector3 mSnapGuideDir2; //!< The direction in which the lower snap guide tick marks face.
|
||||
LLVector3 mSnapDir1; //!< The direction in which the upper snap guides face.
|
||||
LLVector3 mSnapDir2; //!< The direction in which the lower snap guides face.
|
||||
F32 mSnapRegimeOffset; //!< How far off the scale axis centerline the mouse can be before it exits/enters the snap regime.
|
||||
F32 mTickPixelSpacing1; //!< The pixel spacing between snap guide tick marks for the upper scale.
|
||||
F32 mTickPixelSpacing2; //!< The pixel spacing between snap guide tick marks for the lower scale.
|
||||
F32 mSnapGuideLength;
|
||||
LLVector3 mScaleCenter;
|
||||
LLVector3 mScaleDir;
|
||||
F32 mScaleSnapValue;
|
||||
BOOL mInSnapRegime;
|
||||
LLVector3 mScaleCenter; //!< The location of the origin of the scaling operation.
|
||||
LLVector3 mScaleDir; //!< The direction of the scaling action. In face-dragging this is aligned with one of the cardinal axis relative to the prim, but in corner-dragging this is along the diagonal.
|
||||
F32 mScaleSnappedValue; //!< The distance of the current position nearest the mouse location, measured along mScaleDir. Is measured either from the center or from the far face/corner depending upon whether uniform scaling is true or false respectively.
|
||||
ESnapRegimes mSnapRegime; //<! Which, if any, snap regime the cursor is currently residing in.
|
||||
F32* mManipulatorScales;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
#include "llui.h"
|
||||
#include "pipeline.h"
|
||||
#include "llviewershadermgr.h"
|
||||
#include "lltrans.h"
|
||||
|
||||
const S32 NUM_AXES = 3;
|
||||
const S32 MOUSE_DRAG_SLOP = 2; // pixels
|
||||
|
|
@ -111,7 +112,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
|
|||
: LLManip( std::string("Move"), composite ),
|
||||
mLastHoverMouseX(-1),
|
||||
mLastHoverMouseY(-1),
|
||||
mSendUpdateOnMouseUp(FALSE),
|
||||
mMouseOutsideSlop(FALSE),
|
||||
mCopyMadeThisDrag(FALSE),
|
||||
mMouseDownX(-1),
|
||||
|
|
@ -125,7 +125,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
|
|||
mSnapOffsetMeters(0.f),
|
||||
mSubdivisions(10.f),
|
||||
mInSnapRegime(FALSE),
|
||||
mSnapped(FALSE),
|
||||
mArrowScales(1.f, 1.f, 1.f),
|
||||
mPlaneScales(1.f, 1.f, 1.f),
|
||||
mPlaneManipPositions(1.f, 1.f, 1.f, 1.f)
|
||||
|
|
@ -1441,13 +1440,13 @@ void LLManipTranslate::renderSnapGuides()
|
|||
LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis);
|
||||
const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
|
||||
|
||||
std::string help_text = "Move mouse cursor over ruler";
|
||||
std::string help_text = LLTrans::getString("manip_hint1");
|
||||
LLColor4 help_text_color = LLColor4::white;
|
||||
help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
|
||||
help_text = "to snap to grid";
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
|
||||
help_text = LLTrans::getString("manip_hint2");
|
||||
help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapOffsetMeters * 0.2f;
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
|
||||
hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ protected:
|
|||
private:
|
||||
S32 mLastHoverMouseX;
|
||||
S32 mLastHoverMouseY;
|
||||
BOOL mSendUpdateOnMouseUp;
|
||||
BOOL mMouseOutsideSlop; // true after mouse goes outside slop region
|
||||
BOOL mCopyMadeThisDrag;
|
||||
S32 mMouseDownX;
|
||||
|
|
@ -107,7 +106,6 @@ private:
|
|||
LLVector3 mGridScale;
|
||||
F32 mSubdivisions;
|
||||
BOOL mInSnapRegime;
|
||||
BOOL mSnapped;
|
||||
LLVector3 mArrowScales;
|
||||
LLVector3 mPlaneScales;
|
||||
LLVector4 mPlaneManipPositions;
|
||||
|
|
|
|||
|
|
@ -383,6 +383,8 @@ Please try logging in again in a minute.</string>
|
|||
<string name="multiple_textures">Multiple</string>
|
||||
|
||||
<string name="use_texture">Use texture</string>
|
||||
<string name="manip_hint1">Move mouse cursor over ruler</string>
|
||||
<string name="manip_hint2">to snap to grid</string>
|
||||
|
||||
<!-- world map -->
|
||||
<string name="texture_loading">Loading...</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue