Class ScaleValue
See Also: Class Point3, Class Quat.
class ScaleValue
Description:
A ScaleValue describes an arbitrary non-uniform scaling in an arbitrary axis system. The Point3 s gives the scaling along the x, y, and z axes, and the quaternion q defines the axis system in which scaling is to be applied. All methods are implemented by the system.
Data Members:
public:
Point3 s;
Scale components.
Quat q;
The axis system of application.
Methods:
Prototype:
ScaleValue()
Remarks:
Constructor. No initialization is performed.
Prototype:
ScaleValue(const Point3& as)
Remarks:
Constructor. The scale data member is initialized to as. The quaternion data member is set to the identity.
Prototype:
ScaleValue(const Point3& as, const Quat& aq)
Remarks:
Constructor. The scale data member is initialized to as. The quaternion data member is set to aq.
Operators:
Prototype:
ScaleValue& operator+=(const ScaleValue& s)
Remarks:
Adds a ScaleValue to this ScaleValue.
Prototype:
ScaleValue& operator*=(const float s)
Remarks:
Multiplies this ScaleValue by a float. This updates the scale components.
Prototype:
float& operator[](int el)
Remarks:
Array access operator. This allows the scale components to be accessed using the array operator.
Parameters:
int el
Specifies the element to access: 0=x, 1=y, 2=z.
The following operators are not part of the ScaleValue class but are available for use:
Prototype:
ScaleValue operator+(const ScaleValue& s0, const ScaleValue& s1);
Remarks:
Returns the sum of two ScaleValues. This still multiplies since scale values are multiplicative not additive.
Prototype:
ScaleValue operator-(const ScaleValue& s0, const ScaleValue& s1);
Remarks:
Returns the difference of two ScaleValues.
Prototype:
ScaleValue operator*(const ScaleValue& s, float f);
Remarks:
Multiplication of a ScaleValue and a float.
Prototype:
ScaleValue operator*(float f, const ScaleValue& s);
Remarks:
Multiplication of a ScaleValue and a float.
Prototype:
ScaleValue operator+(const ScaleValue& s, float f);
Remarks:
Returns the sum of a ScaleValue and a float. This adds f to s.x, s.y, and s.z.
Prototype:
ScaleValue operator+(float f, const ScaleValue& s);
Remarks:
Returns the sum of a ScaleValue and a float.