Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ModelBuilder Class Reference

Model builder. More...

Inheritance diagram for Dragengine.Scenery.ModelBuilder:

Public Member Functions

Constructors
ModelBuilder new ()
 Create model builder.

Management

Model build (String filename)
 Build model using filename.
void buildModel ()
 Build model.
void addTexture (String name, Point size, bool doubleSided, bool decal, int decalOffset)
 Add texture.
void addTextureCoordinatesSet (String name)
 Add texture coordinate set.
void addLOD ()
 Add LOD.
void setLodError (int lod, float error)
 Set lod error.
void setWeightCount (int lod, int count)
 Set weight count.
void setWeightAt (int lod, int index, int bone, float weight)
 Set weight.
void setWeightGroupCount (int lod, int count)
 Set weight group count.
void setWeightGroupAt (int lod, int index, int count)
 Set weight group.
void setVertexCount (int lod, int count)
 Set vertex count.
void setVertexAt (int lod, int index, Vector position, int weightSet)
 Set vertex.
void setNormalCount (int lod, int count)
 Set normal count.
void setTangentCount (int lod, int count)
 Set tangent count.
void setFaceCount (int lod, int count)
 Set face count.
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.
void setTextureCoordinateSetCount (int lod, int count)
 Set texture coordinates set count.
void setTextureCoordinateSetAtSetCount (int lod, int index, int count)
 Texture coordinate set set texture coordinate count.
void setTextureCoordinateSetAtSetAt (int lod, int index, int index2, Vector2 tc)
 Texture coordinate set set texture coordinate.

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.

Referenced by setWeightCount().

◆ addTexture()

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

Add texture.

Referenced by addTextureCoordinatesSet().

◆ addTextureCoordinatesSet()

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

Add texture coordinate set.

References addTexture().

Referenced by setLodError().

◆ 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.

References build().

Referenced by build().

◆ 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.

References buildModel().

Referenced by buildModel().

◆ new()

ModelBuilder Dragengine.Scenery.ModelBuilder.new ( )

Create model builder.

References new().

Referenced by new().

◆ 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.

References setNormalCount().

Referenced by setTextureCoordinateSetAtSetAt().

◆ setFaceCount()

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

Set face count.

References setVertexAt().

Referenced by setTextureCoordinateSetAtSetAt().

◆ setLodError()

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

Set lod error.

References addTextureCoordinatesSet().

Referenced by setWeightAt().

◆ setNormalCount()

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

Set normal count.

References setWeightGroupAt().

Referenced by setFaceAt().

◆ setTangentCount()

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

Set tangent count.

References setVertexCount().

Referenced by setTextureCoordinateSetAtSetCount().

◆ setTextureCoordinateSetAtSetAt()

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

◆ setTextureCoordinateSetAtSetCount()

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

Texture coordinate set set texture coordinate count.

References setTangentCount().

Referenced by setTextureCoordinateSetAtSetAt().

◆ setTextureCoordinateSetCount()

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

Set texture coordinates set count.

Referenced by setTextureCoordinateSetAtSetAt().

◆ setVertexAt()

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

Set vertex.

References setWeightGroupCount().

Referenced by setFaceCount().

◆ setVertexCount()

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

Set vertex count.

Referenced by setTangentCount().

◆ setWeightAt()

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

Set weight.

References setLodError().

Referenced by setWeightGroupAt().

◆ setWeightCount()

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

Set weight count.

References addLOD().

Referenced by setWeightGroupCount().

◆ setWeightGroupAt()

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

Set weight group.

References setWeightAt().

Referenced by setNormalCount().

◆ setWeightGroupCount()

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

Set weight group count.

References setWeightCount().

Referenced by setVertexAt().


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