home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Templates / Flash / flashmo_101_3d_carousel / org / papervision3d / cameras / FreeCamera3D.as < prev   
Text File  |  2007-07-18  |  4KB  |  97 lines

  1. /*
  2.  *  PAPER    ON   ERVIS  NPAPER ISION  PE  IS ON  PERVI IO  APER  SI  PA
  3.  *  AP  VI  ONPA  RV  IO PA     SI  PA ER  SI NP PE     ON AP  VI ION AP
  4.  *  PERVI  ON  PE VISIO  APER   IONPA  RV  IO PA  RVIS  NP PE  IS ONPAPE
  5.  *  ER     NPAPER IS     PE     ON  PE  ISIO  AP     IO PA ER  SI NP PER
  6.  *  RV     PA  RV SI     ERVISI NP  ER   IO   PE VISIO  AP  VISI  PA  RV3D
  7.  *  ______________________________________________________________________
  8.  *  papervision3d.org + blog.papervision3d.org + osflash.org/papervision3d
  9.  */
  10.  
  11. /*
  12.  * Copyright 2006 (c) Carlos Ulloa Matesanz, noventaynueve.com.
  13.  *
  14.  * Permission is hereby granted, free of charge, to any person
  15.  * obtaining a copy of this software and associated documentation
  16.  * files (the "Software"), to deal in the Software without
  17.  * restriction, including without limitation the rights to use,
  18.  * copy, modify, merge, publish, distribute, sublicense, and/or sell
  19.  * copies of the Software, and to permit persons to whom the
  20.  * Software is furnished to do so, subject to the following
  21.  * conditions:
  22.  *
  23.  * The above copyright notice and this permission notice shall be
  24.  * included in all copies or substantial portions of the Software.
  25.  *
  26.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  27.  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  28.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  29.  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  30.  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  31.  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  33.  * OTHER DEALINGS IN THE SOFTWARE.
  34.  */
  35.  
  36. // _______________________________________________________________________ FREECAMERA3D
  37.  
  38. package org.papervision3d.cameras
  39. {
  40. import org.papervision3d.core.Matrix3D;
  41. import org.papervision3d.core.proto.CameraObject3D;
  42.  
  43. /**
  44. * The FreeCamera3D class creates a camera that views the area in the direction the camera is aimed.
  45. * <p/>
  46. * A camera defines the view from which a scene will be rendered. Different camera settings would present a scene from different points of view.
  47. * <p/>
  48. * 3D cameras simulate still-image, motion picture, or video cameras of the real world. When rendering, the scene is drawn as if you were looking through the camera lens.
  49. */
  50. public class FreeCamera3D extends CameraObject3D
  51. {
  52.     // ___________________________________________________________________ NEW
  53.  
  54.     // NN  NN EEEEEE WW    WW
  55.     // NNN NN EE     WW WW WW
  56.     // NNNNNN EEEE   WWWWWWWW
  57.     // NN NNN EE     WWW  WWW
  58.     // NN  NN EEEEEE WW    WW
  59.  
  60.     /**
  61.     * The FreeCamera3D constructor lets you create a camera that views the area in the direction the camera is aimed.
  62.     *
  63.     * Its initial position can be specified in the initObject.
  64.     *
  65.     * @param    zoom        This value specifies the scale at which the 3D objects are rendered. Higher values magnify the scene, compressing distance. Use it in conjunction with focus.
  66.     * <p/>
  67.     * @param    focus        This value is a positive number representing the distance of the observer from the front clipping plane, which is the closest any object can be to the camera. Use it in conjunction with zoom.
  68.     * <p/>
  69.     * @param    initObject    An optional object that contains user defined properties with which to populate the newly created DisplayObject3D.
  70.     * <p/>
  71.     * It includes x, y, z, rotationX, rotationY, rotationZ, scaleX, scaleY scaleZ and a user defined extra object.
  72.     * <p/>
  73.     * If extra is not an object, it is ignored. All properties of the extra field are copied into the new instance. The properties specified with extra are publicly available.
  74.     * <p/>
  75.     * The following initObject property is also recognized by the constructor:
  76.     * <ul>
  77.     * <li><b>sort</b>: A Boolean value that determines whether the 3D objects are z-depth sorted between themselves when rendering. The default value is true.</li>
  78.     * </ul>
  79.     */
  80.     public function FreeCamera3D( zoom:Number=2, focus:Number=100, initObject:Object=null )
  81.     {
  82.         super( zoom, focus, initObject );
  83.     }
  84.  
  85.     /**
  86.     * [internal-use] Transforms world coordinates into camera space.
  87.     */
  88.     // TODO OPTIMIZE (LOW)
  89.     public override function transformView( transform:Matrix3D=null ):void
  90.     {
  91.         if( this._transformDirty ) updateTransform();
  92.  
  93.         // Rotate Z
  94.         super.transformView();
  95.     }
  96. }
  97. }