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 はジオメトリの視覚的外観に必要なパラメータを定義します。Aspose.3D は LambertMaterial、PhongMaterial、および ShaderMaterial のシェーディングモデルを提供します Example:
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());
}
フィールド
| フィールド | 説明 |
|---|---|
| MAP_AMBIENT | setTexture で環境光テクスチャマッピングを割り当てるために使用されます。 |
| MAP_DIFFUSE | setTexture で拡散テクスチャマッピングを割り当てるために使用されます。 |
| MAP_EMISSIVE | setTexture で放射テクスチャマッピングを割り当てるために使用されます。 |
| MAP_NORMAL | setTexture で法線テクスチャマッピングを割り当てるために使用されます。 |
| MAP_SPECULAR | setTexture で鏡面テクスチャマッピングを割り当てるために使用されます。 |
メソッド
| メソッド | 説明 |
|---|---|
| equals(Object arg0) | |
| findProperty(String propertyName) | プロパティを検索します。 |
| getClass() | |
| getName() | 名前を取得します。 |
| getProperties() | すべてのプロパティのコレクションを取得します。 |
| getProperty(String property) | 指定されたプロパティの値を取得します |
| getTexture(String slotName) | 指定されたスロットからテクスチャを取得します。これはマテリアルのプロパティ名またはシェーダーのパラメータ名で指定できます。 |
| hashCode() | |
| iterator() | 内部テクスチャスロットを列挙するための列挙子を取得します。 |
| notify() | |
| notifyAll() | |
| removeProperty(Property property) | 動的プロパティを削除します。 |
| removeProperty(String property) | 名前で識別される指定されたプロパティを削除します |
| setName(String value) | 名前を設定します。 |
| setProperty(String property, Object value) | 指定されたプロパティの値を設定します |
| setTexture(String slotName, TextureBase texture) | テクスチャを指定されたスロットに設定します。 |
| toString() | オブジェクトを文字列にフォーマットします |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
MAP_AMBIENT
public static final String MAP_AMBIENT
setTexture で環境光テクスチャマッピングを割り当てるために使用されます。
MAP_DIFFUSE
public static final String MAP_DIFFUSE
setTexture で拡散テクスチャマッピングを割り当てるために使用されます。
MAP_EMISSIVE
public static final String MAP_EMISSIVE
setTexture で放射テクスチャマッピングを割り当てるために使用されます。
MAP_NORMAL
public static final String MAP_NORMAL
setTexture で法線テクスチャマッピングを割り当てるために使用されます。
MAP_SPECULAR
public static final String MAP_SPECULAR
setTexture で鏡面テクスチャマッピングを割り当てるために使用されます。
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
プロパティを検索します。動的プロパティ(CreateDynamicProperty/SetProperty により作成)またはネイティブプロパティ(名前で識別)になる可能性があります。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| propertyName | java.lang.String | プロパティ名。 |
Returns: Property - The property.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getName()
public String getName()
名前を取得します。
Returns: java.lang.String - 名前です。
getProperties()
public PropertyCollection getProperties()
すべてのプロパティのコレクションを取得します。
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
指定されたプロパティの値を取得します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| プロパティ | java.lang.String | プロパティ名 |
Returns: java.lang.Object - 見つかったプロパティの値
getTexture(String slotName)
public TextureBase getTexture(String slotName)
指定されたスロットからテクスチャを取得します。これはマテリアルのプロパティ名またはシェーダーのパラメータ名で指定できます。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| slotName | java.lang.String | スロット名。 |
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()
内部テクスチャスロットを列挙するための列挙子を取得します。
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)
動的プロパティを削除します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| property | Property | 削除するプロパティ |
Returns: boolean - プロパティが正常に削除された場合は true
removeProperty(String property)
public boolean removeProperty(String property)
名前で識別される指定されたプロパティを削除します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| プロパティ | java.lang.String | 削除するプロパティ |
Returns: boolean - プロパティが正常に削除された場合は true
setName(String value)
public void setName(String value)
名前を設定します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| 値 | java.lang.String | 新しい値 |
setProperty(String property, Object value)
public void setProperty(String property, Object value)
指定されたプロパティの値を設定します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| プロパティ | java.lang.String | プロパティ名 |
| 値 | java.lang.Object | プロパティの値 |
setTexture(String slotName, TextureBase texture)
public void setTexture(String slotName, TextureBase texture)
テクスチャを指定されたスロットに設定します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| slotName | java.lang.String | スロット名。 |
| 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()
オブジェクトを文字列にフォーマットします
**Returns:**
java.lang.String - オブジェクト文字列
### wait() {#wait--}
public final void wait()
### wait(long arg0) {#wait-long-}
public final void wait(long arg0)
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| arg0 | long | |
### wait(long arg0, int arg1) {#wait-long-int-}
public final void wait(long arg0, int arg1)
**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| arg0 | long | |
| arg1 | int | |