Ejemplo n.º 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");
            }
        }
Ejemplo n.º 2
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");
   }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }