AddMorphTargetDeltas add multiple morph target deltas to the morph geometry.
(morphTargetDeltas ...*Geometry)
| 103 | |
| 104 | // AddMorphTargetDeltas add multiple morph target deltas to the morph geometry. |
| 105 | func (mg *MorphGeometry) AddMorphTargetDeltas(morphTargetDeltas ...*Geometry) { |
| 106 | |
| 107 | for range morphTargetDeltas { |
| 108 | mg.weights = append(mg.weights, 0) |
| 109 | } |
| 110 | mg.targets = append(mg.targets, morphTargetDeltas...) |
| 111 | |
| 112 | // Update all target attributes if we have few enough that we are able to send them |
| 113 | // all to the shader without sorting and choosing the ones with highest current weight |
| 114 | if len(mg.targets) <= MaxActiveMorphTargets { |
| 115 | mg.UpdateTargetAttributes(mg.targets) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // ActiveMorphTargets sorts the morph targets by weight and returns the top n morph targets with largest weight. |
| 120 | func (mg *MorphGeometry) ActiveMorphTargets() ([]*Geometry, []float32) { |
no test coverage detected