public ObjectBrowser(MeshCreatorModifier control) { InitializeComponent(); this.control = control; inputBox = new InputMessageBox(); selectLayerDialog = new ObjectBrowserSelectLayer(); }
public MeshCreatorModifier AddMeshCreatorModifier(TgcMeshCreator tool) { var modifier = new MeshCreatorModifier(tool); AddModifier(modifier); return(modifier); }
public SelectionRectangle(MeshCreatorModifier control) { this.control = control; rectMesh = new SelectionRectangleMesh(); auxBoundingBoxList = new List <TgcBoundingAxisAlignBox>(); selectiveObjectsAdditive = false; }
public EditorPrimitive(MeshCreatorModifier control) { Control = control; selected = false; UserProperties = new Dictionary <string, string>(); Layer = control.CurrentLayer; ModifyCaps = new ModifyCapabilities(); visible = true; }
/// <summary> /// Construir un EditablePoly a partir de un mesh /// </summary> public EditablePoly(MeshCreatorModifier control, TgcMesh origMesh) { Control = control; CurrentPrimitive = PrimitiveType.None; rectMesh = new SelectionRectangleMesh(); SelectionList = new List <EditPolyPrimitive>(); primitiveRenderer = new PrimitiveRenderer(this); translateGizmo = new EditablePolyTranslateGizmo(this); deletedTriangles = new List <int>(); loadMesh(origMesh); }
public ScaleGizmo(MeshCreatorModifier control) : base(control) { selectedAxis = Axis.None; currentState = State.Init; boxX = TGCBox.fromExtremes(TGCVector3.Empty, new TGCVector3(LARGE_AXIS_SIZE, SHORT_AXIS_SIZE, SHORT_AXIS_SIZE), Color.FromArgb(200, 50, 50)); boxX.AutoTransformEnable = true; boxY = TGCBox.fromExtremes(TGCVector3.Empty, new TGCVector3(SHORT_AXIS_SIZE, LARGE_AXIS_SIZE, SHORT_AXIS_SIZE), Color.FromArgb(50, 200, 50)); boxY.AutoTransformEnable = true; boxZ = TGCBox.fromExtremes(TGCVector3.Empty, new TGCVector3(SHORT_AXIS_SIZE, SHORT_AXIS_SIZE, LARGE_AXIS_SIZE), Color.FromArgb(50, 50, 200)); boxZ.AutoTransformEnable = true; }
public MeshPrimitive(MeshCreatorModifier control, TgcMesh mesh) : base(control) { //this.Name = mesh.Name + "_" + EditorPrimitive.PRIMITIVE_COUNT++; Name = mesh.Name; this.mesh = mesh; 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 ModifyCaps.ChangeTexture = true; ModifyCaps.ChangeOffsetUV = true; ModifyCaps.ChangeTilingUV = true; ModifyCaps.TextureNumbers = mesh.DiffuseMaps.Length; originalUVCoords = mesh.getTextureCoordinates(); } else { //No tiene textura, deshabilitar todo ModifyCaps.ChangeTexture = false; ModifyCaps.ChangeOffsetUV = false; ModifyCaps.ChangeTilingUV = false; ModifyCaps.TextureNumbers = 0; } UserProperties = this.mesh.UserProperties; uvOffset = new TGCVector2(0, 0); uvTile = new TGCVector2(1, 1); //Layer if (this.mesh.Layer != null && this.mesh.Layer.Length > 0) { Layer = this.mesh.Layer; } else { Layer = control.CurrentLayer; } //Ubicar mesh en el origen de coordenadas respecto del centro de su AABB setMeshToOrigin(); }
public Grid(MeshCreatorModifier control) { this.control = control; //El bounding box del piso es bien grande para hacer colisiones BoundingBox = new TgcBoundingAxisAlignBox(new TGCVector3(-BIG_VAL, -SMALL_VAL, -BIG_VAL), new TGCVector3(BIG_VAL, 0, BIG_VAL)); //Planos para colision de picking pickingXZAabb = new TgcBoundingAxisAlignBox(new TGCVector3(-BIG_VAL, -SMALL_VAL, -BIG_VAL), new TGCVector3(BIG_VAL, 0, BIG_VAL)); pickingXYAabb = new TgcBoundingAxisAlignBox(new TGCVector3(-BIG_VAL, -BIG_VAL, -SMALL_VAL), new TGCVector3(BIG_VAL, BIG_VAL, 0)); pickingYZAabb = new TgcBoundingAxisAlignBox(new TGCVector3(-SMALL_VAL, -BIG_VAL, -BIG_VAL), new TGCVector3(0, BIG_VAL, BIG_VAL)); vertices = new CustomVertex.PositionColored[12 * 2 * 2]; var color = Color.FromArgb(76, 76, 76).ToArgb(); //10 lineas horizontales en X for (var 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 (var 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 PlaneYZPrimitive(MeshCreatorModifier control) : base(control) { Name = "TGCPlane_" + PRIMITIVE_COUNT++; ModifyCaps.ChangeRotation = false; }
public EditorGizmo(MeshCreatorModifier control) { Control = control; }
public SpherePrimitive(MeshCreatorModifier control) : base(control) { bb = new TgcBoundingAxisAlignBox(); Name = "Sphere_" + PRIMITIVE_COUNT++; }
public TranslateGizmo(MeshCreatorModifier control) : base(control) { gizmoMesh = new TranslateGizmoMesh(); currentState = State.Init; }
public BoxPrimitive(MeshCreatorModifier control) : base(control) { Name = "Box_" + PRIMITIVE_COUNT++; }
public override void Init() { //Crear Modifier especial para este editor Modifier = AddMeshCreatorModifier(this); }