Browse Source

various API renames, added Object.getDirection/setDirection

ncannasse 7 years ago
parent
commit
1333f080f8

+ 1 - 1
h2d/Drawable.hx

@@ -76,7 +76,7 @@ class Drawable extends Sprite {
 			}
 			m.identity();
 			if( col.hue != null ) m.colorHue(col.hue);
-			if( col.saturation != null ) m.colorSaturation(col.saturation);
+			if( col.saturation != null ) m.colorSaturate(col.saturation);
 			if( col.contrast != null ) m.colorContrast(col.contrast);
 			if( col.lightness != null ) m.colorLightness(col.lightness);
 			if( col.gain != null ) m.colorGain(col.gain.color, col.gain.alpha);

+ 1 - 1
h2d/Sprite.hx

@@ -709,7 +709,7 @@ class Sprite {
 		y += dy * Math.sin(rotation);
 	}
 
-	public inline function setPos( x : Float, y : Float ) {
+	public inline function setPosition( x : Float, y : Float ) {
 		this.x = x;
 		this.y = y;
 	}

+ 1 - 1
h2d/filter/ColorMatrix.hx

@@ -24,7 +24,7 @@ class ColorMatrix extends Filter {
 	public static function grayed() {
 		var m = new h3d.Matrix();
 		m.identity();
-		m.colorSaturation(-1);
+		m.colorSaturate(-1);
 		return new ColorMatrix(m);
 	}
 

+ 22 - 21
h3d/Matrix.hx

@@ -51,7 +51,7 @@ class Matrix {
 		_41 = 0.0; _42 = 0.0; _43 = 0.0; _44 = 1.0;
 	}
 
-	public function initRotateX( a : Float ) {
+	public function initRotationX( a : Float ) {
 		var cos = Math.cos(a);
 		var sin = Math.sin(a);
 		_11 = 1.0; _12 = 0.0; _13 = 0.0; _14 = 0.0;
@@ -60,7 +60,7 @@ class Matrix {
 		_41 = 0.0; _42 = 0.0; _43 = 0.0; _44 = 1.0;
 	}
 
-	public function initRotateY( a : Float ) {
+	public function initRotationY( a : Float ) {
 		var cos = Math.cos(a);
 		var sin = Math.sin(a);
 		_11 = cos; _12 = 0.0; _13 = -sin; _14 = 0.0;
@@ -69,7 +69,7 @@ class Matrix {
 		_41 = 0.0; _42 = 0.0; _43 = 0.0; _44 = 1.0;
 	}
 
-	public function initRotateZ( a : Float ) {
+	public function initRotationZ( a : Float ) {
 		var cos = Math.cos(a);
 		var sin = Math.sin(a);
 		_11 = cos; _12 = sin; _13 = 0.0; _14 = 0.0;
@@ -78,7 +78,7 @@ class Matrix {
 		_41 = 0.0; _42 = 0.0; _43 = 0.0; _44 = 1.0;
 	}
 
-	public function initTranslate( x = 0., y = 0., z = 0. ) {
+	public function initTranslation( x = 0., y = 0., z = 0. ) {
 		_11 = 1.0; _12 = 0.0; _13 = 0.0; _14 = 0.0;
 		_21 = 0.0; _22 = 1.0; _23 = 0.0; _24 = 0.0;
 		_31 = 0.0; _32 = 0.0; _33 = 1.0; _34 = 0.0;
@@ -92,7 +92,7 @@ class Matrix {
 		_41 = 0.0; _42 = 0.0; _43 = 0.0; _44 = 1.0;
 	}
 
-	public function initRotateAxis( axis : Vector, angle : Float ) {
+	public function initRotationAxis( axis : Vector, angle : Float ) {
 		var cos = Math.cos(angle), sin = Math.sin(angle);
 		var cos1 = 1 - cos;
 		var x = -axis.x, y = -axis.y, z = -axis.z;
@@ -117,7 +117,7 @@ class Matrix {
 		_41 = 0.; _42 = 0.; _43 = 0.; _44 = 1.;
 	}
 
-	public function initRotate( x : Float, y : Float, z : Float ) {
+	public function initRotation( x : Float, y : Float, z : Float ) {
 		var cx = Math.cos(x);
 		var sx = Math.sin(x);
 		var cy = Math.cos(y);
@@ -176,27 +176,28 @@ class Matrix {
 
 	public function rotate( x, y, z ) {
 		var tmp = tmp;
-		tmp.initRotate(x,y,z);
+		tmp.initRotation(x,y,z);
 		multiply(this, tmp);
 	}
 
 	public function rotateAxis( axis, angle ) {
 		var tmp = tmp;
-		tmp.initRotateAxis(axis, angle);
+		tmp.initRotationAxis(axis, angle);
 		multiply(this, tmp);
 	}
 
-	public inline function pos( ?v : Vector ) {
-		if( v == null )
-			return new Vector( _41, _42 , _43 , _44 );
+	public inline function getPosition( ?v : Vector ) {
+		return new h3d.Vector(_41,_42,_43,_44);
+	}
+
+	public inline function setPosition( v : Vector ) {
 		v.x = _41;
 		v.y = _42;
 		v.z = _43;
 		v.w = _44;
-		return v;
 	}
 
-	public function prependTranslate( x = 0., y = 0., z = 0. ) {
+	public function prependTranslation( x = 0., y = 0., z = 0. ) {
 		var vx = _11 * x + _21 * y + _31 * z + _41;
 		var vy = _12 * x + _22 * y + _32 * z + _42;
 		var vz = _13 * x + _23 * y + _33 * z + _43;
@@ -220,15 +221,15 @@ class Matrix {
 		return v;
 	}
 
-	public function prependRotate( x, y, z ) {
+	public function prependRotation( x, y, z ) {
 		var tmp = tmp;
-		tmp.initRotate(x,y,z);
+		tmp.initRotation(x,y,z);
 		multiply(tmp, this);
 	}
 
-	public function prependRotateAxis( axis, angle ) {
+	public function prependRotationAxis( axis, angle ) {
 		var tmp = tmp;
-		tmp.initRotateAxis(axis, angle);
+		tmp.initRotationAxis(axis, angle);
 		multiply(tmp, this);
 	}
 
@@ -523,7 +524,7 @@ class Matrix {
 				hxd.Math.atan2(m._23, m._33),
 				hxd.Math.atan2(-m._13, cy),
 				hxd.Math.atan2(m._12, m._11));
-			
+
 			var v2 = new h3d.Vector(
 				hxd.Math.atan2(-m._23, -m._33),
 				hxd.Math.atan2(-m._13, -cy),
@@ -581,7 +582,7 @@ class Matrix {
 		multiply3x4(this, tmp);
 	}
 
-	public function colorSaturation( sat : Float ) {
+	public function colorSaturate( sat : Float ) {
 		sat += 1;
 		var is = 1 - sat;
 		var r = is * lumR;
@@ -721,13 +722,13 @@ class Matrix {
 
 	public static function T( x = 0., y = 0., z = 0. ) {
 		var m = new Matrix();
-		m.initTranslate(x, y, z);
+		m.initTranslation(x, y, z);
 		return m;
 	}
 
 	public static function R(x,y,z) {
 		var m = new Matrix();
-		m.initRotate(x,y,z);
+		m.initRotation(x,y,z);
 		return m;
 	}
 

+ 7 - 8
h3d/Quat.hx

@@ -162,7 +162,7 @@ class Quat {
 		}
 	}
 
-	public function initRotate( ax : Float, ay : Float, az : Float ) {
+	public function initRotation( ax : Float, ay : Float, az : Float ) {
 		var sinX = ( ax * 0.5 ).sin();
 		var cosX = ( ax * 0.5 ).cos();
 		var sinY = ( ay * 0.5 ).sin();
@@ -188,12 +188,6 @@ class Quat {
 		w = w2;
 	}
 
-	public function toMatrix() {
-		var m = new Matrix();
-		saveToMatrix(m);
-		return m;
-	}
-
 	public function toEuler() {
 		return toMatrix().getEulerAngles();
 	}
@@ -257,10 +251,15 @@ class Quat {
 		return x * q.x + y * q.y + z * q.z + w * q.w;
 	}
 
+	public inline function getDirection() {
+		return new h3d.Vector(1 - 2 * ( y * y + z * z ), 2 * ( x * y - z * w ), 2 * ( x * z + y * w ));
+	}
+
 	/**
 		Save to a Left-Handed matrix
 	**/
-	public function saveToMatrix( m : h3d.Matrix ) {
+	public function toMatrix( ?m : h3d.Matrix ) {
+		if( m == null ) m = new h3d.Matrix();
 		var xx = x * x;
 		var xy = x * y;
 		var xz = x * z;

+ 1 - 1
h3d/anim/LinearAnimation.hx

@@ -16,7 +16,7 @@ class LinearFrame {
 	}
 	public function toMatrix() {
 		var m = new h3d.Matrix();
-		new h3d.Quat(qx, qy, qz, qw).saveToMatrix(m);
+		new h3d.Quat(qx, qy, qz, qw).toMatrix(m);
 		m.prependScale(sx, sy, sz);
 		m.translate(tx, ty, tz);
 		return m;

+ 2 - 2
h3d/anim/SmoothTarget.hx

@@ -102,7 +102,7 @@ class SmoothTarget extends Animation {
 				q1.set(m._12, m._13, m._21, m._23);
 				var sx = m._11, sy = m._22, sz = m._33;
 				var tx = m.tx, ty = m.ty, tz = m.tz;
-				q1.saveToMatrix(m);
+				q1.toMatrix(m);
 				m._11 *= sx;
 				m._12 *= sx;
 				m._13 *= sx;
@@ -122,7 +122,7 @@ class SmoothTarget extends Animation {
 				q1.set(m._12, m._13, m._21, m._23);
 				qout.lerp(o.q, q1, 1 - blend, true);
 				qout.normalize();
-				qout.saveToMatrix(mout);
+				qout.toMatrix(mout);
 
 				var sx = lerp(o.sx, m._11, blend);
 				var sy = lerp(o.sy, m._22, blend);

+ 1 - 1
h3d/anim/SmoothTransition.hx

@@ -111,7 +111,7 @@ class SmoothTransition extends Transition {
 			// shortest path
 			qout.lerp(q1, q2, a, true);
 			qout.normalize();
-			qout.saveToMatrix(m);
+			qout.toMatrix(m);
 			// interpolate scale
 			var sx = m1._11 * a + m2._11 * b;
 			var sy = m1._22 * a + m2._22 * b;

+ 1 - 1
h3d/parts/GpuParticles.hx

@@ -883,7 +883,7 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 				r.normalize();
 				var q = new h3d.Quat();
 				q.initDirection(r);
-				q.saveToMatrix(g.pshader.cameraRotation);
+				q.toMatrix(g.pshader.cameraRotation);
 			}
 			if( g.emitMode == CameraBounds ) {
 				g.pshader.transform.load(camera.getInverseView());

+ 2 - 2
h3d/pass/Border.hx

@@ -55,13 +55,13 @@ class Border extends ScreenFx<BorderShader> {
 		add(width-size, height);
 		add(width, height);
 
-		this.plan = new h3d.prim.RawPrimitive({ vbuf : bbuf, stride : 2, quads : true }, true);
+		this.plane = new h3d.prim.RawPrimitive({ vbuf : bbuf, stride : 2, quads : true }, true);
 		shader.color.set(1,1,1,1);
 	}
 
 	override function dispose() {
 		super.dispose();
-		this.plan.dispose();
+		this.plane.dispose();
 	}
 
 }

+ 3 - 3
h3d/pass/ScreenFx.hx

@@ -5,7 +5,7 @@ class ScreenFx<T:hxsl.Shader> {
 	public var shader : T;
 	var pass : h3d.mat.Pass;
 	var manager : ShaderManager;
-	var plan : h3d.prim.Primitive;
+	var plane : h3d.prim.Primitive;
 	var engine : h3d.Engine;
 	var shaders : hxsl.ShaderList;
 	var buffers : h3d.shader.Buffers;
@@ -17,7 +17,7 @@ class ScreenFx<T:hxsl.Shader> {
 		pass = new h3d.mat.Pass(Std.string(this), new hxsl.ShaderList(shader));
 		pass.culling = None;
 		pass.depth(false, Always);
-		plan = h3d.prim.Plan2D.get();
+		plane = h3d.prim.Plane2D.get();
 		engine = h3d.Engine.getCurrent();
 	}
 
@@ -66,7 +66,7 @@ class ScreenFx<T:hxsl.Shader> {
 		engine.uploadShaderBuffers(buffers, Globals);
 		engine.uploadShaderBuffers(buffers, Params);
 		engine.uploadShaderBuffers(buffers, Textures);
-		plan.render(engine);
+		plane.render(engine);
 	}
 
 	public function dispose() {

+ 4 - 4
h3d/prim/Plan2D.hx → h3d/prim/Plane2D.hx

@@ -1,6 +1,6 @@
 package h3d.prim;
 
-class Plan2D extends Primitive {
+class Plane2D extends Primitive {
 
 	function new() {
 	}
@@ -45,10 +45,10 @@ class Plan2D extends Primitive {
 
 	public static function get() {
 		var engine = h3d.Engine.getCurrent();
-		var inst = @:privateAccess engine.resCache.get(Plan2D);
+		var inst = @:privateAccess engine.resCache.get(Plane2D);
 		if( inst == null ) {
-			inst = new Plan2D();
-			@:privateAccess engine.resCache.set(Plan2D, inst);
+			inst = new Plane2D();
+			@:privateAccess engine.resCache.set(Plane2D, inst);
 		}
 		return inst;
 	}

+ 2 - 3
h3d/scene/DirLight.hx

@@ -8,8 +8,7 @@ class DirLight extends Light {
 		dshader = new h3d.shader.DirLight();
 		super(dshader, parent);
 		priority = 100;
-		if(dir != null)
-			setDirection(dir.x, dir.y, dir.z);
+		if( dir != null ) setDirection(dir);
 	}
 
 	override function get_color() {
@@ -29,7 +28,7 @@ class DirLight extends Light {
 	}
 
 	override function getShadowDirection() : h3d.Vector {
-		return getDirection();	
+		return absPos.front();	
 	}
 
 	override function emit(ctx) {

+ 0 - 9
h3d/scene/Light.hx

@@ -42,15 +42,6 @@ class Light extends Object {
 		return null;	
 	}
 
-	public function getDirection() : h3d.Vector {
-		return absPos.front();
-	}
-
-	public function setDirection(x: Float, y: Float, z: Float) {
-		qRot.initDirection(new h3d.Vector(x, y, z));
-		posChanged = true;
-	}
-
 	#if hxbit
 	override function customSerialize(ctx:hxbit.Serializer) {
 		super.customSerialize(ctx);

+ 15 - 6
h3d/scene/Object.hx

@@ -479,7 +479,7 @@ class Object implements hxd.impl.Serializable {
 	}
 
 	function calcAbsPos() {
-		qRot.saveToMatrix(absPos);
+		qRot.toMatrix(absPos);
 		// prepend scale
 		absPos._11 *= scaleX;
 		absPos._12 *= scaleX;
@@ -626,7 +626,7 @@ class Object implements hxd.impl.Serializable {
 		return v;
 	}
 
-	public inline function setPos( x : Float, y : Float, z : Float ) {
+	public inline function setPosition( x : Float, y : Float, z : Float ) {
 		this.x = x;
 		this.y = y;
 		this.z = z;
@@ -651,21 +651,30 @@ class Object implements hxd.impl.Serializable {
 	*/
 	public function rotate( rx : Float, ry : Float, rz : Float ) {
 		var qTmp = new h3d.Quat();
-		qTmp.initRotate(rx, ry, rz);
+		qTmp.initRotation(rx, ry, rz);
 		qRot.multiply(qTmp,qRot);
 		posChanged = true;
 	}
 
-	public function setRotate( rx : Float, ry : Float, rz : Float ) {
-		qRot.initRotate(rx, ry, rz);
+	public function setRotation( rx : Float, ry : Float, rz : Float ) {
+		qRot.initRotation(rx, ry, rz);
 		posChanged = true;
 	}
 
-	public function setRotateAxis( ax : Float, ay : Float, az : Float, angle : Float ) {
+	public function setRotationAxis( ax : Float, ay : Float, az : Float, angle : Float ) {
 		qRot.initRotateAxis(ax, ay, az, angle);
 		posChanged = true;
 	}
 
+	public function setDirection( v : h3d.Vector ) {
+		qRot.initDirection(v);
+		posChanged = true;
+	}
+
+	public function getDirection() {
+		return qRot.getDirection();
+	}
+
 	public function getRotationQuat() {
 		return qRot;
 	}

+ 1 - 1
h3d/scene/Trail.hx

@@ -202,7 +202,7 @@ class Trail extends Mesh {
 			var p1 = points[i];
 			var dist2 = hxd.Math.distanceSq(p1.x - p0.x, p1.y - p0.y, p1.z - p0.z);
 			left.load(leftSave);
-			p0.q.saveToMatrix(absPos);
+			p0.q.toMatrix(absPos);
 			left.transform3x3(absPos);
 
 			var n = left.cross(delta);

+ 2 - 3
h3d/scene/pbr/DirLight.hx

@@ -7,8 +7,7 @@ class DirLight extends Light {
 	public function new(?dir: h3d.Vector, ?parent) {
 		pbr = new h3d.shader.pbr.Light.DirLight();
 		super(pbr,parent);
-		if(dir != null)
-			setDirection(dir.x, dir.y, dir.z);
+		if( dir != null ) setDirection(dir);
 	}
 
 	override function get_isSun() {
@@ -20,7 +19,7 @@ class DirLight extends Light {
 	}
 
 	override function getShadowDirection() : h3d.Vector {
-		return getDirection();	
+		return absPos.front();	
 	}
 
 	override function emit(ctx:RenderContext) {

+ 2 - 0
h3d/scene/pbr/Renderer.hx

@@ -159,7 +159,9 @@ class Renderer extends h3d.scene.Renderer {
 				pbrOut.addShader(pbrDirect);
 				pbrOut.addShader(pbrSun);
 			}
+			var pdir = Std.instance(ls.shadowLight, h3d.scene.pbr.DirLight);
 			pbrSun.lightColor.load(ls.shadowLight.color);
+			if( pdir != null ) pbrSun.lightColor.scale3(pdir.power * pdir.power);
 			pbrSun.lightDir.load(@:privateAccess ls.shadowLight.getShadowDirection());
 			pbrSun.lightDir.scale3(-1);
 			pbrSun.lightDir.normalize();

+ 1 - 1
h3d/shader/ParticleShader.hx

@@ -58,7 +58,7 @@ class ParticleShader extends hxsl.Shader {
 
 	public function new() {
 		super();
-		rotationAxis.initRotateAxis(new h3d.Vector(1, 0, 0), Math.PI / 2);
+		rotationAxis.initRotationAxis(new h3d.Vector(1, 0, 0), Math.PI / 2);
 	}
 
 }

+ 5 - 5
hxd/fmt/fbx/BaseLibrary.hx

@@ -868,8 +868,8 @@ class BaseLibrary {
 				if( c.def.preRot == null ) c.def.rotate else
 				{
 					var q = new h3d.Quat(), q2 = new h3d.Quat();
-					q2.initRotate(c.def.preRot.x, c.def.preRot.y, c.def.preRot.z);
-					q.initRotate(c.def.rotate.x, c.def.rotate.y, c.def.rotate.z);
+					q2.initRotation(c.def.preRot.x, c.def.preRot.y, c.def.preRot.z);
+					q.initRotation(c.def.rotate.x, c.def.rotate.y, c.def.rotate.z);
 					q.multiply(q2,q);
 					q.toEuler().toPoint();
 				}
@@ -1037,14 +1037,14 @@ class BaseLibrary {
 
 					if( c.r == null || rp == 0 ) {
 						if( def.rotate != null ) {
-							q.initRotate(def.rotate.x, def.rotate.y, def.rotate.z);
+							q.initRotation(def.rotate.x, def.rotate.y, def.rotate.z);
 						} else
 							q.identity();
 					} else
-						q.initRotate(crx[rp-1], cry[rp-1], crz[rp-1]);
+						q.initRotation(crx[rp-1], cry[rp-1], crz[rp-1]);
 
 					if( def.preRot != null ) {
-						q2.initRotate(def.preRot.x, def.preRot.y, def.preRot.z);
+						q2.initRotation(def.preRot.x, def.preRot.y, def.preRot.z);
 						q.multiply(q2,q);
 					}
 

+ 1 - 1
hxd/fmt/fbx/Geometry.hx

@@ -237,7 +237,7 @@ class Geometry {
 		if( rot == null )
 			m.identity();
 		else
-			m.initRotate(rot.x, rot.y, rot.z);
+			m.initRotation(rot.x, rot.y, rot.z);
 		if( trans != null ) {
 			m.tx += trans.x;
 			m.ty += trans.y;

+ 1 - 1
hxd/fmt/hmd/Data.hx

@@ -75,7 +75,7 @@ class Position {
 		var m = new h3d.Matrix();
 		var q = QTMP;
 		loadQuaternion(q);
-		q.saveToMatrix(m);
+		q.toMatrix(m);
 		if( postScale ) {
 			m.translate(x, y, z);
 			m.scale(sx, sy, sz);

+ 1 - 1
hxd/inspect/SceneProps.hx

@@ -252,7 +252,7 @@ class SceneProps {
 			props.push(PFloats("direction", function() {
 				var dir = dl.getDirection();
 				return [dl.x, dl.y, dl.z];
-			}, function(fl) dl.setDirection(fl[0], fl[1], fl[2])));
+			}, function(fl) dl.setDirection(new h3d.Vector(fl[0], fl[1], fl[2]))));
 		var pl = Std.instance(l, h3d.scene.PointLight);
 		if( pl != null )
 			props.push(PFloats("params", function() return [pl.params.x, pl.params.y, pl.params.z], function(fl) pl.params.set(fl[0], fl[1], fl[2], fl[3])));

+ 1 - 1
samples/Base3D.hx

@@ -66,7 +66,7 @@ class Base3D extends SampleApp {
 		s3d.camera.pos.set(Math.cos(time) * dist, Math.sin(time) * dist, dist * 0.7 * Math.sin(time));
 
 		// rotate the second cube along a given axis + angle
-		obj2.setRotateAxis(-0.5, 2, Math.cos(time), time + Math.PI / 2);
+		obj2.setRotationAxis(-0.5, 2, Math.cos(time), time + Math.PI / 2);
 	}
 
 	static function main() {

+ 1 - 1
samples/Filters.hx

@@ -77,7 +77,7 @@ class Filters extends hxd.App {
 			m.identity();
 			m.colorContrast(0.5);
 			m.colorHue(Math.PI / 4);
-			m.colorSaturation(-0.5);
+			m.colorSaturate(-0.5);
 			spr.filter = new h2d.filter.ColorMatrix(m);
 		case 8:
 			spr.filter = new h2d.filter.Mask(mask);

+ 1 - 1
samples/Lights.hx

@@ -63,7 +63,7 @@ class Lights extends hxd.App {
 			l.z = Math.cos(t * a[(i + 4) % a.length]) * Math.sin(t * a[(i + 6) % a.length]) * 2 - 0.5;
 		}
 
-		dir.direction.set(Math.cos(time * 0.3) * 0.2, Math.sin(time * 0.35) * 0.3 + 0.3, -1);
+		dir.setDirection(new h3d.Vector(Math.cos(time * 0.3) * 0.2, Math.sin(time * 0.35) * 0.3 + 0.3, -1));
 
 	}
 

+ 0 - 1
samples/Mask.hx

@@ -2,7 +2,6 @@ class Mask extends hxd.App {
 
 	var spr : h2d.Sprite;
 	var spr2 : h2d.Sprite;
-	var cache : h2d.CachedBitmap;
 	var time : Float = 0.;
 
 	override function init() {

+ 2 - 2
samples/Pbr.hx

@@ -81,7 +81,7 @@ class Pbr extends SampleApp {
 
 		var cubeShader = bg.material.mainPass.addShader(new h3d.shader.pbr.CubeLod(env.env));
 		var light = new h3d.scene.pbr.PointLight(s3d);
-		light.setPos(30, 10, 40);
+		light.setPosition(30, 10, 40);
 		light.range = 100;
 		light.power = 2;
 
@@ -160,7 +160,7 @@ class Pbr extends SampleApp {
 		var color = new h3d.Vector(1, 0, 0);
 		var m = new h3d.Matrix();
 		m.identity();
-		m.colorSaturation(saturation - 1);
+		m.colorSaturate(saturation - 1);
 		m.colorHue(hue);
 		m.colorLightness(brightness);
 		color.transform3x4(m);

+ 1 - 1
samples/Stencil.hx

@@ -64,7 +64,7 @@ class Stencil extends hxd.App {
 
 	override function update( dt : Float ) {
 		time += 0.01 * dt;
-		root.setRotateAxis (0, 0, 1.0, time);
+		root.setRotationAxis(0, 0, 1.0, time);
 	}
 
 	static function main() {