Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.Model Class Reference

Immutable model resources. More...

Inheritance diagram for Dragengine.Scenery.Model:

Public Member Functions

Management
String getFilename ()
 Normalized filename the model has been loaded from. More...
 
int getLodCount ()
 Number of LODs. More...
 
int getTextureCount ()
 Number of textures. More...
 
String getTextureNameAt (int texture)
 Name of texture at index. More...
 
int getFaceCount (int lod)
 Number of faces in LOD. More...
 
int getVertexCount (int lod)
 Number of vertices in LOD. More...
 
Vector getMinimumExtend ()
 Calculate minimum extend of LOD 0. More...
 
Vector getMaximumExtend ()
 Calculate maximum extend of LOD 0. More...
 
bool equals (Object other)
 Model is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 

Constructors

Model new (String filename)
 Load model from file. More...
 
static void loadAsynchron (String filename, ResourceListener listener)
 Load model from file asynchronously. More...
 

Detailed Description

Immutable model resources.

Model resources provide the meshes to render components with.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ equals()

bool Dragengine.Scenery.Model.equals ( Object  other)

Model is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Model and both point to the same engine model resource.

◆ getFaceCount()

int Dragengine.Scenery.Model.getFaceCount ( int  lod)

Number of faces in LOD.

Exceptions
EOutOfBoundarylod is less than 0 or greater than or equal to getLodCount().

◆ getFilename()

String Dragengine.Scenery.Model.getFilename ( )

Normalized filename the model has been loaded from.

◆ getLodCount()

int Dragengine.Scenery.Model.getLodCount ( )

Number of LODs.

◆ getMaximumExtend()

Vector Dragengine.Scenery.Model.getMaximumExtend ( )

Calculate maximum extend of LOD 0.

Version
1.7

◆ getMinimumExtend()

Vector Dragengine.Scenery.Model.getMinimumExtend ( )

Calculate minimum extend of LOD 0.

Version
1.7

◆ getTextureCount()

int Dragengine.Scenery.Model.getTextureCount ( )

Number of textures.

◆ getTextureNameAt()

String Dragengine.Scenery.Model.getTextureNameAt ( int  texture)

Name of texture at index.

Exceptions
EOutOfBoundarytexture is less than 0 or greater than or equal to getTextureCount().

◆ getVertexCount()

int Dragengine.Scenery.Model.getVertexCount ( int  lod)

Number of vertices in LOD.

Exceptions
EOutOfBoundarylod is less than 0 or greater than or equal to getLodCount().

◆ hashCode()

int Dragengine.Scenery.Model.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ loadAsynchron()

static void Dragengine.Scenery.Model.loadAsynchron ( String  filename,
ResourceListener  listener 
)
static

Load model from file asynchronously.

Registers a request in the game engine to load an model. Once finished or if the file is already loaded the listener is used to deliver the loaded model or null if the loading failed.

◆ new()

Model Dragengine.Scenery.Model.new ( String  filename)

Load model from file.

If the model file has been already loaded it is assigned to this object. If the model is not loaded yet the engine loads the model. This call blocks until the model is fully loaded and ready to be used. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded model resource. Once no object instance uses an model file anymore it is released from memory.


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