jp.digitalmuseum.jogl
クラス JoglModel

java.lang.Object
  上位を拡張 jp.digitalmuseum.jogl.JoglModel
直系の既知のサブクラス:
JoglModelMqo

public class JoglModel
extends java.lang.Object

Base class for holding a three-dimensional model object for JOGL.


入れ子のクラスの概要
static class JoglModel.Color
          Class for holding color parameter.
static class JoglModel.FloatArray
          Class for holding a float array.
static class JoglModel.JoglMaterial
          Class which represents a JOGL material.
static class JoglModel.JoglObject
          Class which represents a JOGL object.
static class JoglModel.LightSourcePoint
          Class for holding three-dimensional coordinates of a light source.
static class JoglModel.Point
          Class for holding three-dimensional coordinates of a point.
static class JoglModel.UV
          Class for holding UV texture mapping parameters.
 
フィールドの概要
protected  JoglCoordinates coordinates
           
protected  int frontFace
           
protected  javax.media.opengl.GL gl
           
protected  boolean hasOwnTextureManager
           
protected  boolean isVboEnabled
           
protected  JoglModel.JoglObject[] joglObjects
           
protected  JoglModel.Point maxPos
           
protected  JoglModel.Point minPos
           
protected  JoglTextureManager textureManager
           
 
コンストラクタの概要
protected JoglModel(javax.media.opengl.GL gl, JoglTextureManager textureManager, JoglCoordinates coordinates, boolean isVboEnabled)
          Default constructor.
 
メソッドの概要
protected static void append(java.lang.StringBuilder sb, float[] array)
           
protected static void append(java.lang.StringBuilder sb, int[] array)
           
protected static void append(java.lang.StringBuilder sb, long[] array)
           
protected  JoglModel.Point calcNormal(JoglModel.Point[] vertices, int indexVertexA, int indexVertexB, int indexVertexC)
          Calculate normal vector of a triangle face.
 void clear()
          Free used memory spaces.
 void draw()
          Draw this object.
 void draw(float alpha)
          Draw this object with the specified transparency.
 JoglModel.Point getMaxPos()
           
 void getMaxPosOut(JoglModel.Point p)
           
 JoglModel.Point getMinPos()
           
 void getMinPosOut(JoglModel.Point p)
           
static boolean isExtensionSupported(javax.media.opengl.GL gl, java.lang.String targetExtension)
          Returns whether current OpenGL implementation supports the specified extension.
 void setMaterialVisible(java.lang.String materialName, boolean isVisible)
          Set visibility of material.
 void setMaterialVisible(java.lang.String objectName, java.lang.String materialName, boolean isVisible)
          Set visibility of material of an object.
 void setObjectVisible(java.lang.String objectName, boolean isVisible)
          Set visibility of an object.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

gl

protected javax.media.opengl.GL gl

textureManager

protected JoglTextureManager textureManager

hasOwnTextureManager

protected boolean hasOwnTextureManager

isVboEnabled

protected boolean isVboEnabled

frontFace

protected int frontFace

coordinates

protected JoglCoordinates coordinates

minPos

protected JoglModel.Point minPos

maxPos

protected JoglModel.Point maxPos

joglObjects

protected JoglModel.JoglObject[] joglObjects
コンストラクタの詳細

JoglModel

protected JoglModel(javax.media.opengl.GL gl,
                    JoglTextureManager textureManager,
                    JoglCoordinates coordinates,
                    boolean isVboEnabled)
Default constructor.

パラメータ:
gl - OpenGL object.
textureManager - JoglTextureManager for managing textures. Create new one inside the instance if this parameter is null.
coordinates - JoglCoordinates for managing coordinates.
isVboEnabled - Whether to use VBO or not.
メソッドの詳細

setObjectVisible

public void setObjectVisible(java.lang.String objectName,
                             boolean isVisible)
Set visibility of an object.

パラメータ:
objectName - Name of an object.
isVisible - Visibility.

setMaterialVisible

public void setMaterialVisible(java.lang.String materialName,
                               boolean isVisible)
Set visibility of material.

パラメータ:
materialName - Name of material.
isVisible - Visibility.

setMaterialVisible

public void setMaterialVisible(java.lang.String objectName,
                               java.lang.String materialName,
                               boolean isVisible)
Set visibility of material of an object.

パラメータ:
objectName - Name of an object.
materialName - Name of material.
isVisible - Visibility.

draw

public void draw()
Draw this object.


draw

public void draw(float alpha)
Draw this object with the specified transparency.

パラメータ:
alpha - 0 (completely transparent) - 1.0 (not transparent)

getMaxPos

public JoglModel.Point getMaxPos()

getMaxPosOut

public void getMaxPosOut(JoglModel.Point p)

getMinPos

public JoglModel.Point getMinPos()

getMinPosOut

public void getMinPosOut(JoglModel.Point p)

clear

public void clear()
Free used memory spaces.


calcNormal

protected JoglModel.Point calcNormal(JoglModel.Point[] vertices,
                                     int indexVertexA,
                                     int indexVertexB,
                                     int indexVertexC)
Calculate normal vector of a triangle face.

パラメータ:
vertices - Array of the coordinates of the vertices
indexVertexA - Index of vertex A in the array
indexVertexB - Index of vertex B in the array
indexVertexC - Index of vertex C in the array
戻り値:
Normal vector

append

protected static void append(java.lang.StringBuilder sb,
                             int[] array)

append

protected static void append(java.lang.StringBuilder sb,
                             long[] array)

append

protected static void append(java.lang.StringBuilder sb,
                             float[] array)

isExtensionSupported

public static boolean isExtensionSupported(javax.media.opengl.GL gl,
                                           java.lang.String targetExtension)
Returns whether current OpenGL implementation supports the specified extension.

パラメータ:
gl - OpenGL object
targetExtension - Name of OpenGL extension
戻り値:
Whether current OpenGL implementation supports the specified extension.


Copyright by Jun KATO (arc@dmz) at http://mr.digitalmuseum.jp/