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)
- [android] app crash -> JNI DETECTED ERROR IN APPLICATION: java_object == null HOT 2
- RN 0.74.0: error: cannot find symbol super.replaceExistingNonRootView HOT 12
- Compilation Failure in :react-native-reanimated:compileDebugJavaWithJavac (RN 0.74.0) HOT 20
- CellRendererComponent prop does not work with Animated.Flatlist HOT 3
- Animated.View does not update exiting/entering layout animations dynamically HOT 1
- [3.9.0] useAnimatedScrollHandler does not fire events from FlashList onScroll HOT 20
- Application crashes on Android when using entering/exiting HOT 3
- 0x104f2f700 -[REAAnimationsManager clearSharedTransitionConfigForTag:] Thread 1: EXC_BAD_ACCESS (code=1, address=0x10) HOT 24
- 'AsyncQueue.h' file not found after upgrading to "react-native-reanimated": "^3.9.0", HOT 3
- Entering layout animation jump on initial render HOT 1
- `react-native-reanimated/plugin` babel plugin increases the size by 3x HOT 3
- Bug after adding react-native-reanimated in react-native 0.74.0 HOT 3
- Can't build ios with XCode 15.3 after update HOT 7
- Xcode looking for REAKeyboardEventObserver.m file, but only .mm is available HOT 7
- "ScrollTo" position not precise when using with FlashList, while FlatList work as expected
- Warnings in console while running web expo HOT 3
- [iOS] App crash when using navigation HOT 7
- error while running the iOS app on Macos M1 HOT 3
- [Bug]: useAnimatedScrollHandler is not working properly with React Native FlashList in version 3.9+ HOT 5
- Entering/exiting dosen't works on android HOT 5
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.