small fix to rotate option in blender-manipulation tool
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9453 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f96e0d771e
commit
c74a54db35
@ -40,8 +40,6 @@ import org.openide.loaders.DataObject;
|
|||||||
* 1) fixed scale and rotation values by holding Ctrl and dragging mouse
|
* 1) fixed scale and rotation values by holding Ctrl and dragging mouse
|
||||||
* BUGS:
|
* BUGS:
|
||||||
* 1) window always needs focus from primary click when it should focus from secondary and middle mouse
|
* 1) window always needs focus from primary click when it should focus from secondary and middle mouse
|
||||||
* 2) ESC will not reset currentState (ESC get hijacked)
|
|
||||||
* 3) rotation towards screen is busted (wrong axis)
|
|
||||||
*
|
*
|
||||||
* @author Brent Owens
|
* @author Brent Owens
|
||||||
*/
|
*/
|
||||||
@ -609,8 +607,8 @@ public class SelectTool extends SceneEditTool {
|
|||||||
} else if (axis == Axis.z) {
|
} else if (axis == Axis.z) {
|
||||||
rotate = rotate.fromAngleAxis(newRotAngle, Vector3f.UNIT_Z);
|
rotate = rotate.fromAngleAxis(newRotAngle, Vector3f.UNIT_Z);
|
||||||
} else {
|
} else {
|
||||||
Vector3f screen = getCamera().getScreenCoordinates(selected.getWorldTranslation());
|
Vector3f screen = getCamera().getLocation().subtract(selected.getWorldTranslation()).normalize();
|
||||||
rotate = rotate.fromAngleAxis(newRotAngle, screen.normalize());
|
rotate = rotate.fromAngleAxis(newRotAngle, screen);
|
||||||
}
|
}
|
||||||
selected.setLocalRotation(selected.getLocalRotation().mult(rotate));
|
selected.setLocalRotation(selected.getLocalRotation().mult(rotate));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user