17 #ifndef _GT_AgentSupport_h_
18 #define _GT_AgentSupport_h_
67 : myLayerIdx(layer_idx), myBindingIdx(shape_idx)
80 virtual ~GT_VulkanAgentData();
91 void clear() { myIndexMap.clear(); }
96 myIndexMap.setSize(size);
101 {
return myIndexMap(ga_index); }
104 { myIndexMap[ga_index] = agent_index; }
120 { myVisibility(idx) = visible ?
lod : 0.0; }
123 {
return myVisibility(idx) != 0.0f; }
127 lod = myVisibility(idx);
142 : myNumTransforms(num_xforms), myNumChannels(num_channels)
151 myTransforms.entries(entries);
152 myChannelValues.entries(entries);
153 mySerial.entries(entries);
157 {
return myTransforms(agent_idx); }
160 {
return *myTransforms(agent_idx); }
163 {
return myChannelValues[agent_idx]; }
166 {
return *myChannelValues(agent_idx); }
170 { mySerial(agent_idx) = serial; }
175 return myNumTransforms;
181 return myNumChannels;
188 exint myNumTransforms = 0;
189 exint myNumChannels = 0;
201 {
return myTransforms(agent_idx); }
204 {
return myTransforms(agent_idx); }
218 void clear() { mySelection.zero(); mySelectState = 0; }
219 void allSelected() { mySelection.constant(1); mySelectState = 1; }
223 { mySelection(idx) = selected?1:0; }
226 {
return mySelection(idx)==1; }
250 { memcpy(id_array, myIDs.array(), myIDs.entries()*
sizeof(
int));}
287 myColors.setSizeNoInit(num_agents * 4);
293 colors->extendedFillArray(myColors.data(), 0, 1, 3, num_agents,
297 colors->fillArray(myColors.data(), 0, num_agents, 3, 4);
303 bool hasColor()
const {
return !myColors.isEmpty(); }
308 memcpy(data, myColors.data() + 4 * agent_idx, 4 *
sizeof(
uint8));
Mapping from GA_Index to per-rig agent index.
Visibility and LOD class for agents.
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
void setAgentIndex(int ga_index, int agent_index)
void setEntries(exint entries)
Contains IDs for each agent.
bool isFullySelected() const
void setEntries(exint entries)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
bool isSelected(exint idx) const
GT_AgentIDHandle myAgentPrimID
GT_AgentShapeBindingID(int layer_idx, int shape_idx)
Contains colors for each agent.
UT_Array< const GU_PrimPacked * > myAgents
UT_Array< RE_VertexArray * > * myRigTransformVA
UT_Matrix4FArray myInvRestTransforms
Inverse rest transform for each region.
bool getLOD(exint idx, fpreal32 &lod) const
UT_StringHolder myMLDeformInitErrors
Any error messages from initializing the ML deformer.
void setEntries(exint entries)
Data common to all levels-of-detail for a series of GT_PrimAgentShapes.
A reference counter base class for use with UT_IntrusivePtr.
UT_IntrusivePtr< GT_ShapeLODGroup > GT_ShapeLODGroupHandle
void setSelected(exint idx, bool selected)
UT_Array< RE_VertexArray * > * myPrimIDVA
UT_IntrusivePtr< GT_AgentColors > GT_AgentColorsHandle
GU_AgentBlendShapeUtils::InputCache myBlendShapeInputs
void fetchColor(exint agent_idx, uint8 *data) const
Fetch the (4 uint8) color for an agent.
int getID(exint idx) const
GT_AgentColorsHandle myAgentColors
UT_Array< GT_AgentShapeBindingID > myBindings
void fetchIDs(int *id_array) const
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool hasMLSkinDeform() const
GT_AgentSelectionHandle myAgentSelection
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
bool hasBlendShapes() const
#define SYS_DECLARE_IS_POD(T)
Declare a type as POD.
void setColors(const GT_DataArrayHandle &colors, GT_Owner owner, exint num_agents)
GT_AgentDeformFlags deformFlags() const
GU_AgentMLSkinDeformerShapeCache myMLDeformCache
Cached data for evaluating the ML deformer for the shape.
GT_AgentShapeRigInfoHandle myRigInfo
GT_AgentRigTransformsHandle myAgentRigTransforms
UT_ENABLE_ENUM_BIT_FLAGS(NET_IODeviceOpenMode)
bool isNothingSelected() const
UT_IntrusivePtr< GT_AgentVisibility > GT_AgentVisibilityHandle
UT_IntArray myDeformMap
Map from the region index to agent rig index.
GT_AgentTransformsHandle myAgentTransforms
void setEntries(exint size)
GT_AgentVisibilityHandle myVisibility
GT_AgentIndexMapHandle myAgentIndexMap
UT_IntrusivePtr< GT_AgentID > GT_AgentIDHandle
UT_Array< RE_VertexArray * > * myTransformVA
int getAgentIndex(exint ga_index) const
const UT_IntArray & getIDs() const
UT_Array< RE_VertexArray * > * mySelectionVA
UT_IntrusivePtr< GT_AgentIndexMap > GT_AgentIndexMapHandle
UT_IntrusivePtr< GT_AgentSelection > GT_AgentSelectionHandle
UT_Array< RE_VertexArray * > * myColorVA
bool isPartiallySelected() const
void setID(exint idx, int id)
Contains a bool array of selected agents.
void setVisibility(exint idx, bool visible, fpreal lod=1.0)
UT_IntrusivePtr< GT_AgentRigTransforms > GT_AgentRigTransformsHandle
bool getVisibility(exint idx) const
Index of a shape binding in one of the agent's current layers.
GT_AgentDeformFlags myDeformFlags
UT_IntrusivePtr< GT_AgentShapeRigInfo > GT_AgentShapeRigInfoHandle
UT_IntrusivePtr< GT_AgentTransforms > GT_AgentTransformsHandle