public override void Update() { var start = startModifier.Value; var end = endModifier.Value; var thickness = thicknessModifier.Value; var headSize = headSizeModifier.Value; var bodyColor = bodyColorModifier.Value; var headColor = headColorModifier.Value; var offset = new TGCVector3(10, 0, 0); //Cargar valores de la flecha arrow.PStart = start - offset; arrow.PEnd = end - offset; arrow.Thickness = thickness; arrow.HeadSize = headSize; arrow.BodyColor = bodyColor; arrow.HeadColor = headColor; //Actualizar valores para hacerlos efectivos, ADVERTENCIA verificar que estemetodo crea los vertices nuevamente. //Recomendado de ser posible realizar transformaciones!!! arrow.updateValues(); var boxColor = boxColorModifier.Value; //Cargar valores de la linea box.PMin = start + offset; box.PMax = end + offset; box.Thickness = thickness; box.Color = boxColor; //Actualizar valores para hacerlos efectivos, ADVERTENCIA verificar que estemetodo crea los vertices nuevamente. //Recomendado de ser posible realizar transformaciones!!! box.updateValues(); }
/// <summary> /// Actualiza los parametros de la caja en base a lo cargado por el usuario /// </summary> private void updateBox() { //Cambiar textura var texturePath = (string)Modifiers["texture"]; if (texturePath != currentTexture) { currentTexture = texturePath; box.setTexture(TgcTexture.createTexture(D3DDevice.Instance.Device, currentTexture)); } var size = (Vector3)Modifiers["size"]; var position = (Vector3)Modifiers["position"]; var thickness = (float)Modifiers["thickness"]; var color = (Color)Modifiers["color"]; //Tamano, posicion y color box.Size = size; box.Position = position + new Vector3(15f, 0, 0); box.Color = color; //Actualizar valores en la caja. debugBox.setPositionSize(position - new Vector3(15f, 0, 0), size); debugBox.Thickness = thickness; debugBox.Color = color; //Rotacion, converitr a radianes var rotaion = (Vector3)Modifiers["rotation"]; box.Rotation = new Vector3(Geometry.DegreeToRadian(rotaion.X), Geometry.DegreeToRadian(rotaion.Y), Geometry.DegreeToRadian(rotaion.Z)); //Offset y Tiling de textura box.UVOffset = (Vector2)Modifiers["offset"]; box.UVTiling = (Vector2)Modifiers["tiling"]; //Actualizar valores en la caja. IMPORTANTE, es mejor realizar transformaciones con matrices. debugBox.updateValues(); //Actualizar valores en la caja. IMPORTANTE, es mejor realizar transformaciones con matrices. //Otra cosa importante, las rotaciones no modifican el AABB. con lo cual hay que tener cuidado. box.updateValues(); }