|
Drag[en]gine Script Module DragonScript 1.35
|
Public Member Functions | |
Constructors | |
| Component | new () |
| Create component. | |
| Component | new (Model model, Skin skin) |
| Create component. | |
Management | |
| DVector | getPosition () |
| Position. | |
| void | setPosition (DVector position) |
| Set position. | |
| Quaternion | getOrientation () |
| Orientation. | |
| void | setOrientation (Quaternion orientation) |
| Set orientation. | |
| Vector | getScaling () |
| Scaling. | |
| void | setScaling (Vector scaling) |
| Set scaling. | |
| DMatrix | getMatrix () |
| Matrix. | |
| DMatrix | getInverseMatrix () |
| Inverse matrix. | |
| bool | getVisible () |
| Component is visible. | |
| void | setVisible (bool visible) |
| Set if component is visible. | |
| World | getParentWorld () |
| Parent world or null if not added to a world. | |
| Model | getModel () |
| Model or null if not set. | |
| void | setModel (Model model) |
| Set model or null if not set. | |
| void | setModelKeepTextures (Model model) |
| Set model or null if not set while keeping textures. | |
| Skin | getSkin () |
| Skin or null if not set. | |
| void | setSkin (Skin skin) |
| Set skin or null if not set. | |
| void | setModelAndSkin (Model model, Skin skin) |
| Set model and skin or null if not set. | |
| void | resetSkinTime (float time) |
| Reset skin time. | |
| Rig | getRig () |
| Rig or null if not set. | |
| void | setRig (Rig rig) |
| Set rig or null if not set. | |
| OcclusionMesh | getOcclusionMesh () |
| Occlusion mesh or null if not set. | |
| void | setOcclusionMesh (OcclusionMesh occlusionMesh) |
| Set occlusion mesh or null if not set. | |
| Model | getAudioModel () |
| Audio model or null if not set. | |
| void | setAudioModel (Model model) |
| Set audio model or null if not set. | |
| LayerMask | getLayerMask () |
| Layer mask for visibility masking. | |
| void | setLayerMask (LayerMask layerMask) |
| Set layer mask for visibility masking. | |
| DynamicSkin | getDynamicSkin () |
| Dynamic skin or null if not set. | |
| void | setDynamicSkin (DynamicSkin dynamicSkin) |
| Set dynamic skin or null if not set. | |
| void | updateBones () |
| Update bone matrices. | |
| void | copyBonesToComponent (Component component) |
| Copy bone states to matching bones states of another component. | |
Textures | |
| int | getTextureCount () |
| Count of textures in the model or 0 if no model is set. | |
| int | indexOfTextureNamed (String name) |
| Index of named texture or -1 if not found or model is not set. | |
| String | getTextureNameAt (int texture) |
| Name of texture. | |
| Skin | getTextureSkinAt (int texture) |
| Skin of texture or null if not used. | |
| int | getTextureTextureAt (int texture) |
| Texture number of texture or null if not used. | |
| void | setTextureSkinAt (int texture, Skin skin, int skinTexture) |
| Set skin of texture or null if not set. | |
| TexMatrix2 | getTextureTransformAt (int texture) |
| Texture coordinates transformation of texture. | |
| void | setTextureTransformAt (int texture, TexMatrix2 transform) |
| Set texture coordinates transformation of texture. | |
| DynamicSkin | getTextureDynamicSkinAt (int texture) |
| Dynamic skin of texture or null if not set. | |
| void | setTextureDynamicSkinAt (int texture, DynamicSkin dynamicSkin) |
| Set dynamic skin of texture or null if not set. | |
Bones | |
| int | getBoneCount () |
| Number of bones. | |
| int | indexOfBoneNamed (String name) |
| Index of named bone or -1 if not found in rig or rig is not set. | |
| String | boneGetName (int index) |
| Name of bone. | |
| Vector | boneGetPosition (int bone) |
| Position of bone relative to bone origin matrix. | |
| void | boneSetPosition (int bone, Vector position) |
| Set position of the bone relative to bone origin matrix. | |
| Quaternion | boneGetRotation (int bone) |
| Rotation of bone relative to bone origin matrix. | |
| void | boneSetRotation (int bone, Quaternion rotation) |
| Set rotation of the bone relative to bone origin matrix. | |
| Vector | boneGetScale (int bone) |
| Scale of bone relative to bone origin matrix. | |
| void | boneSetScale (int bone, Vector scale) |
| Set scale of bone relative to bone origin matrix. | |
| Matrix | boneGetMatrix (int bone) |
| Bone matrix relative to component space. | |
| Matrix | boneGetInverseMatrix (int bone) |
| Inverse bone matrix relative to component space. | |
| Matrix | getBoneOriginMatrix (int bone) |
| Bone origin matrix in component space. | |
| Matrix | getBoneOriginInverseMatrix (int bone) |
| Inverse bone origin matrix in component space. | |
| Vector | getBonePosition (String bone) |
| Position of bone relative to bone origin matrix. | |
| void | setBonePosition (String bone, Vector position) |
| Set position of the bone relative to bone origin matrix. | |
| Quaternion | getBoneRotation (String bone) |
| Rotation of bone relative to bone origin matrix. | |
| void | setBoneRotation (String bone, Quaternion rotation) |
| Set rotation of the bone relative to bone origin matrix. | |
| Matrix | getBoneMatrix (String bone) |
| Bone matrix relative to component space. | |
| Matrix | getBoneInverseMatrix (String bone) |
| Inverse bone matrix relative to component space. | |
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. | |
| float | vertexPositionSetGetWeightAt (int index) |
| Weight of vertex position set at index. | |
| float | vertexPositionSetGetWeightNamed (String name) |
| Weight of vertex position set by name. | |
| void | vertexPositionSetSetWeightAt (int index, float weight) |
| Set weight of vertex position set at index. | |
| void | vertexPositionSetSetWeightNamed (String name, float weight) |
| Set weight of vertex position set by name. | |
| ComponentHintMovement | getHintMovement () |
| Movement hint. | |
| void | setHintMovement (ComponentHintMovement hint) |
| Set movement hint. | |
| bool | getEnableGI () |
| Enable GI in graphic module if supported. | |
| void | setEnableGI (bool enable) |
| Set if enabled for GI in graphic module if supported. | |
| int | getHintGIImportance () |
| GI important hint. | |
| void | setHintGIImportance (int importance) |
| Set GI important hint. | |
Decals | |
| int | getDecalCount () |
| Number of decals. | |
| void | addDecal (Decal decal) |
| Add decal. | |
| void | removeDecal (Decal decal) |
| Remove decal. | |
| void | removeAllDecals () |
| Remove all decals. | |
| void | forEachDecal (Block ablock) |
| Visit decals with block with parameter Decal. | |
This is a native class.
| void Dragengine.Scenery.Component.addDecal | ( | Decal | decal | ) |
Add decal.
Referenced by forEachDecal().
| Matrix Dragengine.Scenery.Component.boneGetInverseMatrix | ( | int | bone | ) |
Inverse bone matrix relative to component space.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References getBoneCount().
Referenced by indexOfVertexPositionSetNamed().
| Matrix Dragengine.Scenery.Component.boneGetMatrix | ( | int | bone | ) |
Bone matrix relative to component space.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References setTextureDynamicSkinAt().
Referenced by getVertexPositionSetCount().
| String Dragengine.Scenery.Component.boneGetName | ( | int | index | ) |
Name of bone.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
Referenced by getBoneOriginInverseMatrix().
| Vector Dragengine.Scenery.Component.boneGetPosition | ( | int | bone | ) |
Position of bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References getTextureTextureAt().
Referenced by getBonePosition().
| Quaternion Dragengine.Scenery.Component.boneGetRotation | ( | int | bone | ) |
Rotation of bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References getTextureTransformAt().
Referenced by getBoneRotation().
| Vector Dragengine.Scenery.Component.boneGetScale | ( | int | bone | ) |
Scale of bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References getTextureDynamicSkinAt().
Referenced by getBoneMatrix().
| void Dragengine.Scenery.Component.boneSetPosition | ( | int | bone, |
| Vector | position ) |
Set position of the bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References setTextureSkinAt().
Referenced by setBonePosition().
| void Dragengine.Scenery.Component.boneSetRotation | ( | int | bone, |
| Quaternion | rotation ) |
Set rotation of the bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References setTextureTransformAt().
Referenced by setBoneRotation().
| void Dragengine.Scenery.Component.boneSetScale | ( | int | bone, |
| Vector | scale ) |
Set scale of bone relative to bone origin matrix.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
Referenced by getBoneInverseMatrix().
| void Dragengine.Scenery.Component.copyBonesToComponent | ( | Component | component | ) |
Copy bone states to matching bones states of another component.
References setOcclusionMesh().
Referenced by getTextureTransformAt().
| void Dragengine.Scenery.Component.forEachDecal | ( | Block | ablock | ) |
Visit decals with block with parameter Decal.
References addDecal(), forEachDecal(), getDecalCount(), getEnableGI(), getHintGIImportance(), getHintMovement(), removeAllDecals(), removeDecal(), setEnableGI(), setHintGIImportance(), setHintMovement(), vertexPositionSetGetNameAt(), vertexPositionSetGetWeightAt(), vertexPositionSetGetWeightNamed(), vertexPositionSetSetWeightAt(), and vertexPositionSetSetWeightNamed().
Referenced by forEachDecal().
| Model Dragengine.Scenery.Component.getAudioModel | ( | ) |
Audio model or null if not set.
Referenced by getTextureCount().
| int Dragengine.Scenery.Component.getBoneCount | ( | ) |
| Matrix Dragengine.Scenery.Component.getBoneInverseMatrix | ( | String | bone | ) |
Inverse bone matrix relative to component space.
| EInvalidParam | No bone with name boneName found. |
References boneSetScale().
Referenced by setHintGIImportance().
| Matrix Dragengine.Scenery.Component.getBoneMatrix | ( | String | bone | ) |
Bone matrix relative to component space.
| EInvalidParam | No bone with name boneName found. |
References boneGetScale().
Referenced by getHintGIImportance().
| Matrix Dragengine.Scenery.Component.getBoneOriginInverseMatrix | ( | int | bone | ) |
Inverse bone origin matrix in component space.
The bone origina matrix is the matrix in component space where the bone has no position, no rotation and 1 scaling.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References boneGetName().
Referenced by vertexPositionSetGetWeightNamed().
| Matrix Dragengine.Scenery.Component.getBoneOriginMatrix | ( | int | bone | ) |
Bone origin matrix in component space.
The bone origina matrix is the matrix in component space where the bone has no position, no rotation and 1 scaling.
| EInvalidParam | bone is less than 0 or larger than or equal to GetBoneCount(). |
References indexOfBoneNamed().
Referenced by vertexPositionSetGetNameAt().
| Vector Dragengine.Scenery.Component.getBonePosition | ( | String | bone | ) |
Position of bone relative to bone origin matrix.
| EInvalidParam | No bone with name bone found. |
References boneGetPosition().
Referenced by vertexPositionSetSetWeightAt().
| Quaternion Dragengine.Scenery.Component.getBoneRotation | ( | String | bone | ) |
Rotation of bone relative to bone origin matrix.
| EInvalidParam | No bone with name boneName found. |
References boneGetRotation().
Referenced by getEnableGI().
| int Dragengine.Scenery.Component.getDecalCount | ( | ) |
Number of decals.
Referenced by forEachDecal().
| DynamicSkin Dragengine.Scenery.Component.getDynamicSkin | ( | ) |
| bool Dragengine.Scenery.Component.getEnableGI | ( | ) |
Enable GI in graphic module if supported.
References getBoneRotation().
Referenced by forEachDecal().
| int Dragengine.Scenery.Component.getHintGIImportance | ( | ) |
GI important hint.
Value is in the range from 0 (very unimportant) to 4 (very important). This hint can be used by the graphic module to improve performance by excluding components with a GI important below a user chosen threashold. The default important is 4.
References getBoneMatrix().
Referenced by forEachDecal().
| ComponentHintMovement Dragengine.Scenery.Component.getHintMovement | ( | ) |
Movement hint.
Referenced by forEachDecal().
| DMatrix Dragengine.Scenery.Component.getInverseMatrix | ( | ) |
Inverse matrix.
Referenced by getParentWorld().
| LayerMask Dragengine.Scenery.Component.getLayerMask | ( | ) |
Layer mask for visibility masking.
Referenced by getTextureNameAt().
| DMatrix Dragengine.Scenery.Component.getMatrix | ( | ) |
| Model Dragengine.Scenery.Component.getModel | ( | ) |
| OcclusionMesh Dragengine.Scenery.Component.getOcclusionMesh | ( | ) |
| Quaternion Dragengine.Scenery.Component.getOrientation | ( | ) |
| World Dragengine.Scenery.Component.getParentWorld | ( | ) |
Parent world or null if not added to a world.
References getInverseMatrix().
Referenced by setModel().
| DVector Dragengine.Scenery.Component.getPosition | ( | ) |
| Rig Dragengine.Scenery.Component.getRig | ( | ) |
| Vector Dragengine.Scenery.Component.getScaling | ( | ) |
Scaling.
Referenced by getMatrix().
| Skin Dragengine.Scenery.Component.getSkin | ( | ) |
| int Dragengine.Scenery.Component.getTextureCount | ( | ) |
Count of textures in the model or 0 if no model is set.
References getAudioModel().
Referenced by getTextureDynamicSkinAt().
| DynamicSkin Dragengine.Scenery.Component.getTextureDynamicSkinAt | ( | int | texture | ) |
Dynamic skin of texture or null if not set.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References getTextureCount(), and indexOfTextureNamed().
Referenced by boneGetScale().
| String Dragengine.Scenery.Component.getTextureNameAt | ( | int | texture | ) |
Name of texture.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References getLayerMask().
Referenced by getBoneCount().
| Skin Dragengine.Scenery.Component.getTextureSkinAt | ( | int | texture | ) |
Skin of texture or null if not used.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References setLayerMask().
Referenced by indexOfBoneNamed().
| int Dragengine.Scenery.Component.getTextureTextureAt | ( | int | texture | ) |
Texture number of texture or null if not used.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References getDynamicSkin(), and setDynamicSkin().
Referenced by boneGetPosition().
| TexMatrix2 Dragengine.Scenery.Component.getTextureTransformAt | ( | int | texture | ) |
Texture coordinates transformation of texture.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References copyBonesToComponent().
Referenced by boneGetRotation().
| int Dragengine.Scenery.Component.getVertexPositionSetCount | ( | ) |
| bool Dragengine.Scenery.Component.getVisible | ( | ) |
| int Dragengine.Scenery.Component.indexOfBoneNamed | ( | String | name | ) |
Index of named bone or -1 if not found in rig or rig is not set.
References getTextureSkinAt().
Referenced by getBoneOriginMatrix().
| int Dragengine.Scenery.Component.indexOfTextureNamed | ( | String | name | ) |
Index of named texture or -1 if not found or model is not set.
References setAudioModel().
Referenced by getTextureDynamicSkinAt().
| int Dragengine.Scenery.Component.indexOfVertexPositionSetNamed | ( | String | name | ) |
Index of vertex position set with name or -1 if not found.
References boneGetInverseMatrix().
Referenced by removeAllDecals().
| Component Dragengine.Scenery.Component.new | ( | ) |
Create component.
References new().
| void Dragengine.Scenery.Component.removeAllDecals | ( | ) |
| void Dragengine.Scenery.Component.removeDecal | ( | Decal | decal | ) |
| void Dragengine.Scenery.Component.resetSkinTime | ( | float | time | ) |
Reset skin time.
The graphic module manages skin time. When creating a new component the skin time is set to 0 and advanced when the deWorld is updated. All components created at the same time share the same skin time. Reseting the skin time can be used for two main purposes:
References setModelKeepTextures().
Referenced by setLayerMask().
| void Dragengine.Scenery.Component.setAudioModel | ( | Model | model | ) |
Set audio model or null if not set.
Shares textures with assigned model.
Referenced by indexOfTextureNamed().
| void Dragengine.Scenery.Component.setBonePosition | ( | String | bone, |
| Vector | position ) |
Set position of the bone relative to bone origin matrix.
| EInvalidParam | No bone with name boneName found. |
References boneSetPosition().
Referenced by setHintMovement().
| void Dragengine.Scenery.Component.setBoneRotation | ( | String | bone, |
| Quaternion | rotation ) |
Set rotation of the bone relative to bone origin matrix.
| EInvalidParam | No bone with name boneName found. |
References boneSetRotation().
Referenced by setEnableGI().
| void Dragengine.Scenery.Component.setDynamicSkin | ( | DynamicSkin | dynamicSkin | ) |
| void Dragengine.Scenery.Component.setEnableGI | ( | bool | enable | ) |
Set if enabled for GI in graphic module if supported.
References setBoneRotation().
Referenced by forEachDecal().
| void Dragengine.Scenery.Component.setHintGIImportance | ( | int | importance | ) |
Set GI important hint.
Value is in the range from 0 (very unimportant) to 4 (very important). This hint can be used by the graphic module to improve performance by excluding components with a GI important below a user chosen threshold.
References getBoneInverseMatrix().
Referenced by forEachDecal().
| void Dragengine.Scenery.Component.setHintMovement | ( | ComponentHintMovement | hint | ) |
| void Dragengine.Scenery.Component.setLayerMask | ( | LayerMask | layerMask | ) |
Set layer mask for visibility masking.
References resetSkinTime().
Referenced by getTextureSkinAt().
| void Dragengine.Scenery.Component.setModel | ( | Model | model | ) |
Set model or null if not set.
Textures are reset. To keep textures use setModelKeepTextures.
References getParentWorld(), and setVisible().
Referenced by setModelAndSkin().
| void Dragengine.Scenery.Component.setModelKeepTextures | ( | Model | model | ) |
Set model or null if not set while keeping textures.
Restores current state of textures after switching model if possible. Use this method instead of setModel if you set textures on the component and the new model is similar enough to match. Textures not existing anymore are not restored.
Referenced by resetSkinTime().
| void Dragengine.Scenery.Component.setOcclusionMesh | ( | OcclusionMesh | occlusionMesh | ) |
Set occlusion mesh or null if not set.
References setModelAndSkin().
Referenced by copyBonesToComponent().
| void Dragengine.Scenery.Component.setOrientation | ( | Quaternion | orientation | ) |
| void Dragengine.Scenery.Component.setPosition | ( | DVector | position | ) |
Set position.
Referenced by getOrientation().
| void Dragengine.Scenery.Component.setRig | ( | Rig | rig | ) |
Set rig or null if not set.
Referenced by setDynamicSkin().
| void Dragengine.Scenery.Component.setScaling | ( | Vector | scaling | ) |
| void Dragengine.Scenery.Component.setSkin | ( | Skin | skin | ) |
Set skin or null if not set.
Referenced by getOcclusionMesh().
| void Dragengine.Scenery.Component.setTextureDynamicSkinAt | ( | int | texture, |
| DynamicSkin | dynamicSkin ) |
Set dynamic skin of texture or null if not set.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
Referenced by boneGetMatrix().
| void Dragengine.Scenery.Component.setTextureSkinAt | ( | int | texture, |
| Skin | skin, | ||
| int | skinTexture ) |
Set skin of texture or null if not set.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
References updateBones().
Referenced by boneSetPosition().
| void Dragengine.Scenery.Component.setTextureTransformAt | ( | int | texture, |
| TexMatrix2 | transform ) |
Set texture coordinates transformation of texture.
| EOutOfBoundary | texture is less than 0 or greater than or equal to getTextureCount(). |
Referenced by boneSetRotation().
| void Dragengine.Scenery.Component.setVisible | ( | bool | visible | ) |
| void Dragengine.Scenery.Component.updateBones | ( | ) |
| String Dragengine.Scenery.Component.vertexPositionSetGetNameAt | ( | int | index | ) |
Name of vertex position set at index.
| EOutOfBoundary | Index is less than 0. |
| EOutOfBoundary | Index is larger than or equal to getVertexPositionSetCount(). |
References getBoneOriginMatrix().
Referenced by forEachDecal().
| float Dragengine.Scenery.Component.vertexPositionSetGetWeightAt | ( | int | index | ) |
Weight of vertex position set at index.
| EOutOfBoundary | Index is less than 0. |
| EOutOfBoundary | Index is larger than or equal to getVertexPositionSetCount(). |
Referenced by forEachDecal().
| float Dragengine.Scenery.Component.vertexPositionSetGetWeightNamed | ( | String | name | ) |
Weight of vertex position set by name.
| EOutOfBoundary | Vertex position set with name is absent. |
References getBoneOriginInverseMatrix().
Referenced by forEachDecal().
| void Dragengine.Scenery.Component.vertexPositionSetSetWeightAt | ( | int | index, |
| float | weight ) |
Set weight of vertex position set at index.
| EOutOfBoundary | Index is less than 0. |
| EOutOfBoundary | Index is larger than or equal to getVertexPositionSetCount(). |
References getBonePosition().
Referenced by forEachDecal().
| void Dragengine.Scenery.Component.vertexPositionSetSetWeightNamed | ( | String | name, |
| float | weight ) |
Set weight of vertex position set by name.
| EOutOfBoundary | Vertex position set with name is absent. |
Referenced by forEachDecal().