public virtual void Recompute(float t) { var p = position.Evaluate(t); var s = scale.Evaluate(t); var q = orientation.Evaluate(t); WorldMatrix = mat4.Translate(p) * q.ToMat4 * mat4.Scale(s); }
public void Recompute(float t) { colorField.Evaluate(t); var p = positionField.Evaluate(t); var s = scaleField.Evaluate(t); var q = orientationField.Evaluate(t); // By shifting the world matrix using the origin, all sprites using the same source rect and alignment // (regardless of transform) can be rendered using the same quad in GPU memory. This is most applicable to // 3D sprites that don't use a source rect at all (since they can all use the same unit square). var v = new vec3(correction / PixelDivisor, 0); WorldMatrix = mat4.Translate(p) * q.ToMat4 * mat4.Translate(v) * mat4.Scale(new vec3(s, 0)); }