OLD | NEW |
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2015, Daniel Murphy, Google | 2 * Copyright (c) 2015, Daniel Murphy, Google |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without modificati
on, | 5 * Redistribution and use in source and binary forms, with or without modificati
on, |
6 * are permitted provided that the following conditions are met: | 6 * are permitted provided that the following conditions are met: |
7 * * Redistributions of source code must retain the above copyright notice, | 7 * * Redistributions of source code must retain the above copyright notice, |
8 * this list of conditions and the following disclaimer. | 8 * this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright notice, | 9 * * Redistributions in binary form must reproduce the above copyright notice, |
10 * this list of conditions and the following disclaimer in the documentation | 10 * this list of conditions and the following disclaimer in the documentation |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 * | 177 * |
178 * @return | 178 * @return |
179 */ | 179 */ |
180 Fixture get fixtureB => _fixtureB; | 180 Fixture get fixtureB => _fixtureB; |
181 | 181 |
182 int getChildIndexB() { | 182 int getChildIndexB() { |
183 return _indexB; | 183 return _indexB; |
184 } | 184 } |
185 | 185 |
186 void resetFriction() { | 186 void resetFriction() { |
187 _friction = | 187 _friction = Contact.mixFriction(_fixtureA._friction, _fixtureB._friction); |
188 Contact.mixFriction(_fixtureA._friction, _fixtureB._friction); | |
189 } | 188 } |
190 | 189 |
191 void resetRestitution() { | 190 void resetRestitution() { |
192 _restitution = Contact.mixRestitution( | 191 _restitution = |
193 _fixtureA._restitution, _fixtureB._restitution); | 192 Contact.mixRestitution(_fixtureA._restitution, _fixtureB._restitution); |
194 } | 193 } |
195 | 194 |
196 void evaluate(Manifold manifold, Transform xfA, Transform xfB); | 195 void evaluate(Manifold manifold, Transform xfA, Transform xfB); |
197 | 196 |
198 /** | 197 /** |
199 * Flag this contact for filtering. Filtering will occur the next time step. | 198 * Flag this contact for filtering. Filtering will occur the next time step. |
200 */ | 199 */ |
201 void flagForFiltering() { | 200 void flagForFiltering() { |
202 _flags |= FILTER_FLAG; | 201 _flags |= FILTER_FLAG; |
203 } | 202 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 * example, a superball bounces on anything. | 302 * example, a superball bounces on anything. |
304 * | 303 * |
305 * @param restitution1 | 304 * @param restitution1 |
306 * @param restitution2 | 305 * @param restitution2 |
307 * @return | 306 * @return |
308 */ | 307 */ |
309 static double mixRestitution(double restitution1, double restitution2) { | 308 static double mixRestitution(double restitution1, double restitution2) { |
310 return restitution1 > restitution2 ? restitution1 : restitution2; | 309 return restitution1 > restitution2 ? restitution1 : restitution2; |
311 } | 310 } |
312 } | 311 } |
OLD | NEW |