// object owning data should be locked private static void Render2D(IPluginViewSettings pluginViewSettings, viz.Texture texture, float left, float top, float width, float height, EventTypePluginData data, nui.Registration registration) { Debug.Assert(data != null); BodyPlugin2DViewSettings bodyPluginViewSettings = pluginViewSettings as BodyPlugin2DViewSettings; if ((bodyPluginViewSettings != null) && (registration != null) && (data.body != null) && data.bodiesValid) { if (bodyPluginViewSettings.RenderBodies || bodyPluginViewSettings.RenderHands) { viz.Body2DMode bodyMode = viz.Body2DMode.DepthIR; if ((texture != null) && (texture.GetWidth() == nui.Constants.STREAM_COLOR_WIDTH) && (texture.GetHeight() == nui.Constants.STREAM_COLOR_HEIGHT)) { bodyMode = viz.Body2DMode.Color; } data.body.Begin2D(left, top, width, height, bodyMode, registration.GetCalibrationData()); for (uint i = 0; i < BodyPlugin.bodyOptions.Length; ++i) { if (bodyPluginViewSettings.RenderBodies) { viz.Vector color = BodyPlugin.bodyOptions[i].ColorVector; color.A = 0.7f; data.body.RenderBones2D(i, color); } if (bodyPluginViewSettings.RenderHands) { data.body.RenderHandStates2D(i); } } data.body.End2D(); } } }
private BodyPlugin2DViewSettings(BodyPlugin2DViewSettings source) : base(source) { }
public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl) { IPluginViewSettings pluginViewSettings = new BodyPlugin2DViewSettings(); return(pluginViewSettings); }
public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl) { IPluginViewSettings pluginViewSettings = new BodyPlugin2DViewSettings(); return pluginViewSettings; }