(color, wireframe)
| 895 | ]; |
| 896 | |
| 897 | function getTargetOfStyle(color, wireframe) { |
| 898 | const pool = wireframe ? targetWireframePool : targetPool; |
| 899 | let target = pool.get(color).pop(); |
| 900 | if (!target) { |
| 901 | target = new Entity({ |
| 902 | model: optimizeModel(makeRecursiveCubeModel({ |
| 903 | recursionLevel: 1, |
| 904 | splitFn: mengerSpongeSplit, |
| 905 | scale: targetRadius |
| 906 | })), |
| 907 | color: color, |
| 908 | wireframe: wireframe |
| 909 | }); |
| 910 | |
| 911 | // Init any properties that will be used. |
| 912 | // These will not be automatically reset when recycled. |
| 913 | target.color = color; |
| 914 | target.wireframe = wireframe; |
| 915 | // Some properties don't have their final value yet. |
| 916 | // Initialize with any value of the right type. |
| 917 | target.hit = false; |
| 918 | target.maxHealth = 0; |
| 919 | target.health = 0; |
| 920 | } |
| 921 | return target; |
| 922 | } |
| 923 | |
| 924 | return function getTarget() { |
| 925 | if (doubleStrong && state.game.score <= doubleStrongEnableScore) { |
no test coverage detected