rotatedVerticesBonfire method
gives back the shape vectors multiplied by the size and scale
Implementation
List<Vector2> rotatedVerticesBonfire(double parentAngle) {
final angle = parentAngle;
if (!_cachedGlobalVertices.isCacheValid<dynamic>(<dynamic>[
size,
angle,
])) {
final globalVertices = List.generate(
vertices.length,
(_) => Vector2.zero(),
growable: false,
);
for (var i = 0; i < vertices.length; i++) {
final vertex = vertices[i];
globalVertices[i]
..setFrom(vertex)
..rotate(angle);
}
_cachedGlobalVertices.updateCache<dynamic>(
globalVertices,
<dynamic>[size.clone(), angle],
);
}
return _cachedGlobalVertices.value!;
}