Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ModelBuilder Class Reference

Model builder. More...

Inheritance diagram for Dragengine.Scenery.ModelBuilder:

Public Member Functions

Constructors
ModelBuilder new ()
 Create model builder. More...
 

Management

Model build (String filename)
 Build model using filename. More...
 
void buildModel ()
 Build model. More...
 
void addTexture (String name, Point size, bool doubleSided, bool decal, int decalOffset)
 Add texture. More...
 
void addTextureCoordinatesSet (String name)
 Add texture coordinate set. More...
 
void addLOD ()
 Add LOD. More...
 
void setLodError (int lod, float error)
 Set lod error. More...
 
void setWeightCount (int lod, int count)
 Set weight count. More...
 
void setWeightAt (int lod, int index, int bone, float weight)
 Set weight. More...
 
void setWeightGroupCount (int lod, int count)
 Set weight group count. More...
 
void setWeightGroupAt (int lod, int index, int count)
 Set weight group. More...
 
void setVertexCount (int lod, int count)
 Set vertex count. More...
 
void setVertexAt (int lod, int index, Vector position, int weightSet)
 Set vertex. More...
 
void setNormalCount (int lod, int count)
 Set normal count. More...
 
void setTangentCount (int lod, int count)
 Set tangent count. More...
 
void setFaceCount (int lod, int count)
 Set face count. More...
 
void setFaceAt (int lod, int index, int texture, int vertex1, int vertex2, int vertex3, int normal1, int normal2, int normal3, int tangent1, int tangent2, int tangent3, int texCoord1, int texCoord2, int texCoord3, Vector faceNormal, Vector faceTangent)
 Set face. More...
 
void setTextureCoordinateSetCount (int lod, int count)
 Set texture coordinates set count. More...
 
void setTextureCoordinateSetAtSetCount (int lod, int index, int count)
 Texture coordinate set set texture coordinate count. More...
 
void setTextureCoordinateSetAtSetAt (int lod, int index, int index2, Vector2 tc)
 Texture coordinate set set texture coordinate. More...
 

Detailed Description

Model builder.

Builds model resource without requiring a model resource file. The created model can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named models can not clash with filenames present in the virtual file system. For this reason use unnamed models if possible. Using named models though can be useful if you want to provide model resources to scripts not needing to know if the path they try to load is a build model instead of a resource one.

To use the model builder create a subclass and implement ModelBuilder.buildModel() . You are only allowed to call methods from ModelBuilder from inside this function call. To create the model call ModelBuilder.build() . This will call ModelBuilder.buildModel() to fill a new model resource with content. Once finished the build method returns the ready to use model resource. Otherwise an exception is thrown.

This is a native class.

Member Function Documentation

◆ addLOD()

void Dragengine.Scenery.ModelBuilder.addLOD ( )
protected

Add LOD.

◆ addTexture()

void Dragengine.Scenery.ModelBuilder.addTexture ( String  name,
Point  size,
bool  doubleSided,
bool  decal,
int  decalOffset 
)
protected

Add texture.

◆ addTextureCoordinatesSet()

void Dragengine.Scenery.ModelBuilder.addTextureCoordinatesSet ( String  name)
protected

Add texture coordinate set.

◆ build()

Model Dragengine.Scenery.ModelBuilder.build ( String  filename)

Build model using filename.

The created model can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named models can not clash with filenames present in the virtual file system. For this reason use unnamed models if possible. Using named models though can be useful if you want to provide model resources to scripts not needing to know if the path they try to load is a build model instead of a resource one.

To create the model call build() . This will call buildModel() to fill a new model resource with content. Once finished the build method returns the ready to use model resource. Otherwise an exception is thrown.

◆ buildModel()

void Dragengine.Scenery.ModelBuilder.buildModel ( )
protected

Build model.

Called by build(String) to fill a new model resource with content. You are only allowed to call methods from ModelBuilder from inside this function call.

◆ new()

ModelBuilder Dragengine.Scenery.ModelBuilder.new ( )

Create model builder.

◆ setFaceAt()

void Dragengine.Scenery.ModelBuilder.setFaceAt ( int  lod,
int  index,
int  texture,
int  vertex1,
int  vertex2,
int  vertex3,
int  normal1,
int  normal2,
int  normal3,
int  tangent1,
int  tangent2,
int  tangent3,
int  texCoord1,
int  texCoord2,
int  texCoord3,
Vector  faceNormal,
Vector  faceTangent 
)
protected

Set face.

◆ setFaceCount()

void Dragengine.Scenery.ModelBuilder.setFaceCount ( int  lod,
int  count 
)
protected

Set face count.

◆ setLodError()

void Dragengine.Scenery.ModelBuilder.setLodError ( int  lod,
float  error 
)
protected

Set lod error.

◆ setNormalCount()

void Dragengine.Scenery.ModelBuilder.setNormalCount ( int  lod,
int  count 
)
protected

Set normal count.

◆ setTangentCount()

void Dragengine.Scenery.ModelBuilder.setTangentCount ( int  lod,
int  count 
)
protected

Set tangent count.

◆ setTextureCoordinateSetAtSetAt()

void Dragengine.Scenery.ModelBuilder.setTextureCoordinateSetAtSetAt ( int  lod,
int  index,
int  index2,
Vector2  tc 
)
protected

Texture coordinate set set texture coordinate.

◆ setTextureCoordinateSetAtSetCount()

void Dragengine.Scenery.ModelBuilder.setTextureCoordinateSetAtSetCount ( int  lod,
int  index,
int  count 
)
protected

Texture coordinate set set texture coordinate count.

◆ setTextureCoordinateSetCount()

void Dragengine.Scenery.ModelBuilder.setTextureCoordinateSetCount ( int  lod,
int  count 
)
protected

Set texture coordinates set count.

◆ setVertexAt()

void Dragengine.Scenery.ModelBuilder.setVertexAt ( int  lod,
int  index,
Vector  position,
int  weightSet 
)
protected

Set vertex.

◆ setVertexCount()

void Dragengine.Scenery.ModelBuilder.setVertexCount ( int  lod,
int  count 
)
protected

Set vertex count.

◆ setWeightAt()

void Dragengine.Scenery.ModelBuilder.setWeightAt ( int  lod,
int  index,
int  bone,
float  weight 
)
protected

Set weight.

◆ setWeightCount()

void Dragengine.Scenery.ModelBuilder.setWeightCount ( int  lod,
int  count 
)
protected

Set weight count.

◆ setWeightGroupAt()

void Dragengine.Scenery.ModelBuilder.setWeightGroupAt ( int  lod,
int  index,
int  count 
)
protected

Set weight group.

◆ setWeightGroupCount()

void Dragengine.Scenery.ModelBuilder.setWeightGroupCount ( int  lod,
int  count 
)
protected

Set weight group count.


The documentation for this class was generated from the following file: