HDK
|
A shape belonging to agents, instanced with material assignments. More...
#include <GT_PrimAgentShape.h>
Classes | |
class | ShapeInstance |
Public Member Functions | |
GT_PrimAgentShape () | |
GT_PrimAgentShape (const GT_PrimAgentShape &shape) | |
GT_PrimAgentShape (const GT_PrimitiveHandle &geometry, const GU_ConstDetailHandle &dh, const GT_ShapeLODGroupHandle &agent_group, int lod_level, GT_DataArray *mat_remap) | |
~GT_PrimAgentShape () override | |
const GT_PrimitiveHandle & | geometry () const |
shape geometry. More... | |
GU_ConstDetailHandle & | detail () const |
const GT_ShapeLODGroupHandle & | shapeGroup () const |
Access to the shared data between LOD levels of the same agent shape. More... | |
int | lodLevel () const |
Which LOD level this shape represents: 0=primary, 1+ lower resolutions. More... | |
exint | getNumMatGroups () const |
one set of transforms per material. More... | |
exint | getMatGroupNumInstances (exint grp_idx) const |
int | getMatGroupMaterialID (exint grp_idx) const |
const UT_IntArray & | getMatGroupAgentPrimIDs (exint grp_idx) const |
const UT_IntArray & | getMatGroupAgentPointIDs (exint grp_idx) const |
GT_DataArrayHandle | getMatRemapAttrib () const |
int | getNumTransformsPerInstance () const |
int | getNumBlendWeightsPerInstance () const |
int | getNumPoints () const |
bool | hasBlendShapeNormalOffsets () const |
void | getMatGroupTransforms (exint grp_idx, UT_Matrix4FArray &xforms, bool packed_xform_only) const |
void | fetchMatGroupTransforms (int idx, UT_Matrix4F *buf, bool packed_xform_only) const |
Copy transforms into a fp32 mat buffer. Must be num_instances in size. More... | |
void | fetchMatGroupRigTransforms (int idx, fpreal32 *buf) const |
void | fetchMatGroupBlendWeights (int idx, std::pair< int32, fpreal32 > *active_targets) const |
void | fetchMatGroupColors (int idx, uint8 *buf) const |
Copy colors into a 4 x uint8 buffer. More... | |
int | getVisibleInstances (int grp_idx, UT_IntArray &inst_idx, int lod_base=0.0, fpreal lod_bias=1.0) const |
void | addShapeInstance (int xform_index, int material_id, GA_Index agent_prim_idx, GA_Index agent_pnt_idx, const GT_AgentShapeBindingID &binding) |
Add a instance. More... | |
const char * | className () const override |
int | getPrimitiveType () const override |
void | enlargeBounds (UT_BoundingBox boxes[], int nsegments) const override |
void | enlargeRenderBounds (UT_BoundingBox boxes[], int nsegments) const override |
int | getMotionSegments () const override |
int64 | getMemoryUsage () const override |
GT_PrimitiveHandle | doSoftCopy () const override |
GT_PrimitiveHandle | doHarden () const override |
bool | refine (GT_Refine &refiner, const GT_RefineParms *parms=NULL) const override |
bool | getTopologyVersion (int64 &version) const override |
Returns the topology version for the primitive. More... | |
int | getNumUnstyledGroups () const |
ShapeInstance & | getShapeInstancesForUnstyledGroup (int mat_group) |
void | resetStyledMatGroups () |
ShapeInstance * | addStyledMatGroup (int mat_id) |
Public Member Functions inherited from GT_Primitive | |
GT_Primitive () | |
GT_Primitive (const GT_Primitive &src) | |
virtual | ~GT_Primitive () |
virtual bool | getUniqueID (int64 &id) const |
virtual void | getVelocityRange (UT_Vector3 &min, UT_Vector3 &max, const UT_StringRef &attribute_name=GA_Names::v) const |
const GT_TransformHandle & | getPrimitiveTransform () const |
void | setPrimitiveTransform (const GT_TransformHandle &x) |
Set the transform for a the primitive. More... | |
GT_PrimitiveHandle | clone () const |
virtual bool | hasDataArray (const UT_StringRef &name, GT_Owner owner_scope[], int num_owners, GT_Storage *storage=NULL, GT_Size *tuple_size=NULL) const |
virtual bool | updateGeoPrim (const GU_ConstDetailHandle &dtl, const GT_RefineParms &parms) |
update any cached data for geometry and its attributes More... | |
void | setStaticGeometry (bool static_geo) |
Return true if the primitive represents geometry at frame 'fr'. More... | |
bool | isStaticGeometry () const |
bool | isFrameInfoAvailable () const |
bool | getDataIdHash (int64 &hash, int segment=0, bool cache_data_id=false) const |
GT_DataArrayHandle | findAttribute (const UT_StringRef &name, GT_Owner &owner, int segment) const |
void | dumpAttributeLists (const char *label, bool data_too) const |
print out all attribute lists More... | |
void | dumpPrimitive () const |
bool | saveAttributeLists (UT_JSONWriter &w) const |
virtual bool | save (UT_JSONWriter &w) const |
virtual const GT_ViewportRefineOptions & | viewportRefineOptions () const |
GT_PrimitiveHandle | harden () const |
GT_PrimitiveHandle | copyTransformed (const GT_TransformHandle &x, bool force=false) const |
void | refineCopyTransformFrom (const GT_Primitive &src) |
GT_PrimitiveHandle | attributeMerge (const GT_Primitive &src, const UT_StringMMPattern *vertex_pattern, const UT_StringMMPattern *point_pattern, const UT_StringMMPattern *uniform_pattern, const UT_StringMMPattern *detail_pattern) const |
virtual GT_PrimitiveHandle | doAttributeMerge (const GT_Primitive &src, const UT_StringMMPattern *vertex, const UT_StringMMPattern *point, const UT_StringMMPattern *uniform, const UT_StringMMPattern *detail) const |
The virtual implementation of attribute merging. More... | |
bool | enlargeWidth (UT_BoundingBox boxes[], int nsegments, fpreal defwidth=-1) const |
virtual const GT_AttributeListHandle & | getPointAttributes () const |
virtual const GT_AttributeListHandle & | getVertexAttributes () const |
virtual const GT_AttributeListHandle & | getUniformAttributes () const |
virtual const GT_AttributeListHandle & | getDetailAttributes () const |
const GT_AttributeListHandle & | getAttributeList (GT_Owner owner) const |
virtual const GT_DataArrayHandle & | getVertexList () const |
virtual GT_DataArrayHandle | createPointNormals (int segment=0, const UT_StringRef &P=GA_Names::P, bool normalize=true, const fpreal32 *pntdata=NULL, GT_Storage store=GT_STORE_REAL32) const |
virtual fpreal | computePerimeter (int seg=0) const |
virtual fpreal | computeSurfaceArea (int seg=0) const |
virtual fpreal | computeVolume (const UT_Vector3 &ref_P, int seg=0) const |
Public Member Functions inherited from UT_IntrusiveRefCounter< GT_Primitive > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
A shape belonging to agents, instanced with material assignments.
Definition at line 32 of file GT_PrimAgentShape.h.
GT_PrimAgentShape::GT_PrimAgentShape | ( | ) |
GT_PrimAgentShape::GT_PrimAgentShape | ( | const GT_PrimAgentShape & | shape | ) |
GT_PrimAgentShape::GT_PrimAgentShape | ( | const GT_PrimitiveHandle & | geometry, |
const GU_ConstDetailHandle & | dh, | ||
const GT_ShapeLODGroupHandle & | agent_group, | ||
int | lod_level, | ||
GT_DataArray * | mat_remap | ||
) |
|
override |
void GT_PrimAgentShape::addShapeInstance | ( | int | xform_index, |
int | material_id, | ||
GA_Index | agent_prim_idx, | ||
GA_Index | agent_pnt_idx, | ||
const GT_AgentShapeBindingID & | binding | ||
) |
Add a instance.
|
inline |
Definition at line 245 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
Implements GT_Primitive.
Definition at line 118 of file GT_PrimAgentShape.h.
|
inline |
Definition at line 254 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
Hardening the primitive will return a copy of the primitive, but without any dangling references. The default implementation returns a NULL ptr.
Reimplemented from GT_Primitive.
Definition at line 132 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
Create a copy of the primitive, referencing all the source data This can return a NULL pointer, but it would be better to implement it properly.
Implements GT_Primitive.
Definition at line 130 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
An array of bounding boxes is passed in. There is a bounding box for each segement. Each bounding box should be enlarged appropriately.
Implements GT_Primitive.
Definition at line 122 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
This is used when computing bounds for rendering (not just geometric bounds). This normally just calls enlargeBounds()
, but for some primitives, their bounds can be influenced by attribute values (i.e. the "width" in point mesh primitives). This allows proper bounds to be passed to mantra. Users may want to call enlargeWidth()
Reimplemented from GT_Primitive.
Definition at line 125 of file GT_PrimAgentShape.h.
void GT_PrimAgentShape::fetchMatGroupBlendWeights | ( | int | idx, |
std::pair< int32, fpreal32 > * | active_targets | ||
) | const |
Copy weights for the active target shapes into a buffer. Must be num_instances * getNumBlendWeightsPerInstance() in size.
Copy colors into a 4 x uint8 buffer.
Copy rig transforms into a fp32 4x3 matrix buffer. Must be num_instances * getNumTransformsPerInstance() in size.
void GT_PrimAgentShape::fetchMatGroupTransforms | ( | int | idx, |
UT_Matrix4F * | buf, | ||
bool | packed_xform_only | ||
) | const |
Copy transforms into a fp32 mat buffer. Must be num_instances in size.
|
inline |
shape geometry.
Definition at line 181 of file GT_PrimAgentShape.h.
|
inline |
Definition at line 216 of file GT_PrimAgentShape.h.
|
inline |
Definition at line 208 of file GT_PrimAgentShape.h.
Definition at line 200 of file GT_PrimAgentShape.h.
Definition at line 192 of file GT_PrimAgentShape.h.
void GT_PrimAgentShape::getMatGroupTransforms | ( | exint | grp_idx, |
UT_Matrix4FArray & | xforms, | ||
bool | packed_xform_only | ||
) | const |
Import computed transforms into 'xforms'. If packed_xform_only is true, only the agent transforms are returned. If false, the rig * agent transforms are returned.
|
inline |
Definition at line 61 of file GT_PrimAgentShape.h.
|
overridevirtual |
Return an approximate memory usage. Since data may be shared, this will always be an over-estimation.
Implements GT_Primitive.
|
inlineoverridevirtual |
Return the number of motion segments defined on the geometry By default, this simply returns the number of segments on P.
Implements GT_Primitive.
Definition at line 128 of file GT_PrimAgentShape.h.
int GT_PrimAgentShape::getNumBlendWeightsPerInstance | ( | ) | const |
|
inline |
one set of transforms per material.
Definition at line 185 of file GT_PrimAgentShape.h.
int GT_PrimAgentShape::getNumPoints | ( | ) | const |
Number of points in the shape. If there are blendshapes, each target shape in the BlendShapeOffsets buffer also has this number of points.
int GT_PrimAgentShape::getNumTransformsPerInstance | ( | ) | const |
|
inline |
Definition at line 224 of file GT_PrimAgentShape.h.
|
inlineoverridevirtual |
Return the primitive type. By default this returns GT_PRIM_UNDEFINED,
Reimplemented from GT_Primitive.
Definition at line 120 of file GT_PrimAgentShape.h.
|
inline |
Definition at line 230 of file GT_PrimAgentShape.h.
|
overridevirtual |
Returns the topology version for the primitive.
Reimplemented from GT_Primitive.
int GT_PrimAgentShape::getVisibleInstances | ( | int | grp_idx, |
UT_IntArray & | inst_idx, | ||
int | lod_base = 0.0 , |
||
fpreal | lod_bias = 1.0 |
||
) | const |
Return a list of visible instances in this material group, based on the visibility info computed by the GT_GEOPackedAgent. returns -1 if only some are visible, 0 if none are visible, and 1 if all are visible. The 'lod_bias' is a factor that will favour lower LOD levels if > 1, and higher LOD levels if < 1. A bias of zero will disable LOD.
bool GT_PrimAgentShape::hasBlendShapeNormalOffsets | ( | ) | const |
Returns whether there are any blendshapes with normal offsets (i.e. the BlendShapeNormalOffsets buffer should be used).
|
inline |
Which LOD level this shape represents: 0=primary, 1+ lower resolutions.
Definition at line 258 of file GT_PrimAgentShape.h.
|
overridevirtual |
Refine the primitive.
refiner
Reimplemented from GT_Primitive.
|
inline |
Definition at line 236 of file GT_PrimAgentShape.h.
|
inline |
Access to the shared data between LOD levels of the same agent shape.
Definition at line 262 of file GT_PrimAgentShape.h.