rebound
Advanced tools
Comparing version 0.0.13 to 0.0.14
{ | ||
"name": "rebound", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "A simple library for modeling spring dynamics", | ||
"main": "rebound.js", | ||
"types": "rebound.d.ts", | ||
"author": "Facebook", | ||
@@ -7,0 +8,0 @@ "license": "BSD", |
[![Build | ||
Status](https://travis-ci.org/facebook/rebound-js.svg?branch=master)](https://travis-ci.org/facebook/rebound-js) | ||
###REBOUND | ||
### REBOUND ### | ||
@@ -9,3 +9,3 @@ Rebound is a simple library that models Spring dynamics for the purpose of | ||
###ORIGIN | ||
### ORIGIN ### | ||
@@ -19,3 +19,3 @@ Rebound was originally written in Java to provide a lightweight physics system | ||
###OVERVIEW | ||
### OVERVIEW ### | ||
@@ -22,0 +22,0 @@ The Library provides a SpringSystem for maintaining a set of Spring objects and |
@@ -423,3 +423,2 @@ // Rebound | ||
this.listeners = []; | ||
this.frames = []; | ||
this._springSystem.deregisterSpring(this); | ||
@@ -532,9 +531,9 @@ }, | ||
// Set the current velocity of the Spring. As previously mentioned, | ||
// this can be useful when you are performing a direct manipulation | ||
// gesture. When a UI element is released you may call setVelocity | ||
// on its animation Spring so that the Spring continues with the | ||
// same velocity as the gesture ended with. The friction, tension, | ||
// and displacement of the Spring will then govern its motion to | ||
// return to rest on a natural feeling curve. | ||
// Set the current velocity of the Spring, in pixels per second. As | ||
// previously mentioned, this can be useful when you are performing | ||
// a direct manipulation gesture. When a UI element is released you | ||
// may call setVelocity on its animation Spring so that the Spring | ||
// continues with the same velocity as the gesture ended with. The | ||
// friction, tension, and displacement of the Spring will then | ||
// govern its motion to return to rest on a natural feeling curve. | ||
setVelocity: function(velocity) { | ||
@@ -549,3 +548,3 @@ if (velocity === this._currentState.velocity) { | ||
// Get the current velocity of the Spring. | ||
// Get the current velocity of the Spring, in pixels per second. | ||
getVelocity: function() { | ||
@@ -666,5 +665,5 @@ return this._currentState.velocity; | ||
tempPosition = position + cVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5; | ||
tempPosition = position + cVelocity * Spring.SOLVER_TIMESTEP_SEC; | ||
tempVelocity = | ||
velocity + cAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5; | ||
velocity + cAcceleration * Spring.SOLVER_TIMESTEP_SEC; | ||
dVelocity = tempVelocity; | ||
@@ -671,0 +670,0 @@ dAcceleration = |
@@ -97,34 +97,40 @@ var rebound = require('../rebound'); | ||
var expectedValues = [ | ||
0.00009528483384916665, 0.028055130517962948, 0.09762221624500955, 0.19049729510981317, | ||
0.2936714067404636, 0.40497286144544664, 0.5111546203653615, 0.608094950748042, | ||
0.6989512644000222, 0.7763987794431019, 0.8407054339615845, 0.8958918579042241, | ||
0.9389972480971012, 0.9717337781699595, 0.9971592132059878, 1.0147625813663106, | ||
1.0262208257725207, 1.0332956493268395, 1.0364894607275925, 1.0369398983555251, | ||
1.035403885129236, 1.032578591121358, 1.0290563359258007, 1.0250064291810552, | ||
1.0209746156852837, 1.017177199769159, 1.01352576938495, 1.0103417579447809, | ||
1.0076425888100107, 1.0052779569597994, 1.0033901510059924, 1.0019218958288727, | ||
1.0007486041427742, 0.9999054758294816, 0.9993272477227115, 0.9989374541332141, | ||
0.9987229619135461, 0.9986362506581137, 0.9986416423402271, 0.9987133189462081, | ||
0.9988248788496944, 0.9989660543527678, 0.9991147367563946, 0.999260176669424, | ||
0.9994041755139224, 0.9995328710495801, 0.9996443410389881, 0.9997440186579756, | ||
0.9998252721214403, 0.9998898549593689, 0.9999427545081083, 0.9999819409115459, | ||
1.0000098947929037, 1 | ||
]; | ||
0.00011425836769833332, 0.02826894887325712, 0.09786685539023218, | ||
0.1906494054868597, 0.29365843980608936, 0.40474896134789684, | ||
0.5107172515563908, 0.6074646735059072, 0.6981529338231078, | ||
0.7754777086457709, 0.839707819077817, 0.8948595531478145, | ||
0.9379716344919623, 0.9707479956875202, 0.9962428035545625, | ||
1.0139342469614867, 1.0254911376885876, 1.0326752603538492, | ||
1.0359769203762703, 1.0365293261033242, 1.0350922763323542, | ||
1.0323542266285861, 1.0289066506717395, 1.0249225975602652, | ||
1.0209434111787616, 1.0171866123097923, 1.0135669403763488, | ||
1.0104047123230713, 1.0077191568237913, 1.0053619452157372, | ||
1.0034760195970387, 1.0020056186933401, 1.0008270224418958, | ||
0.9999766409388905, 0.9993901328804057, 0.9989911526141649, | ||
0.9987676456533224, 0.9986724777596906, 0.9986697290588868, | ||
0.9987342814912026, 0.9988397756522094, 0.9989756166030785, | ||
0.9991200309747728, 0.9992621551645858, 0.9994035221256672, | ||
0.9995303572870538, 0.9996405939737665, 0.9997394992090661, | ||
0.9998204037171646, 0.9998849475545486, 0.9999380421221211, | ||
0.9999775818502517, 1.0000059803454007, 1.0000264835439028, 1 ]; | ||
var expectedVelocities = [ | ||
0.22809713393833664, 3.1836279556537797, 5.189693552210269, 6.308133231261666, | ||
6.777680072142652, 6.779820703245073, 6.4423806169966324, 5.8988969764596115, | ||
5.2027207222858145, 4.464480016354999, 3.739124457374943, 3.0186340411984003, | ||
2.3728782790346234, 1.812176854322289, 1.3096658169399373, 0.8990634713436961, | ||
0.5719079083707492, 0.30321776183243665, 0.10352766527348324, -0.039503489141740795, | ||
-0.1423507144869582, -0.2058607850785233, -0.23984623785015569, -0.2526432950540898, | ||
-0.24879364530323395, -0.23414513023207698, -0.2115811308267352, -0.185501057593562, | ||
-0.15853434660787047, -0.13076036811539526, -0.10514546934610718, -0.08237222075625747, | ||
-0.06151931327812765, -0.0441214723178374, -0.029969085071624765, -0.018082334323351185, | ||
-0.009015079581744903, -0.0023131392365830466, 0.0027155555738820987, 0.00603264077492341, | ||
0.00803456840095728, 0.009095655645431211, 0.009368949074455861, 0.009106122079028167, | ||
0.008453224982293001, 0.007581738755800811, 0.006613800148558283, 0.005570115988782897, | ||
0.004574621636742495, 0.003665965171462857, 0.002814740532247959, 0.0020893441663066958, | ||
0.0014872204418175175, 0 | ||
]; | ||
0.2276775324800067, 3.1774598721505054, 5.1793267330810915, | ||
6.295509849377661, 6.764476633590014, 6.76742694258232, 6.431820383696734, | ||
5.890780309158667, 5.1974947091126475, 4.462143087776778, | ||
3.7394582582521605, 3.021424291526861, 2.3776517513733193, | ||
1.8184393728184831, 1.3169969453548693, 0.906988991160123, | ||
0.5800273047791344, 0.31119327922524626, 0.11108882863895153, | ||
-0.03254366218086566, -0.1361569165953432, -0.2004956653386716, | ||
-0.23531870559388396, -0.24897437017600185, -0.24591942995283073, | ||
-0.2319823912240368, -0.2100747888822411, -0.18454561286117094, | ||
-0.1580280108075904, -0.13062975758538428, -0.10529753257479642, | ||
-0.08272714732814185, -0.062017752864186065, -0.044703645341229135, | ||
-0.030588635672438014, -0.01870387489501671, -0.009611048353110578, | ||
-0.0028653747019518534, 0.002221614953962866, 0.005602663755134356, | ||
0.0076693990836953, 0.008796769142543886, 0.009131171230224182, | ||
0.008922837011801944, 0.00832006031857832, 0.007490584515806349, | ||
0.006556941548531174, 0.00554210142341889, 0.004568554860624362, | ||
0.0036759782316913665, 0.002836575672722143, 0.0021186451259753557, | ||
0.0015206065620057547, 0.0010057481768040006, 0 ]; | ||
@@ -131,0 +137,0 @@ var actualValues = [], actualVelocities = []; |
Sorry, the diff of this file is not supported yet
798177
41
5761