SkinningAttributeData (struct)

A simple struct that holds the data for the SkinningAttribute. This struct can be moved to the GPU wholesale, and its methods will also continue to work on the GPU. This is a workaround untill objects are supported on the GPU. currently only structs are supported, so we move the data and important fucntions to the struct, and add the struct to objct as a member.

SkinningAttributeData SkinningAttributeData SkinningAttributeData

Members

Size count  
UInt32ArrayAllocator weightsAllocator  
UInt16[] ids  
UInt32[] offsets  
UInt16[] counts  

Methods

  SkinningAttributeData ( in SkinningAttributeData other )
  SkinningAttributeData ()
SkinningAttributeData clone ? ()
  cloneMembersTo ? ( io SkinningAttributeData that )
  copyFrom ! ( in SkinningAttributeData other )
  copyValue ! ( in Size sourceIndex, in Size targetIndex )
  copyValue ! ( in SkinningAttributeData source, in Size sourceIndex, in Size targetIndex )
Boolean equalValues ? ( in Size index1, in Size index2 )
  getLinearCombination ? ( in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, out LocalL16UInt32Array skinIds, out LocalL16ScalarArray skinWeights )
  getPair ? ( in UInt32 index, in UInt32 offset, out UInt16 id, out Scalar weight )
UInt16 getPairCount ? ( in UInt32 index )
  getPairs ? ( in UInt32 index, out LocalL16UInt32Array skinIds, out LocalL16ScalarArray skinWeights )
  linearCombine ! ( in Ref<Object> sourceAttr, in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, in Size targetIndex )
Size memUsage ? ()
  normalize ! ( in Size index )
  resize ! ( in Size count )
  setPair ! ( in UInt32 index, in UInt32 offset, in UInt16 id, in Scalar weight )
  setPairCount ! ( in UInt32 index, in UInt16 pairCount )
  setPairs ! ( in UInt32 index, in LocalL16UInt32Array skinIds, in LocalL16ScalarArray skinWeights )
Size size ? ()

Methods in detail

SkinningAttributeData ( in SkinningAttributeData other )

copy constructor


SkinningAttributeData ()


SkinningAttributeData SkinningAttributeData.clone? ()

clone method


SkinningAttributeData.cloneMembersTo? ( io SkinningAttributeData that )


SkinningAttributeData.copyFrom! ( in SkinningAttributeData other )


SkinningAttributeData.copyValue! ( in Size sourceIndex, in Size targetIndex )


SkinningAttributeData.copyValue! ( in SkinningAttributeData source, in Size sourceIndex, in Size targetIndex )


Boolean SkinningAttributeData.equalValues? ( in Size index1, in Size index2 )

Returns true if id-weight pair values are the same, considering it is an unordered set (it will return ‘true’ even if pair order differs, as long as values are the same).


SkinningAttributeData.getLinearCombination? ( in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, out LocalL16UInt32Array skinIds, out LocalL16ScalarArray skinWeights )

Returns the ids and weights arrays (1 to 1 correspondence) resulting from the linear combination of source items (sourceWeights: factors per source, not the same as id-weight values)

sourceIndices The array of source indices
sourceWeights The array of source weights, which need to correspond to each sourceIndices. Normally the sum of the weights should be 1.0


SkinningAttributeData.getPair? ( in UInt32 index, in UInt32 offset, out UInt16 id, out Scalar weight )

Returns for item ‘index’, returns the id-weight values for pair ‘offset’


UInt16 SkinningAttributeData.getPairCount? ( in UInt32 index )

Returns the number of id-weight pairs for a given item


SkinningAttributeData.getPairs? ( in UInt32 index, out LocalL16UInt32Array skinIds, out LocalL16ScalarArray skinWeights )

For an item, returns ids and weights arrays (1 to 1 correspondence)


SkinningAttributeData.linearCombine! ( in Ref<Object> sourceAttr, in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, in Size targetIndex )


Size SkinningAttributeData.memUsage? ()


SkinningAttributeData.normalize! ( in Size index )

Normalizes the weights of the item so it sums to 1.0. If the sum is almost 0, will set equal weights.


SkinningAttributeData.resize! ( in Size count )


SkinningAttributeData.setPair! ( in UInt32 index, in UInt32 offset, in UInt16 id, in Scalar weight )

Returns for item ‘index’, sets the id-weight values for pair ‘offset’


SkinningAttributeData.setPairCount! ( in UInt32 index, in UInt16 pairCount )

Sets the number of id-weight pairs for the item (resizes item)


SkinningAttributeData.setPairs! ( in UInt32 index, in LocalL16UInt32Array skinIds, in LocalL16ScalarArray skinWeights )

For an item, set ids and weights arrays (1 to 1 correspondence)


Size SkinningAttributeData.size? ()