forked from deltaluca/nape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog
305 lines (223 loc) · 13.3 KB
/
changelog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
GeomPol:
forward_iterator renamed forwardIterator
backwards_iterator renamed backwardsIterator
skip_forward renamed skipForward
skip_backwards renamed skipBackwards
simple_decomposition renamed simpleDecomposition
convex_decomposition renamed convexDecomposition
triangular_decomposition renamed triangularDecomposition
monotone_decomposition renamed monotoneDecomposition
constructor, copy methods changed so that the current head of GeomPoly
will point to the first vertex given.
Added a simple 'inflate' method, working on non-intersecting polygons
with miter joints, and no handling of self-intersections that may occur
in extreme cases.
Massively improved memory usage of the decomposition methods including
permitting an input list to append polygons to instead of always creating
a new list, includes cut method.
Permit GeomPoly to be released/allocated from object pool.
For FLASH, enforce that MarchingSquares iso-function must be given as
an 'IsoFunction' implementation, instead of a function value. This is to
avoid flash player needing to box inputs/unbox outputs of function and
permit better memory use and less GC activity.
convex and triangular decompositions now have a 'delaunay' parameter which
will indicate that a delaunay triangulation is wanted; in the case of convex
(which performs a triangulation first) this means that it will base the convex
polys off of a delaunay triangulation.
InteractionListener:
Fixed bug in ONGOING listeners being invoked for sleeping interactions. eek!
However, I understand this may be useful in certain situations, so if you wish
to still receive ongoing callbacks for sleeping objects, set:
allowSleepingCallbacks to true on the InteractionListener object.
InteractionFilter:
Fixed bug with InteractionFilter constructor being marked in .swc as having 0
optinoal arguments instead of 6.
AngleJoint:
slack property removed, replaced with isSlack method
Fix for incorrect clamping of impulses in certain scenarios.
Permit ratio to be specified in constructor.
DistanceJoint
slack property removed, replaced with isSlack method
Fix for incorrect clamping of impulses in certain scenarios.
LineJoint
Fix for incorrect clamping of impulses in certain scenarios.
CbType:
Fixed bug so that constraints list correctly only tracks Constraints
that have been added to a Space.
Vec2:
fromPoint now included for nme target, not just flash
Added Vec2::normalise and Vec2::unit methods
Added toPoint.
Added addMul method.
Added distance and dsq static methods.
AABB:
fromRect now included for nme target, not just flash
Added toRect.
Fixed bug in AABB::copy to validate structure before producing copy.
Mat23:
set, setAs, reset methods now returns reference to 'this' instead of nothing.
NapeList's:
removed debug errors when modifying a list whilst iterating. Not because doing
so is safe (or ever has been), but because I realised that if iteration over a
list is terminated early then the iterator will not be removed from the tracker
and spurious errors were possible as well as potential GC issues.
foreach and filter method now returns reference to 'this' instead of nothing
UserConstraint:
__destroy method to be overriden, renamed as __broken. (And fixed bug where it wouldn't
have ever even been called :P)
methods invalidate, bindVec2 and registerBody prefixed with similar __ prefixes to denote
their private nature to sub-type of user constraint.
Arbiter:
remove arbiter id, remove active property.
rename restitution to elasticity to better match Material names.
Make physics properties mutable, once set they will persist until the arbiter is destroyed
(The shapes seperate).
Remove mutability of contacts. This does not play well with continuous collisions (and
to be fair, has very little use that I can think of). The most important parts are
still persent, changing friction/elasticity values specifically and ignoring interactions.
CollisionArbiter:
Added properties referenceEdge1, and referenceEdge2 which link to the Edge of the related
shape1/shape2. (refEdge1 is obvs. null if shape is is a Circle)
And methods firstVertex()/secondVertex() which respectively return true if the Circle in
a Circle-Polygon collision is colliding against the first/second vertex rather than the
edge itself.
Edge:
Added properties localVertex1, localVertex2, worldVertex1, worldVertex2 which link to
the respective vertices in the Polygon's localVerts and worldVerts lists.
Added back reference on public API to the parent Polygon.
Contact:
remove active property.
remove restitution, and rolling friction property (duplicated information available from
arbiter).
InteractionGroup:
remove id property.
Space:
remove id property.
Modified the clear() method so that things like gravity, and globalLinearDrag are left
untouched instead of being set to default.
Permit sampling methods like bodiesUnderPoint to be supplied a lsit to append results to
Permit convexMultiCast and rayMultiCast to be supplied with a list for appending results.
Fix bug in convexCasts; not that you'll have used it before...
Fix bug in shapesInAABB/bodiesInAABB when filter is supplied.
Fix bug in shapes/bodiesInCircle when used with 'strict containment' = true due to
incorrect test for circle2circle containment.
Fix bug in all 'bodiesIn#' samplers when used with 'strict containment' to ensure
that - as documented - we only get bodies that are 'entirely' contained when considering
filtered shapes.
RayResult/ConvexResult:
These objects are now allocated from an object pool and can be returned to it via
the dispose method on these objects. Vec2's associated with the results are now
immutable and are released to object pool when the Result object is diposed.
Shape:
Modify transformation methods to return reference to 'this' Shape.
Removed static method copy in favour of member method.
This method also has a bug fix for the recent changes in userData,
instead of copying the userData object, a new userData object is created
and has all it's fields instantiated to the same fields as that of the present
userData.
Add sensorEnabled.
This effects interaction type determination.
Previously fluid interaction had highest precedence, possible only if one
of the shapes was fluid enabled. Followed by collisions, and should
collisions not be possible, sensor interactions.
Now. Sensor interaction has highest precedence, possible only if one of th shapes is a sensor. Following this is fluid interaction possible only if one of the shapes is a fluid. Followed lastly by collision type.
Also rules governing fluid interactino are relaxed (reducing number of checks needed.. a lot) so that it is now:
if either shape is fluid, and at least one object is dynamic => use fluid interaction type.
Circle:
Removed static method copy in favour of member method on Shape.
Polygon:
Removed static method copy in favour of member method on Shape.
ValidationResult:
Moved this class into its own file.
FluidProperties:
Fix bug in copy for changes in userData so that field is copied
properly alla Shape.
Fix bug in copy so that gravity property is also copied.
Debug:
Removed drawConstraintSprings/drawConstraintErrors properties as
they are no longer used.
Renamed bgColor bgColour to be consistent with british spelling used
everywhere else.
Removed version() function.
Added Body::debugDraw and Constraint::debugDraw properties to enable/disable
drawing of body/constraint in debug draw on per-body-constraint basis.
Body:
Removed clear method, can use body.shapes.clear() to remove all shapes.
Removed graphic and related properties.
Methods like normalImpulse now return a Vec3 instead of a Vec2 so angular
information is no longer discarded. Necessarigly can no longer create a weak
Vec2 as Vec3 cannot presently be defined weak.
Changed behaviour of force/torque so that they are persistant values (not reset
to 0 after step()). Removed apply#Force methods.
Change transform method names (and reduced number of such methods). Methods are now
localPointToWorld, localVectorToWorld, worldPointToLocal, worldVectorToLocal.
I feel these names are more representative of what the method does.
Get rid of applyLocalImpulse and applyRelativeImpulse, renaming applyWorldImpulse
into just applyImpulse. Consistency is important, and these methods were anything but
applyImpulse takes both impulse, and position in world coordinates.
Permit Bodys containing NO shapes whatsoever to be simulated in a space. (Restriction that dynamic body must have non-zero mass/inertia). This can be used to add new bodies (like space.world) for use in constraints, but that are not only at (0,0) with no velocity etc. A body with no shapes will simply be integrated through time.
Add setVelocityFromTarget to aid in animation of kinematic bodies:
body.setVelocityFromTarget(targetPosition, targetRotation, deltaTime);
Add integrate() to integrate body position/rotation by it's velocities, may be
useful in conjunction with new convexCast method on Space.
Add 'disableCCD' to Body, if either body in a colliding pair has this flag true
then no CCD will be performed. This flag, together with 'isBullet' will be
applied to any copies made of this Body.
Slightly modify interactingBodies,connectedBodies to not include 'this' Body in the return list,
also permit passing a list to be populated.
Allow applyImpulse to be 'sleepable' in the sense that it will not prevent objects from going to
sleep; this flag requires care in its use to ensure validity.
Add applyAngularImpulse to complement applyImpulse, also having the same 'sleepable' parameter.
Material:
Material density is now permitted to be 0. Restriction is that a dynamic body must have non-zero mass/inertia at the end of it all.
Compound:
Modified COM to get Vec2 from object pool, and permit weakly allocated return.
nape-hacks::ForcedSleep
Added inline docs, and sleepCompound method.
nape-symbolic::SymbolicConstraint
Added inline docs, and effected changes required for naming changes on UserConstraint API.
Moved private data to a typical Nape inner object, with non-public API's moved to
the typical nape zpp_inner package.
Geom:
Modified distance method to return useful result in case that Shapes are
interseting, returning the penetration distance and witness points whose difference
forms the minimal translational vector to seperate the objects.
Added distanceBody method which performs an optimised search between two Bodies
returning closest points (/minimal translation vector points if intersecting).
Added intersectsBody to generalise over intersects method.
Elastic contacts:
Method of elastic contacts reconfigured. You will likely need to play around with
Mateiral elasticities as behaviour will change as a result.
Continuous collision detection:
A form of continuous collision detection has been added. This is continuous detection
and not continuous physics. Objects are frozen at their time of impact and will have
no further time simulated for them until the following step.
In practice this is perfectly acceptible, where it breaks down and what you should not
do is have groups of bullet enabled dynamic bodies interacting together as you will
get visual stalling.
Continuous collisions always occur with static and kinematic objects.
Tunnelling should be rare, less so with kinematic objects as no continuos collisions
occur during positional error resolvement which means that if an object is forced to
move a large distance due to overlapping of objects it may tunnel (This is more often
the case with a fast moving kinematic as the continuos collision is resolved in this
case primarily with positional error resolvement, but kinematics normally cause
tunneling though 'forcing' objects into one another anyways).
Continous 'colisions' also work for sensor interactions, so you can receive a pre event
or begin event due to a body flying all the way through a sensor in a single update.
END events will be delayed until the following step however in such a case.
To the Space object, added methods convexCast and convexMultiCast as 'extensions'
of rayCast/rayMultiCast using a Shape and body integration for the cast instead of
a linear ray.
MarchingSquares:
Fixed some memory issues where objects that should have been recycled were not being
recycled. Permit supplying a GeomPolyList to be populated instead of always creating
a new one.
PulleyJoint:
New feature: PulleyJoint being in the most general case a 4-body constraint
constraining weighted sum of two distance pairs to a range.
Other:
Fixed bug in waking objects, appearing when waking static objects through changes
to filters/materials where not all objects were being woken properly.
Added explicit default values for all members to support Haxe JS properly.
TODO:
Add sweeps to Geom.