Related Scripting Object: SIVector3
A 3-element vector that is represented by double precision floating point x,y,z coordinates. More...
#include <xsi_vector3.h>
Public Member Functions |
|
| __forceinline | CVector3 () |
| __forceinline | CVector3 (double in_dX, double in_dY, double in_dZ) |
| __forceinline | CVector3 (const CVector3 &in_vector3) |
| __forceinline | ~CVector3 () |
| __forceinline CVector3 & | operator= (const CVector3 &in_vector3) |
| __forceinline bool | operator== (const CVector3 &in_vector3) const |
| __forceinline bool | operator!= (const CVector3 &in_vector3) const |
| __forceinline CVector3 & | operator~ () |
| __forceinline CVector3 & | operator+= (const CVector3 &in_vector3) |
| __forceinline CVector3 & | operator-= (const CVector3 &in_vector3) |
| __forceinline CVector3 & | operator *= (const CMatrix3 &in_matrix3) |
| __forceinline CVector3 & | operator *= (const CMatrix4 &in_matrix4) |
| __forceinline CVector3 & | operator *= (const CTransformation &in_transformation) |
| __forceinline CVector3 & | operator *= (const double &in_dAlpha) |
| __forceinline double | operator[] (const short &in_sIndex) |
| __forceinline CVector3 & | MulByMatrix3InPlace (const CMatrix3 &in_matrix3) |
| __forceinline CVector3 & | MulByMatrix3 (const CVector3 &in_vector3, const CMatrix3 &in_matrix3) |
| __forceinline CVector3 & | MulByMatrix4InPlace (const CMatrix4 &in_matrix4) |
| __forceinline CVector3 & | MulByMatrix4 (const CVector3 &in_vector3, const CMatrix4 &in_matrix4) |
| __forceinline CVector3 & | MulByTransformationInPlace (const CTransformation &in_transformation) |
| CVector3 & | MulByTransformation (const CVector3 &in_vector3, const CTransformation &in_transformation) |
| __forceinline CVector3 & | PutNull () |
| __forceinline short | GetMaxComponentIndex () const |
| __forceinline double | GetMaxComponent () const |
| __forceinline short | GetMinComponentIndex () const |
| __forceinline double | GetMinComponent () const |
| __forceinline double | GetLength () const |
| __forceinline double | GetLengthSquared () const |
| CStatus | NormalizeInPlace () |
| CStatus | Normalize (const CVector3 &in_vector3) |
| __forceinline double | Dot (const CVector3 &in_vector3) const |
| __forceinline CVector3 & | Cross (const CVector3 &in_vector3A, const CVector3 &in_vector3B) |
| double | GetAngle (const CVector3 &in_vector3) const |
| __forceinline CVector3 & | LinearlyInterpolate (const CVector3 &in_vector3A, const CVector3 &in_vector3B, double in_dAlpha) |
| CVector3 & | AbsoluteInPlace () |
| CVector3 & | Absolute (const CVector3 &in_vector3) |
| CVector3 & | ClampInPlace (double in_dMinValue, double in_dMaxValue) |
| __forceinline CVector3 & | Clamp (double in_dMinValue, double in_dMaxValue, const CVector3 &in_vector3) |
| __forceinline bool | EpsilonEquals (const CVector3 &in_vector3, double in_dEpsilon) const |
| __forceinline bool | Equals (const CVector3 &in_vector3) const |
| __forceinline CVector3 & | ScaleAddInPlace (double in_dS, const CVector3 &in_vector3) |
| __forceinline CVector3 & | ScaleAdd (double in_dS, const CVector3 &in_vector3A, const CVector3 &in_vector3B) |
| __forceinline CVector3 & | ScaleInPlace (double in_dAlpha) |
| __forceinline CVector3 & | Scale (double in_dAlpha, const CVector3 &in_vector3) |
| __forceinline CVector3 & | NegateInPlace () |
| __forceinline CVector3 & | Negate (const CVector3 &in_vector3) |
| __forceinline CVector3 & | SubInPlace (const CVector3 &in_vector3) |
| __forceinline CVector3 & | Sub (const CVector3 &in_vector3A, const CVector3 &in_vector3B) |
| __forceinline CVector3 & | AddInPlace (const CVector3 &in_vector3) |
| __forceinline CVector3 & | Add (const CVector3 &in_vector3A, const CVector3 &in_vector3B) |
| void | Get (double &io_dX, double &io_dY, double &io_dZ) const |
| __forceinline CVector3 & | Set (double in_dX, double in_dY, double in_dZ) |
| __forceinline double | GetZ () const |
| __forceinline CVector3 & | PutZ (double in_dZ) |
| __forceinline double | GetY () const |
| __forceinline CVector3 & | PutY (double in_dY) |
| __forceinline double | GetX () const |
| __forceinline CVector3 & | PutX (double in_dX) |
In this API vectors are considered as row vectors as described in [Foley, J., and A. van Dam, Fundamentals of Interactive Computer Graphics, Addison-Wesley, Reading, MA, 1982]. This is important when you multiply a CVector3 by a CMatrix3 or a CMatrix4.
using namespace XSI; using namespace MATH; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube ); KinematicState globalKinematicState = myCube.GetKinematics().GetGlobal(); globalKinematicState.PutParameterValue(L"posy", 4.0); globalKinematicState.PutParameterValue(L"posx", 2.0); X3DObject myCube2; myCube.AddGeometry( L"Cube", L"MeshSurface",L"",myCube2); globalKinematicState = myCube2.GetKinematics().GetGlobal(); globalKinematicState.PutParameterValue(L"posz",3.0); globalKinematicState.PutParameterValue(L"rotx",45.0); CTransformation localTransformation = myCube.GetKinematics().GetLocal().GetTransform(); CTransformation globalTransformation = globalKinematicState.GetTransform(); CVector3 translation(localTransformation.GetTranslation()); app.LogMessage(L"The translation of the cube relative to its parent: x " + CValue(translation.GetX()).GetAsText() + L" y " + CValue(translation.GetY()).GetAsText() + L" z " + CValue(translation.GetZ()).GetAsText()); MapObjectPoseToWorldSpace( globalTransformation, localTransformation); translation = localTransformation.GetTranslation(); app.LogMessage(L"The translation of the cube relative to the origin of the universe: x " + CValue(translation.GetX()).GetAsText() + L" y " + CValue(translation.GetY()).GetAsText() + L" z " + CValue(translation.GetZ()).GetAsText());
| __forceinline CVector3 | ( | double | in_dX, | |
| double | in_dY, | |||
| double | in_dZ | |||
| ) |
Constructor.
| in_dX | Value of the x component | |
| in_dY | Value of the y component | |
| in_dZ | Value of the z component |
Copy constructor.
| in_vector3 | constant class object. |
Default destructor.
Assignment operator.
| in_vector3 | constant class object. |
Equality operator tests the strict equality of this CVector3 with the specified vector3.
| in_vector3 | Operand vector. |
Inequality operator tests the strict inequality of this CVector3 with the specified vector3.
| in_vector3 | Operand vector. |
Negates this vector (this = - this).
Adds the input vector to this one (this = this + in_vector3)
| in_vector3 | Operand vector.. |
Subtracts the input vector (in_vector3) from this one (this = this - in_vector3).
| in_vector3 | Operand vector. |
Right-multiplies this vector by the matrix m in place (this = this . m ).
| in_matrix3 | Operand matrix. |
Right-multiplies this vector by the matrix m in place (this = this . m ).
| in_matrix4 | Operand matrix. |
| __forceinline CVector3 & operator *= | ( | const CTransformation & | in_transformation | ) |
Right-multiplies this vector by the transformation t in place (this = this . t).
| in_transformation | transformation operand. |
| __forceinline CVector3 & operator *= | ( | const double & | in_dAlpha | ) |
Scales this vector by the input scalar (alpha) (this = alpha * this).
| in_dAlpha | Scalar multiplicator. |
Read-only accessors to the X,Y,Z components.
| in_sIndex | 0,1,2 for X,Y and Z values. |
Right-multiplies this vector by the matrix m in place (this = this . m ).
| in_matrix3 | Operand matrix. |
Right-multiplies the vector v by the matrix m and store the result in this vector (this = v . m ).
| in_vector3 | Operand vector | |
| in_matrix3 | Operand matrix. |
Right-multiplies this vector by the matrix m in place (this = this . m ).
| in_matrix4 | Operand matrix. |
Right-multiplies the vector v by the matrix m and store the result in this vector (this = v . m ).
| in_vector3 | Operand vector | |
| in_matrix4 | Operand matrix. |
Right-multiplies this vector by the transformation t in place (this = this . t).
| in_transformation | transformation operand. |
| CVector3& MulByTransformation | ( | const CVector3 & | in_vector3, | |
| const CTransformation & | in_transformation | |||
| ) |
Right-multiplies the vector v by the transformation t and stores the result in this vector (this = v . t ).
| in_vector3 | transformation operand. | |
| in_transformation | transformation operand. |
Sets this vector to a null vector.
Returns the index of the maximum component of this vector.
Returns the maximum component value of this vector.
Returns the index of the minimum component of this vector.
Returns the minimum component value of this vector.
Returns the length of this vector.
Returns the squared length of this vector.
Normalizes this vector in place.
Sets the value of this vector to the normalization of inputed vector.
| in_vector3 | vector operand. |
Returns the dot product of this vector and the inputed vector.
| in_vector3 | vector operand. |
Sets this vector to the vector cross product of vectors A and B.
| in_vector3A | vector operand. | |
| in_vector3B | vector operand. |
Returns the angle (in radians) between this vector and the inputed vector.
| in_vector3 | vector operand. |
| __forceinline CVector3 & LinearlyInterpolate | ( | const CVector3 & | in_vector3A, | |
| const CVector3 & | in_vector3B, | |||
| double | in_dAlpha | |||
| ) |
Linearly interpolates between vectors A and B and places the result into this vector: this = (1-alpha)*A + alpha*B.
| in_vector3A | vector operand. | |
| in_vector3B | vector operand. | |
| in_dAlpha | Scalar interpolator Possible Values: [0.0, 1.0] Domain of validity |
Sets each component of this vector3 to its absolute value.
Sets each component of the specified vector3 to its absolute value and places the modified values into this vector.
Clamps this vector3's components to the range [MinValue, MaxValue].
| in_dMinValue | Lower bound of the clamping domain. | |
| in_dMaxValue | Higher bound of the clamping domain. |
| __forceinline CVector3& Clamp | ( | double | in_dMinValue, | |
| double | in_dMaxValue, | |||
| const CVector3 & | in_vector3 | |||
| ) |
Clamps the specified vector3's components to the range [MinValue, MaxValue] and places the values into this vector3.
| in_dMinValue | Lower bound of the clamping domain. | |
| in_dMaxValue | Higher bound of the clamping domain. | |
| in_vector3 | Operand vector. |
Tests the equality of this vector3 with the specified vector3, with a tolerance of Epsilon.
| in_vector3 | Operand vector. | |
| in_dEpsilon | Error margin Possible Values: [0, +INF[ should be a positive value |
Tests the strict equality of this vector3 with the specified vector3.
| in_vector3 | Operand vector. |
Sets the value of this vector to the scalar multiplication of itself by s and then adds vector3 v. (this = s*this + v)
| in_dS | Scalar multiplicator. | |
| in_vector3 | Operand vector. |
| __forceinline CVector3 & ScaleAdd | ( | double | in_dS, | |
| const CVector3 & | in_vector3A, | |||
| const CVector3 & | in_vector3B | |||
| ) |
Sets the value of this vector3 to the scalar multiplication of vector3 A by s and then adds vector3 B. (this = s*v1 + v2).
| in_dS | Scalar multiplicator. | |
| in_vector3A | Operand vector. | |
| in_vector3B | Operand vector. |
Scales this vector by the input scalar (alpha) (this = alpha * this).
| in_dAlpha | Scalar multiplicator. |
Scales the input vector (v) by (alpha) store the result into this one (this = alpha * v).
| in_dAlpha | Scalar multiplicator. | |
| in_vector3 | Operand vector. |
Negates this vector (this = - this).
Negates the input vector (v) store the result into this one (this = - v).
| in_vector3 | Operand vector. |
Subtracts the input vector3 (v) from this one (this = this - v).
| in_vector3 | Operand vector. |
Subtracts the input vector3 (A) from the input vector3 (B) and stores the result into this one (this = A - B).
| in_vector3A | Operand vector. | |
| in_vector3B | Operand vector. |
Adds the input vector to this one (this = this + in_vector3).
| in_vector3 | Operand vector. |
Adds both input vectors and stores the result in this one. (this = A + B)
| in_vector3A | Operand vector. | |
| in_vector3B | Operand vector. |
Returns the X, Y and Z values of the vector.
| io_dX | X value to get in the vector. | |
| io_dY | Y value to get in the vector. | |
| io_dZ | Z value to get in the vector. |
Sets the X, Y and Z values of the vector.
| in_dX | X value to set in the vector. | |
| in_dY | Y value to set in the vector. | |
| in_dZ | Z value to set in the vector. |
Returns the Z value of this vector.
Sets the Z value of this vector.
| in_dZ | z value. |
Returns the Y value of this vector.
Sets the Y value of this vector.
| in_dY | y value. |
Returns the X value of this vector.
Sets the X value of this vector.
| in_dX | x value. |