|
Drag[en]gine Script Module DragonScript 1.35
|
Immutable model resources. More...
Public Member Functions | |
Management | |
| String | getFilename () |
| Normalized filename the model has been loaded from. | |
| int | getLodCount () |
| Number of LODs. | |
| int | getTextureCount () |
| Number of textures. | |
| String | getTextureNameAt (int texture) |
| Name of texture at index. | |
| int | getFaceCount (int lod) |
| Number of faces in LOD. | |
| int | getVertexCount (int lod) |
| Number of vertices in LOD. | |
| Vector | getMinimumExtend () |
| Calculate minimum extend of LOD 0. | |
| Vector | getMaximumExtend () |
| Calculate maximum extend of LOD 0. | |
Vertex position sets | |
| int | getVertexPositionSetCount () |
| Count of vertex position sets. | |
| int | indexOfVertexPositionSetNamed (String name) |
| Index of vertex position set with name or -1 if not found. | |
| String | vertexPositionSetGetNameAt (int index) |
| Name of vertex position set at index. | |
Collision Shapes | |
| Rig | generateCollisionShapes () |
| Generate collision shapes as rig. | |
| Rig | generateCollisionShapes (float convexHullThreshold, float weightThreshold) |
| Generate collision shapes as rig. | |
| bool | equals (Object other) |
| Model is equal to another object. | |
| int | hashCode () |
| Hash code for use as dictionary keys. | |
Constructors | |
| Model | new (String filename) |
| Load model from file. | |
| static void | loadAsynchron (String filename, ResourceListener listener) |
| Load model from file asynchronously. | |
Immutable model resources.
Model resources provide the meshes to render components with.
This is a native class. It can not be subclassed.
| bool Dragengine.Scenery.Model.equals | ( | Object | other | ) |
Model is equal to another object.
Implements Object.equals(Object).
Referenced by hashCode().
| Rig Dragengine.Scenery.Model.generateCollisionShapes | ( | ) |
Generate collision shapes as rig.
Creates a rig containing collision shapes generated from the model. Generated shapes can be analytic shapes (sphere, box, capsule, cylinder) or convex hulls.
References indexOfVertexPositionSetNamed(), and vertexPositionSetGetNameAt().
Referenced by generateCollisionShapes(), and hashCode().
| Rig Dragengine.Scenery.Model.generateCollisionShapes | ( | float | convexHullThreshold, |
| float | weightThreshold ) |
Generate collision shapes as rig.
| convexHullThreshold | Threshold for generating convex hulls. |
| weightThreshold | Threshold for model weights to consider. |
Creates a rig containing collision shapes generated from the model. Generated shapes can be analytic shapes (sphere, box, capsule, cylinder) or convex hulls.
The convex hull threshold is multiplied by the threshold used by the physics module. It is recommended to use 1 as default value. If you want to generate only convex hulls set value to 0. If you want to not generate convex hulls set value to a large number like
Weight threshold indicates the minimum weight required for a vertex to be included in collision shape calculation. The weight threshold is relative to the maximum weight of all vertices affecting the same bone. Recommended default value is 0.45. This makes collision shapes overlap to some degree. For models with broadly smeared weights using a larger value helps.
References generateCollisionShapes().
| int Dragengine.Scenery.Model.getFaceCount | ( | int | lod | ) |
Number of faces in LOD.
| EOutOfBoundary | lod is less than 0 or greater than or equal to getLodCount(). |
References getTextureNameAt().
Referenced by getVertexCount().
| String Dragengine.Scenery.Model.getFilename | ( | ) |
Normalized filename the model has been loaded from.
References getFilename().
Referenced by getFilename().
| int Dragengine.Scenery.Model.getLodCount | ( | ) |
Number of LODs.
Referenced by getTextureCount().
| Vector Dragengine.Scenery.Model.getMaximumExtend | ( | ) |
Calculate maximum extend of LOD 0.
References getMinimumExtend(), and getVertexCount().
Referenced by getVertexPositionSetCount().
| Vector Dragengine.Scenery.Model.getMinimumExtend | ( | ) |
| int Dragengine.Scenery.Model.getTextureCount | ( | ) |
| String Dragengine.Scenery.Model.getTextureNameAt | ( | int | texture | ) |
Name of texture at index.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References getTextureCount().
Referenced by getFaceCount().
| int Dragengine.Scenery.Model.getVertexCount | ( | int | lod | ) |
Number of vertices in LOD.
| EOutOfBoundary | lod is less than 0 or greater than or equal to getLodCount(). |
References getFaceCount().
Referenced by getMaximumExtend().
| int Dragengine.Scenery.Model.getVertexPositionSetCount | ( | ) |
Count of vertex position sets.
References getMaximumExtend().
Referenced by vertexPositionSetGetNameAt().
| int Dragengine.Scenery.Model.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
References equals(), generateCollisionShapes(), and hashCode().
Referenced by hashCode().
| int Dragengine.Scenery.Model.indexOfVertexPositionSetNamed | ( | String | name | ) |
Index of vertex position set with name or -1 if not found.
Referenced by generateCollisionShapes().
|
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.
References loadAsynchron().
Referenced by loadAsynchron().
| 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.
References new().
Referenced by new().
| String Dragengine.Scenery.Model.vertexPositionSetGetNameAt | ( | int | index | ) |
Name of vertex position set at index.
| EOutOfBoundary | index is less than 0 or greater than or equal to getVertexPositionSetCount(). |
References getVertexPositionSetCount().
Referenced by generateCollisionShapes().