File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ namespace Box2d {
2727 getObject ()->friction = value.asNumber ();
2828 }
2929
30+ JSI_PROPERTY_SET (restitution) {
31+ getObject ()->restitution = value.asNumber ();
32+ }
33+
3034 JSI_EXPORT_PROPERTY_SETTERS (
3135 JSI_EXPORT_PROP_SET (JSIBox2dFixtureDef, shape),
3236 JSI_EXPORT_PROP_SET(JSIBox2dFixtureDef, density),
33- JSI_EXPORT_PROP_SET(JSIBox2dFixtureDef, friction))
37+ JSI_EXPORT_PROP_SET(JSIBox2dFixtureDef, friction),
38+ JSI_EXPORT_PROP_SET(JSIBox2dFixtureDef, restitution))
3439
3540 /* *
3641 * Constructor
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ export interface b2FixtureDef {
4646 **/
4747 friction : number ;
4848
49+ /**
50+ * The restitution (elasticity) usually in the range [0,1].
51+ **/
52+ restitution : number ;
53+
4954 /**
5055 * The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
5156 **/
You can’t perform that action at this time.
0 commit comments