@@ -261,6 +261,40 @@ static void GetSyncInfo(const v8::FunctionCallbackInfo<v8::Value>& info)
261
261
result->Set (ctx, v8::String::NewFromUtf8 (isolate, " propertyUpdateTicks" ).ToLocalChecked (), componentPropertyIndex);
262
262
263
263
V8_RETURN (result);
264
+ }
265
+
266
+ static void AngInertiaGetter (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
267
+ {
268
+ V8_GET_ISOLATE_CONTEXT_RESOURCE ();
269
+ V8_GET_THIS_BASE_OBJECT (_this, alt::IEntity);
270
+
271
+ V8_RETURN_VECTOR3 (_this->GetAngInertia ());
272
+ }
273
+
274
+ static void AngInertiaSetter (v8::Local<v8::String>, v8::Local<v8::Value> val, const v8::PropertyCallbackInfo<void >& info)
275
+ {
276
+ V8_GET_ISOLATE_CONTEXT ();
277
+ V8_GET_THIS_BASE_OBJECT (_this, alt::IEntity);
278
+
279
+ V8_TO_VECTOR3 (val, vector);
280
+
281
+ _this->SetAngInertia (vector);
282
+ }
283
+
284
+ static void ResetMass (const v8::FunctionCallbackInfo<v8::Value>& info)
285
+ {
286
+ V8_GET_ISOLATE_CONTEXT ();
287
+ V8_GET_THIS_BASE_OBJECT (_this, alt::IEntity);
288
+
289
+ _this->ResetMass ();
290
+ }
291
+
292
+ static void ResetAngInertia (const v8::FunctionCallbackInfo<v8::Value>& info)
293
+ {
294
+ V8_GET_ISOLATE_CONTEXT ();
295
+ V8_GET_THIS_BASE_OBJECT (_this, alt::IEntity);
296
+
297
+ _this->ResetAngInertia ();
264
298
}
265
299
266
300
static void StaticGetByScriptID (const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -334,7 +368,13 @@ extern V8Class v8Entity("Entity",
334
368
V8Helpers::SetAccessor (isolate, tpl, " rot" , &RotationGetter, &RotationSetter);
335
369
V8Helpers::SetAccessor<IEntity, uint32_t , &IEntity::GetModel>(isolate, tpl, " model" );
336
370
V8Helpers::SetAccessor<IEntity, uint32_t , &IEntity::GetScriptID>(isolate, tpl, " scriptID" );
337
- V8Helpers::SetAccessor<IEntity, bool , &IEntity::GetVisible>(isolate, tpl, " visible" );
371
+ V8Helpers::SetAccessor<IEntity, bool , &IEntity::GetVisible>(isolate, tpl, " visible" );
372
+
373
+ V8Helpers::SetAccessor<IEntity, float , &IEntity::GetMass, &IEntity::SetMass>(isolate, tpl, " mass" );
374
+ V8Helpers::SetMethod (isolate, tpl, " resetMass" , &ResetMass);
375
+
376
+ V8Helpers::SetAccessor (isolate, tpl, " angularInertia" , &AngInertiaGetter, &AngInertiaSetter);
377
+ V8Helpers::SetMethod (isolate, tpl, " resetAngularInertia" , &ResetAngInertia);
338
378
339
379
V8Helpers::SetAccessor (isolate, tpl, " isSpawned" , &IsSpawnedGetter);
340
380
V8Helpers::SetMethod (isolate, tpl, " getSyncInfo" , &GetSyncInfo);
0 commit comments