Comments (2)
Hi, take a look here:
https://en.wikipedia.org/wiki/Harmonic_oscillator
@kmagiera has implemented harmonic oscillator's behaviour
function springBehavior(dt, target, obj, anchor, tension = 300) {
const dx = sub(target.x, anchor.x);
const ax = divide(multiply(-1, tension, dx), obj.mass);
const dy = sub(target.y, anchor.y);
const ay = divide(multiply(-1, tension, dy), obj.mass);
return {
x: set(obj.vx, add(obj.vx, multiply(dt, ax))),
y: set(obj.vy, add(obj.vy, multiply(dt, ay))),
};
}
from react-native-reanimated.
Thks a lot, really appreciate it.
from react-native-reanimated.
Related Issues (20)
- [Bug]: 3.10.0 - Uncaught exception 'NSUnknownKeyException', reason: '[<RCTUIManager 0x600002acc230> valueForUndefinedKey:] HOT 9
- Exception in Hostfunction: not implemented HOT 33
- onPress not work correctly HOT 2
- Shared transitions break when parent element uses justifyContent
- Property 'fill' was whitelisted both as UI and native prop. Please remove it from one of the lists. HOT 3
- SharedValue is an type of object, and sometimes a number HOT 5
- Animated.createAnimatedComponent() TypeError: Cannot read property 'remove' of undefined HOT 1
- [Android-IOS] [3.11.0] Animation update incorrect when setState after set shared value HOT 5
- NodesManager causing an app crash because of the "Map already consumed" HOT 2
- error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] HOT 3
- [Reanimated] Babel plugin exception: TypeError: (0 , types_12.cloneNode) is not a function HOT 1
- Unable to run on Android HOT 3
- ReferenceError: _updateDataSynchronously is not defined HOT 2
- [3.6.0] pod install error after upgrading 3.6.0 HOT 4
- Problems with react-native-reanimated v3.11.0 e react-native v 0.74.1 HOT 4
- Unable to resolve module ./publicGlobals HOT 4
- 【Bug】Modal displays incorrectly if use reanimated HOT 3
- [3.11.0] Plugin does not traverse node_modules, only the root of the project HOT 2
- Flickering in animation after updating react native
- 1st item in an inverted list is no longer animated after a while with itemLayoutAnimation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-reanimated.