[prev in list] [next in list] [prev in thread] [next in thread] 

List:       osflash-sandy
Subject:    [Sandy] [sandy commit] r744 - trunk/sandy/as3/trunk/src/sandy/core
From:       codesite-noreply () google ! com (codesite-noreply at google ! com)
Date:       2008-08-25 17:40:10
Message-ID: 000e0cd243ba62e8be04554c472b () google ! com
[Download RAW message or body]

Author: baepstein at gmail.com
Date: Mon Aug 25 10:39:37 2008
New Revision: 744

Modified:
    trunk/sandy/as3/trunk/src/sandy/core/Scene3D.as
    trunk/sandy/as3/trunk/src/sandy/core/World3D.as

Log:
Moved getVersion() method from deprecated World3D subclass to preferred  
Scene3D superclass, and added very rough example for Scene3D

Modified: trunk/sandy/as3/trunk/src/sandy/core/Scene3D.as
==============================================================================
--- trunk/sandy/as3/trunk/src/sandy/core/Scene3D.as	(original)
+++ trunk/sandy/as3/trunk/src/sandy/core/Scene3D.as	Mon Aug 25 10:39:37 2008
@@ -25,6 +25,37 @@
  	import sandy.core.scenegraph.Group;
  	import sandy.events.SandyEvent;
  	import sandy.materials.MaterialManager;
+	
+	/**
+	 * The Sandy 3D scene.
+	 *
+	 * <p>Supercedes deprecated World3D class.</p>
+	 *
+	 * <p>The Scene3D object is the central point of a Sandy scene.<br/>
+	 * You can have multiple scenes.<br/>
+	 * A scene contains the object tree with groups, a camera, a light source  
and a canvas to draw on</p>
+	 *
+	 * @example	To create the scene, you invoke the Scene3D constructor,  
passing it the base movie clip, the camera, and the root group for the  
scene.<br/>
+	 * The rendering of the scene is driven by a "heart beat", which may be a  
Timer or the Event.ENTER_FRAME event.
+	 *
+	 * The following pseudo-code approximates the necessary steps. It is very  
approximate and not meant as a working example:
+	 * <listing version="3.0.3">
+	 * 		var cam:Camera = new Camera3D(600, 450, 45, 0, 2000); // camera  
viewport height,width, fov, near plane, and far plane
+	 *		var mc:MovieClip = someSceneHoldingMovieClip;  // Programmer must  
ensure it is a valid movie clip.
+	 *		var rootGroup = new Group("world_root_group");
+	 *		// Add some child objects to the world (not shown), perhaps as follows
+	 *		//rootGroup.addChild(someChild);
+	 *		// Create the scene and render it
+	 *     	var myScene:Scene3D = new Scene3D("scene_name", mc, cam,  
rootGroup);
+	 *		myScene.render();
+	 *	//The enterFrameHandler presumably calls the myScene.render() method  
to render the scene for each frame.
+	 *	yourMovieRoot.addEventListener( Event.ENTER_FRAME, enterFrameHandler );
+	 *  </listing>
+	 *
+	 * @author		Thomas Pfeiffer - kiroukou
+	 * @version		3.0.3
+	 * @date 		25.08.2008
+	 */

  	/**
  	* Dispatched when a light is added to the scene.
@@ -265,6 +296,14 @@
  		{
  			return m_sName;
  		}
+		
+		/**
+		 * Returns a version string ("3.0.3"), useful for conditional code
+		 */	
+		public static function getVersion( ) : String
+		{
+			return _version;
+		}

  		/**
  	     * @private
@@ -272,5 +311,6 @@
  		protected var m_sName:String;
  		private var m_bRectClipped:Boolean = true;
  		private var _light:Light3D; 	//the unique light instance of the world
+		private static var _version:String = "3.0.3";
  	}
  }

Modified: trunk/sandy/as3/trunk/src/sandy/core/World3D.as
==============================================================================
--- trunk/sandy/as3/trunk/src/sandy/core/World3D.as	(original)
+++ trunk/sandy/as3/trunk/src/sandy/core/World3D.as	Mon Aug 25 10:39:37 2008
@@ -48,8 +48,8 @@
  	 *
  	 * @author		Thomas Pfeiffer - kiroukou
  	 * @author		Xavier Martin - zeflasher - http://dev.webbymx.net
-	 * @version		3.1
-	 * @date 		07.09.2007
+	 * @version		3.0.3
+	 * @date 		25.08.2008
  	 */
  	public class World3D extends Scene3D
  	{
@@ -91,15 +91,7 @@
  			return instance;
  		}

-		/**
-		 * Returns a version string ("3.0.3"), useful for conditional code
-		 */	
-		public static function getVersion( ) : String
-		{
-			return _version;
-		}
-
-		
+	
  		/**
  		 * Returns a string representation of this object.
  		 *
@@ -117,6 +109,5 @@
  		private var _light : Light3D; //the unique light instance of the world
  		private static var instance:World3D;
  		private static var create:Boolean;
-		private static var _version:String = "3.0.3";
  	}
  }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic