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(); } }
private void AddToScene() { string sceneName = WorldEditor.GetUniqueName(name, "Particle System"); particleSystem = ParticleSystemManager.Instance.CreateSystem(sceneName, particleSystemName); particleSystem.ScaleVelocity(velocityScale); baseHeight = particleSystem.DefaultHeight; baseWidth = particleSystem.DefaultWidth; ParticleScale = particleScale; if (attached) { Axiom.Animating.AttachmentPoint attachmentPoint = displayObject.GetAttachmentPoint(attachmentPointName); if (attachmentPoint == null) { attachmentPoint = new Axiom.Animating.AttachmentPoint(attachmentPointName, null, Quaternion.Identity, Vector3.Zero); } if (attachmentPoint.ParentBone != null) { tagPoint = displayObject.Entity.AttachObjectToBone(attachmentPoint.ParentBone, particleSystem, attachmentPoint.Orientation, attachmentPoint.Position); node = null; } else { node = scene.CreateSceneNode(); node.Position = attachmentPoint.Position; node.Orientation = attachmentPoint.Orientation; displayObject.SceneNode.AddChild(node); node.AttachObject(particleSystem); } } else { node = scene.RootSceneNode.CreateChildSceneNode(); node.AttachObject(particleSystem); node.Position = position; node.ScaleFactor = scale; node.Orientation = Quaternion.FromAngleAxis(rotation.y * MathUtil.RADIANS_PER_DEGREE, Vector3.UnitY); } }
public void AddToScene() { if (!inScene) { inScene = true; // create scene manager boundary sceneBoundary = new Axiom.SceneManagers.Multiverse.Boundary(WorldEditor.GetUniqueName("Boundary", name)); Axiom.SceneManagers.Multiverse.TerrainManager.Instance.AddBoundary(sceneBoundary); } // update points list in scene manager RefreshPoints(); // add all children to the scene foreach (IWorldObject child in children) { child.AddToScene(); } OnSceneChange(); }
public void AddToScene(Vector3 position, Vector3 scale, Quaternion rotation) { string uniqueName = WorldEditor.GetUniqueName(name, type); if (!String.Equals(type, "Drag")) { this.uniName = uniqueName; nameDictionary.Add(uniqueName, parent); } entity = scene.CreateEntity(uniqueName, this.MeshName); entity.CastShadows = castShadows; node = scene.RootSceneNode.CreateChildSceneNode(position); node.ScaleFactor = scale; node.Orientation = rotation; node.AttachObject(entity); ValidateSubMeshList(); AddCollisionObject(); //subMeshCollection.Changed += new SubMeshChangeEventHandler(subMeshCollection_Changed); }
public void AddToScene() { if (!inScene) { inScene = true; this.waterSemantic = new Axiom.SceneManagers.Multiverse.WaterPlane(this.Height, WorldEditor.GetUniqueName((parent as Boundary).Name, "BoundaryWaterSemantic"), null); parent.SceneBoundary.AddSemantic(this.waterSemantic); } }
public void AddToScene() { if (!inScene) { inScene = true; forestSemantic = new Axiom.SceneManagers.Multiverse.Forest(this.seed, WorldEditor.GetUniqueName("ForestBoundarySemantic", parent.Name), app.Scene.RootSceneNode); parent.SceneBoundary.AddSemantic(this.forestSemantic); forestSemantic.WindFilename = filename; forestSemantic.WindDirection = windDirection; forestSemantic.WindStrength = windSpeed; } foreach (IWorldObject tree in treeTypes) { tree.AddToScene(); } }