public TextSceneNode AddTextSceneNodeW(GUIFont font, string text, Color color, SceneNode parent) { #if !LINUX return (TextSceneNode) NativeElement.GetObject(SceneManager_AddTextSceneNodeW(_raw, font.Raw, text, color.ToUnmanaged(), GetPtr(parent)), typeof(TextSceneNode)); #else return (TextSceneNode) NativeElement.GetObject(SceneManager_AddTextSceneNode(_raw, font.Raw, text, color.ToUnmanaged(), GetPtr(parent)), typeof(TextSceneNode)); #endif }
public TextSceneNode AddBillboardTextSceneNodeW(GUIFont font, string text, SceneNode parent, Dimension2Df size, Vector3D position, int id, Color shade_top, Color shade_down) { #if !LINUX return (TextSceneNode) NativeElement.GetObject(SceneManager_AddTextSceneNode2W(_raw, font.Raw, text, GetPtr(parent), size.ToUnmanaged(), position.ToUnmanaged(), id, shade_top.ToUnmanaged(), shade_down.ToUnmanaged()), typeof(TextSceneNode)); #else return (TextSceneNode) NativeElement.GetObject(SceneManager_AddTextSceneNode2(_raw, font.Raw, text, GetPtr(parent), size.ToUnmanaged(), position.ToUnmanaged(), id, shade_top.ToUnmanaged(), shade_down.ToUnmanaged()), typeof(TextSceneNode)); #endif }
public virtual void RemoveChild(SceneNode child) { SceneNode_RemoveChild(_raw, child.Raw); }
/// <summary> /// Adds a FPS camera, look at controlled by mouse and movement by arrow keys /// </summary> /// <returns>The camera</returns> /// <param name="parent">Parent of the node</param> /// <param name="rotateSpeed">Rotation speed</param> /// <param name="moveSpeed">Movement speed</param> /// <param name="noVerticalMovement">Are vertical movements forbidden ?</param> /// <param name="map">KeyMap which defines all actions of the camera</param> public CameraSceneNode AddCameraSceneNodeFPS(SceneNode parent, float rotateSpeed, float moveSpeed, bool noVerticalMovement, KeyMap map) { return (CameraSceneNode) NativeElement.GetObject(SceneManager_AddCameraSceneNodeFPSA(_raw, GetPtr(parent), rotateSpeed, moveSpeed, -1, noVerticalMovement, map.Actions, map.Codes, map.Size), typeof(CameraSceneNode)); }
/// <summary> /// Returns the first scene node with the specified type. /// </summary> /// <param name="type"> /// A SceneNodeType used for searching <see cref="SceneNodeType"/> /// </param> /// <param name="start"> /// A first scene node searching should start from <see cref="SceneNode"/> /// </param> /// <returns> /// A closest scenenode if any <see cref="SceneNode"/> /// </returns> public SceneNode GetSceneNodeFromType(SceneNodeType type, SceneNode start) { return (SceneNode) NativeElement.GetObject(SceneManager_GetSceneNodeFromType(_raw, GetPtr(start), (int)type), typeof(SceneNode)); }
/// <summary> /// Creates a basic triangle selector based on a mesh /// </summary> /// <returns>A TriangleSelector</returns> /// <param name="mesh">The MESH !</param> /// <param name="node">Scene node, you NEED TO ADD THIS SELECTOR WITH SceneNode.TriangleSelector !</param> public TriangleSelector CreateTriangleSelector(Mesh mesh, SceneNode node) { return (TriangleSelector) NativeElement.GetObject(SceneManager_CreateTriangleSelector(_raw, mesh.Raw, node.Raw), typeof(TriangleSelector)); }
/// <summary> /// Adds a simple camera to the node /// </summary> /// <returns>The camera</returns> /// <param name="parent">The parents (null if no parent)</param> public CameraSceneNode AddCameraSceneNode(SceneNode parent) { return (CameraSceneNode) NativeElement.GetObject(SceneManager_AddCameraSceneNode(_raw, GetPtr(parent)), typeof(CameraSceneNode)); }
/// <summary> /// Adds a water surface based on a hill mesh (use AddHillPlaneMesh). Looks good when material is TransparentReflection /// </summary> /// <returns>The water to surf on</returns> /// <param name="hillMesh">Hill mesh the water is based on</param> /// <param name="waveH">Height of waves</param> /// <param name="waveS">Speed of waves</param> /// <param name="waveL">Length of waves</param> /// <param name="parent">Parent of the node</param> /// <param name="id">ID (-1 for automatic assign.)</param> public SceneNode AddWaterSurfaceSceneNode(Mesh hillMesh, float waveH, float waveS, float waveL, SceneNode parent, int id) { return (SceneNode) NativeElement.GetObject(SceneManager_AddWaterSurfaceSceneNode(_raw, hillMesh.Raw, waveH, waveS, waveL, GetPtr(parent), id), typeof(SceneNode)); }
/// <summary> /// Adds a simple skybox. A skybox is a basic cube rendered before everything and used to simulate an external environment with only textures. /// </summary> /// <returns>The skybox scene node (it should NOT be used since the skybox may not be moved nor rotated)</returns> /// <param name="parent">Its parent (should be set to null)</param> /// <param name="textureList">List of 6 Textures that constitute the skybox, order : top, bottom, left, right, front, back</param> /// <param name="id">ID of the node, -1 for automatic assign.</param> public SceneNode AddSkyBoxSceneNode(SceneNode parent, Texture[] textureList, int id) { IntPtr top = textureList[0].Raw; IntPtr bottom = textureList[1].Raw; IntPtr right = textureList[2].Raw; IntPtr left = textureList[3].Raw; IntPtr front = textureList[4].Raw; IntPtr back = textureList[5].Raw; return (SceneNode) NativeElement.GetObject(SceneManager_AddSkyBoxSceneNode(_raw, top, bottom, left, right, front, back, GetPtr(parent), id), typeof(SceneNode)); }
/// <summary> /// Adds a simple particle scene node /// </summary> /// <returns>The particle scene node</returns> /// <param name="defaultEmitter">Creates a basic emitter. If disabled you'll need to use ParticleSystemSceneNode.Emitter</param> /// <param name="parent">A SceneNode</param> /// <param name="id">An int</param> public ParticleSystemSceneNode AddParticleSystemSceneNode(bool defaultEmitter, SceneNode parent, int id) { return (ParticleSystemSceneNode) NativeElement.GetObject(SceneManager_AddParticleSystemSceneNode(_raw, defaultEmitter, GetPtr(parent), id), typeof(ParticleSystemSceneNode)); }
/// <summary> /// Adds a scene node for rendering using an octtree to the scene graph /// </summary> /// <returns>The oct tree</returns> /// <param name="mesh">The mesh the oct tree is based on. If this animated mesh has more than one frame, the first one is used</param> /// <param name="parent">Its parent</param> /// <param name="id">ID of the node (-1 for automatic assign.)</param> /// <param name="minimalPolysPerNode">Specifies the minimal polygons per node. Idea = 128</param> public SceneNode AddOctTreeSceneNode(AnimatedMesh mesh, SceneNode parent, int id, int minimalPolysPerNode) { return (SceneNode) NativeElement.GetObject(SceneManager_AddOctTreeSceneNodeA(_raw, mesh.Raw, GetPtr(parent), id, minimalPolysPerNode), typeof(SceneNode)); }
/// <summary> /// Adds a basic and not-moving scene node based on a simple mesh /// </summary> /// <returns>Your scene node</returns> /// <param name="mesh">A static mesh often obtained via GetMesh(0)</param> /// <param name="parent">Parent of the node</param> /// <param name="id">ID of the node (-1 for automatic assignation)</param> public MeshSceneNode AddMeshSceneNode(Mesh mesh, SceneNode parent, int id) { return (MeshSceneNode) NativeElement.GetObject(SceneManager_AddMeshSceneNode(_raw, mesh.Raw, GetPtr(parent), id), typeof(MeshSceneNode)); }
/// <summary> /// Adds a light scene node to the scene /// </summary> /// <returns>The light</returns> /// <param name="parent">Parent from the node</param> /// <param name="position">Initial position of the light</param> /// <param name="color">Floating color of the light</param> /// <param name="radius">Radius of the light</param> /// <param name="id">ID (-1 for automatic assignation)</param> public LightSceneNode AddLightSceneNode(SceneNode parent, Vector3D position, Colorf color, float radius, int id) { return (LightSceneNode) NativeElement.GetObject(SceneManager_AddLightSceneNode(_raw, GetPtr(parent), position.ToUnmanaged(), color.ToUnmanaged(), radius, id), typeof(LightSceneNode)); }
/// <summary> /// Adds an empty scene node, not rendered and not displayed but which exists /// </summary> /// <returns>This quite useful scene node</returns> /// <param name="parent">Parent from the node</param> /// <param name="id">ID (-1 for automatic assignation)</param> public SceneNode AddEmptySceneNode(SceneNode parent, int id) { return (SceneNode) NativeElement.GetObject(SceneManager_AddEmptySceneNode(_raw, GetPtr(parent), id), typeof(SceneNode)); }
/// <summary> /// Adds a dummy transformation scene node /// </summary> /// <returns>The node</returns> /// <param name="parent">Parent (null if no parent)</param> /// <param name="id">ID of the node (-1 for automatic assignation)</param> public SceneNode AddDummyTransformationSceneNode(SceneNode parent, int id) { return (SceneNode) NativeElement.GetObject(SceneManager_AddDummyTransformationSceneNode(_raw, GetPtr(parent), id), typeof(SceneNode)); }
/// <summary> /// Adds a node to the deletion queue (it will be deleted immediately when it is secure) /// </summary> /// <param name="node">A SceneNode</param> public void AddToDeletionQueue(SceneNode node) { System.Diagnostics.Debug.WriteLine("Add to deletionqueue for: " + node.Raw + " Elements remaining: " + NativeElement.Elements.Count); RemoveFromElements(node); SceneManager_AddToDeletionQueue(_raw, node.Raw); }
private void RemoveFromElements(SceneNode node) { if (NativeElement.Elements.ContainsKey(node.Raw)) { NativeElement.Elements.Remove(node.Raw); } else { //throw new Exception("Element was stale!!!!"); } foreach (SceneNode cnode in node.Children) { System.Diagnostics.Debug.WriteLine("Deleting child nodes for: " + node.Raw + " Elements remaining: " + NativeElement.Elements.Count); RemoveFromElements(cnode); } }
/// <summary> /// Adds a heightmap-based terrain on the scene /// </summary> /// <returns>The terrain node</returns> /// <param name="heightMap">Relative or non-relative path to the heightmap.</param> /// <param name="parent">Parent from the terrain</param> /// <param name="id">ID (-1 for automatic assign.)</param> /// <param name="position">Position of the node</param> /// <param name="rotation">Rotation of the node</param> /// <param name="scale">Scale of the node</param> /// <param name="vertexColor">Default color of all the vertices used if no texture is assigned to the node.</param> /// <param name="maxLOD">Maximal LOD, set 5 or change it ONLY IF YOU KNOW WHAT YOU ARE DOING</param> /// <param name="patchSize">PatchSize, should be 17 and you mustn't change it unless you know what you're doing</param> /// <param name="smoothFactor">Smoothing factor</param> public TerrainSceneNode AddTerrainSceneNode(string heightMap, SceneNode parent, int id, Vector3D position, Vector3D rotation, Vector3D scale, Color vertexColor, int maxLOD, TerrainPatchSize patchSize, int smoothFactor) { return (TerrainSceneNode) NativeElement.GetObject(SceneManager_AddTerrainSceneNode(_raw, heightMap, GetPtr(parent), id, position.ToUnmanaged(), rotation.ToUnmanaged(), scale.ToUnmanaged(), vertexColor.ToUnmanaged(), maxLOD, patchSize, smoothFactor), typeof(TerrainSceneNode)); }
/// <summary> /// Creates a simple animator for collision detection /// </summary> /// <returns>An Animator</returns> /// <param name="world">"World", meaning the triangle selector of the terrain/map</param> /// <param name="node">Node. Notice that this node MUST BE THE ONE THE ANIMATOR IS ADDED</param> /// <param name="ellipsoidRadius">Ellipsoid radius. Usually it's the difference between the node's skybox's max edge and its center</param> /// <param name="gravityPerSecond">How much gravity (don't try (0, -100000, 0), even on Jupiter you wouldn't have such gravity)</param> /// <param name="ellipsoidTranslation">By default (0, 0, 0), meaning the center of the scene node. You can modify it if needed</param> /// <param name="slidingValue">Sliding value, usually 0.0005f</param> public Animator CreateCollisionResponseAnimator(TriangleSelector world, SceneNode node, Vector3D ellipsoidRadius, Vector3D gravityPerSecond, Vector3D ellipsoidTranslation, float slidingValue) { return (Animator) NativeElement.GetObject(SceneManager_CreateCollisionResponseAnimator(_raw, world.Raw, node.Raw, ellipsoidRadius.ToUnmanaged(), gravityPerSecond.ToUnmanaged(), ellipsoidTranslation.ToUnmanaged(), slidingValue), typeof(Animator)); }
/// <summary> /// Adds a simple cube /// </summary> /// <returns>This cube scene node</returns> /// <param name="size">Size</param> /// <param name="parent">Parent</param> /// <param name="id">ID of the node (-1 for automatic assign.)</param> public SceneNode AddCubeSceneNode(float size, SceneNode parent, int id) { return (SceneNode) NativeElement.GetObject(SceneManager_AddCubeSceneNode(_raw, size, GetPtr(parent), id), typeof(SceneNode)); }
/// <summary> /// Creates an optimized collision detector based on OctTrees /// </summary> /// <returns>A TriangleSelector</returns> /// <param name="mesh">Mesh from your node</param> /// <param name="node">Node</param> /// <param name="minimalPolysPerNode">Specifies the minimal polygons contained a octree node. If a node gets less polys the this value, it will not be splitted into smaller nodes.</param> public TriangleSelector CreateOctTreeTriangleSelector(Mesh mesh, SceneNode node, int minimalPolysPerNode) { return (TriangleSelector) NativeElement.GetObject(SceneManager_CreateOctTreeTriangleSelector(_raw, mesh.Raw, node.Raw, minimalPolysPerNode), typeof(TriangleSelector)); }
/// <summary> /// Adds a skydome scene node to the scene graph. /// A skydome is a large (half-) sphere with a panoramic texture on the inside and is drawn around the camera position. /// </summary> /// <param name="texture">Texture for the dome. </param> /// <param name="horiRes">Number of vertices of a horizontal layer of the sphere. </param> /// <param name="vertRes">Number of vertices of a vertical layer of the sphere. </param> /// <param name="texturePercentage">How much of the height of the texture is used. Should be between 0 and 1. </param> /// <param name="spherePercentage">How much of the sphere is drawn. Value should be between 0 and 2, where 1 is an exact half-sphere and 2 is a full sphere. </param> /// <param name="radius"></param> /// <param name="parent">Parent scene node of the dome. A dome usually has no parent, so this should be null. Note: If a parent is set, the dome will not change how it is drawn.</param> /// <returns>The scene node</returns> public SceneNode AddSkyDomeSceneNode(Texture texture, uint horiRes, uint vertRes, double texturePercentage, double spherePercentage, double radius, SceneNode parent) { return (SceneNode) NativeElement.GetObject(SceneManager_AddSkyDomeSceneNode(_raw, texture.Raw, horiRes, vertRes, texturePercentage, spherePercentage, radius, GetPtr(parent)), typeof(SceneNode)); }
/// <summary> /// Creates the basic boundingbox-based triangle selector. Useful for a basic collision detection that doesn't need polygon precision /// </summary> /// <returns>A TriangleSelector</returns> /// <param name="node">The node it is taken from</param> public TriangleSelector CreateTriangleSelectorFromBoundingBox(SceneNode node) { return (TriangleSelector) NativeElement.GetObject(SceneManager_CreateTriangleSelectorFromBoundingBox(_raw, node.Raw), typeof(TriangleSelector)); }
/// <summary> /// Adds a sphere scene node for test purposes to the scene. /// It is a simple sphere. /// </summary> /// <param name="radius">Radius of the sphere. </param> /// <param name="polycount">Polycount of the sphere. </param> /// <param name="parent">Parent of the scene node. Can be null if no parent. </param> /// <returns>Scene node of the sphere</returns> public SceneNode AddSphereSceneNode(float radius, int polycount, SceneNode parent) { return (SceneNode) NativeElement.GetObject(SceneManager_AddSphereSceneNode(_raw, radius, polycount, GetPtr(parent)), typeof(SceneNode)); }
/// <summary> /// Loads a scene. Note that the current scene is not cleared before. /// </summary> /// <param name="filename">File where the scene is going to be saved into.</param> /// <param name="parent"></param> public void LoadScene(string filename, SceneNode parent) { SceneManager_LoadScene(_raw, filename, parent.Raw); }
/// <summary> /// Registers a node for rendering it at a specific time. /// </summary> /// <param name="node">Node to register for drawing. Usually scene nodes would set 'this' as parameter here because they want to be drawn. </param> /// <param name="pass">Specifies when the mode wants to be drawn in relation to the other nodes. For example, if the node is a shadow, it usually wants to be drawn after all other nodes and will use Shadow for this.</param> public void RegisterNodeForRendering(SceneNode node, SceneNodeRenderPass pass) { SceneManager_RegisterNodeForRendering(_raw, node.Raw, pass); }
/// <summary> /// Adds a simple Maya camera scene node /// </summary> /// <returns>The camera</returns> /// <param name="parent">Parent from the node</param> /// <param name="rotateSpeed">Rotation speed</param> /// <param name="zoomSpeed">Zoom speed</param> /// <param name="transSpeed">Translation speed</param> /// <param name="id">ID of the node (-1 for an automatic assignation)</param> public CameraSceneNode AddCameraSceneNodeMaya(SceneNode parent, float rotateSpeed, float zoomSpeed, float transSpeed, int id) { return (CameraSceneNode) NativeElement.GetObject(SceneManager_AddCameraSceneNodeMaya(_raw, GetPtr(parent), rotateSpeed, zoomSpeed, transSpeed, id), typeof(CameraSceneNode)); }
/// <summary> /// Adds a billboard (simple 2D texture which seems to be on a 3D box) /// </summary> /// <returns>The billboard</returns> /// <param name="parent">Parents from the node</param> /// <param name="size">Size of the billboard</param> /// <param name="id">ID (-1 for automatic ID assignation)</param> public BillboardSceneNode AddBillboardSceneNode(SceneNode parent, Dimension2Df size, int id) { return (BillboardSceneNode) NativeElement.GetObject(SceneManager_AddBillboardSceneNode(_raw, GetPtr(parent), size.ToUnmanaged(), id), typeof(BillboardSceneNode)); }
/// <summary> /// Registers a node for rendering it at a specific time. /// </summary> /// <param name="node">Node to register for drawing. Usually scene nodes would set 'this' as parameter here because they want to be drawn. </param> public void RegisterNodeForRendering(SceneNode node) { RegisterNodeForRendering(node, SceneNodeRenderPass.Automatic); }
public virtual void AddChild(SceneNode child) { SceneNode_AddChild(_raw, child.Raw); }