- mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+2, AnimatableVertex::POSITION ),
- Source(meshActor, bouncePropertyIndex),
- VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) );
- mesh.ApplyConstraint( Constraint::New<Vector3>( mesh.GetPropertyIndex(j+3, AnimatableVertex::POSITION),
- Source(meshActor, bouncePropertyIndex),
- VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) );
+ Constraint constraint = Constraint::New<Vector3>( mesh, mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) );
+ constraint.AddSource( Source(meshActor, bouncePropertyIndex) );
+ constraint.Apply();
+
+ constraint = Constraint::New<Vector3>( mesh, mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) );
+ constraint.AddSource( Source(meshActor, bouncePropertyIndex) );
+ constraint.Apply();