public Tree(XmlReader r, Forest parent, WorldEditor worldEditor) { this.app = worldEditor; this.parent = parent; FromXml(r); }
/// <summary> /// Function that handles all the input in the actual scene window /// </summary> void OnSceneGUI() { //Check for edit mode if (Event.current.alt) { inEditMode = false; } else { inEditMode = true; } // if in edit mode, start processing inputs if (inEditMode) { //Disable mouse selection while in edit mode to prevent selection if (Event.current.type == EventType.layout) { HandleUtility.AddDefaultControl(GUIUtility.GetControlID(GetHashCode(), FocusType.Passive)); } if (Event.current.type == EventType.mouseDown) { Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); //cast ray from screen point towards 3d space - super useful RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, 1000f)) { //if we hit terrain, execute prop instantiation. Vector3 brushPosition = hit.point; worldEditor = (WorldEditor)target; worldEditor.PrefabBrush(brushPosition, (GameObject)prefab); } } } }
public PointLight(WorldEditor worldEditor, IWorldContainer parent, SceneManager scene, XmlReader r) { this.app = worldEditor; this.parent = parent; this.scene = scene; fromXML(r); }
public void AddToScene() { if (!foundOffset) { terrainOffset = position.y - app.GetTerrainHeight(Position.x, Position.z); foundOffset = true; } if (app.DisplayPointLightMarker) { this.DisplayPointLightMarker(); if (displayObject.Entity.Mesh.TriangleIntersector == null) { displayObject.Entity.Mesh.CreateTriangleIntersector(); } } string uniqueName = WorldEditor.GetUniqueName(ObjectType, name); pLight = this.scene.CreateLight(uniqueName); pLight.Type = Axiom.Graphics.LightType.Point; pLight.Position = position; pLight.Specular = specular; pLight.Diffuse = diffuse; pLight.IsVisible = true; pLight.SetAttenuation(attenuationRange, attenuationConstant, attenuationLinear, attenuationQuadratic); inScene = true; if (app.DisplayPointLightCircles) { UpdateShowCircles(); } }
public ScaleChangeCommand(WorldEditor app, IObjectScale scaleObj, float oldScale, float newScale) { this.scaleObj = scaleObj; this.oldScale = oldScale; this.newScale = newScale; this.app = app; }
public AddObjectCommand(WorldEditor worldEditor, IWorldContainer parentObject, string objectName, string meshName, bool randomRotation, bool randomScale, float minScale, float maxScale, Vector3 position) { this.app = worldEditor; this.parent = parentObject; this.name = objectName; this.meshName = meshName; this.location = position; this.randomRotation = randomRotation; this.randomScale = randomScale; this.minScale = minScale; this.maxScale = maxScale; // apply random scale and rotation if (randomRotation) { rotation = (float)app.Random.NextDouble() * 360f; } if (randomScale) { float scaleRange = maxScale - minScale; scale = minScale + (float)app.Random.NextDouble() * scaleRange; } placing = false; }
public PositionChangeCommand(WorldEditor app, IObjectPosition posObj, Vector3 oldPosition, Vector3 newPosition) { this.posObj = posObj; this.oldPosition = oldPosition; this.newPosition = newPosition; this.app = app; }
public Sound(XmlReader r, IWorldContainer parent, WorldEditor worldEditor) { this.parent = parent; this.app = worldEditor; FromXml(r); }
public SearchDialog(WorldTreeNode node, TreeNodeCollection collection, WorldEditor worldEditor) { this.rootNode = node; this.rootNodeCollection = collection; this.app = worldEditor; InitializeComponent(); }
// Look up the path set associated with a particular mesh public static InteriorPathSet FindPathsForMesh(WorldEditor app, string meshName) { InteriorPathSetLookup result; if (pathSetDictionary.TryGetValue(meshName, out result)) { return(result.paths); } else { string meshNameWithoutExtension = Path.GetFileNameWithoutExtension(meshName); string modelPathFile = meshNameWithoutExtension + ".modelpaths"; try { Stream stream = ResourceManager.FindCommonResourceData(modelPathFile); InteriorPathSet pathset = new InteriorPathSet(stream, app, meshNameWithoutExtension); return(pathset); } catch (Exception e) { LogManager.Instance.Write("Could not read '{0}'; error was '{1}'", modelPathFile, e.Message); pathSetDictionary[meshNameWithoutExtension] = new InteriorPathSetLookup(false, null); return(null); } } }
public AlphaSplatTerrainDisplay(WorldTerrain parent, WorldEditor worldEditor, XmlReader r) { this.parent = parent; this.app = worldEditor; FromXml(r); }
public ChangeCollectionCommandFactory(WorldEditor worldEditor, List <IObjectChangeCollection> changeObjList, IObjectCollectionParent toCollection) { this.app = worldEditor; this.objList = changeObjList; this.toCollection = toCollection; }
public PlantType(XmlReader r, Grass parent, WorldEditor app) { this.app = app; this.parent = parent; FromXml(r); }
public Skybox(IWorldContainer parentContainer, WorldEditor worldEditor, XmlReader r) { this.parent = parentContainer; this.app = worldEditor; FromXml(r); }
public Grass(Boundary parent, WorldEditor app, String name) { this.parent = parent; this.app = app; this.name = name; this.plantList = new List <IWorldObject>(); }
public GlobalAmbientLight(IWorldContainer parentContainer, WorldEditor worldEditor) { this.app = worldEditor; this.parent = parentContainer; this.scene = app.Scene; this.color = app.Config.DefaultAmbientLightColor; }
public GlobalAmbientLight(IWorldContainer parentContainer, WorldEditor worldEditor, SceneManager sceneManager, ColorEx lightColor) { this.parent = parentContainer; this.app = worldEditor; this.scene = sceneManager; this.color = lightColor; }
public RotationChangeCommand(WorldEditor app, IObjectRotation rotObj, float oldRot, float newRot) { this.rotObj = rotObj; this.oldRot = oldRot; this.newRot = newRot; this.app = app; }
public GlobalDirectionalLight(IWorldContainer parent, WorldEditor worldEditor, XmlReader r) { this.app = worldEditor; this.parent = parent; this.scene = app.Scene; fromXml(r); }
public TerraformTool(EditorScreen screen, WorldEditor editor) : base(screen, editor, EditorToolType.Terraform, Key.Number6) { window = new TerraformWindow(UI.GUISystem, UI.Theme); window.Visible = false; UI.GUISystem.Add(window); }
public PaintTool(EditorScreen screen, WorldEditor editor) : base(screen, editor, EditorToolType.Paint, Key.Number4) { window = new PaintWindow(UI.GUISystem, UI.Theme); window.Visible = false; UI.GUISystem.Add(window); }
public ParticleEffect(XmlReader r, IWorldObject parent, WorldEditor app) { this.parent = parent; this.app = app; FromXml(r); }
public PointCollection(IWorldContainer parent, WorldEditor worldEditor, bool noIntersect, bool displayMarkers, string markerMeshName, string markerMaterialName, MPPointType type, XmlReader r) : this(parent, worldEditor, noIntersect, displayMarkers, markerMeshName, markerMaterialName, type) { // // don't do the intersection test when adding points from xml // this.noIntersect = false; while (r.Read()) { // look for the start of an element if (r.NodeType == XmlNodeType.Whitespace) { continue; } if (r.NodeType == XmlNodeType.EndElement) { break; } if (r.NodeType == XmlNodeType.Element) { if (String.Equals(r.Name, "Point")) { Vector3 ptLoc = XmlHelperClass.ParseVectorAttributes(r); int pointNum; AddPoint(ptLoc, out pointNum); } } } this.noIntersect = noIntersect; }
static public void SendUserError(string text, string anchor, int displayTime, bool includeBeep, object objin, WorldEditor appin) { app = appin; link = anchor; if (includeBeep) { SystemSounds.Beep.Play(); } obj = objin; if (showing == false) { showing = true; toolStripErrorMessage = new ToolStripLabel(text, null, false); toolStripErrorMessage.ForeColor = Color.Red; toolStripErrorMessage.Click += toolStripErrorMessage_clicked; toolStripErrorMessage.IsLink = true; toolStripErrorMessage.ActiveLinkColor = Color.Red; toolStripErrorMessage.LinkBehavior = LinkBehavior.AlwaysUnderline; toolStripErrorMessage.LinkColor = Color.Red; toolStripErrorMessage.VisitedLinkColor = Color.Red; toolStripErrorMessageItem = toolStripErrorMessage as ToolStripItem; app.StatusBarAddItem(toolStripErrorMessageItem); timeOutErrorMessage(toolStripErrorMessageItem, displayTime); } }
public void MultipleDragMove(WorldEditor app, int x, int y) { int i = 0; location = app.PickTerrain(x, y); Vector3 position; foreach (IObjectDrag disObject in dragObjects) { switch (disObject.ObjectType) { case "PointLight": case "Marker": case "Object": position = location + dragOffset[i]; if (i == 0) { if (disObject.AllowAdjustHeightOffTerrain) { position = app.ObjectPlacementLocation(x, y) + new Vector3(0, terrainOffset[i], 0); } else { position = app.ObjectPlacementLocation(x, y); } disObject.Position = position; break; } else { if (disObject.AllowAdjustHeightOffTerrain) { position = app.ObjectPlacementLocation(location + dragOffset[i]) + new Vector3(0, terrainOffset[i], 0); } else { position = app.ObjectPlacementLocation(location + dragOffset[i]); } disObject.Position = position; break; } default: position = location + dragOffset[i]; position.y = app.GetTerrainHeight(location.x, location.z); disObject.Position = position; if (String.Equals(disObject.ObjectType, "Points") && (disObject as PointCollection).DisplayMarkers != true) { (disObject as PointCollection).DisplayMarkers = true; } break; } if (!disObject.InScene) { (disObject as IWorldObject).AddToScene(); } i++; } }
public AddFogCommand(WorldEditor app, Boundary parent, ColorEx color, float nearin, float farin) { this.app = app; this.parent = parent; this.color = color; this.near = nearin; this.far = farin; }
public InsertPointsCommand(WorldEditor worldEditor, IWorldContainer parent, Vector3 newPoint, int index) { this.app = worldEditor; this.parent = (PointCollection)parent; this.newPoint = newPoint; this.index = index; this.placing = true; }
public Grass(XmlReader r, Boundary parent, WorldEditor app) { this.parent = parent; this.app = app; this.plantList = new List <IWorldObject>(); FromXml(r); }
public Fog(XmlReader r, Boundary parent, WorldEditor app) { this.app = app; this.parentNode = null; this.parent = parent; FromXml(r); }
public AddMarkerAtCameraCommand(WorldEditor app, IWorldContainer parent, string name) { this.app = app; this.parent = parent; this.name = name; this.pos = app.CameraPosition; this.orient = new Quaternion(app.CameraOrientation.w, app.CameraOrientation.x, app.CameraOrientation.y, app.CameraOrientation.z); }