Forráskód Böngészése

fixed Quat.getDirection, renamed Object.getDirection to getLocalDirection (close #889)

Nicolas Cannasse 5 éve
szülő
commit
271f4f6cbd
3 módosított fájl, 3 hozzáadás és 3 törlés
  1. 1 1
      h3d/Quat.hx
  2. 1 1
      h3d/scene/Object.hx
  3. 1 1
      hxd/inspect/SceneProps.hx

+ 1 - 1
h3d/Quat.hx

@@ -252,7 +252,7 @@ class Quat {
 	}
 
 	public inline function getDirection() {
-		return new h3d.Vector(1 - 2 * ( y * y + z * z ), 2 * ( x * y - z * w ), 2 * ( x * z + y * w ));
+		return new h3d.Vector(1 - 2 * ( y * y + z * z ), 2 * ( x * y + z * w ), 2 * ( x * z - y * w ));
 	}
 
 	/**

+ 1 - 1
h3d/scene/Object.hx

@@ -853,7 +853,7 @@ class Object implements hxd.impl.Serializable {
 	/**
 		Return the direction in which the object rotation is currently oriented to
 	**/
-	public function getDirection() {
+	public function getLocalDirection() {
 		return qRot.getDirection();
 	}
 

+ 1 - 1
hxd/inspect/SceneProps.hx

@@ -252,7 +252,7 @@ class SceneProps {
 		var dl = hxd.impl.Api.downcast(l, h3d.scene.fwd.DirLight);
 		if( dl != null )
 			props.push(PFloats("direction", function() {
-				var dir = dl.getDirection();
+				var dir = dl.getLocalDirection();
 				return [dl.x, dl.y, dl.z];
 			}, function(fl) dl.setDirection(new h3d.Vector(fl[0], fl[1], fl[2]))));
 		var pl = hxd.impl.Api.downcast(l, h3d.scene.fwd.PointLight);