public ObjectBrowser(MeshCreatorControl control) { InitializeComponent(); this.control = control; this.inputBox = new InputMessageBox(); this.selectLayerDialog = new ObjectBrowserSelectLayer(); }
public Grid(MeshCreatorControl control) { this.control = control; //El bounding box del piso es bien grande para hacer colisiones boundingBox = new TgcBoundingBox(new Vector3(-BIG_VAL, -SMALL_VAL, -BIG_VAL), new Vector3(BIG_VAL, 0, BIG_VAL)); //Planos para colision de picking pickingXZAabb = new TgcBoundingBox(new Vector3(-BIG_VAL, -SMALL_VAL, -BIG_VAL), new Vector3(BIG_VAL, 0, BIG_VAL)); pickingXYAabb = new TgcBoundingBox(new Vector3(-BIG_VAL, -BIG_VAL, -SMALL_VAL), new Vector3(BIG_VAL, BIG_VAL, 0)); pickingYZAabb = new TgcBoundingBox(new Vector3(-SMALL_VAL, -BIG_VAL, -BIG_VAL), new Vector3(0, BIG_VAL, BIG_VAL)); vertices = new CustomVertex.PositionColored[12 * 2 * 2]; int color = Color.FromArgb(76, 76, 76).ToArgb(); //10 lineas horizontales en X for (int i = 0; i < 11; i++) { vertices[i * 2] = new CustomVertex.PositionColored(-GRID_RADIUS, 0, -GRID_RADIUS + LINE_SEPARATION * i, color); vertices[i * 2 + 1] = new CustomVertex.PositionColored(GRID_RADIUS, 0, -GRID_RADIUS + LINE_SEPARATION * i, color); } //10 lineas horizontales en Z for (int i = 11; i < 22; i++) { vertices[i * 2] = new CustomVertex.PositionColored(-GRID_RADIUS * 3 + LINE_SEPARATION * i - LINE_SEPARATION, 0, -GRID_RADIUS, color); vertices[i * 2 + 1] = new CustomVertex.PositionColored(-GRID_RADIUS * 3 + LINE_SEPARATION * i - LINE_SEPARATION, 0, GRID_RADIUS, color); } }
public SelectionRectangle(MeshCreatorControl control) { this.control = control; this.rectMesh = new SelectionRectangleMesh(); auxBoundingBoxList = new List <TgcBoundingBox>(); this.selectiveObjectsAdditive = false; }
public EditorPrimitive(MeshCreatorControl control) { this.control = control; this.selected = false; this.userProperties = new Dictionary <string, string>(); this.layer = control.CurrentLayer; this.modifyCaps = new ModifyCapabilities(); this.visible = true; }
public EditorPrimitive(MeshCreatorControl control) { this.control = control; this.selected = false; this.userProperties = new Dictionary<string, string>(); this.layer = control.CurrentLayer; this.modifyCaps = new ModifyCapabilities(); this.visible = true; }
public ScaleGizmo(MeshCreatorControl control) : base(control) { selectedAxis = Axis.None; currentState = State.Init; boxX = TgcBox.fromExtremes(new Vector3(0, 0, 0), new Vector3(LARGE_AXIS_SIZE, SHORT_AXIS_SIZE, SHORT_AXIS_SIZE), Color.FromArgb(200, 50, 50)); boxY = TgcBox.fromExtremes(new Vector3(0, 0, 0), new Vector3(SHORT_AXIS_SIZE, LARGE_AXIS_SIZE, SHORT_AXIS_SIZE), Color.FromArgb(50, 200, 50)); boxZ = TgcBox.fromExtremes(new Vector3(0, 0, 0), new Vector3(SHORT_AXIS_SIZE, SHORT_AXIS_SIZE, LARGE_AXIS_SIZE), Color.FromArgb(50, 50, 200)); }
/// <summary> /// Construir un EditablePoly a partir de un mesh /// </summary> public EditablePoly(MeshCreatorControl control, TgcMesh origMesh) { this.control = control; this.currentPrimitive = PrimitiveType.None; this.rectMesh = new SelectionRectangleMesh(); this.selectionList = new List<EditPolyPrimitive>(); this.primitiveRenderer = new PrimitiveRenderer(this); this.translateGizmo = new EditablePolyTranslateGizmo(this); this.deletedTriangles = new List<int>(); loadMesh(origMesh); }
/// <summary> /// Construir un EditablePoly a partir de un mesh /// </summary> public EditablePoly(MeshCreatorControl control, TgcMesh origMesh) { this.control = control; this.currentPrimitive = PrimitiveType.None; this.rectMesh = new SelectionRectangleMesh(); this.selectionList = new List <EditPolyPrimitive>(); this.primitiveRenderer = new PrimitiveRenderer(this); this.translateGizmo = new EditablePolyTranslateGizmo(this); this.deletedTriangles = new List <int>(); loadMesh(origMesh); }
public MeshPrimitive(MeshCreatorControl control, TgcMesh mesh) : base(control) { //this.Name = mesh.Name + "_" + EditorPrimitive.PRIMITIVE_COUNT++; this.Name = mesh.Name; this.mesh = mesh; this.editablePolyEnabled = false; //Ver si tiene texturas if (mesh.RenderType == TgcMesh.MeshRenderType.DIFFUSE_MAP || mesh.RenderType == TgcMesh.MeshRenderType.DIFFUSE_MAP_AND_LIGHTMAP) { //Tiene, habilitar la edicion this.ModifyCaps.ChangeTexture = true; this.ModifyCaps.ChangeOffsetUV = true; this.ModifyCaps.ChangeTilingUV = true; this.ModifyCaps.TextureNumbers = mesh.DiffuseMaps.Length; this.originalUVCoords = mesh.getTextureCoordinates(); } else { //No tiene textura, deshabilitar todo this.ModifyCaps.ChangeTexture = false; this.ModifyCaps.ChangeOffsetUV = false; this.ModifyCaps.ChangeTilingUV = false; this.ModifyCaps.TextureNumbers = 0; } this.UserProperties = this.mesh.UserProperties; this.uvOffset = new Vector2(0, 0); this.uvTile = new Vector2(1, 1); //Layer if (this.mesh.Layer != null && this.mesh.Layer.Length > 0) { this.Layer = this.mesh.Layer; } else { this.Layer = control.CurrentLayer; } //Ubicar mesh en el origen de coordenadas respecto del centro de su AABB setMeshToOrigin(); }
public MeshPrimitive(MeshCreatorControl control, TgcMesh mesh) : base(control) { //this.Name = mesh.Name + "_" + EditorPrimitive.PRIMITIVE_COUNT++; this.Name = mesh.Name; this.mesh = mesh; this.editablePolyEnabled = false; //Ver si tiene texturas if(mesh.RenderType == TgcMesh.MeshRenderType.DIFFUSE_MAP || mesh.RenderType == TgcMesh.MeshRenderType.DIFFUSE_MAP_AND_LIGHTMAP) { //Tiene, habilitar la edicion this.ModifyCaps.ChangeTexture = true; this.ModifyCaps.ChangeOffsetUV = true; this.ModifyCaps.ChangeTilingUV = true; this.ModifyCaps.TextureNumbers = mesh.DiffuseMaps.Length; this.originalUVCoords = mesh.getTextureCoordinates(); } else { //No tiene textura, deshabilitar todo this.ModifyCaps.ChangeTexture = false; this.ModifyCaps.ChangeOffsetUV = false; this.ModifyCaps.ChangeTilingUV = false; this.ModifyCaps.TextureNumbers = 0; } this.UserProperties = this.mesh.UserProperties; this.uvOffset = new Vector2(0, 0); this.uvTile = new Vector2(1, 1); //Layer if (this.mesh.Layer != null && this.mesh.Layer.Length > 0) { this.Layer = this.mesh.Layer; } else { this.Layer = control.CurrentLayer; } //Ubicar mesh en el origen de coordenadas respecto del centro de su AABB setMeshToOrigin(); }
public BoxPrimitive(MeshCreatorControl control) : base(control) { this.Name = "Box_" + EditorPrimitive.PRIMITIVE_COUNT++; }
public EditorGizmo(MeshCreatorControl control) { this.control = control; }
/// <summary> /// Liberar recursos /// </summary> public void dispose() { control = null; primitiveRenderer.dispose(); }
public TranslateGizmo(MeshCreatorControl control) : base(control) { gizmoMesh = new TranslateGizmoMesh(); currentState = State.Init; }
public MeshCreatorModifier(string varName, TgcMeshCreator creator) : base(varName) { control = new MeshCreatorControl(creator); contentPanel.Controls.Add(control); }
public PlaneXYPrimitive(MeshCreatorControl control) : base(control) { this.Name = "Plane_" + EditorPrimitive.PRIMITIVE_COUNT++; this.ModifyCaps.ChangeRotation = false; }
public PlaneXZPrimitive(MeshCreatorControl control) : base(control) { this.Name = "Plane_" + EditorPrimitive.PRIMITIVE_COUNT++; this.ModifyCaps.ChangeRotation = false; }
public SpherePrimitive(MeshCreatorControl control) : base(control) { this.bb = new TgcBoundingBox(); this.Name = "Sphere_" + EditorPrimitive.PRIMITIVE_COUNT++; }