HDK
|
#include <xformCache.h>
A caching mechanism for transform matrices. For best performance, this object should be reused for multiple CTM queries.
Instances of this type can be copied, though using Swap() may result in better performance.
It is valid to cache prims from multiple stages in a single XformCache.
WARNING: this class does not automatically invalidate cached values based on changes to the stage from which values were cached. Additionally, a separate instance of this class should be used per-thread, calling the Get* methods from multiple threads is not safe, as they mutate internal state.
Definition at line 57 of file xformCache.h.
|
explicit |
Construct a new XformCache for the specified time
.
USDGEOM_API UsdGeomXformCache::UsdGeomXformCache | ( | ) |
Construct a new XformCache for UsdTimeCode::Default().
USDGEOM_API void UsdGeomXformCache::Clear | ( | ) |
Clears all pre-cached values.
USDGEOM_API GfMatrix4d UsdGeomXformCache::ComputeRelativeTransform | ( | const UsdPrim & | prim, |
const UsdPrim & | ancestor, | ||
bool * | resetXformStack | ||
) |
Returns the result of concatenating all transforms beneath ancestor
that affect prim
. This includes the local transform of prim
itself, but not the local transform of ancestor
. If ancestor
is not an ancestor of prim
, the resulting transform is the local-to-world transformation of prim
. The resetXformTsack
pointer must be valid. If any intermediate prims reset the transform stack, resetXformStack
will be set to true. Intermediate transforms are cached, but the result of this call itself is not cached.
USDGEOM_API GfMatrix4d UsdGeomXformCache::GetLocalToWorldTransform | ( | const UsdPrim & | prim | ) |
Compute the transformation matrix for the given prim
, including the transform authored on the Prim itself, if present.
USDGEOM_API GfMatrix4d UsdGeomXformCache::GetLocalTransformation | ( | const UsdPrim & | prim, |
bool * | resetsXformStack | ||
) |
Returns the local transformation of the prim. Uses the cached XformQuery to compute the result quickly. The resetsXformStack
pointer must be valid. It will be set to true if prim
resets the transform stack. The result of this call is cached.
USDGEOM_API GfMatrix4d UsdGeomXformCache::GetParentToWorldTransform | ( | const UsdPrim & | prim | ) |
Compute the transformation matrix for the given prim
, but do NOT include the transform authored on the prim itself.
USDGEOM_API bool UsdGeomXformCache::GetResetXformStack | ( | const UsdPrim & | prim | ) |
Whether the xform stack is reset at the given prim.
|
inline |
Get the current time from which this cache is reading values.
Definition at line 141 of file xformCache.h.
USDGEOM_API bool UsdGeomXformCache::IsAttributeIncludedInLocalTransform | ( | const UsdPrim & | prim, |
const TfToken & | attrName | ||
) |
Whether the attribute named attrName
, belonging to the given prim
affects the local transform value at the prim.
USDGEOM_API void UsdGeomXformCache::SetTime | ( | UsdTimeCode | time | ) |
Use the new time
when computing values and may clear any existing values cached for the previous time. Setting time
to the current time is a no-op.
USDGEOM_API void UsdGeomXformCache::Swap | ( | UsdGeomXformCache & | other | ) |
Swap the contents of this XformCache with other
.
USDGEOM_API bool UsdGeomXformCache::TransformMightBeTimeVarying | ( | const UsdPrim & | prim | ) |
Whether the local transformation value at the prim may vary over time.