public PrimitiveRenderer(EditablePoly editablePoly) { this.editablePoly = editablePoly; this.batchRenderer = new TrianglesBatchRenderer(); this.vertexBox = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Blue); this.selectedVertexBox = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Red); }
/// <summary> /// Setear estado EditablePoly /// </summary> /// <param name="enabled"></param> public void setEditablePolyEnable(bool enabled, EditablePoly.PrimitiveType primitiveType) { if (enabled) { currentState = State.EditablePoly; groupBoxEPolyCommon.Enabled = true; creatingPrimitive = null; currentGizmo = null; MeshPrimitive m = (MeshPrimitive)selectionList[0]; m.enableEditablePoly(true, primitiveType); } else { if (currentState == State.EditablePoly) { MeshPrimitive m = (MeshPrimitive)selectionList[0]; m.enableEditablePoly(false, primitiveType); radioButtonEPolyPrimitiveVertex.Checked = false; radioButtonEPolyPrimitiveEdge.Checked = false; radioButtonEPolyPrimitivePolygon.Checked = false; groupBoxEPolyCommon.Enabled = false; groupBoxEPolyEditVertices.Enabled = false; groupBoxEPolyEditEdges.Enabled = false; groupBoxEPolyEditPolygons.Enabled = false; setSelectObjectState(); } } }
public EditablePolyTranslateGizmo(EditablePoly editablePoly) { this.editablePoly = editablePoly; gizmoMesh = new TranslateGizmoMesh(); currentState = State.Init; }
public override void dispose() { mesh.dispose(); mesh = null; originalUVCoords = null; if (editablePoly != null) { editablePoly.dispose(); editablePoly = null; } }
/// <summary> /// Activar/Desactivar modo editablePoly /// </summary> public void enableEditablePoly(bool enabled, EditablePoly.PrimitiveType primitiveType) { if (enabled) { if (editablePoly == null) { editablePoly = new EditablePoly(this.Control, mesh); } else { editablePoly.updateValuesFromMesh(mesh); } editablePoly.setPrimitiveType(primitiveType); } else { //Acomodar mesh luego de haber sido editado internamente applyMeshTransformToVertices(mesh); setMeshToOrigin(); } editablePolyEnabled = enabled; }