17 #ifndef _GT_AgentSupport_h_
18 #define _GT_AgentSupport_h_
65 : myLayerIdx(layer_idx), myBindingIdx(shape_idx)
78 virtual ~GT_VulkanAgentData();
89 void clear() { myIndexMap.clear(); }
94 myIndexMap.setSize(size);
99 {
return myIndexMap(ga_index); }
102 { myIndexMap[ga_index] = agent_index; }
118 { myVisibility(idx) = visible ?
lod : 0.0; }
121 {
return myVisibility(idx) != 0.0f; }
125 lod = myVisibility(idx);
144 myTransforms.entries(entries);
145 myChannelValues.entries(entries);
146 mySerial.entries(entries);
150 {
return myTransforms(agent_idx); }
153 {
return *myTransforms(agent_idx); }
156 {
return myChannelValues[agent_idx]; }
159 {
return *myChannelValues(agent_idx); }
163 { mySerial(agent_idx) = serial; }
179 {
return myTransforms(agent_idx); }
182 {
return myTransforms(agent_idx); }
196 void clear() { mySelection.zero(); mySelectState = 0; }
197 void allSelected() { mySelection.constant(1); mySelectState = 1; }
201 { mySelection(idx) = selected?1:0; }
204 {
return mySelection(idx)==1; }
228 { memcpy(id_array, myIDs.array(), myIDs.entries()*
sizeof(
int));}
261 myColors.setSizeNoInit(num_agents * 4);
267 colors->extendedFillArray(myColors.data(), 0, 1, 3, num_agents,
271 colors->fillArray(myColors.data(), 0, num_agents, 3, 4);
277 bool hasColor()
const {
return !myColors.isEmpty(); }
282 memcpy(data, myColors.data() + 4 * agent_idx, 4 *
sizeof(
uint8));
291 namespace GT_AgentDeformFlags
293 static constexpr
uint None = 0;
294 static constexpr
uint BlendShapes = 1;
295 static constexpr
uint Skinning = 2;
319 return myDeformFlags != GT_AgentDeformFlags::None;
323 return myDeformFlags & GT_AgentDeformFlags::Skinning;
327 return myDeformFlags & GT_AgentDeformFlags::BlendShapes;
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
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.
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_AgentShapeRigInfoHandle myRigInfo
GT_AgentRigTransformsHandle myAgentRigTransforms
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.
UT_IntrusivePtr< GT_AgentShapeRigInfo > GT_AgentShapeRigInfoHandle
UT_IntrusivePtr< GT_AgentTransforms > GT_AgentTransformsHandle