AlexandreBonaventure / vue-zdog

Vue wrapper for zDog
https://alexandrebonaventure.github.io/vue-zdog/
MIT License
56 stars 8 forks source link

Espose Zdog.TAU #4

Closed vuchl closed 5 years ago

vuchl commented 5 years ago

Having the constant exposed for easier rotation handling would be useful

AlexandreBonaventure commented 5 years ago

I don't see really why you would want that. To me, this is out-of-scope, I'm going to close this one. Feel free to tell me your use case anyhow

vuchl commented 5 years ago

From here: https://zzz.dog/api#utilities-tau

A full rotation in radians. Math.PI * 2. TAU is more user-friendly than PI as TAU maps directly to a full rotation.


const TAU = Zdog.TAU; // easier to read constant

rotate: { y: TAU/4 } // /4 = quarter turn
rotate: { y: TAU/2 } // /2 = half turn
rotate: { y: TAU*3 } // *3 = 3 full turns```

If you won't add it it's no big deal just thought it would generally bring more of the surface of Zdog to the wrapper library.

AlexandreBonaventure commented 5 years ago

If you use it extensively in templates, it is easy to expose that yourself : Vue.prototype.TAU = Math.PI * 2 I'd rather left that in userland.