コード例 #1
0
 public ObjectBrowser(MeshCreatorControl control)
 {
     InitializeComponent();
     this.control           = control;
     this.inputBox          = new InputMessageBox();
     this.selectLayerDialog = new ObjectBrowserSelectLayer();
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public SelectionRectangle(MeshCreatorControl control)
 {
     this.control                  = control;
     this.rectMesh                 = new SelectionRectangleMesh();
     auxBoundingBoxList            = new List <TgcBoundingBox>();
     this.selectiveObjectsAdditive = false;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
        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));
        }
コード例 #7
0
ファイル: ScaleGizmo.cs プロジェクト: aniPerezG/barbalpha
        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));
        }
コード例 #8
0
 /// <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);
 }
コード例 #9
0
ファイル: EditablePoly.cs プロジェクト: nicoschtein/TGC2014
 /// <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);
 }
コード例 #10
0
ファイル: MeshPrimitive.cs プロジェクト: nicoschtein/TGC2014
        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();
        }
コード例 #11
0
ファイル: MeshPrimitive.cs プロジェクト: aniPerezG/barbalpha
        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();
        }
コード例 #12
0
ファイル: BoxPrimitive.cs プロジェクト: aniPerezG/barbalpha
 public BoxPrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.Name = "Box_" + EditorPrimitive.PRIMITIVE_COUNT++;
 }
コード例 #13
0
ファイル: EditorGizmo.cs プロジェクト: aniPerezG/barbalpha
 public EditorGizmo(MeshCreatorControl control)
 {
     this.control = control;
 } 
コード例 #14
0
ファイル: EditablePoly.cs プロジェクト: nicoschtein/TGC2014
 /// <summary>
 /// Liberar recursos
 /// </summary>
 public void dispose()
 {
     control = null;
     primitiveRenderer.dispose();
 }
コード例 #15
0
ファイル: TranslateGizmo.cs プロジェクト: aniPerezG/barbalpha
 public TranslateGizmo(MeshCreatorControl control)
     : base(control)
 {
     gizmoMesh = new TranslateGizmoMesh();
     currentState = State.Init;
 }
コード例 #16
0
 public MeshCreatorModifier(string varName, TgcMeshCreator creator)
     : base(varName)
 {
     control = new MeshCreatorControl(creator);
     contentPanel.Controls.Add(control);
 }
コード例 #17
0
 public TranslateGizmo(MeshCreatorControl control)
     : base(control)
 {
     gizmoMesh    = new TranslateGizmoMesh();
     currentState = State.Init;
 }
コード例 #18
0
 public BoxPrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.Name = "Box_" + EditorPrimitive.PRIMITIVE_COUNT++;
 }
コード例 #19
0
 public PlaneXYPrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.Name = "Plane_" + EditorPrimitive.PRIMITIVE_COUNT++;
     this.ModifyCaps.ChangeRotation = false;
 }
コード例 #20
0
 public PlaneXZPrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.Name = "Plane_" + EditorPrimitive.PRIMITIVE_COUNT++;
     this.ModifyCaps.ChangeRotation = false;
 }
コード例 #21
0
 public SpherePrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.bb = new TgcBoundingBox();
     this.Name = "Sphere_" + EditorPrimitive.PRIMITIVE_COUNT++;
 }
コード例 #22
0
 /// <summary>
 /// Liberar recursos
 /// </summary>
 public void dispose()
 {
     control = null;
     primitiveRenderer.dispose();
 }
コード例 #23
0
 public EditorGizmo(MeshCreatorControl control)
 {
     this.control = control;
 }
コード例 #24
0
 public SpherePrimitive(MeshCreatorControl control)
     : base(control)
 {
     this.bb   = new TgcBoundingBox();
     this.Name = "Sphere_" + EditorPrimitive.PRIMITIVE_COUNT++;
 }