HDK
|
Compute an instance transform given a set of attributes. More...
#include <GA_AttributeInstanceMatrix.h>
Static Public Attributes | |
static constexpr int | theNumAttribs = 10 |
static constexpr GA_DataId | theAttribNotPresentDataId = GA_DataId(-2) |
Compute an instance transform given a set of attributes.
Given a normal (or velocity) attribute, along with attributes for the up vector, a translation offset, a uniform scale, a 3-tuple scale, a rotation quaternion and an orientation quaternion, compute a 4x4 transform matrix for a given position.
This transform is the same as the one generated by the copy SOP or by SOHO instancing.
Definition at line 40 of file GA_AttributeInstanceMatrix.h.
|
inline |
Default c-tor.
Definition at line 44 of file GA_AttributeInstanceMatrix.h.
|
inline |
Construct given the explicit attributes
All attributes must be bound to the same owner (GA_AttributeOwner). The offset passed into getMatrix()
determines which element is used to build the matrix. The owner does not have to be GA_ATTRIB_POINT, though that is the most common case.
Definition at line 54 of file GA_AttributeInstanceMatrix.h.
|
inline |
Definition at line 82 of file GA_AttributeInstanceMatrix.h.
|
inline |
Definition at line 89 of file GA_AttributeInstanceMatrix.h.
|
inline |
Definition at line 95 of file GA_AttributeInstanceMatrix.h.
Get all data IDs of attributes used by this class. This uses a value of theAttribNotPresentDataId for attributes that aren't present.
void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_Matrix4 & | xform, |
const UT_Vector3 & | P, | ||
GA_Offset | offset, | ||
float | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
) and an attribute element for which the GA_ROHandle objects are valid.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_Matrix4D & | xform, |
const UT_Vector3D & | P, | ||
GA_Offset | offset, | ||
fpreal | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
) and an attribute element for which the GA_ROHandle objects are valid.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_Matrix3 & | xform, |
GA_Offset | offset | ||
) | const |
void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_DMatrix3 & | xform, |
GA_Offset | offset | ||
) | const |
void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_Matrix4 & | xform, |
const UT_Vector3 & | P, | ||
const UT_Quaternion & | orient, | ||
GA_Offset | offset, | ||
float | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
), an orientaiton (orient
), and an attribute element for which the GA_ROHandle objects are valid.
The provided orientation will be used instead of any rotation attributes on the geometry, but the translation and pivot attributes will still be used.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getInverseMatrix | ( | UT_Matrix4D & | xform, |
const UT_Vector3D & | P, | ||
const UT_QuaternionD & | orient, | ||
GA_Offset | offset, | ||
fpreal | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
), an orientaiton (orient
), and an attribute element for which the GA_ROHandle objects are valid.
The provided orientation will be used instead of any rotation attributes on the geometry, but the translation and pivot attributes will still be used.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getMatrix | ( | UT_Matrix4 & | xform, |
const UT_Vector3 & | P, | ||
GA_Offset | offset, | ||
float | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
) and an attribute element for which the GA_ROHandle objects are valid.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getMatrix | ( | UT_Matrix4D & | xform, |
const UT_Vector3D & | P, | ||
GA_Offset | offset, | ||
fpreal | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
) and an attribute element for which the GA_ROHandle objects are valid.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getMatrix | ( | UT_Matrix3 & | xform, |
GA_Offset | offset | ||
) | const |
Create a 3x3 transform matrix ignoring translate components Will include scale if still present!
void GA_AttributeInstanceMatrix::getMatrix | ( | UT_DMatrix3 & | xform, |
GA_Offset | offset | ||
) | const |
void GA_AttributeInstanceMatrix::getMatrix | ( | UT_Matrix4 & | xform, |
const UT_Vector3 & | P, | ||
const UT_Quaternion & | orient, | ||
GA_Offset | offset, | ||
float | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
), an orientaiton (orient
), and an attribute element for which the GA_ROHandle objects are valid.
The provided orientation will be used instead of any rotation attributes on the geometry, but the translation and pivot attributes will still be used.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes. void GA_AttributeInstanceMatrix::getMatrix | ( | UT_Matrix4D & | xform, |
const UT_Vector3D & | P, | ||
const UT_QuaternionD & | orient, | ||
GA_Offset | offset, | ||
fpreal | default_pscale = 1 |
||
) | const |
Create a 4x4 transform matrix given a position (P
), an orientaiton (orient
), and an attribute element for which the GA_ROHandle objects are valid.
The provided orientation will be used instead of any rotation attributes on the geometry, but the translation and pivot attributes will still be used.
If the "pscale" attribute is invalid, the default_pscale
will be used.
P
) is passed in since the attribute handles may not be bound to point attributes.
|
inline |
Accessors
Definition at line 217 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 223 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 224 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 220 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 221 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 227 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 222 of file GA_AttributeInstanceMatrix.h.
UT_Vector3D GA_AttributeInstanceMatrix::getScales | ( | GA_Offset | offset | ) | const |
Returns just the product of myPscale and myPscale3.
|
inline |
Accessors
Definition at line 219 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 218 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 225 of file GA_AttributeInstanceMatrix.h.
|
inline |
Accessors
Definition at line 226 of file GA_AttributeInstanceMatrix.h.
bool GA_AttributeInstanceMatrix::hasAnyAttribs | ( | ) | const |
Returns true if there are any attributes bound.
bool GA_AttributeInstanceMatrix::hasNonScales | ( | ) | const |
Returns true if there are any attributes bound to anything other than myPscale or myPscale3
bool GA_AttributeInstanceMatrix::hasScales | ( | ) | const |
Returns true if myPscale or myPscale3 is bound.
void GA_AttributeInstanceMatrix::initialize | ( | const GA_AttributeDict & | dict, |
const UT_StringRef & | N_name = GA_Names::N , |
||
const UT_StringRef & | v_name = GA_Names::v |
||
) |
Initialize attribute lookups based on an attribute dictionary This method scans for:
N_name
defines the name of the attribute to look up to determine orientation. If there is no attribute of the given name, then an attribute named v_name
will be searched for. void GA_AttributeInstanceMatrix::initialize | ( | const GA_AttributeDict & | dict, |
const GA_Attribute * | N | ||
) |
Initialize with a provided, possilby detached N.
|
inline |
Make invalid.
Definition at line 126 of file GA_AttributeInstanceMatrix.h.
void GA_AttributeInstanceMatrix::reset | ( | ) |
Clear out any attribute handles.
void GA_AttributeInstanceMatrix::resetScales | ( | ) |
Resets only the scale attributes.
|
inline |
Overrides the N attribute with the specified attribute.
Definition at line 231 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleV3D GA_AttributeInstanceMatrix::myN |
Definition at line 253 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleQD GA_AttributeInstanceMatrix::myOrient |
Definition at line 259 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleV3D GA_AttributeInstanceMatrix::myPivot |
Definition at line 260 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleD GA_AttributeInstanceMatrix::myPscale |
Definition at line 256 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleV3D GA_AttributeInstanceMatrix::myPscale3 |
Definition at line 257 of file GA_AttributeInstanceMatrix.h.
bool GA_AttributeInstanceMatrix::myRemoveScales |
Definition at line 263 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleQD GA_AttributeInstanceMatrix::myRot |
Definition at line 258 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleV3D GA_AttributeInstanceMatrix::myTrans |
Definition at line 255 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleV3D GA_AttributeInstanceMatrix::myUp |
Definition at line 254 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleM3D GA_AttributeInstanceMatrix::myXform3 |
Definition at line 261 of file GA_AttributeInstanceMatrix.h.
GA_ROHandleM4D GA_AttributeInstanceMatrix::myXform4 |
Definition at line 262 of file GA_AttributeInstanceMatrix.h.
This uses GA_DataId(-2) to indicate an attribute not being present, to distinguish it from GA_DataId(-1), which is usually considered unequal even to itself.
Definition at line 242 of file GA_AttributeInstanceMatrix.h.
|
static |
The number of attributes cached for use with transforms by this class. If an attribute gets added, be sure to update this and the getDataIds function implementation.
Definition at line 237 of file GA_AttributeInstanceMatrix.h.