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.
1 parent c271062 commit 1596a36Copy full SHA for 1596a36
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
@@ -108,6 +108,12 @@ export interface b2Body {
108
**/
109
SetLinearVelocity(v: b2Vec2): void;
110
111
+ /**
112
+ * Set the linear damping of the body.
113
+ * @param linearDamping New linear damping of the body.
114
+ **/
115
+ SetLinearDamping(linearDamping: number): void;
116
117
/**
118
*
119
* Set the position of the body's origin and rotation.
0 commit comments