Skip to content

Commit fb38a4d

Browse files
authored
DefaultParticleInfluencer: use Cloner
1 parent 78e1090 commit fb38a4d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

jme3-core/src/main/java/com/jme3/effect/influencers/DefaultParticleInfluencer.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.jme3.math.FastMath;
4141
import com.jme3.math.Vector3f;
4242
import com.jme3.util.clone.Cloner;
43+
4344
import java.io.IOException;
4445

4546
/**
@@ -101,14 +102,10 @@ public void read(JmeImporter im) throws IOException {
101102

102103
@Override
103104
public DefaultParticleInfluencer clone() {
104-
try {
105-
DefaultParticleInfluencer clone = (DefaultParticleInfluencer) super.clone();
106-
clone.initialVelocity = initialVelocity.clone();
107-
clone.temp = temp.clone();
108-
return clone;
109-
} catch (CloneNotSupportedException e) {
110-
throw new AssertionError();
111-
}
105+
// Set up the cloner for the type of cloning we want to do.
106+
Cloner cloner = new Cloner();
107+
DefaultParticleInfluencer clone = cloner.clone(this);
108+
return clone;
112109
}
113110

114111
/**

0 commit comments

Comments
 (0)