* Added AbstractControl.getSpatial() as otherwise AnimEventListener is kinda useless as it only gives the AnimControl as the reference and to get userdata you need the spatial itself
* World space particles are now influenced by rotation git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7980 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5476be99f7
commit
2d2ce703d9
@ -44,6 +44,7 @@ import com.jme3.export.OutputCapsule;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.FastMath;
|
||||
import com.jme3.math.Matrix3f;
|
||||
import com.jme3.math.Quaternion;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.renderer.RenderManager;
|
||||
@ -878,7 +879,9 @@ public class ParticleEmitter extends Geometry {
|
||||
//shape.getRandomPoint(p.position);
|
||||
particleInfluencer.influenceParticle(p, shape);
|
||||
if (worldSpace) {
|
||||
p.position.addLocal(worldTransform.getTranslation());
|
||||
worldTransform.transformVector(p.position, p.position);
|
||||
worldTransform.getRotation().mult(p.velocity, p.velocity);
|
||||
// TODO: Make scale relevant somehow??
|
||||
}
|
||||
if (randomAngle) {
|
||||
p.angle = FastMath.nextRandomFloat() * FastMath.TWO_PI;
|
||||
|
@ -60,6 +60,10 @@ public abstract class AbstractControl implements Control {
|
||||
}
|
||||
this.spatial = spatial;
|
||||
}
|
||||
|
||||
public Spatial getSpatial(){
|
||||
return spatial;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
|
Loading…
x
Reference in New Issue
Block a user