Example #1
0
        public ISceneNode CreateSceneNode(SceneNodeType type)
        {
            switch (type)
            {
            case SceneNodeType.Scene:
                return(new BaseSceneNode());

            case SceneNodeType.Shape:
                return(new ShapeNode(_shapeFactory, _resourceManager));

            case SceneNodeType.PerspectiveCamera:
                return(new PerspectiveCamera());

            case SceneNodeType.OrthographicCamera:
                return(new OrtographicCamera());

            case SceneNodeType.PointLight:
                return(new PointLight());

            case SceneNodeType.DirectionalLight:
                return(new DirectionalLight());

            case SceneNodeType.AmbientLight:
                return(new AmbientLight());

            default:
                throw new ArgumentOutOfRangeException("type");
            }
        }
 public ISceneNode CreateSceneNode(SceneNodeType type)
 {
   switch (type)
   {
     case SceneNodeType.Scene:
       return new BaseSceneNode();
     case SceneNodeType.Shape:
       return new ShapeNode(_shapeFactory, _resourceManager);
     case SceneNodeType.PerspectiveCamera:
       return new PerspectiveCamera();
     case SceneNodeType.OrthographicCamera:
       return new OrtographicCamera();
     case SceneNodeType.PointLight:
       return new PointLight();
     case SceneNodeType.DirectionalLight:
       return new DirectionalLight();
     case SceneNodeType.AmbientLight:
       return new AmbientLight();
     default:
       throw new ArgumentOutOfRangeException("type");
   }
 }
Example #3
0
 /// <summary>
 /// Create the root game object.
 /// </summary>
 /// <param name="scene">Parent scene instance.</param>
 /// <param name="nodeType">Node type to use for this game object.</param>
 public RootGameObject(GameScene scene, SceneNodeType nodeType) : base("root", nodeType)
 {
     _parentScene = scene;
     _isInScene   = true;
 }
Example #4
0
 /// <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,
                                                                   start == null?
                                                                   IntPtr.Zero:
                                                                   start.Raw,
                                                                   (int)type),
                                 typeof(SceneNode));
 }
Example #5
0
 /// <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));
 }