Lines Matching refs:ctx

76 napi_value MeshJS::GetSubmesh(NapiApi::FunctionContext<>& ctx)
78 auto node = interface_pointer_cast<SCENE_NS::IMesh>(GetThisNativeObject(ctx));
82 napi_get_undefined(ctx, &undef);
93 auto status = napi_create_array_with_length(ctx, subs.size(), &tmp);
96 NapiApi::Object argJS(ctx);
100 ctx, interface_pointer_cast<META_NS::IObject>(node), false, BASE_NS::countof(args), args);
101 status = napi_set_element(ctx, tmp, i++, val);
107 napi_value MeshJS::GetAABB(NapiApi::FunctionContext<>& ctx)
110 napi_get_undefined(ctx, &undef);
111 auto node = interface_pointer_cast<SCENE_NS::IMesh>(GetThisNativeObject(ctx));
123 NapiApi::Object res(ctx);
125 NapiApi::Object min(ctx);
126 min.Set("x", NapiApi::Value<float> { ctx, aabmin.x });
127 min.Set("y", NapiApi::Value<float> { ctx, aabmin.y });
128 min.Set("z", NapiApi::Value<float> { ctx, aabmin.z });
131 NapiApi::Object max(ctx);
132 max.Set("x", NapiApi::Value<float> { ctx, aabmax.x });
133 max.Set("y", NapiApi::Value<float> { ctx, aabmax.y });
134 max.Set("z", NapiApi::Value<float> { ctx, aabmax.z });
139 napi_value MeshJS::GetMaterialOverride(NapiApi::FunctionContext<>& ctx)
142 napi_get_undefined(ctx, &undef);
143 auto sm = interface_pointer_cast<SCENE_NS::IMesh>(GetThisNativeObject(ctx));
156 return ctx.GetUndefined();
162 napi_value args[] = { ctx.This() };
163 return CreateFromNativeInstance(ctx, obj, false /*these are owned by the scene*/, BASE_NS::countof(args), args);
166 void MeshJS::SetMaterialOverride(NapiApi::FunctionContext<NapiApi::Object>& ctx)
168 auto sm = interface_pointer_cast<SCENE_NS::IMesh>(GetThisNativeObject(ctx));
173 NapiApi::Object obj = ctx.Arg<0>();