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 @@ -62,6 +62,11 @@ export interface b2FixtureDef {
6262 **/
6363 friction : number ;
6464
65+ /**
66+ * The restitution (elasticity) usually in the range [0,1].
67+ **/
68+ restitution : number ;
69+
6570 /**
6671 * The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
6772 **/
You can’t perform that action at this time.
0 commit comments