Material
Inheritance: java.lang.Object, com.aspose.threed.A3DObject
All Implemented Interfaces: java.lang.Iterable
public abstract class Material extends A3DObject implements Iterable<TextureSlot>
Material définit les paramètres nécessaires à l’apparence visuelle de la géométrie. Aspose.3D fournit un modèle d’éclairage pour LambertMaterial, PhongMaterial et ShaderMaterial Exemple:
var mat = new LambertMaterial();
var tex = new Texture();
tex.setFileName("diffuse.png");
mat.setTexture(Material.MAP_DIFFUSE, tex);
for(var slot : mat)
{
System.out.printf("Texture slot %s = %s", slot.getSlotName(), slot.getTexture());
}
Champs
| Champ | Description |
|---|---|
| MAP_AMBIENT | Utilisé dans setTexture pour assigner un mappage de texture ambiant. |
| MAP_DIFFUSE | Utilisé dans setTexture pour assigner un mappage de texture diffus. |
| MAP_EMISSIVE | Utilisé dans setTexture pour assigner un mappage de texture émissif. |
| MAP_NORMAL | Utilisé dans setTexture pour assigner un mappage de texture normal. |
| MAP_SPECULAR | Utilisé dans setTexture pour assigner un mappage de texture spéculaire. |
Méthodes
| Méthode | Description |
|---|---|
| equals(Object arg0) | |
| findProperty(String propertyName) | Trouve la propriété. |
| getClass() | |
| getName() | Obtient le nom. |
| getProperties() | Obtient la collection de toutes les propriétés. |
| getProperty(String property) | Obtenir la valeur de la propriété spécifiée |
| getTexture(String slotName) | Obtient la texture du slot spécifié, cela peut être le nom de la propriété du matériau ou le nom du paramètre du shader |
| hashCode() | |
| iterator() | Obtient l’énumérateur pour parcourir les slots de texture internes. |
| notify() | |
| notifyAll() | |
| removeProperty(Property property) | Supprime une propriété dynamique. |
| removeProperty(String property) | Supprime la propriété spécifiée identifiée par son nom |
| setName(String value) | Définit le nom. |
| setProperty(String property, Object value) | Définit la valeur de la propriété spécifiée |
| setTexture(String slotName, TextureBase texture) | Définit la texture au slot spécifié |
| toString() | Formate l’objet en chaîne |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
MAP_AMBIENT
public static final String MAP_AMBIENT
Utilisé dans setTexture pour assigner un mappage de texture ambiant.
MAP_DIFFUSE
public static final String MAP_DIFFUSE
Utilisé dans setTexture pour assigner un mappage de texture diffus.
MAP_EMISSIVE
public static final String MAP_EMISSIVE
Utilisé dans setTexture pour assigner un mappage de texture émissif.
MAP_NORMAL
public static final String MAP_NORMAL
Utilisé dans setTexture pour assigner un mappage de texture normal.
MAP_SPECULAR
public static final String MAP_SPECULAR
Utilisé dans setTexture pour assigner un mappage de texture spéculaire.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
Trouve la propriété. Elle peut être une propriété dynamique (Créée par CreateDynamicProperty/SetProperty) ou une propriété native (Identifiée par son nom)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| propertyName | java.lang.String | Nom de la propriété. |
Returns: Property - The property.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getName()
public String getName()
Obtient le nom.
Returns: java.lang.String - le nom.
getProperties()
public PropertyCollection getProperties()
Obtient la collection de toutes les propriétés.
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
Obtenir la valeur de la propriété spécifiée
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| propriété | java.lang.String | Nom de la propriété |
Returns: java.lang.Object - La valeur de la propriété trouvée
getTexture(String slotName)
public TextureBase getTexture(String slotName)
Obtient la texture du slot spécifié, cela peut être le nom de la propriété du matériau ou le nom du paramètre du shader
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| slotName | java.lang.String | Nom du slot. |
Returns: TextureBase - The texture. Example:
var mat = new LambertMaterial();
var tex = new Texture();
tex.setFileName("diffuse.png");
mat.setTexture(Material.MAP_DIFFUSE, tex);
tex = (Texture)mat.getTexture(Material.MAP_DIFFUSE);
hashCode()
public native int hashCode()
Returns: int
iterator()
public Iterator<TextureSlot> iterator()
Obtient l’énumérateur pour parcourir les slots de texture internes.
Returns: java.util.Iterator<com.aspose.threed.TextureSlot>
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
removeProperty(Property property)
public boolean removeProperty(Property property)
Supprime une propriété dynamique.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| property | Property | Quelle propriété supprimer |
Returns: boolean - vrai si la propriété est supprimée avec succès
removeProperty(String property)
public boolean removeProperty(String property)
Supprime la propriété spécifiée identifiée par son nom
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| propriété | java.lang.String | Quelle propriété supprimer |
Returns: boolean - vrai si la propriété est supprimée avec succès
setName(String value)
public void setName(String value)
Définit le nom.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| valeur | java.lang.String | Nouvelle valeur |
setProperty(String property, Object value)
public void setProperty(String property, Object value)
Définit la valeur de la propriété spécifiée
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| propriété | java.lang.String | Nom de la propriété |
| valeur | java.lang.Object | La valeur de la propriété |
setTexture(String slotName, TextureBase texture)
public void setTexture(String slotName, TextureBase texture)
Définit la texture au slot spécifié
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| slotName | java.lang.String | Nom du slot. |
| texture | TextureBase |
var mat = new LambertMaterial();
var tex = new Texture();
tex.setFileName("diffuse.png");
mat.setTexture(Material.MAP_NORMAL, tex);
``` |
### toString() {#toString--}
public String toString()
Formate l'objet en chaîne
**Returns:**
java.lang.String - Chaîne d'objet
### wait() {#wait--}
public final void wait()
### wait(long arg0) {#wait-long-}
public final void wait(long arg0)
**Parameters:**
| Paramètre | Type | Description |
| --- | --- | --- |
| arg0 | long | |
### wait(long arg0, int arg1) {#wait-long-int-}
public final void wait(long arg0, int arg1)
**Parameters:**
| Paramètre | Type | Description |
| --- | --- | --- |
| arg0 | long | |
| arg1 | int | |