j3d.org Code

org.j3d.loaders.discreet
Class MaterialBlock

java.lang.Object
  extended by org.j3d.loaders.discreet.MaterialBlock

public class MaterialBlock
extends java.lang.Object

Representation of a collection of material definitions that form a single block of data in the file.

For each piece of data, if it was not defined in the loaded file, then the array will be null.

The material chunk has the following format:

 MATERIAL BLOCK 0xAFFF
     MATERIAL NAME 0xA000
     AMBIENT COLOR 0xA010
     DIFFUSE COLOR 0xA020
     SPECULAR COLOR 0xA030
     SHININESS PERC 0xA040
     TRANSPARENCY PERC 0xA050
     TWO_SIDED_LIGHTING 0xA081
     TEXTURE MAP 1 0xA200
     SPECULAR MAP 0xA204
     OPACITY MAP 0xA210
     REFLECTION MAP 0xA220
     BUMP MAP 0xA230
     [SUB CHUNKS FOR EACH MAP]
         MAPPING FILENAME 0xA300
         MAPPING PARAMETERS 0xA351
 

Version:
$Revision: 1.3 $
Author:
Justin Couch

Field Summary
 boolean additiveBlend
          Flag indicating the transparency blend is additive
 float[] ambientColor
          The ambient colour of this block - transcribed to 3 value RGB [0,1]
 TextureBlock bumpMap
          The bump map to be associated with this material
 TextureBlock bumpMask
          The bump map to be associated with this material
 float[] diffuseColor
          The diffuse colour of this block - transcribed to 3 value RGB [0,1]
 java.lang.String name
          The name of this material
 TextureBlock opacityMap
          The opacity map to be associated with this material
 TextureBlock opacityMask
          The opacity map to be associated with this material
 TextureBlock reflectionMap
          The reflection map (environment map) associated with this material
 TextureBlock reflectionMask
          The reflection map (environment map) associated with this material
 int shadingType
          The shading type.
 TextureBlock shininessMap
          The shininess map associated with this material
 TextureBlock shininessMask
          The shininess map associated with this material
 float shininessRatio
          The shininess ratio to a [0,1] range
 float shininessStrength
          The shininess converted to a [0,1] range.
 float[] specularColor
          The specular colour of this block - transcribed to 3 value RGB [0,1]
 TextureBlock specularMap
          The specular light map to be associated with this material
 TextureBlock specularMask
          The specular light map to be associated with this material
 TextureBlock textureMap1
          The first texture map to be associated with this material
 TextureBlock textureMap2
          The second texture map to be associated with this material
 TextureBlock textureMask1
          The first texture map to be associated with this material
 TextureBlock textureMask2
          The second texture map to be associated with this material
 float transparency
          The transparency converted to a [0,1] range
 boolean twoSidedLighting
          Flag indicating 2-sided lighting is set or not
 boolean wireframe
          Flag indicating if the object should be rendered as wireframe
 float wireSize
          The wire size to use if wireframe
 
Constructor Summary
MaterialBlock()
          Create a new instance of this material block with the defaults set.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The name of this material


ambientColor

public float[] ambientColor
The ambient colour of this block - transcribed to 3 value RGB [0,1]


diffuseColor

public float[] diffuseColor
The diffuse colour of this block - transcribed to 3 value RGB [0,1]


specularColor

public float[] specularColor
The specular colour of this block - transcribed to 3 value RGB [0,1]


shininessRatio

public float shininessRatio
The shininess ratio to a [0,1] range


shininessStrength

public float shininessStrength
The shininess converted to a [0,1] range. This is the typical shininess that one expects of a material property.


transparency

public float transparency
The transparency converted to a [0,1] range


wireframe

public boolean wireframe
Flag indicating if the object should be rendered as wireframe


wireSize

public float wireSize
The wire size to use if wireframe


shadingType

public int shadingType
The shading type. What each value means is not known right now


additiveBlend

public boolean additiveBlend
Flag indicating the transparency blend is additive


twoSidedLighting

public boolean twoSidedLighting
Flag indicating 2-sided lighting is set or not


textureMap1

public TextureBlock textureMap1
The first texture map to be associated with this material


textureMask1

public TextureBlock textureMask1
The first texture map to be associated with this material


textureMap2

public TextureBlock textureMap2
The second texture map to be associated with this material


textureMask2

public TextureBlock textureMask2
The second texture map to be associated with this material


specularMap

public TextureBlock specularMap
The specular light map to be associated with this material


specularMask

public TextureBlock specularMask
The specular light map to be associated with this material


opacityMap

public TextureBlock opacityMap
The opacity map to be associated with this material


opacityMask

public TextureBlock opacityMask
The opacity map to be associated with this material


bumpMap

public TextureBlock bumpMap
The bump map to be associated with this material


bumpMask

public TextureBlock bumpMask
The bump map to be associated with this material


reflectionMap

public TextureBlock reflectionMap
The reflection map (environment map) associated with this material


reflectionMask

public TextureBlock reflectionMask
The reflection map (environment map) associated with this material


shininessMap

public TextureBlock shininessMap
The shininess map associated with this material


shininessMask

public TextureBlock shininessMask
The shininess map associated with this material

Constructor Detail

MaterialBlock

public MaterialBlock()
Create a new instance of this material block with the defaults set.


j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org