Last updated
Last updated
In engineering and physics, a Spring System or Spring Network is a model of physics described as a [graph]() "Graph (discrete mathematics)") with a position at each vertex and a [spring]() "Spring (device)") of given stiffness and length along each edge.
With FP Motion, the Spring System is the part of the asset that allows developers to produce motion effects like: , ...etc
The class contains all the spring code; every component that uses the spring system holds an instance of this class, as it is the ‘bridge’ between it and the .
In order for the Spring System to work its magic, it first needs to have an object designated as a target, in FP Motion we do this by subscribing that object to the trough a component (usually on that same object).
Once you subscribe the object to the manager, the latter will create and return a for it, which is the component in charge of calculating the spring physics.
Once the object gets a value, the having now registered and created a spring system for it will update the object’s physics every frame.
The system works in the following way:
1. Take a force.
2. Calculate the effect that force produces on an object.
3. Changes the object's state (Position, rotation and scale) to match.
The resulting changes in position, rotation and scale are something we calculate using , and thus allow you to have access to a couple of parameters, making each force interesting and unique, while keeping the precision that some games need.