Trass3r wrote:
The Anh Tran schrieb:
One of my C++ struct is Vector3. It is a wrapper from D3DXVECTOR3.
I would like to use expression template to calculate where to point
the gun. In C++, it is provided by boost::proto or boost::ublas.
You calculate where to point the gun at compile-time?
No :)
I would like to learn D template programming; all i need is just a
compile-time expression.
vPredicted = vEnd
+ (((ProjectileSpeed^2 * |vStart-vEnd|^2 - |(vStart-vEnd) X Velocity |
^2) ^ 0.5
+ (vStart-vEnd) * vVelocity) / (ProjectileSpeed^2 - |vVelocity|^2)) *
vVelocity
vXYZ is a struct, re-present 3D coordinate / velocity vector.