|
|
|
@ -29,15 +29,14 @@ |
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
package com.jme3.scene.plugins.ogre.matext; |
|
|
|
|
|
|
|
|
|
import com.jme3.asset.AssetKey; |
|
|
|
|
import com.jme3.material.MaterialList; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <code>OgreMaterialKey</code> allows specifying material extensions, |
|
|
|
|
* which map from Ogre3D base materials to jME3 materials |
|
|
|
|
* <code>OgreMaterialKey</code> allows specifying material extensions, which map |
|
|
|
|
* from Ogre3D base materials to jME3 materials |
|
|
|
|
*/ |
|
|
|
|
public class OgreMaterialKey extends AssetKey<MaterialList> { |
|
|
|
|
|
|
|
|
@ -51,10 +50,36 @@ public class OgreMaterialKey extends AssetKey<MaterialList> { |
|
|
|
|
super(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean equals(Object obj) { |
|
|
|
|
if (obj == null) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (getClass() != obj.getClass()) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
final OgreMaterialKey other = (OgreMaterialKey) obj; |
|
|
|
|
if (!super.equals(other)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (this.matExts != other.matExts && (this.matExts == null || !this.matExts.equals(other.matExts))) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int hashCode() { |
|
|
|
|
int hash = 5; |
|
|
|
|
hash = 71 * hash + (super.hashCode()); |
|
|
|
|
hash = 71 * hash + (this.matExts != null ? this.matExts.hashCode() : 0); |
|
|
|
|
return hash; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set the {@link MaterialExtensionSet} to use for mapping |
|
|
|
|
* base materials to jME3 matdefs when loading. |
|
|
|
|
* Set to <code>null</code> to disable this functionality. |
|
|
|
|
* Set the {@link MaterialExtensionSet} to use for mapping base materials to |
|
|
|
|
* jME3 matdefs when loading. Set to |
|
|
|
|
* <code>null</code> to disable this functionality. |
|
|
|
|
* |
|
|
|
|
* @param matExts The {@link MaterialExtensionSet} to use |
|
|
|
|
*/ |
|
|
|
@ -64,7 +89,9 @@ public class OgreMaterialKey extends AssetKey<MaterialList> { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the {@link MaterialExtensionSet} previously set using |
|
|
|
|
* {@link OgreMaterialKey#setMaterialExtensionSet(com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet) } method. |
|
|
|
|
* {@link OgreMaterialKey#setMaterialExtensionSet(com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet) |
|
|
|
|
* } method. |
|
|
|
|
* |
|
|
|
|
* @return the {@link MaterialExtensionSet} |
|
|
|
|
*/ |
|
|
|
|
public MaterialExtensionSet getMaterialExtensionSet() { |
|
|
|
|