Removed some cloneForSpatial() methods that weren't doing anything
that the super class would do. Adding @Override to cloneForSpatial() methods in jme3-core controls and CloneableTracks.
This commit is contained in:
parent
eb2e2f4cdc
commit
f83c7006f0
@ -108,6 +108,7 @@ public final class AnimControl extends AbstractControl implements Cloneable {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
try {
|
try {
|
||||||
AnimControl clone = (AnimControl) super.clone();
|
AnimControl clone = (AnimControl) super.clone();
|
||||||
|
@ -174,6 +174,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
* @param spatial the Spatial holding the AnimControl
|
* @param spatial the Spatial holding the AnimControl
|
||||||
* @return the cloned Track with proper reference
|
* @return the cloned Track with proper reference
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Track cloneForSpatial(Spatial spatial) {
|
public Track cloneForSpatial(Spatial spatial) {
|
||||||
AudioTrack audioTrack = new AudioTrack();
|
AudioTrack audioTrack = new AudioTrack();
|
||||||
audioTrack.length = this.length;
|
audioTrack.length = this.length;
|
||||||
|
@ -263,6 +263,7 @@ public class EffectTrack implements ClonableTrack {
|
|||||||
* @param spatial the Spatial holding the AnimControl
|
* @param spatial the Spatial holding the AnimControl
|
||||||
* @return the cloned Track with proper reference
|
* @return the cloned Track with proper reference
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Track cloneForSpatial(Spatial spatial) {
|
public Track cloneForSpatial(Spatial spatial) {
|
||||||
EffectTrack effectTrack = new EffectTrack();
|
EffectTrack effectTrack = new EffectTrack();
|
||||||
effectTrack.particlesPerSeconds = this.particlesPerSeconds;
|
effectTrack.particlesPerSeconds = this.particlesPerSeconds;
|
||||||
|
@ -345,6 +345,7 @@ public class SkeletonControl extends AbstractControl implements Cloneable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
Node clonedNode = (Node) spatial;
|
Node clonedNode = (Node) spatial;
|
||||||
SkeletonControl clone = new SkeletonControl();
|
SkeletonControl clone = new SkeletonControl();
|
||||||
|
@ -115,6 +115,7 @@ public class StatsView extends Node implements Control {
|
|||||||
//statistics.clearFrame();
|
//statistics.clearFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
return (Control) spatial;
|
return (Control) spatial;
|
||||||
}
|
}
|
||||||
|
@ -274,6 +274,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control {
|
|||||||
* @param spatial
|
* @param spatial
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
MotionEvent control = new MotionEvent(spatial, path);
|
MotionEvent control = new MotionEvent(spatial, path);
|
||||||
control.playState = playState;
|
control.playState = playState;
|
||||||
|
@ -119,6 +119,7 @@ public class ParticleEmitter extends Geometry {
|
|||||||
this.parentEmitter = parentEmitter;
|
this.parentEmitter = parentEmitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
return this; // WARNING: Sets wrong control on spatial. Will be
|
return this; // WARNING: Sets wrong control on spatial. Will be
|
||||||
// fixed automatically by ParticleEmitter.clone() method.
|
// fixed automatically by ParticleEmitter.clone() method.
|
||||||
|
@ -567,6 +567,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
* @param spatial
|
* @param spatial
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
public Control cloneForSpatial(Spatial spatial) {
|
||||||
ChaseCamera cc = new ChaseCamera(cam, spatial, inputManager);
|
ChaseCamera cc = new ChaseCamera(cam, spatial, inputManager);
|
||||||
cc.setMaxDistance(getMaxDistance());
|
cc.setMaxDistance(getMaxDistance());
|
||||||
|
@ -86,12 +86,13 @@ public class BillboardControl extends AbstractControl {
|
|||||||
alignment = Alignment.Screen;
|
alignment = Alignment.Screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Control cloneForSpatial(Spatial spatial) {
|
// default implementation from AbstractControl is equivalent
|
||||||
BillboardControl control = new BillboardControl();
|
//public Control cloneForSpatial(Spatial spatial) {
|
||||||
control.alignment = this.alignment;
|
// BillboardControl control = new BillboardControl();
|
||||||
control.setSpatial(spatial);
|
// control.alignment = this.alignment;
|
||||||
return control;
|
// control.setSpatial(spatial);
|
||||||
}
|
// return control;
|
||||||
|
//}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void controlUpdate(float tpf) {
|
protected void controlUpdate(float tpf) {
|
||||||
|
@ -136,13 +136,14 @@ public class CameraControl extends AbstractControl {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// default implementation from AbstractControl is equivalent
|
||||||
public Control cloneForSpatial(Spatial newSpatial) {
|
//@Override
|
||||||
CameraControl control = new CameraControl(camera, controlDir);
|
//public Control cloneForSpatial(Spatial newSpatial) {
|
||||||
control.setSpatial(newSpatial);
|
// CameraControl control = new CameraControl(camera, controlDir);
|
||||||
control.setEnabled(isEnabled());
|
// control.setSpatial(newSpatial);
|
||||||
return control;
|
// control.setEnabled(isEnabled());
|
||||||
}
|
// return control;
|
||||||
|
//}
|
||||||
private static final String CONTROL_DIR_NAME = "controlDir";
|
private static final String CONTROL_DIR_NAME = "controlDir";
|
||||||
private static final String CAMERA_NAME = "camera";
|
private static final String CAMERA_NAME = "camera";
|
||||||
|
|
||||||
|
@ -167,13 +167,14 @@ public class LightControl extends AbstractControl {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// default implementation from AbstractControl is equivalent
|
||||||
public Control cloneForSpatial(Spatial newSpatial) {
|
//@Override
|
||||||
LightControl control = new LightControl(light, controlDir);
|
//public Control cloneForSpatial(Spatial newSpatial) {
|
||||||
control.setSpatial(newSpatial);
|
// LightControl control = new LightControl(light, controlDir);
|
||||||
control.setEnabled(isEnabled());
|
// control.setSpatial(newSpatial);
|
||||||
return control;
|
// control.setEnabled(isEnabled());
|
||||||
}
|
// return control;
|
||||||
|
//}
|
||||||
private static final String CONTROL_DIR_NAME = "controlDir";
|
private static final String CONTROL_DIR_NAME = "controlDir";
|
||||||
private static final String LIGHT_NAME = "light";
|
private static final String LIGHT_NAME = "light";
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ public class UpdateControl extends AbstractControl {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Control cloneForSpatial(Spatial newSpatial) {
|
public Control cloneForSpatial(Spatial newSpatial) {
|
||||||
UpdateControl control = new UpdateControl();
|
UpdateControl control = new UpdateControl();
|
||||||
control.setSpatial(newSpatial);
|
control.setSpatial(newSpatial);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user