forked from jMonkeyEngine/jmonkeyengine
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.jme3.texture; | ||
|
||
import com.jme3.export.InputCapsule; | ||
import com.jme3.export.JmeExporter; | ||
import com.jme3.export.JmeImporter; | ||
import com.jme3.export.OutputCapsule; | ||
|
||
import java.io.IOException; | ||
|
||
public abstract class Texture3D extends Texture{ | ||
|
||
protected WrapMode wrapR = WrapMode.EdgeClamp; | ||
|
||
public Texture3D() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public Texture createSimpleClone(Texture rVal) { | ||
rVal.setWrap(WrapAxis.S, wrapS); | ||
rVal.setWrap(WrapAxis.T, wrapT); | ||
rVal.setWrap(WrapAxis.R, wrapR); | ||
return super.createSimpleClone(rVal); | ||
} | ||
|
||
/** | ||
* <code>setWrap</code> sets the wrap mode of this texture for a | ||
* particular axis. | ||
* | ||
* @param axis | ||
* the texture axis to define a wrapmode on. | ||
* @param mode | ||
* the wrap mode for the given axis of the texture. | ||
* @throws IllegalArgumentException | ||
* if axis or mode are null | ||
*/ | ||
public void setWrap(WrapAxis axis, WrapMode mode) { | ||
super.setWrap(axis, mode); | ||
if(axis == WrapAxis.R) { | ||
this.wrapR = mode; | ||
} | ||
} | ||
|
||
/** | ||
* <code>setWrap</code> sets the wrap mode of this texture for all axis. | ||
* | ||
* @param mode | ||
* the wrap mode for the given axis of the texture. | ||
* @throws IllegalArgumentException | ||
* if mode is null | ||
*/ | ||
public void setWrap(WrapMode mode) { | ||
super.setWrap(mode); | ||
this.wrapR = mode; | ||
} | ||
|
||
/** | ||
* <code>getWrap</code> returns the wrap mode for a given coordinate axis | ||
* on this texture. | ||
* | ||
* @param axis | ||
* the axis to return for | ||
* @return the wrap mode of the texture. | ||
* @throws IllegalArgumentException | ||
* if axis is null | ||
*/ | ||
public WrapMode getWrap(WrapAxis axis) { | ||
if (axis == WrapAxis.R) { | ||
return wrapR; | ||
} | ||
return super.getWrap(axis); | ||
} | ||
|
||
@Override | ||
public void write(JmeExporter e) throws IOException { | ||
super.write(e); | ||
OutputCapsule capsule = e.getCapsule(this); | ||
capsule.write(wrapR, "wrapR", WrapMode.EdgeClamp); | ||
} | ||
|
||
@Override | ||
public void read(JmeImporter e) throws IOException { | ||
super.read(e); | ||
InputCapsule capsule = e.getCapsule(this); | ||
wrapS = capsule.readEnum("wrapS", WrapMode.class, WrapMode.EdgeClamp); | ||
wrapT = capsule.readEnum("wrapT", WrapMode.class, WrapMode.EdgeClamp); | ||
wrapR = capsule.readEnum("wrapR", WrapMode.class, WrapMode.EdgeClamp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
jme3-core/src/main/resources/com/jme3/system/version.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# THIS IS AN AUTO-GENERATED FILE.. | ||
# DO NOT MODIFY! | ||
build.date=2016-03-21 | ||
git.revision=5387 | ||
git.revision=5388 | ||
git.branch=test-texture | ||
git.hash=c5b83a57ec6ffca5369b77a4e381d7061a400c4f | ||
git.hash.short=c5b83a5 | ||
git.tag=v3.1-alpha1-229-gc5b83a5 | ||
name.full=jMonkeyEngine 3.1-test-texture-5387 | ||
version.full=3.1-test-texture-5387 | ||
git.hash=8a4fc350becaf8719fb76bae268ccead6e1b0ee6 | ||
git.hash.short=8a4fc35 | ||
git.tag=v3.1-alpha1-230-g8a4fc35 | ||
name.full=jMonkeyEngine 3.1-test-texture-5388 | ||
version.full=3.1-test-texture-5388 | ||
version.number=3.1.0 | ||
version.tag=SNAPSHOT |