This FAQ discuss the major API changes from Sandy 1.1 to Sandy 1.2, so you can update your code.
Remember that 1.2 remains a beta and somewhat buggy. Be sure to download the latest patches from the online source repository
Things you need to correct in your code to port it from Sandy 1.1 to Sandy 1.2 include the following
These changes affect how you set up your camera and add it to the world:
Parameters for the Camera3D constructor have changed. It now takes a height and width. See
camera_1.2 for details.
Camera3D. setFocal() is no longer supported. Use Camera3D.setPerspectiveProjection() or Camera3D.setOrthographicProjection() instead.
Use World3D.setCamera() instead of World3D.addCamera(). Likewise, the beta of Sandy 1.2 dropped supported for other methods that supported multiple cameras in Sandy 1.1, such as getCameraList(). I patched all the deprecated multi-camera methods back into Sandy 1.2 so your code will compile, but it will always set/retrieve the first and only camera, no matter what camera ID you specify or how many you attempt to add.
Sandy 1.2 expects a String (the name of a library symbol or an external
URL string, I think) as the first argument to the MovieSkin() constructor. See the the MovieSkin.as file for Sandy 1.2 to investigate it yourself. Sandy 1.1 expected a MovieClip instance name as the first argument.
The getPosition() method of Object3D has changed. In Sandy 1.1, it returned the object's position in world coordinates, but in Sandy 1.2, it returns the obect's position in the camera’s coordinate system.
Instead of using Object3D.getFaces() method, use the public property Object3D.aFaces.
Object3D.enableBackFaceCulling has changed from a property to a method, Object3D.enableBackFaceCulling().
The TriFace3D.getId() method isn't supported in Sandy 1.2. See below.
See more changes below.
For developers who modify the Sandy classes themselves, also note you must:
Change BasicInterpolator.onEndEVENTand BasicInterpolator.onProgressEVENT to InterpolationEvent.onEndEVENT and InterpolationEvent.onProgressEVENT.
Change addUVCoordinate() to new UVCoord(). (Must import sandy.core.data.UVCoord class). Since Object3D.addUVCoordinates() pushed the coords into an array named _aUv, which no longer exists, you might want to create an _aUv array and use _aUv.push(new UVCoord (0, 0.5)); or similar to add the UVcoords to that array manually. (Not sure if this is the best approach, but I used it to upgrade Hedra.as).
Change TriFace3D class references to Polygon. (import sandy.core.face.Polygon instead of sandy.core.face.TriFace3D). (Also applies to Face and QuadFace3D classes)
Change TriFace3D.setUVCoordinates() calls to Polygon.setUVCoords()
If you used the TriFace3D.getId() method in Sandy 1.1, it isn't supported in Sandy 1.2. You can use Polygon.getId() instead, if you add this patch to Polygon.as:
public function getId(Void):Number {return _id;}
For details on how to add conditions to your code so it compiles under either Sandy 1.1 or Sandy 1.2, see here.
