react-native-reanimated 3.17.0-rc.0 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/reanimated/CSS/common/Quaternion.cpp +58 -0
- package/Common/cpp/reanimated/CSS/common/Quaternion.h +28 -0
- package/Common/cpp/reanimated/CSS/common/TransformMatrix.cpp +634 -0
- package/Common/cpp/reanimated/CSS/common/TransformMatrix.h +106 -0
- package/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +95 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +42 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +50 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +39 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +136 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSColor.h +53 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDimension.cpp +131 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDimension.h +45 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +111 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +55 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +100 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +62 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +90 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +73 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSValue.h +100 -0
- package/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +258 -0
- package/Common/cpp/reanimated/CSS/common/vectors.cpp +104 -0
- package/Common/cpp/reanimated/CSS/common/vectors.h +59 -0
- package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.cpp +135 -0
- package/Common/cpp/reanimated/CSS/config/CSSAnimationConfig.h +66 -0
- package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.cpp +87 -0
- package/Common/cpp/reanimated/CSS/config/CSSTransitionConfig.h +50 -0
- package/Common/cpp/reanimated/CSS/config/PropertyInterpolatorsConfig.h +300 -0
- package/Common/cpp/reanimated/CSS/config/common.cpp +20 -0
- package/Common/cpp/reanimated/CSS/config/common.h +16 -0
- package/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +147 -0
- package/Common/cpp/reanimated/CSS/core/CSSAnimation.h +61 -0
- package/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +94 -0
- package/Common/cpp/reanimated/CSS/core/CSSTransition.h +49 -0
- package/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +77 -0
- package/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +31 -0
- package/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +79 -0
- package/Common/cpp/reanimated/CSS/easing/cubicBezier.h +18 -0
- package/Common/cpp/reanimated/CSS/easing/linear.cpp +35 -0
- package/Common/cpp/reanimated/CSS/easing/linear.h +23 -0
- package/Common/cpp/reanimated/CSS/easing/steps.cpp +16 -0
- package/Common/cpp/reanimated/CSS/easing/steps.h +17 -0
- package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +164 -0
- package/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +163 -0
- package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +26 -0
- package/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +87 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +105 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +45 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +69 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +42 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +126 -0
- package/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +44 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +35 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +123 -0
- package/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +48 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformInterpolator.h +89 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +524 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +216 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +68 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +129 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +487 -0
- package/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +121 -0
- package/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +56 -0
- package/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +281 -0
- package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +187 -0
- package/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +70 -0
- package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
- package/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +86 -0
- package/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +19 -0
- package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +49 -0
- package/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +37 -0
- package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +228 -0
- package/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +97 -0
- package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.cpp +279 -0
- package/Common/cpp/reanimated/CSS/registry/CSSAnimationsRegistry.h +77 -0
- package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.cpp +152 -0
- package/Common/cpp/reanimated/CSS/registry/CSSTransitionsRegistry.h +56 -0
- package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.cpp +58 -0
- package/Common/cpp/reanimated/CSS/registry/StaticPropsRegistry.h +42 -0
- package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.cpp +95 -0
- package/Common/cpp/reanimated/CSS/util/DelayedItemsManager.h +56 -0
- package/Common/cpp/reanimated/CSS/util/algorithms.cpp +13 -0
- package/Common/cpp/reanimated/CSS/util/algorithms.h +13 -0
- package/Common/cpp/reanimated/CSS/util/interpolators.cpp +42 -0
- package/Common/cpp/reanimated/CSS/util/interpolators.h +28 -0
- package/Common/cpp/reanimated/CSS/util/keyframes.cpp +55 -0
- package/Common/cpp/reanimated/CSS/util/keyframes.h +18 -0
- package/Common/cpp/reanimated/CSS/util/props.cpp +337 -0
- package/Common/cpp/reanimated/CSS/util/props.h +48 -0
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +32 -28
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +5 -5
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +9 -43
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +6 -4
- package/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +37 -17
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +38 -0
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +21 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +166 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +80 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +130 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +67 -0
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +1 -1
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +3 -10
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +1 -2
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +0 -2
- package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.cpp → ReanimatedModuleProxy.cpp} +351 -214
- package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.h → ReanimatedModuleProxy.h} +78 -53
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +259 -0
- package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModuleSpec.h → ReanimatedModuleProxySpec.h} +37 -25
- package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +6 -15
- package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +3 -2
- package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +119 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +79 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +72 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +44 -0
- package/Common/cpp/worklets/SharedItems/Shareables.cpp +12 -2
- package/Common/cpp/worklets/Tools/Defs.h +10 -0
- package/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
- package/Common/cpp/worklets/Tools/JSScheduler.h +0 -12
- package/Common/cpp/{reanimated → worklets}/Tools/PlatformLogger.h +2 -2
- package/Common/cpp/{reanimated → worklets}/Tools/SingleInstanceChecker.h +5 -6
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +11 -2
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +2 -2
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -10
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +2 -13
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +3 -11
- package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -8
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +6 -0
- package/README.md +3 -4
- package/android/CMakeLists.txt +20 -12
- package/android/build.gradle +0 -16
- package/android/src/{reactNativeVersionPatch/NativeProxyFabric/latest → fabric/java}/com/swmansion/reanimated/NativeProxy.java +24 -40
- package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +6 -0
- package/android/src/main/cpp/reanimated/CMakeLists.txt +22 -41
- package/android/src/main/cpp/reanimated/android/LayoutAnimations.cpp +4 -0
- package/android/src/main/cpp/reanimated/android/LayoutAnimations.h +2 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +97 -133
- package/android/src/main/cpp/reanimated/android/NativeProxy.h +9 -34
- package/android/src/main/cpp/reanimated/android/OnLoad.cpp +0 -2
- package/android/src/main/cpp/worklets/CMakeLists.txt +52 -106
- package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.cpp +3 -3
- package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.h +3 -3
- package/android/src/main/cpp/{reanimated → worklets}/android/PlatformLogger.cpp +4 -4
- package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +40 -11
- package/android/src/main/cpp/worklets/android/WorkletsModule.h +22 -12
- package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +5 -2
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -3
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +3 -3
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +10 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +1 -1
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +3 -11
- package/android/src/main/java/com/swmansion/{reanimated → worklets}/AndroidUIScheduler.java +1 -1
- package/android/src/main/java/com/swmansion/worklets/JSCallInvokerResolver.java +27 -0
- package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThread.java → worklets/WorkletsMessageQueueThread.java} +2 -2
- package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThreadBase.java → worklets/WorkletsMessageQueueThreadBase.java} +3 -3
- package/android/src/main/java/com/swmansion/worklets/WorkletsModule.java +39 -9
- package/android/src/{reactNativeVersionPatch/NativeProxyPaper/latest → paper/java}/com/swmansion/reanimated/NativeProxy.java +13 -7
- package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +2 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/ReanimatedModule.java +11 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +11 -0
- package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +17 -2
- package/apple/reanimated/apple/LayoutReanimation/REASwizzledUIManager.mm +5 -6
- package/apple/reanimated/apple/REAModule.h +6 -9
- package/apple/reanimated/apple/REAModule.mm +52 -126
- package/apple/reanimated/apple/REANodesManager.h +0 -1
- package/apple/reanimated/apple/REANodesManager.mm +1 -8
- package/apple/reanimated/apple/native/NativeProxy.h +7 -14
- package/apple/reanimated/apple/native/NativeProxy.mm +58 -102
- package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.h +1 -1
- package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +2 -3
- package/apple/{reanimated/apple/native/REAIOSUIScheduler.h → worklets/apple/IOSUIScheduler.h} +3 -3
- package/apple/{reanimated/apple/native/REAIOSUIScheduler.mm → worklets/apple/IOSUIScheduler.mm} +4 -4
- package/apple/{reanimated/apple/native → worklets/apple}/PlatformLogger.mm +3 -3
- package/apple/{reanimated/apple/native/REAMessageThread.h → worklets/apple/WorkletsMessageThread.h} +1 -1
- package/apple/{reanimated/apple/native/REAMessageThread.mm → worklets/apple/WorkletsMessageThread.mm} +7 -7
- package/apple/worklets/apple/WorkletsModule.h +2 -2
- package/apple/worklets/apple/WorkletsModule.mm +31 -6
- package/lib/module/{PropsRegistry.js → AnimatedPropsRegistry.js} +2 -2
- package/lib/module/AnimatedPropsRegistry.js.map +1 -0
- package/lib/module/ReanimatedModule/NativeReanimated.js +29 -16
- package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
- package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js +23 -21
- package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/Sensor.js.map +1 -1
- package/lib/module/commonTypes.js.map +1 -1
- package/lib/module/component/FlatList.js +11 -13
- package/lib/module/component/FlatList.js.map +1 -1
- package/lib/module/component/LayoutAnimationConfig.js +9 -13
- package/lib/module/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/component/PerformanceMonitor.js +21 -25
- package/lib/module/component/PerformanceMonitor.js.map +1 -1
- package/lib/module/component/ScrollView.js +5 -5
- package/lib/module/component/ScrollView.js.map +1 -1
- package/lib/module/core.js +1 -1
- package/lib/module/core.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js +341 -0
- package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -0
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +4 -5
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/NativeEventsManager.js +35 -8
- package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +8 -385
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js +28 -0
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/css/component/AnimatedComponent.js +134 -0
- package/lib/module/css/component/AnimatedComponent.js.map +1 -0
- package/lib/module/css/component/createAnimatedComponent.js +30 -0
- package/lib/module/css/component/createAnimatedComponent.js.map +1 -0
- package/lib/module/css/component/index.js +4 -0
- package/lib/module/css/component/index.js.map +1 -0
- package/lib/module/css/constants/font.js +17 -0
- package/lib/module/css/constants/font.js.map +1 -0
- package/lib/module/css/constants/index.js +6 -0
- package/lib/module/css/constants/index.js.map +1 -0
- package/lib/module/css/constants/platform.js +5 -0
- package/lib/module/css/constants/platform.js.map +1 -0
- package/lib/module/css/constants/regex.js +6 -0
- package/lib/module/css/constants/regex.js.map +1 -0
- package/lib/module/css/easings/cubicBezier.js +34 -0
- package/lib/module/css/easings/cubicBezier.js.map +1 -0
- package/lib/module/css/easings/index.js +16 -0
- package/lib/module/css/easings/index.js.map +1 -0
- package/lib/module/css/easings/linear.js +123 -0
- package/lib/module/css/easings/linear.js.map +1 -0
- package/lib/module/css/easings/steps.js +97 -0
- package/lib/module/css/easings/steps.js.map +1 -0
- package/lib/module/css/easings/types.js +4 -0
- package/lib/module/css/easings/types.js.map +1 -0
- package/lib/module/css/errors.js +15 -0
- package/lib/module/css/errors.js.map +1 -0
- package/lib/module/css/index.js +6 -0
- package/lib/module/css/index.js.map +1 -0
- package/lib/module/css/managers/CSSAnimationsManager.js +98 -0
- package/lib/module/css/managers/CSSAnimationsManager.js.map +1 -0
- package/lib/module/css/managers/CSSAnimationsManager.web.js +139 -0
- package/lib/module/css/managers/CSSAnimationsManager.web.js.map +1 -0
- package/lib/module/css/managers/CSSManager.js +52 -0
- package/lib/module/css/managers/CSSManager.js.map +1 -0
- package/lib/module/css/managers/CSSManager.web.js +35 -0
- package/lib/module/css/managers/CSSManager.web.js.map +1 -0
- package/lib/module/css/managers/CSSTransitionManager.js +44 -0
- package/lib/module/css/managers/CSSTransitionManager.js.map +1 -0
- package/lib/module/css/managers/CSSTransitionManager.web.js +52 -0
- package/lib/module/css/managers/CSSTransitionManager.web.js.map +1 -0
- package/lib/module/css/managers/index.js +4 -0
- package/lib/module/css/managers/index.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRule.js +14 -0
- package/lib/module/css/models/CSSKeyframesRule.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRule.web.js +14 -0
- package/lib/module/css/models/CSSKeyframesRule.web.js.map +1 -0
- package/lib/module/css/models/CSSKeyframesRuleBase.js +29 -0
- package/lib/module/css/models/CSSKeyframesRuleBase.js.map +1 -0
- package/lib/module/css/models/index.js +4 -0
- package/lib/module/css/models/index.js.map +1 -0
- package/lib/module/css/platform/native/config.js +274 -0
- package/lib/module/css/platform/native/config.js.map +1 -0
- package/lib/module/css/platform/native/index.js +7 -0
- package/lib/module/css/platform/native/index.js.map +1 -0
- package/lib/module/css/platform/native/native.js +36 -0
- package/lib/module/css/platform/native/native.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/constants.js +6 -0
- package/lib/module/css/platform/native/normalization/animation/constants.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/index.js +7 -0
- package/lib/module/css/platform/native/normalization/animation/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/keyframes.js +107 -0
- package/lib/module/css/platform/native/normalization/animation/keyframes.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/properties.js +28 -0
- package/lib/module/css/platform/native/normalization/animation/properties.js.map +1 -0
- package/lib/module/css/platform/native/normalization/animation/settings.js +88 -0
- package/lib/module/css/platform/native/normalization/animation/settings.js.map +1 -0
- package/lib/module/css/platform/native/normalization/common/index.js +4 -0
- package/lib/module/css/platform/native/normalization/common/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/common/settings.js +51 -0
- package/lib/module/css/platform/native/normalization/common/settings.js.map +1 -0
- package/lib/module/css/platform/native/normalization/index.js +6 -0
- package/lib/module/css/platform/native/normalization/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/config.js +84 -0
- package/lib/module/css/platform/native/normalization/transition/config.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/constants.js +4 -0
- package/lib/module/css/platform/native/normalization/transition/constants.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/index.js +4 -0
- package/lib/module/css/platform/native/normalization/transition/index.js.map +1 -0
- package/lib/module/css/platform/native/normalization/transition/settings.js +14 -0
- package/lib/module/css/platform/native/normalization/transition/settings.js.map +1 -0
- package/lib/module/css/platform/native/style/builderFactory.js +59 -0
- package/lib/module/css/platform/native/style/builderFactory.js.map +1 -0
- package/lib/module/css/platform/native/style/index.js +6 -0
- package/lib/module/css/platform/native/style/index.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/colors.js +25 -0
- package/lib/module/css/platform/native/style/processors/colors.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/font.js +17 -0
- package/lib/module/css/platform/native/style/processors/font.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/index.js +10 -0
- package/lib/module/css/platform/native/style/processors/index.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/insets.js +17 -0
- package/lib/module/css/platform/native/style/processors/insets.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/others.js +26 -0
- package/lib/module/css/platform/native/style/processors/others.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/shadows.js +49 -0
- package/lib/module/css/platform/native/style/processors/shadows.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/transform.js +138 -0
- package/lib/module/css/platform/native/style/processors/transform.js.map +1 -0
- package/lib/module/css/platform/native/style/processors/transformOrigin.js +64 -0
- package/lib/module/css/platform/native/style/processors/transformOrigin.js.map +1 -0
- package/lib/module/css/platform/native/style/types.js +4 -0
- package/lib/module/css/platform/native/style/types.js.map +1 -0
- package/lib/module/css/platform/native/styleBuilder.js +7 -0
- package/lib/module/css/platform/native/styleBuilder.js.map +1 -0
- package/lib/module/css/platform/native/types/animation.js +4 -0
- package/lib/module/css/platform/native/types/animation.js.map +1 -0
- package/lib/module/css/platform/native/types/common.js +2 -0
- package/lib/module/css/platform/native/types/common.js.map +1 -0
- package/lib/module/css/platform/native/types/index.js +6 -0
- package/lib/module/css/platform/native/types/index.js.map +1 -0
- package/lib/module/css/platform/native/types/transition.js +4 -0
- package/lib/module/css/platform/native/types/transition.js.map +1 -0
- package/lib/module/css/platform/web/animationParser.js +28 -0
- package/lib/module/css/platform/web/animationParser.js.map +1 -0
- package/lib/module/css/platform/web/config.js +265 -0
- package/lib/module/css/platform/web/config.js.map +1 -0
- package/lib/module/css/platform/web/domUtils.js +75 -0
- package/lib/module/css/platform/web/domUtils.js.map +1 -0
- package/lib/module/css/platform/web/index.js +6 -0
- package/lib/module/css/platform/web/index.js.map +1 -0
- package/lib/module/css/platform/web/style/builderFactories.js +124 -0
- package/lib/module/css/platform/web/style/builderFactories.js.map +1 -0
- package/lib/module/css/platform/web/style/builders/index.js +4 -0
- package/lib/module/css/platform/web/style/builders/index.js.map +1 -0
- package/lib/module/css/platform/web/style/builders/shadows.js +45 -0
- package/lib/module/css/platform/web/style/builders/shadows.js.map +1 -0
- package/lib/module/css/platform/web/style/index.js +7 -0
- package/lib/module/css/platform/web/style/index.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/colors.js +12 -0
- package/lib/module/css/platform/web/style/processors/colors.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/filter.js +28 -0
- package/lib/module/css/platform/web/style/processors/filter.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/font.js +13 -0
- package/lib/module/css/platform/web/style/processors/font.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/index.js +10 -0
- package/lib/module/css/platform/web/style/processors/index.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/margins.js +24 -0
- package/lib/module/css/platform/web/style/processors/margins.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/paddings.js +24 -0
- package/lib/module/css/platform/web/style/processors/paddings.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/shadows.js +17 -0
- package/lib/module/css/platform/web/style/processors/shadows.js.map +1 -0
- package/lib/module/css/platform/web/style/processors/transforms.js +37 -0
- package/lib/module/css/platform/web/style/processors/transforms.js.map +1 -0
- package/lib/module/css/platform/web/style/types.js +4 -0
- package/lib/module/css/platform/web/style/types.js.map +1 -0
- package/lib/module/css/platform/web/utils.js +69 -0
- package/lib/module/css/platform/web/utils.js.map +1 -0
- package/lib/module/css/stylesheet.js +25 -0
- package/lib/module/css/stylesheet.js.map +1 -0
- package/lib/module/css/types/animation.js +4 -0
- package/lib/module/css/types/animation.js.map +1 -0
- package/lib/module/css/types/common.js +4 -0
- package/lib/module/css/types/common.js.map +1 -0
- package/lib/module/css/types/config.js +4 -0
- package/lib/module/css/types/config.js.map +1 -0
- package/lib/module/css/types/helpers.js +4 -0
- package/lib/module/css/types/helpers.js.map +1 -0
- package/lib/module/css/types/index.js +9 -0
- package/lib/module/css/types/index.js.map +1 -0
- package/lib/module/css/types/props.js +4 -0
- package/lib/module/css/types/props.js.map +1 -0
- package/lib/module/css/types/transition.js +4 -0
- package/lib/module/css/types/transition.js.map +1 -0
- package/lib/module/css/utils/conversions.js +8 -0
- package/lib/module/css/utils/conversions.js.map +1 -0
- package/lib/module/css/utils/equality.js +57 -0
- package/lib/module/css/utils/equality.js.map +1 -0
- package/lib/module/css/utils/guards.js +24 -0
- package/lib/module/css/utils/guards.js.map +1 -0
- package/lib/module/css/utils/index.js +8 -0
- package/lib/module/css/utils/index.js.map +1 -0
- package/lib/module/css/utils/parsers.js +27 -0
- package/lib/module/css/utils/parsers.js.map +1 -0
- package/lib/module/css/utils/props.js +34 -0
- package/lib/module/css/utils/props.js.map +1 -0
- package/lib/module/fabricUtils.js +4 -11
- package/lib/module/fabricUtils.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/initializers.js +5 -1
- package/lib/module/initializers.js.map +1 -1
- package/lib/module/layoutReanimation/web/componentUtils.js +1 -0
- package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/logger/logger.js +3 -3
- package/lib/module/logger/logger.js.map +1 -1
- package/lib/module/mock.js +38 -6
- package/lib/module/mock.js.map +1 -1
- package/lib/module/mutables.js +2 -2
- package/lib/module/platform-specific/findHostInstance.js +53 -0
- package/lib/module/platform-specific/findHostInstance.js.map +1 -0
- package/lib/module/platform-specific/findHostInstance.web.js +4 -0
- package/lib/module/platform-specific/findHostInstance.web.js.map +1 -0
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/propsAllowlists.js +7 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/runtimes.js +3 -3
- package/lib/module/runtimes.js.map +1 -1
- package/lib/module/shareables.js +215 -141
- package/lib/module/shareables.js.map +1 -1
- package/lib/module/threads.js +5 -5
- package/lib/module/threads.js.map +1 -1
- package/lib/module/worklets/WorkletsModule/JSWorklets.js +27 -1
- package/lib/module/worklets/WorkletsModule/JSWorklets.js.map +1 -1
- package/lib/module/worklets/WorkletsModule/NativeWorklets.js +15 -0
- package/lib/module/worklets/WorkletsModule/NativeWorklets.js.map +1 -1
- package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js +1 -1
- package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js.map +1 -1
- package/lib/typescript/{PropsRegistry.d.ts → AnimatedPropsRegistry.d.ts} +1 -1
- package/lib/typescript/AnimatedPropsRegistry.d.ts.map +1 -0
- package/lib/typescript/ReanimatedModule/NativeReanimated.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/js-reanimated/JSReanimated.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +14 -8
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
- package/lib/typescript/Sensor.d.ts.map +1 -1
- package/lib/typescript/commonTypes.d.ts +14 -21
- package/lib/typescript/commonTypes.d.ts.map +1 -1
- package/lib/typescript/core.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +58 -0
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts +2 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +1 -3
- package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +11 -7
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +2 -7
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/utils.d.ts +5 -0
- package/lib/typescript/createAnimatedComponent/utils.d.ts.map +1 -1
- package/lib/typescript/css/component/AnimatedComponent.d.ts +29 -0
- package/lib/typescript/css/component/AnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/css/component/createAnimatedComponent.d.ts +12 -0
- package/lib/typescript/css/component/createAnimatedComponent.d.ts.map +1 -0
- package/lib/typescript/css/component/index.d.ts +2 -0
- package/lib/typescript/css/component/index.d.ts.map +1 -0
- package/lib/typescript/css/constants/font.d.ts +15 -0
- package/lib/typescript/css/constants/font.d.ts.map +1 -0
- package/lib/typescript/css/constants/index.d.ts +4 -0
- package/lib/typescript/css/constants/index.d.ts.map +1 -0
- package/lib/typescript/css/constants/platform.d.ts +2 -0
- package/lib/typescript/css/constants/platform.d.ts.map +1 -0
- package/lib/typescript/css/constants/regex.d.ts +4 -0
- package/lib/typescript/css/constants/regex.d.ts.map +1 -0
- package/lib/typescript/css/easings/cubicBezier.d.ts +15 -0
- package/lib/typescript/css/easings/cubicBezier.d.ts.map +1 -0
- package/lib/typescript/css/easings/index.d.ts +10 -0
- package/lib/typescript/css/easings/index.d.ts.map +1 -0
- package/lib/typescript/css/easings/linear.d.ts +17 -0
- package/lib/typescript/css/easings/linear.d.ts.map +1 -0
- package/lib/typescript/css/easings/steps.d.ts +18 -0
- package/lib/typescript/css/easings/steps.d.ts.map +1 -0
- package/lib/typescript/css/easings/types.d.ts +26 -0
- package/lib/typescript/css/easings/types.d.ts.map +1 -0
- package/lib/typescript/css/errors.d.ts +9 -0
- package/lib/typescript/css/errors.d.ts.map +1 -0
- package/lib/typescript/css/index.d.ts +5 -0
- package/lib/typescript/css/index.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.d.ts +13 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts +15 -0
- package/lib/typescript/css/managers/CSSAnimationsManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSManager.d.ts +12 -0
- package/lib/typescript/css/managers/CSSManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSManager.web.d.ts +12 -0
- package/lib/typescript/css/managers/CSSManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSTransitionManager.d.ts +12 -0
- package/lib/typescript/css/managers/CSSTransitionManager.d.ts.map +1 -0
- package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts +11 -0
- package/lib/typescript/css/managers/CSSTransitionManager.web.d.ts.map +1 -0
- package/lib/typescript/css/managers/index.d.ts +2 -0
- package/lib/typescript/css/managers/index.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRule.d.ts +9 -0
- package/lib/typescript/css/models/CSSKeyframesRule.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts +8 -0
- package/lib/typescript/css/models/CSSKeyframesRule.web.d.ts.map +1 -0
- package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts +14 -0
- package/lib/typescript/css/models/CSSKeyframesRuleBase.d.ts.map +1 -0
- package/lib/typescript/css/models/index.d.ts +2 -0
- package/lib/typescript/css/models/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/config.d.ts +5 -0
- package/lib/typescript/css/platform/native/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/index.d.ts +5 -0
- package/lib/typescript/css/platform/native/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/native.d.ts +14 -0
- package/lib/typescript/css/platform/native/native.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts +5 -0
- package/lib/typescript/css/platform/native/normalization/animation/constants.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/index.d.ts +5 -0
- package/lib/typescript/css/platform/native/normalization/animation/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts +8 -0
- package/lib/typescript/css/platform/native/normalization/animation/keyframes.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts +3 -0
- package/lib/typescript/css/platform/native/normalization/animation/properties.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts +16 -0
- package/lib/typescript/css/platform/native/normalization/animation/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/common/index.d.ts +2 -0
- package/lib/typescript/css/platform/native/normalization/common/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/common/settings.d.ts +14 -0
- package/lib/typescript/css/platform/native/normalization/common/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/normalization/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/config.d.ts +8 -0
- package/lib/typescript/css/platform/native/normalization/transition/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts +3 -0
- package/lib/typescript/css/platform/native/normalization/transition/constants.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/index.d.ts +2 -0
- package/lib/typescript/css/platform/native/normalization/transition/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts +6 -0
- package/lib/typescript/css/platform/native/normalization/transition/settings.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/builderFactory.d.ts +4 -0
- package/lib/typescript/css/platform/native/style/builderFactory.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/style/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/colors.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/colors.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/font.d.ts +3 -0
- package/lib/typescript/css/platform/native/style/processors/font.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/index.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/insets.d.ts +8 -0
- package/lib/typescript/css/platform/native/style/processors/insets.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/others.d.ts +7 -0
- package/lib/typescript/css/platform/native/style/processors/others.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/shadows.d.ts +13 -0
- package/lib/typescript/css/platform/native/style/processors/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/transform.d.ts +7 -0
- package/lib/typescript/css/platform/native/style/processors/transform.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts +9 -0
- package/lib/typescript/css/platform/native/style/processors/transformOrigin.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/style/types.d.ts +16 -0
- package/lib/typescript/css/platform/native/style/types.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/styleBuilder.d.ts +3 -0
- package/lib/typescript/css/platform/native/styleBuilder.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/animation.d.ts +29 -0
- package/lib/typescript/css/platform/native/types/animation.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/common.d.ts +7 -0
- package/lib/typescript/css/platform/native/types/common.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/index.d.ts +4 -0
- package/lib/typescript/css/platform/native/types/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/native/types/transition.d.ts +15 -0
- package/lib/typescript/css/platform/native/types/transition.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/animationParser.d.ts +3 -0
- package/lib/typescript/css/platform/web/animationParser.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/config.d.ts +4 -0
- package/lib/typescript/css/platform/web/config.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/domUtils.d.ts +4 -0
- package/lib/typescript/css/platform/web/domUtils.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/index.d.ts +4 -0
- package/lib/typescript/css/platform/web/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builderFactories.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/builderFactories.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builders/index.d.ts +2 -0
- package/lib/typescript/css/platform/web/style/builders/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/builders/shadows.d.ts +7 -0
- package/lib/typescript/css/platform/web/style/builders/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/index.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/colors.d.ts +4 -0
- package/lib/typescript/css/platform/web/style/processors/colors.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/filter.d.ts +4 -0
- package/lib/typescript/css/platform/web/style/processors/filter.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/font.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/font.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/index.d.ts +8 -0
- package/lib/typescript/css/platform/web/style/processors/index.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/margins.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/margins.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/paddings.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/paddings.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/shadows.d.ts +7 -0
- package/lib/typescript/css/platform/web/style/processors/shadows.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/processors/transforms.d.ts +5 -0
- package/lib/typescript/css/platform/web/style/processors/transforms.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/style/types.d.ts +35 -0
- package/lib/typescript/css/platform/web/style/types.d.ts.map +1 -0
- package/lib/typescript/css/platform/web/utils.d.ts +11 -0
- package/lib/typescript/css/platform/web/utils.d.ts.map +1 -0
- package/lib/typescript/css/stylesheet.d.ts +11 -0
- package/lib/typescript/css/stylesheet.d.ts.map +1 -0
- package/lib/typescript/css/types/animation.d.ts +47 -0
- package/lib/typescript/css/types/animation.d.ts.map +1 -0
- package/lib/typescript/css/types/common.d.ts +12 -0
- package/lib/typescript/css/types/common.d.ts.map +1 -0
- package/lib/typescript/css/types/config.d.ts +5 -0
- package/lib/typescript/css/types/config.d.ts.map +1 -0
- package/lib/typescript/css/types/helpers.d.ts +12 -0
- package/lib/typescript/css/types/helpers.d.ts.map +1 -0
- package/lib/typescript/css/types/index.d.ts +7 -0
- package/lib/typescript/css/types/index.d.ts.map +1 -0
- package/lib/typescript/css/types/props.d.ts +17 -0
- package/lib/typescript/css/types/props.d.ts.map +1 -0
- package/lib/typescript/css/types/transition.d.ts +26 -0
- package/lib/typescript/css/types/transition.d.ts.map +1 -0
- package/lib/typescript/css/utils/conversions.d.ts +3 -0
- package/lib/typescript/css/utils/conversions.d.ts.map +1 -0
- package/lib/typescript/css/utils/equality.d.ts +3 -0
- package/lib/typescript/css/utils/equality.d.ts.map +1 -0
- package/lib/typescript/css/utils/guards.d.ts +20 -0
- package/lib/typescript/css/utils/guards.d.ts.map +1 -0
- package/lib/typescript/css/utils/index.d.ts +6 -0
- package/lib/typescript/css/utils/index.d.ts.map +1 -0
- package/lib/typescript/css/utils/parsers.d.ts +3 -0
- package/lib/typescript/css/utils/parsers.d.ts.map +1 -0
- package/lib/typescript/css/utils/props.d.ts +7 -0
- package/lib/typescript/css/utils/props.d.ts.map +1 -0
- package/lib/typescript/fabricUtils.d.ts +2 -1
- package/lib/typescript/fabricUtils.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/initializers.d.ts +2 -1
- package/lib/typescript/initializers.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
- package/lib/typescript/platform-specific/findHostInstance.d.ts +15 -0
- package/lib/typescript/platform-specific/findHostInstance.d.ts.map +1 -0
- package/lib/typescript/platform-specific/findHostInstance.web.d.ts +2 -0
- package/lib/typescript/platform-specific/findHostInstance.web.d.ts.map +1 -0
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts.map +1 -1
- package/lib/typescript/propsAllowlists.d.ts.map +1 -1
- package/lib/typescript/shareables.d.ts +4 -1
- package/lib/typescript/shareables.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/JSWorklets.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/NativeWorklets.d.ts.map +1 -1
- package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts +7 -0
- package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/{PropsRegistry.ts → AnimatedPropsRegistry.ts} +3 -1
- package/src/ReanimatedModule/NativeReanimated.ts +73 -37
- package/src/ReanimatedModule/js-reanimated/JSReanimated.ts +66 -39
- package/src/ReanimatedModule/reanimatedModuleProxy.ts +39 -22
- package/src/Sensor.ts +2 -1
- package/src/commonTypes.ts +26 -62
- package/src/core.ts +9 -4
- package/src/createAnimatedComponent/AnimatedComponent.tsx +510 -0
- package/src/createAnimatedComponent/JSPropsUpdater.ts +5 -6
- package/src/createAnimatedComponent/NativeEventsManager.ts +45 -19
- package/src/createAnimatedComponent/commonTypes.ts +17 -7
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +14 -563
- package/src/createAnimatedComponent/setAndForwardRef.ts +1 -1
- package/src/createAnimatedComponent/utils.ts +25 -0
- package/src/css/component/AnimatedComponent.tsx +181 -0
- package/src/css/component/createAnimatedComponent.tsx +67 -0
- package/src/css/component/index.ts +2 -0
- package/src/css/constants/font.ts +15 -0
- package/src/css/constants/index.ts +4 -0
- package/src/css/constants/platform.ts +4 -0
- package/src/css/constants/regex.ts +4 -0
- package/src/css/easings/cubicBezier.ts +46 -0
- package/src/css/easings/index.ts +29 -0
- package/src/css/easings/linear.ts +151 -0
- package/src/css/easings/steps.ts +104 -0
- package/src/css/easings/types.ts +54 -0
- package/src/css/errors.ts +20 -0
- package/src/css/index.ts +24 -0
- package/src/css/managers/CSSAnimationsManager.ts +155 -0
- package/src/css/managers/CSSAnimationsManager.web.ts +203 -0
- package/src/css/managers/CSSManager.ts +65 -0
- package/src/css/managers/CSSManager.web.ts +52 -0
- package/src/css/managers/CSSTransitionManager.ts +67 -0
- package/src/css/managers/CSSTransitionManager.web.ts +83 -0
- package/src/css/managers/index.ts +2 -0
- package/src/css/models/CSSKeyframesRule.ts +20 -0
- package/src/css/models/CSSKeyframesRule.web.ts +23 -0
- package/src/css/models/CSSKeyframesRuleBase.ts +45 -0
- package/src/css/models/index.ts +2 -0
- package/src/css/platform/native/config.ts +237 -0
- package/src/css/platform/native/index.ts +5 -0
- package/src/css/platform/native/native.ts +61 -0
- package/src/css/platform/native/normalization/animation/constants.ts +25 -0
- package/src/css/platform/native/normalization/animation/index.ts +5 -0
- package/src/css/platform/native/normalization/animation/keyframes.ts +145 -0
- package/src/css/platform/native/normalization/animation/properties.ts +38 -0
- package/src/css/platform/native/normalization/animation/settings.ts +136 -0
- package/src/css/platform/native/normalization/common/index.ts +6 -0
- package/src/css/platform/native/normalization/common/settings.ts +86 -0
- package/src/css/platform/native/normalization/index.ts +4 -0
- package/src/css/platform/native/normalization/transition/config.ts +136 -0
- package/src/css/platform/native/normalization/transition/constants.ts +7 -0
- package/src/css/platform/native/normalization/transition/index.ts +5 -0
- package/src/css/platform/native/normalization/transition/settings.ts +20 -0
- package/src/css/platform/native/style/builderFactory.ts +81 -0
- package/src/css/platform/native/style/index.ts +4 -0
- package/src/css/platform/native/style/processors/colors.ts +36 -0
- package/src/css/platform/native/style/processors/font.ts +21 -0
- package/src/css/platform/native/style/processors/index.ts +8 -0
- package/src/css/platform/native/style/processors/insets.ts +25 -0
- package/src/css/platform/native/style/processors/others.ts +30 -0
- package/src/css/platform/native/style/processors/shadows.ts +74 -0
- package/src/css/platform/native/style/processors/transform.ts +182 -0
- package/src/css/platform/native/style/processors/transformOrigin.ts +117 -0
- package/src/css/platform/native/style/types.ts +33 -0
- package/src/css/platform/native/styleBuilder.ts +7 -0
- package/src/css/platform/native/types/animation.ts +50 -0
- package/src/css/platform/native/types/common.ts +8 -0
- package/src/css/platform/native/types/index.ts +4 -0
- package/src/css/platform/native/types/transition.ts +20 -0
- package/src/css/platform/web/animationParser.ts +46 -0
- package/src/css/platform/web/config.ts +233 -0
- package/src/css/platform/web/domUtils.ts +101 -0
- package/src/css/platform/web/index.ts +4 -0
- package/src/css/platform/web/style/builderFactories.ts +220 -0
- package/src/css/platform/web/style/builders/index.ts +2 -0
- package/src/css/platform/web/style/builders/shadows.ts +57 -0
- package/src/css/platform/web/style/index.ts +5 -0
- package/src/css/platform/web/style/processors/colors.ts +15 -0
- package/src/css/platform/web/style/processors/filter.ts +46 -0
- package/src/css/platform/web/style/processors/font.ts +17 -0
- package/src/css/platform/web/style/processors/index.ts +8 -0
- package/src/css/platform/web/style/processors/margins.ts +34 -0
- package/src/css/platform/web/style/processors/paddings.ts +34 -0
- package/src/css/platform/web/style/processors/shadows.ts +40 -0
- package/src/css/platform/web/style/processors/transforms.ts +59 -0
- package/src/css/platform/web/style/types.ts +77 -0
- package/src/css/platform/web/utils.ts +108 -0
- package/src/css/stylesheet.ts +37 -0
- package/src/css/types/animation.ts +74 -0
- package/src/css/types/common.ts +24 -0
- package/src/css/types/config.ts +6 -0
- package/src/css/types/helpers.ts +29 -0
- package/src/css/types/index.ts +7 -0
- package/src/css/types/props.ts +36 -0
- package/src/css/types/transition.ts +38 -0
- package/src/css/utils/conversions.ts +15 -0
- package/src/css/utils/equality.ts +67 -0
- package/src/css/utils/guards.ts +85 -0
- package/src/css/utils/index.ts +6 -0
- package/src/css/utils/parsers.ts +36 -0
- package/src/css/utils/props.ts +64 -0
- package/src/fabricUtils.ts +9 -15
- package/src/index.ts +1 -0
- package/src/initializers.ts +8 -1
- package/src/layoutReanimation/web/componentUtils.ts +1 -0
- package/src/logger/logger.ts +3 -3
- package/src/mock.ts +36 -2
- package/src/mutables.ts +2 -2
- package/src/platform-specific/findHostInstance.ts +88 -0
- package/src/platform-specific/findHostInstance.web.ts +3 -0
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/propsAllowlists.ts +6 -0
- package/src/runtimes.ts +3 -3
- package/src/shareables.ts +315 -164
- package/src/threads.ts +5 -5
- package/src/worklets/WorkletsModule/JSWorklets.ts +47 -2
- package/src/worklets/WorkletsModule/NativeWorklets.ts +38 -1
- package/src/worklets/WorkletsModule/workletsModuleProxy.ts +26 -1
- package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -41
- package/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -59
- package/Common/cpp/reanimated/NativeModules/NativeReanimatedModuleSpec.cpp +0 -210
- package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.cpp +0 -19
- package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.h +0 -14
- package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.cpp +0 -25
- package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.h +0 -23
- package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.cpp +0 -9
- package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.h +0 -18
- package/android/src/reactNativeVersionPatch/NativeProxyFabric/74/com/swmansion/reanimated/NativeProxy.java +0 -149
- package/android/src/reactNativeVersionPatch/NativeProxyPaper/74/com/swmansion/reanimated/NativeProxy.java +0 -153
- package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.h +0 -12
- package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.mm +0 -73
- package/lib/module/PropsRegistry.js.map +0 -1
- package/lib/module/platform-specific/RNRenderer.js +0 -6
- package/lib/module/platform-specific/RNRenderer.js.map +0 -1
- package/lib/module/platform-specific/RNRenderer.web.js +0 -6
- package/lib/module/platform-specific/RNRenderer.web.js.map +0 -1
- package/lib/typescript/PropsRegistry.d.ts.map +0 -1
- package/lib/typescript/platform-specific/RNRenderer.d.ts +0 -2
- package/lib/typescript/platform-specific/RNRenderer.d.ts.map +0 -1
- package/lib/typescript/platform-specific/RNRenderer.web.d.ts +0 -3
- package/lib/typescript/platform-specific/RNRenderer.web.d.ts.map +0 -1
- package/src/platform-specific/RNRenderer.ts +0 -4
- package/src/platform-specific/RNRenderer.web.ts +0 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#include <reanimated/CSS/common/Quaternion.h>
|
|
3
|
+
|
|
4
|
+
namespace reanimated {
|
|
5
|
+
|
|
6
|
+
bool Quaternion::operator==(const Quaternion &other) const {
|
|
7
|
+
return x == other.x && y == other.y && z == other.z && w == other.w;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#ifndef NDEBUG
|
|
11
|
+
|
|
12
|
+
std::ostream &operator<<(std::ostream &os, const Quaternion &quaternion) {
|
|
13
|
+
os << "Quaternion(" << quaternion.x << ", " << quaternion.y << ", "
|
|
14
|
+
<< quaternion.z << ", " << quaternion.w << ")";
|
|
15
|
+
return os;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#endif // NDEBUG
|
|
19
|
+
|
|
20
|
+
Quaternion Quaternion::interpolate(const double t, const Quaternion &other)
|
|
21
|
+
const {
|
|
22
|
+
const double kEpsilon = 1e-5;
|
|
23
|
+
Quaternion copy = *this;
|
|
24
|
+
|
|
25
|
+
double cosHalfAngle =
|
|
26
|
+
copy.x * other.x + copy.y * other.y + copy.z * other.z + copy.w * other.w;
|
|
27
|
+
|
|
28
|
+
if (cosHalfAngle < 0.0) {
|
|
29
|
+
copy.x = -copy.x;
|
|
30
|
+
copy.y = -copy.y;
|
|
31
|
+
copy.z = -copy.z;
|
|
32
|
+
copy.w = -copy.w;
|
|
33
|
+
cosHalfAngle = -cosHalfAngle;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (cosHalfAngle > 1)
|
|
37
|
+
cosHalfAngle = 1;
|
|
38
|
+
|
|
39
|
+
double sinHalfAngle = std::sqrt(1.0 - cosHalfAngle * cosHalfAngle);
|
|
40
|
+
if (sinHalfAngle < kEpsilon) {
|
|
41
|
+
// Quaternions share common axis and angle.
|
|
42
|
+
return *this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
double halfAngle = std::acos(cosHalfAngle);
|
|
46
|
+
double scale = std::sin((1 - t) * halfAngle) / sinHalfAngle;
|
|
47
|
+
double invscale = std::sin(t * halfAngle) / sinHalfAngle;
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
copy.x * scale + other.x * invscale,
|
|
51
|
+
copy.y * scale + other.y * invscale,
|
|
52
|
+
copy.z * scale + other.z * invscale,
|
|
53
|
+
copy.w * scale + other.w * invscale};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
} // namespace reanimated
|
|
57
|
+
|
|
58
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <cmath>
|
|
5
|
+
|
|
6
|
+
#ifndef NDEBUG
|
|
7
|
+
#include <iostream>
|
|
8
|
+
#endif // NDEBUG
|
|
9
|
+
|
|
10
|
+
namespace reanimated {
|
|
11
|
+
|
|
12
|
+
struct Quaternion {
|
|
13
|
+
double x, y, z, w;
|
|
14
|
+
|
|
15
|
+
bool operator==(const Quaternion &other) const;
|
|
16
|
+
|
|
17
|
+
#ifndef NDEBUG
|
|
18
|
+
friend std::ostream &operator<<(
|
|
19
|
+
std::ostream &os,
|
|
20
|
+
const Quaternion &quaternion);
|
|
21
|
+
#endif // NDEBUG
|
|
22
|
+
|
|
23
|
+
Quaternion interpolate(double progress, const Quaternion &other) const;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
} // namespace reanimated
|
|
27
|
+
|
|
28
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#include <reanimated/CSS/common/TransformMatrix.h>
|
|
3
|
+
|
|
4
|
+
namespace reanimated {
|
|
5
|
+
|
|
6
|
+
DecomposedTransformMatrix DecomposedTransformMatrix::interpolate(
|
|
7
|
+
const double progress,
|
|
8
|
+
const DecomposedTransformMatrix &other) const {
|
|
9
|
+
return {
|
|
10
|
+
.scale = scale.interpolate(progress, other.scale),
|
|
11
|
+
.skew = skew.interpolate(progress, other.skew),
|
|
12
|
+
.quaternion = quaternion.interpolate(progress, other.quaternion),
|
|
13
|
+
.translation = translation.interpolate(progress, other.translation),
|
|
14
|
+
.perspective = perspective.interpolate(progress, other.perspective)};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#ifndef NDEBUG
|
|
18
|
+
|
|
19
|
+
std::ostream &operator<<(
|
|
20
|
+
std::ostream &os,
|
|
21
|
+
const DecomposedTransformMatrix &decomposed) {
|
|
22
|
+
os << "DecomposedTransformMatrix(scale=" << decomposed.scale
|
|
23
|
+
<< ", skew=" << decomposed.skew << ", quaternion=" << decomposed.quaternion
|
|
24
|
+
<< ", translation=" << decomposed.translation
|
|
25
|
+
<< ", perspective=" << decomposed.perspective << ")";
|
|
26
|
+
return os;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#endif // NDEBUG
|
|
30
|
+
|
|
31
|
+
TransformMatrix::TransformMatrix(const Vec16Array &matrix) {
|
|
32
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
33
|
+
matrix_[i / 4][i % 4] = matrix[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
TransformMatrix::TransformMatrix(const Matrix4x4 &matrix) : matrix_(matrix) {}
|
|
38
|
+
|
|
39
|
+
TransformMatrix::TransformMatrix(jsi::Runtime &rt, const jsi::Value &value) {
|
|
40
|
+
const auto array = value.asObject(rt).asArray(rt);
|
|
41
|
+
if (array.size(rt) != 16) {
|
|
42
|
+
throw std::invalid_argument(
|
|
43
|
+
"[Reanimated] Matrix array should have 16 elements");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
47
|
+
matrix_[i / 4][i % 4] = array.getValueAtIndex(rt, i).asNumber();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
TransformMatrix TransformMatrix::Identity() {
|
|
52
|
+
return TransformMatrix({{// clang-format off
|
|
53
|
+
{1, 0, 0, 0},
|
|
54
|
+
{0, 1, 0, 0},
|
|
55
|
+
{0, 0, 1, 0},
|
|
56
|
+
{0, 0, 0, 1}
|
|
57
|
+
}}); // clang-format on
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
TransformMatrix TransformMatrix::Perspective(const double v) {
|
|
61
|
+
if (v == 0) {
|
|
62
|
+
// Ignore perspective if it is invalid
|
|
63
|
+
return TransformMatrix::Identity();
|
|
64
|
+
}
|
|
65
|
+
return TransformMatrix({{// clang-format off
|
|
66
|
+
{1, 0, 0, 0},
|
|
67
|
+
{0, 1, 0, 0},
|
|
68
|
+
{0, 0, 1, -1.0 / v},
|
|
69
|
+
{0, 0, 0, 1}
|
|
70
|
+
}}); // clang-format on
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
TransformMatrix TransformMatrix::RotateX(const double v) {
|
|
74
|
+
const auto cosVal = std::cos(v);
|
|
75
|
+
const auto sinVal = std::sin(v);
|
|
76
|
+
return TransformMatrix({{// clang-format off
|
|
77
|
+
{1, 0, 0, 0},
|
|
78
|
+
{0, cosVal, sinVal, 0},
|
|
79
|
+
{0, -sinVal, cosVal, 0},
|
|
80
|
+
{0, 0, 0, 1}
|
|
81
|
+
}}); // clang-format on
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
TransformMatrix TransformMatrix::RotateY(const double v) {
|
|
85
|
+
const auto cosVal = std::cos(v);
|
|
86
|
+
const auto sinVal = std::sin(v);
|
|
87
|
+
return TransformMatrix({{// clang-format off
|
|
88
|
+
{cosVal, 0, -sinVal, 0},
|
|
89
|
+
{ 0, 1, 0, 0},
|
|
90
|
+
{sinVal, 0, cosVal, 0},
|
|
91
|
+
{ 0, 0, 0, 1}
|
|
92
|
+
}}); // clang-format on
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
TransformMatrix TransformMatrix::RotateZ(const double v) {
|
|
96
|
+
const auto cosVal = std::cos(v);
|
|
97
|
+
const auto sinVal = std::sin(v);
|
|
98
|
+
return TransformMatrix({{// clang-format off
|
|
99
|
+
{ cosVal, sinVal, 0, 0},
|
|
100
|
+
{-sinVal, cosVal, 0, 0},
|
|
101
|
+
{ 0, 0, 1, 0},
|
|
102
|
+
{ 0, 0, 0, 1}
|
|
103
|
+
}}); // clang-format on
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
TransformMatrix TransformMatrix::Scale(const double v) {
|
|
107
|
+
return TransformMatrix({{// clang-format off
|
|
108
|
+
{v, 0, 0, 0},
|
|
109
|
+
{0, v, 0, 0},
|
|
110
|
+
{0, 0, v, 0},
|
|
111
|
+
{0, 0, 0, 1}
|
|
112
|
+
}}); // clang-format on
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
TransformMatrix TransformMatrix::ScaleX(const double v) {
|
|
116
|
+
return TransformMatrix({{// clang-format off
|
|
117
|
+
{v, 0, 0, 0},
|
|
118
|
+
{0, 1, 0, 0},
|
|
119
|
+
{0, 0, 1, 0},
|
|
120
|
+
{0, 0, 0, 1}
|
|
121
|
+
}}); // clang-format on
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
TransformMatrix TransformMatrix::ScaleY(const double v) {
|
|
125
|
+
return TransformMatrix({{// clang-format off
|
|
126
|
+
{1, 0, 0, 0},
|
|
127
|
+
{0, v, 0, 0},
|
|
128
|
+
{0, 0, 1, 0},
|
|
129
|
+
{0, 0, 0, 1}
|
|
130
|
+
}}); // clang-format on
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
TransformMatrix TransformMatrix::TranslateX(const double v) {
|
|
134
|
+
return TransformMatrix({{// clang-format off
|
|
135
|
+
{1, 0, 0, 0},
|
|
136
|
+
{0, 1, 0, 0},
|
|
137
|
+
{0, 0, 1, 0},
|
|
138
|
+
{v, 0, 0, 1}
|
|
139
|
+
}}); // clang-format on
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
TransformMatrix TransformMatrix::TranslateY(const double v) {
|
|
143
|
+
return TransformMatrix({{// clang-format off
|
|
144
|
+
{1, 0, 0, 0},
|
|
145
|
+
{0, 1, 0, 0},
|
|
146
|
+
{0, 0, 1, 0},
|
|
147
|
+
{0, v, 0, 1}
|
|
148
|
+
}}); // clang-format on
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
TransformMatrix TransformMatrix::SkewX(const double v) {
|
|
152
|
+
const auto tan = std::tan(v);
|
|
153
|
+
return TransformMatrix({{// clang-format off
|
|
154
|
+
{ 1, 0, 0, 0},
|
|
155
|
+
{tan, 1, 0, 0},
|
|
156
|
+
{ 0, 0, 1, 0},
|
|
157
|
+
{ 0, 0, 0, 1}
|
|
158
|
+
}}); // clang-format on
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
TransformMatrix TransformMatrix::SkewY(const double v) {
|
|
162
|
+
const auto tan = std::tan(v);
|
|
163
|
+
return TransformMatrix({{// clang-format off
|
|
164
|
+
{1, tan, 0, 0},
|
|
165
|
+
{0, 1, 0, 0},
|
|
166
|
+
{0, 0, 1, 0},
|
|
167
|
+
{0, 0, 0, 1}
|
|
168
|
+
}}); // clang-format on
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
std::array<double, 4> &TransformMatrix::operator[](const size_t rowIdx) {
|
|
172
|
+
return matrix_[rowIdx];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const std::array<double, 4> &TransformMatrix::operator[](
|
|
176
|
+
const size_t rowIdx) const {
|
|
177
|
+
return matrix_[rowIdx];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
bool TransformMatrix::operator==(const TransformMatrix &other) const {
|
|
181
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
182
|
+
for (size_t j = 0; j < 4; ++j) {
|
|
183
|
+
if (matrix_[i][j] != other.matrix_[i][j]) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
TransformMatrix TransformMatrix::operator*(const TransformMatrix &rhs) const {
|
|
192
|
+
const auto &a = matrix_;
|
|
193
|
+
const auto &b = rhs.matrix_;
|
|
194
|
+
Matrix4x4 result{};
|
|
195
|
+
|
|
196
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
197
|
+
for (size_t j = 0; j < 4; ++j) {
|
|
198
|
+
result[i][j] = 0;
|
|
199
|
+
for (size_t k = 0; k < 4; ++k) {
|
|
200
|
+
result[i][j] += a[i][k] * b[k][j];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return TransformMatrix(result);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
TransformMatrix TransformMatrix::operator*=(const TransformMatrix &rhs) {
|
|
209
|
+
*this = *this * rhs;
|
|
210
|
+
return *this;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
Vector4D operator*(const Vector4D &v, const TransformMatrix &m) {
|
|
214
|
+
Vector4D result;
|
|
215
|
+
|
|
216
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
217
|
+
result[i] = 0;
|
|
218
|
+
for (size_t j = 0; j < 4; ++j) {
|
|
219
|
+
result[i] += v[j] * m[j][i];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
#ifndef NDEBUG
|
|
227
|
+
|
|
228
|
+
std::ostream &operator<<(std::ostream &os, const TransformMatrix &matrix) {
|
|
229
|
+
std::string result = "TransformMatrix{";
|
|
230
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
231
|
+
result += std::to_string(matrix[i / 4][i % 4]);
|
|
232
|
+
if (i < 15) {
|
|
233
|
+
result += ", ";
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
result += "}";
|
|
237
|
+
return os << result;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
#endif // NDEBUG
|
|
241
|
+
|
|
242
|
+
std::string TransformMatrix::toString() const {
|
|
243
|
+
std::string result = "[";
|
|
244
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
245
|
+
result += std::to_string(matrix_[i / 4][i % 4]);
|
|
246
|
+
if (i < 15) {
|
|
247
|
+
result += ", ";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
result += "]";
|
|
251
|
+
return result;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
jsi::Value TransformMatrix::toJSIValue(jsi::Runtime &rt) const {
|
|
255
|
+
jsi::Array result(rt, 16);
|
|
256
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
257
|
+
result.setValueAtIndex(rt, i, matrix_[i / 4][i % 4]);
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
folly::dynamic TransformMatrix::toDynamic() const {
|
|
263
|
+
folly::dynamic result = folly::dynamic::array;
|
|
264
|
+
for (size_t i = 0; i < 16; ++i) {
|
|
265
|
+
result.push_back(matrix_[i / 4][i % 4]);
|
|
266
|
+
}
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
bool TransformMatrix::isSingular() const {
|
|
271
|
+
return determinant() == 0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
bool TransformMatrix::normalize() {
|
|
275
|
+
if (matrix_[3][3] == 0) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
280
|
+
for (size_t j = 0; j < 4; ++j) {
|
|
281
|
+
matrix_[i][j] /= matrix_[3][3];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
double TransformMatrix::determinant() const {
|
|
289
|
+
const double a1 = matrix_[0][0];
|
|
290
|
+
const double b1 = matrix_[0][1];
|
|
291
|
+
const double c1 = matrix_[0][2];
|
|
292
|
+
const double d1 = matrix_[0][3];
|
|
293
|
+
|
|
294
|
+
const double a2 = matrix_[1][0];
|
|
295
|
+
const double b2 = matrix_[1][1];
|
|
296
|
+
const double c2 = matrix_[1][2];
|
|
297
|
+
const double d2 = matrix_[1][3];
|
|
298
|
+
|
|
299
|
+
const double a3 = matrix_[2][0];
|
|
300
|
+
const double b3 = matrix_[2][1];
|
|
301
|
+
const double c3 = matrix_[2][2];
|
|
302
|
+
const double d3 = matrix_[2][3];
|
|
303
|
+
|
|
304
|
+
const double a4 = matrix_[3][0];
|
|
305
|
+
const double b4 = matrix_[3][1];
|
|
306
|
+
const double c4 = matrix_[3][2];
|
|
307
|
+
const double d4 = matrix_[3][3];
|
|
308
|
+
|
|
309
|
+
return a1 * determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4) -
|
|
310
|
+
b1 * determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4) +
|
|
311
|
+
c1 * determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4) -
|
|
312
|
+
d1 * determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
void TransformMatrix::adjugate() {
|
|
316
|
+
const double a1 = matrix_[0][0];
|
|
317
|
+
const double b1 = matrix_[0][1];
|
|
318
|
+
const double c1 = matrix_[0][2];
|
|
319
|
+
const double d1 = matrix_[0][3];
|
|
320
|
+
|
|
321
|
+
const double a2 = matrix_[1][0];
|
|
322
|
+
const double b2 = matrix_[1][1];
|
|
323
|
+
const double c2 = matrix_[1][2];
|
|
324
|
+
const double d2 = matrix_[1][3];
|
|
325
|
+
|
|
326
|
+
const double a3 = matrix_[2][0];
|
|
327
|
+
const double b3 = matrix_[2][1];
|
|
328
|
+
const double c3 = matrix_[2][2];
|
|
329
|
+
const double d3 = matrix_[2][3];
|
|
330
|
+
|
|
331
|
+
const double a4 = matrix_[3][0];
|
|
332
|
+
const double b4 = matrix_[3][1];
|
|
333
|
+
const double c4 = matrix_[3][2];
|
|
334
|
+
const double d4 = matrix_[3][3];
|
|
335
|
+
|
|
336
|
+
matrix_[0][0] = determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4);
|
|
337
|
+
matrix_[1][0] = -determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4);
|
|
338
|
+
matrix_[2][0] = determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4);
|
|
339
|
+
matrix_[3][0] = -determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
|
|
340
|
+
|
|
341
|
+
matrix_[0][1] = -determinant3x3(b1, b3, b4, c1, c3, c4, d1, d3, d4);
|
|
342
|
+
matrix_[1][1] = determinant3x3(a1, a3, a4, c1, c3, c4, d1, d3, d4);
|
|
343
|
+
matrix_[2][1] = -determinant3x3(a1, a3, a4, b1, b3, b4, d1, d3, d4);
|
|
344
|
+
matrix_[3][1] = determinant3x3(a1, a3, a4, b1, b3, b4, c1, c3, c4);
|
|
345
|
+
|
|
346
|
+
matrix_[0][2] = determinant3x3(b1, b2, b4, c1, c2, c4, d1, d2, d4);
|
|
347
|
+
matrix_[1][2] = -determinant3x3(a1, a2, a4, c1, c2, c4, d1, d2, d4);
|
|
348
|
+
matrix_[2][2] = determinant3x3(a1, a2, a4, b1, b2, b4, d1, d2, d4);
|
|
349
|
+
matrix_[3][2] = -determinant3x3(a1, a2, a4, b1, b2, b4, c1, c2, c4);
|
|
350
|
+
|
|
351
|
+
matrix_[0][3] = -determinant3x3(b1, b2, b3, c1, c2, c3, d1, d2, d3);
|
|
352
|
+
matrix_[1][3] = determinant3x3(a1, a2, a3, c1, c2, c3, d1, d2, d3);
|
|
353
|
+
matrix_[2][3] = -determinant3x3(a1, a2, a3, b1, b2, b3, d1, d2, d3);
|
|
354
|
+
matrix_[3][3] = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
bool TransformMatrix::invert() {
|
|
358
|
+
const auto det = determinant();
|
|
359
|
+
|
|
360
|
+
// If the determinant is invalid (zero, very small number, etc.), then the
|
|
361
|
+
// matrix is not invertible
|
|
362
|
+
if (!std::isnormal(det)) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
adjugate();
|
|
367
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
368
|
+
for (size_t j = 0; j < 4; ++j) {
|
|
369
|
+
matrix_[i][j] /= det;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
void TransformMatrix::transpose() {
|
|
377
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
378
|
+
for (size_t j = i + 1; j < 4; ++j) {
|
|
379
|
+
std::swap(matrix_[i][j], matrix_[j][i]);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
void TransformMatrix::translate3d(const Vector3D &translation) {
|
|
385
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
386
|
+
matrix_[3][i] += translation[0] * matrix_[0][i] +
|
|
387
|
+
translation[1] * matrix_[1][i] + translation[2] * matrix_[2][i];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
void TransformMatrix::scale3d(const Vector3D &scale) {
|
|
392
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
393
|
+
matrix_[0][i] *= scale[0];
|
|
394
|
+
matrix_[1][i] *= scale[1];
|
|
395
|
+
matrix_[2][i] *= scale[2];
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
std::optional<DecomposedTransformMatrix> TransformMatrix::decompose() const {
|
|
400
|
+
auto matrixCp = *this;
|
|
401
|
+
|
|
402
|
+
if (!matrixCp.normalize()) {
|
|
403
|
+
return std::nullopt;
|
|
404
|
+
}
|
|
405
|
+
const auto perspective = matrixCp.computePerspective();
|
|
406
|
+
if (!perspective) {
|
|
407
|
+
return std::nullopt;
|
|
408
|
+
}
|
|
409
|
+
const auto translation = matrixCp.getTranslation();
|
|
410
|
+
|
|
411
|
+
// Move the remaining matrix to 3 separate column vectors for easier
|
|
412
|
+
// processing
|
|
413
|
+
std::array<Vector3D, 3> rows;
|
|
414
|
+
for (size_t i = 0; i < 3; ++i) {
|
|
415
|
+
rows[i] = Vector3D(matrixCp[i][0], matrixCp[i][1], matrixCp[i][2]);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
auto [scale, skew] = computeScaleAndSkew(rows);
|
|
419
|
+
|
|
420
|
+
// At this point, the matrix (in rows) is orthonormal.
|
|
421
|
+
// Check for a coordinate system flip. If the determinant
|
|
422
|
+
// is -1, then negate the matrix and the scaling factors.
|
|
423
|
+
if (rows[0].dot(rows[1].cross(rows[2])) < 0) {
|
|
424
|
+
for (size_t i = 0; i < 3; ++i) {
|
|
425
|
+
scale[i] *= -1;
|
|
426
|
+
rows[i] *= -1;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
const auto rotation = computeQuaternion(rows);
|
|
430
|
+
|
|
431
|
+
return DecomposedTransformMatrix{
|
|
432
|
+
.scale = scale,
|
|
433
|
+
.skew = skew,
|
|
434
|
+
.quaternion = rotation,
|
|
435
|
+
.translation = translation,
|
|
436
|
+
.perspective = perspective.value()};
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
TransformMatrix TransformMatrix::recompose(
|
|
440
|
+
const DecomposedTransformMatrix &decomposed) {
|
|
441
|
+
auto result = TransformMatrix::Identity();
|
|
442
|
+
|
|
443
|
+
// Start from applying perspective
|
|
444
|
+
for (size_t i = 0; i < 4; ++i) {
|
|
445
|
+
result[i][3] = decomposed.perspective[i];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Apply translation
|
|
449
|
+
result.translate3d(decomposed.translation);
|
|
450
|
+
|
|
451
|
+
// Apply rotation
|
|
452
|
+
result = fromQuaternion(decomposed.quaternion) * result;
|
|
453
|
+
|
|
454
|
+
// Apply skew
|
|
455
|
+
auto tmp = TransformMatrix::Identity();
|
|
456
|
+
if (decomposed.skew[2] != 0) { // YZ
|
|
457
|
+
tmp[2][1] = decomposed.skew[2];
|
|
458
|
+
result = tmp * result;
|
|
459
|
+
}
|
|
460
|
+
if (decomposed.skew[1] != 0) { // XZ
|
|
461
|
+
tmp[2][1] = 0;
|
|
462
|
+
tmp[2][0] = decomposed.skew[1];
|
|
463
|
+
result = tmp * result;
|
|
464
|
+
}
|
|
465
|
+
if (decomposed.skew[0] != 0) { // XY
|
|
466
|
+
tmp[2][0] = 0;
|
|
467
|
+
tmp[1][0] = decomposed.skew[0];
|
|
468
|
+
result = tmp * result;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Apply scale
|
|
472
|
+
result.scale3d(decomposed.scale);
|
|
473
|
+
|
|
474
|
+
return result;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
TransformMatrix TransformMatrix::fromQuaternion(const Quaternion &q) {
|
|
478
|
+
const double xx = q.x * q.x;
|
|
479
|
+
const double yy = q.y * q.y;
|
|
480
|
+
const double zz = q.z * q.z;
|
|
481
|
+
const double xz = q.x * q.z;
|
|
482
|
+
const double xy = q.x * q.y;
|
|
483
|
+
const double yz = q.y * q.z;
|
|
484
|
+
const double xw = q.w * q.x;
|
|
485
|
+
const double yw = q.w * q.y;
|
|
486
|
+
const double zw = q.w * q.z;
|
|
487
|
+
|
|
488
|
+
// clang-format off
|
|
489
|
+
return TransformMatrix({{
|
|
490
|
+
{1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw), 0},
|
|
491
|
+
{ 2 * (xy + zw), 1 - 2 * (xx + zz), 2 * (yz - xw), 0},
|
|
492
|
+
{ 2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy), 0},
|
|
493
|
+
{ 0, 0, 0, 1}
|
|
494
|
+
}}); // clang-format on
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
std::optional<Vector4D> TransformMatrix::computePerspective() const {
|
|
498
|
+
auto perspectiveMatrix = *this;
|
|
499
|
+
|
|
500
|
+
for (size_t i = 0; i < 3; ++i) {
|
|
501
|
+
perspectiveMatrix[i][3] = 0;
|
|
502
|
+
}
|
|
503
|
+
perspectiveMatrix[3][3] = 1;
|
|
504
|
+
|
|
505
|
+
if (perspectiveMatrix.isSingular()) {
|
|
506
|
+
return std::nullopt;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (matrix_[0][3] == 0 && matrix_[1][3] == 0 && matrix_[2][3] == 0) {
|
|
510
|
+
// No perspective
|
|
511
|
+
return Vector4D{0, 0, 0, 1};
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// Invert and transpose the perspective matrix (we will solve the equation
|
|
515
|
+
// by multiplying the rhs vector by the inverse of the perspective matrix)
|
|
516
|
+
if (!perspectiveMatrix.invert()) {
|
|
517
|
+
return std::nullopt;
|
|
518
|
+
}
|
|
519
|
+
perspectiveMatrix.transpose();
|
|
520
|
+
|
|
521
|
+
// rhs is the right hand side of the equation we are trying to solve
|
|
522
|
+
const Vector4D rhs(
|
|
523
|
+
matrix_[0][3], matrix_[1][3], matrix_[2][3], matrix_[3][3]);
|
|
524
|
+
// Solve the equation
|
|
525
|
+
return rhs * perspectiveMatrix;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
Vector3D TransformMatrix::getTranslation() const {
|
|
529
|
+
return Vector3D(matrix_[3][0], matrix_[3][1], matrix_[3][2]);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
std::pair<Vector3D, Vector3D> TransformMatrix::computeScaleAndSkew(
|
|
533
|
+
std::array<Vector3D, 3> &rows) {
|
|
534
|
+
Vector3D scale, skew;
|
|
535
|
+
|
|
536
|
+
// Compute X scale factor and normalize first row
|
|
537
|
+
scale[0] = rows[0].length();
|
|
538
|
+
rows[0].normalize();
|
|
539
|
+
|
|
540
|
+
// Compute XY shear factor and make 2nd row orthogonal to 1st.
|
|
541
|
+
skew[0] = rows[0].dot(rows[1]);
|
|
542
|
+
rows[1] = rows[1].addScaled(rows[0], -skew[0]);
|
|
543
|
+
|
|
544
|
+
// Now, compute Y scale and normalize 2nd row.
|
|
545
|
+
scale[1] = rows[1].length();
|
|
546
|
+
rows[1].normalize();
|
|
547
|
+
skew[0] /= scale[1]; // normalize XY shear
|
|
548
|
+
|
|
549
|
+
// Compute XZ and YZ shears, orthogonalize 3rd row
|
|
550
|
+
skew[1] = rows[0].dot(rows[2]);
|
|
551
|
+
rows[2] = rows[2].addScaled(rows[0], -skew[1]);
|
|
552
|
+
skew[2] = rows[1].dot(rows[2]);
|
|
553
|
+
rows[2] = rows[2].addScaled(rows[1], -skew[2]);
|
|
554
|
+
|
|
555
|
+
// Next, get Z scale and normalize 3rd row
|
|
556
|
+
scale[2] = rows[2].length();
|
|
557
|
+
rows[2].normalize();
|
|
558
|
+
skew[1] /= scale[2]; // normalize XZ shear
|
|
559
|
+
skew[2] /= scale[2]; // normalize YZ shear
|
|
560
|
+
|
|
561
|
+
return {scale, skew};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
Quaternion TransformMatrix::computeQuaternion(std::array<Vector3D, 3> &rows) {
|
|
565
|
+
double m00 = rows[0][0];
|
|
566
|
+
double m01 = rows[0][1];
|
|
567
|
+
double m02 = rows[0][2];
|
|
568
|
+
|
|
569
|
+
double m10 = rows[1][0];
|
|
570
|
+
double m11 = rows[1][1];
|
|
571
|
+
double m12 = rows[1][2];
|
|
572
|
+
|
|
573
|
+
double m20 = rows[2][0];
|
|
574
|
+
double m21 = rows[2][1];
|
|
575
|
+
double m22 = rows[2][2];
|
|
576
|
+
|
|
577
|
+
Quaternion q;
|
|
578
|
+
double trace = m00 + m11 + m22; // Trace of the matrix
|
|
579
|
+
|
|
580
|
+
if (trace > 0.0) {
|
|
581
|
+
double s = 0.5 / sqrt(trace + 1.0);
|
|
582
|
+
q.w = 0.25 / s;
|
|
583
|
+
q.x = (m21 - m12) * s;
|
|
584
|
+
q.y = (m02 - m20) * s;
|
|
585
|
+
q.z = (m10 - m01) * s;
|
|
586
|
+
} else {
|
|
587
|
+
if (m00 > m11 && m00 > m22) {
|
|
588
|
+
double s = 2.0 * sqrt(1.0 + m00 - m11 - m22);
|
|
589
|
+
q.w = (m21 - m12) / s;
|
|
590
|
+
q.x = 0.25 * s;
|
|
591
|
+
q.y = (m01 + m10) / s;
|
|
592
|
+
q.z = (m02 + m20) / s;
|
|
593
|
+
} else if (m11 > m22) {
|
|
594
|
+
double s = 2.0 * sqrt(1.0 + m11 - m00 - m22);
|
|
595
|
+
q.w = (m02 - m20) / s;
|
|
596
|
+
q.x = (m01 + m10) / s;
|
|
597
|
+
q.y = 0.25 * s;
|
|
598
|
+
q.z = (m12 + m21) / s;
|
|
599
|
+
} else {
|
|
600
|
+
double s = 2.0 * sqrt(1.0 + m22 - m00 - m11);
|
|
601
|
+
q.w = (m10 - m01) / s;
|
|
602
|
+
q.x = (m02 + m20) / s;
|
|
603
|
+
q.y = (m12 + m21) / s;
|
|
604
|
+
q.z = 0.25 * s;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return q;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Calculate the determinant of a 3x3 matrix
|
|
613
|
+
*
|
|
614
|
+
* | a b c |
|
|
615
|
+
* | d e f |
|
|
616
|
+
* | g h i |
|
|
617
|
+
*/
|
|
618
|
+
double TransformMatrix::determinant3x3(
|
|
619
|
+
const double a,
|
|
620
|
+
const double b,
|
|
621
|
+
const double c,
|
|
622
|
+
const double d,
|
|
623
|
+
const double e,
|
|
624
|
+
const double f,
|
|
625
|
+
const double g,
|
|
626
|
+
const double h,
|
|
627
|
+
const double i) {
|
|
628
|
+
return (a * e * i) + (b * f * g) + (c * d * h) - (c * e * g) - (b * d * i) -
|
|
629
|
+
(a * f * h);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
} // namespace reanimated
|
|
633
|
+
|
|
634
|
+
#endif // RCT_NEW_ARCH_ENABLED
|