We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dfaeab2 + 1596a36 commit 58f7543Copy full SHA for 58f7543
cpp/JSIBox2dBody.h
@@ -61,6 +61,12 @@ namespace Box2d {
61
return JSIBox2dVec2::toValue(runtime, getObject()->GetLinearVelocity());
62
}
63
64
+ JSI_HOST_FUNCTION(SetLinearDamping) {
65
+ auto linearDamping = arguments[0].asNumber();
66
+ getObject()->SetLinearDamping(linearDamping);
67
+ return jsi::Value::undefined();
68
+ }
69
+
70
JSI_HOST_FUNCTION(SetTransform) {
71
auto position = JSIBox2dVec2::fromValue(runtime, arguments[0]).get();
72
auto angle = arguments[1].asNumber();
@@ -92,6 +98,7 @@ namespace Box2d {
92
98
JSI_EXPORT_FUNC(JSIBox2dBody, CreateFixture2),
93
99
JSI_EXPORT_FUNC(JSIBox2dBody, SetLinearVelocity),
94
100
JSI_EXPORT_FUNC(JSIBox2dBody, GetLinearVelocity),
101
+ JSI_EXPORT_FUNC(JSIBox2dBody, SetLinearDamping),
95
102
JSI_EXPORT_FUNC(JSIBox2dBody, SetTransform),
96
103
JSI_EXPORT_FUNC(JSIBox2dBody, ApplyForceToCenter),
97
104
JSI_EXPORT_FUNC(JSIBox2dBody, ApplyLinearImpulseToCenter),
src/types.ts
@@ -129,6 +129,12 @@ export interface b2Body {
129
**/
130
SetLinearVelocity(v: b2Vec2): void;
131
132
+ /**
133
+ * Set the linear damping of the body.
134
+ * @param linearDamping New linear damping of the body.
135
+ **/
136
+ SetLinearDamping(linearDamping: number): void;
137
138
/**
139
*
140
* Set the position of the body's origin and rotation.
0 commit comments