public void Render3D(EventType eventType, IPluginViewSettings pluginViewSettings, viz.Context context, viz.Texture texture) { if (eventType == EventType.Monitor) { lock (this.lockObj) { if (pluginViewSettings is AudioPlugin3DViewSettings) { if (this.beamConfidence > 0.0f) { viz.Effect effectBeam = new viz.Effect() { EnableLighting = true, Ambient = new viz.Vector(0.0f, 1.0f, 0.0f, 0.5f), }; float[] matrixFloats = new float[16]; unsafe { fixed(float *pMatrix = &matrixFloats[0]) { MatrixHelper.CalculateBeamMatrix(this.beamAngle, pMatrix); } } viz.Matrix mat = new viz.Matrix(); mat.R0 = new viz.Vector(matrixFloats[0], matrixFloats[1], matrixFloats[2], matrixFloats[3]); mat.R1 = new viz.Vector(matrixFloats[4], matrixFloats[5], matrixFloats[6], matrixFloats[7]); mat.R2 = new viz.Vector(matrixFloats[8], matrixFloats[9], matrixFloats[10], matrixFloats[11]); mat.R3 = new viz.Vector(matrixFloats[12], matrixFloats[13], matrixFloats[14], matrixFloats[15]); this.beamMesh.Render(viz.MeshRenderMode.IndexedTriangleList, mat, effectBeam, null); } } } } }
public void Render3D(EventType eventType, IPluginViewSettings pluginViewSettings, viz.Context context, viz.Texture texture) { if (eventType == EventType.Monitor) { lock (this.lockObj) { if (pluginViewSettings is AudioPlugin3DViewSettings) { if (this.beamConfidence > 0.0f) { viz.Effect effectBeam = new viz.Effect() { EnableLighting = true, Ambient = new viz.Vector(0.0f, 1.0f, 0.0f, 0.5f), }; float[] matrixFloats = new float[16]; unsafe { fixed (float* pMatrix = &matrixFloats[0]) { MatrixHelper.CalculateBeamMatrix(this.beamAngle, pMatrix); } } viz.Matrix mat = new viz.Matrix(); mat.R0 = new viz.Vector(matrixFloats[0], matrixFloats[1], matrixFloats[2], matrixFloats[3]); mat.R1 = new viz.Vector(matrixFloats[4], matrixFloats[5], matrixFloats[6], matrixFloats[7]); mat.R2 = new viz.Vector(matrixFloats[8], matrixFloats[9], matrixFloats[10], matrixFloats[11]); mat.R3 = new viz.Vector(matrixFloats[12], matrixFloats[13], matrixFloats[14], matrixFloats[15]); this.beamMesh.Render(viz.MeshRenderMode.IndexedTriangleList, mat, effectBeam, null); } } } } }