MCPcopy
hub / github.com/g3n/engine / AddMorphTargetDeltas

Method AddMorphTargetDeltas

geometry/morph.go:105–117  ·  view source on GitHub ↗

AddMorphTargetDeltas add multiple morph target deltas to the morph geometry.

(morphTargetDeltas ...*Geometry)

Source from the content-addressed store, hash-verified

103
104// AddMorphTargetDeltas add multiple morph target deltas to the morph geometry.
105func (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.
120func (mg *MorphGeometry) ActiveMorphTargets() ([]*Geometry, []float32) {

Callers 1

LoadMeshMethod · 0.95

Calls 1

Tested by

no test coverage detected