# Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
# Secretary of Defense (Personnel & Readiness).
# 
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.

## The component representation of a camera in 3D space
## 
## @name camera.vwf
## @namespace

--- 
extends: http://vwf.example.com/node3.vwf
properties:

  ## The far clipping plane value
  ## 
  ## @name camera.vwf#far
  ## @property

  far:
    set: |
      if ( value > 0 && value > this.near ) {
        this.far = value;
      }
    value: 1000.0

  ## The near clipping plane value
  ## 
  ## @name camera.vwf#near
  ## @property

  near:
    set: |
      if ( value > 0 && value < this.far ) {
        this.near = value;
      }
    value: 0.1

  ## Field of view
  ## 
  ## @name camera.vwf#fovy
  ## @property

  fovy:
    value: 35
    set: |
      if ( value > 0 ) {
        this.fovy = value;
      }

  ## Aspect ratio
  ## 
  ## @name camera.vwf#aspect
  ## @property

  aspect:

  ## Type of camera (perspective vs. orthographic)
  ## 
  ## @name camera.vwf#cameraType
  ## @property

  cameraType:
    set: |
      switch ( value ) {
        case 'perspective':
        case 'orthographic':
          this.cameraType = value;
          break;
      }
    value: "perspective"

  ## Speed of the camera
  ## 
  ## @name camera.vwf#speed
  ## @property

  speed: 2.0

  ## World bounding box of the camera. Overrides inherited property to return null, since a camera has no dimensions
  ##
  ## @name camera.vwf#worldBoundingBox
  ## @property

  worldBoundingBox:
    get: |
      return null;
    value: null