fixed issue 418
http://code.google.com/p/jmonkeyengine/issues/detail?id=418&q=label%3AProduct-jME3&sort=priority&colspec=ID%20Type%20Status%20Component%20Priority%20Difficulty%20Product%20Milestone%20Owner%20Summary git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10039 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
4ad164f278
commit
a330f83a2d
@ -234,7 +234,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control {
|
|||||||
switch (directionType) {
|
switch (directionType) {
|
||||||
case Path:
|
case Path:
|
||||||
Quaternion q = new Quaternion();
|
Quaternion q = new Quaternion();
|
||||||
q.lookAt(direction, Vector3f.UNIT_Y);
|
q.lookAt(direction, upVector);
|
||||||
spatial.setLocalRotation(q);
|
spatial.setLocalRotation(q);
|
||||||
break;
|
break;
|
||||||
case LookAt:
|
case LookAt:
|
||||||
@ -245,7 +245,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control {
|
|||||||
case PathAndRotation:
|
case PathAndRotation:
|
||||||
if (rotation != null) {
|
if (rotation != null) {
|
||||||
Quaternion q2 = new Quaternion();
|
Quaternion q2 = new Quaternion();
|
||||||
q2.lookAt(direction, Vector3f.UNIT_Y);
|
q2.lookAt(direction, upVector);
|
||||||
q2.multLocal(rotation);
|
q2.multLocal(rotation);
|
||||||
spatial.setLocalRotation(q2);
|
spatial.setLocalRotation(q2);
|
||||||
}
|
}
|
||||||
@ -339,12 +339,25 @@ public class MotionEvent extends AbstractCinematicEvent implements Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the direction of the spatial
|
* Sets the direction of the spatial, using the Y axis as the up vector
|
||||||
|
* Use MotionEvent#setDirection((Vector3f direction,Vector3f upVector) if
|
||||||
|
* you want a custum up vector.
|
||||||
* This method is used by the motion path.
|
* This method is used by the motion path.
|
||||||
* @param direction
|
* @param direction
|
||||||
*/
|
*/
|
||||||
public void setDirection(Vector3f direction) {
|
public void setDirection(Vector3f direction) {
|
||||||
|
setDirection(direction, Vector3f.UNIT_Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the direction of the spatial witht ht egiven up vector
|
||||||
|
* This method is used by the motion path.
|
||||||
|
* @param direction
|
||||||
|
* @param upVector the up vector to consider for this direction
|
||||||
|
*/
|
||||||
|
public void setDirection(Vector3f direction,Vector3f upVector) {
|
||||||
this.direction.set(direction);
|
this.direction.set(direction);
|
||||||
|
this.upVector.set(upVector);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user