A spherical linear interpolation from one Vector3 point to another, without quaternions, and with selectable radius and orientation of arc.
These comments were in the function definition but to keep the header uncluttered I've put them here. It explains the math.
//Provides a constant-rate interpolation along an arc from v1 to v2 as t goes from 0 to 1.0, i.e. a spherical linear interpolation (slerp)
//The basic formula is as follows: (https://en.wikipedia.org/wiki/Slerp)
//Define omega as the angle between the two points using omega=acos( a-dot-b / ||a||*||b|| ) (Law of cosines)
//slerp(v1,v2,t) = ( sin((1-t)omega)/sin(omega) )*v1 + ( sin(t*omega)/sin(omega) )*v2
//However, the basic formula has two drawbacks. First, the center of the arc always lies on the midpoint, so the arc is a semi-circle. One might want a flatter arc with an increased radius and thus a center located off the midpoint
//Second, the arc is drawn with reference to the origin (i.e., it arcs away from wherever the origin is). One might wish to specify a different direction of the arc.
//This formula permits both parameters: iradius increases the radius from the minimum which is half the distance between the two points. So the resulting radius of the arc is iradius+Length(midpoint-v1)
//Theta (in radians) rotates the direction of the arc around the line connecting the two points (think of a jumprope)
//Overview of formula below: We define L as the line between v1 and v2. L=v2-v1. Midpoint is the midpoint of this line: M=v1+0.5*L. From the midpoint we will construct an arc centerpoint, on a radial line perpendicular to L and rotated around it by theta.
//For the plane of rotation of the radial line, we construct a plane normal to L at M. The plane by definition has the form (L.x)*X+(L.y)*Y+(L.z)*Z+D=0. To locate the plane at the midpoint, we substitute the midpoint into the equation and solve for D. So D=-(L-dot-M).
//Next we need to pick two orthogonal vectors in this plane as a basis for rotating the the radial line of the arc around it. We call these vectors F and G. The choice of lines on the plane is infinite and arbitrary.
//So we choose an easy point to solve: the intersection of the plane and the x-axis (where y==0 && z==0). This works in all cases except those where (1) the plane is parallel to the x-axis, which happens when L.x==0. So in this case we choose y-axis or z-axis instead which are just as easy, and (2) the midpoint is very close to the origin, in which case we just move aside a small amount to avoid denominators close to zero
//The x-intercept (called Incept below) is some vector {x,0,0} so we substitute this into the equation for the plane and obtain x=-D/L.x. Incept={-D/L.x,0,0} F is therefore the line between the midpoint and this intercept. F=Incept-midpoint. We normalize F because we will use it to rotate the radial line.
//The second vector must be orthogonal to F and L. It is easily obtained by LxF (cross product). We normalize G as well.
//Now F and G permit us to rotate the radial line by theta.
//The centerpoint of the arc, called perp below, becomes midpoint+(F*cos(theta)+G*sin(theta))*radius).
//Finally we translate our start and end point into a coordinate system with its center at perp: a=v1-perp and b=v2-perp. We apply our basic slerp formula to points a and b. We translate our result back into the original coordinate frame returning r+perp
After lot of investigation, I'm afraid I'm removing official UWP support from raylib, I'll keep the current implementation in a separate branch (UWP), just in case. It seems Microsoft is trying to replace UWP in the long term, they announced lack of support for the new WinUI 3 and they seem to be moving to Windows App SDK.
Also, on current implementation, the code is divided between raylib and the example, requiring multiple callback hooks, making it difficult to follow and maintain.
And realistically speaking, raylib is probably not the best option for anyone willing to target UWP, neither Xbox consoles.
* Added my own model and license to Raylib exclusively created by me and provided for use in the examples (and other projects if anyone decides to)
* Use animation vertices on initial load if possible.
* Added girl model to model example
* Revamped GLTF model loading as it was wrong by default. Also updated some comments.
GLTF models were loaded only by mesh but they should be loaded recursively by hierarchical nodes because tehre are some static node transformations that are to be applied to the vertices. It also resulted in more meshes being included in some models.
It is the correct way of loading GLTF and what is suggested in the official examples.
Currenlty limiting to only one scene but more can be included later.
* Refactored the new names and structure of extracted functions.
* Safer and easier read value.
* Made reading easier for accessor->bufferView->buffer in GLTF.
Now there is no need to check for supported types or anything.
* Correct inclusion of limits.h in the cases of MSVC based compilers vs the world
* Removed weird example file