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

Component. More...

Inheritance diagram for Dragengine.Scenery.Component:

Public Member Functions

Constructors
Component new ()
 Create component. More...
 
Component new (Model model, Skin skin)
 Create component. More...
 
Management
DVector getPosition ()
 Position. More...
 
void setPosition (DVector position)
 Set position. More...
 
Quaternion getOrientation ()
 Orientation. More...
 
void setOrientation (Quaternion orientation)
 Set orientation. More...
 
Vector getScaling ()
 Scaling. More...
 
void setScaling (Vector scaling)
 Set scaling. More...
 
DMatrix getMatrix ()
 Matrix. More...
 
DMatrix getInverseMatrix ()
 Inverse matrix. More...
 
bool getVisible ()
 Component is visible. More...
 
void setVisible (bool visible)
 Set if component is visible. More...
 
Model getModel ()
 Model or null if not set. More...
 
void setModel (Model model)
 Set model or null if not set. More...
 
void setModelKeepTextures (Model model)
 Set model or null if not set while keeping textures. More...
 
Skin getSkin ()
 Skin or null if not set. More...
 
void setSkin (Skin skin)
 Set skin or null if not set. More...
 
void setModelAndSkin (Model model, Skin skin)
 Set model and skin or null if not set. More...
 
Rig getRig ()
 Rig or null if not set. More...
 
void setRig (Rig rig)
 Set rig or null if not set. More...
 
OcclusionMesh getOcclusionMesh ()
 Occlusion mesh or null if not set. More...
 
void setOcclusionMesh (OcclusionMesh occlusionMesh)
 Set occlusion mesh or null if not set. More...
 
Model getAudioModel ()
 Audio model or null if not set. More...
 
void setAudioModel (Model model)
 Set audio model or null if not set. More...
 
LayerMask getLayerMask ()
 Layer mask for visibility masking. More...
 
void setLayerMask (LayerMask layerMask)
 Set layer mask for visibility masking. More...
 
DynamicSkin getDynamicSkin ()
 Dynamic skin or null if not set. More...
 
void setDynamicSkin (DynamicSkin dynamicSkin)
 Set dynamic skin or null if not set. More...
 
void updateBones ()
 Update bone matrices. More...
 
void copyBonesToComponent (Component component)
 Copy bone states to matching bones states of another component. More...
 
Textures
int getTextureCount ()
 Count of textures in the model or 0 if no model is set. More...
 
int indexOfTextureNamed (String name)
 Index of named texture or -1 if not found or model is not set. More...
 
String getTextureNameAt (int texture)
 Name of texture. More...
 
Skin getTextureSkinAt (int texture)
 Skin of texture or null if not used. More...
 
int getTextureTextureAt (int texture)
 Texture number of texture or null if not used. More...
 
void setTextureSkinAt (int texture, Skin skin, int skinTexture)
 Set skin of texture or null if not set. More...
 
TexMatrix2 getTextureTransformAt (int texture)
 Texture coordinates transformation of texture. More...
 
void setTextureTransformAt (int texture, TexMatrix2 transform)
 Set texture coordinates transformation of texture. More...
 
DynamicSkin getTextureDynamicSkinAt (int texture)
 Dynamic skin of texture or null if not set. More...
 
void setTextureDynamicSkinAt (int texture, DynamicSkin dynamicSkin)
 Set dynamic skin of texture or null if not set. More...
 
Bones
int getBoneCount ()
 Number of bones. More...
 
int indexOfBoneNamed (String name)
 Index of named bone or -1 if not found in rig or rig is not set. More...
 
String boneGetName (int index)
 Name of bone. More...
 
Vector boneGetPosition (int bone)
 Position of bone relative to bone origin matrix. More...
 
void boneSetPosition (int bone, Vector position)
 Set position of the bone relative to bone origin matrix. More...
 
Quaternion boneGetRotation (int bone)
 Rotation of bone relative to bone origin matrix. More...
 
void boneSetRotation (int bone, Quaternion rotation)
 Set rotation of the bone relative to bone origin matrix. More...
 
Matrix boneGetMatrix (int bone)
 Bone matrix relative to component space. More...
 
Matrix boneGetInverseMatrix (int bone)
 Inverse bone matrix relative to component space. More...
 
Matrix getBoneOriginMatrix (int bone)
 Bone origin matrix in component space. More...
 
Matrix getBoneOriginInverseMatrix (int bone)
 Inverse bone origin matrix in component space. More...
 
Vector getBonePosition (String bone)
 Position of bone relative to bone origin matrix. More...
 
void setBonePosition (String bone, Vector position)
 Set position of the bone relative to bone origin matrix. More...
 
Quaternion getBoneRotation (String bone)
 Rotation of bone relative to bone origin matrix. More...
 
void setBoneRotation (String bone, Quaternion rotation)
 Set rotation of the bone relative to bone origin matrix. More...
 
Matrix getBoneMatrix (String bone)
 Bone matrix relative to component space. More...
 
Matrix getBoneInverseMatrix (String bone)
 Inverse bone matrix relative to component space. More...
 
Vertex position sets
int getVertexPositionSetCount ()
 Count of vertex position sets. More...
 
int indexOfVertexPositionSetNamed (String name)
 Index of vertex position set with name or -1 if not found. More...
 
String vertexPositionSetGetNameAt (int index)
 Name of vertex position set at index. More...
 
float vertexPositionSetGetWeightAt (int index)
 Weight of vertex position set at index. More...
 
float vertexPositionSetGetWeightNamed (String name)
 Weight of vertex position set by name. More...
 
void vertexPositionSetSetWeightAt (int index, float weight)
 Set weight of vertex position set at index. More...
 
void vertexPositionSetSetWeightNamed (String name, float weight)
 Set weight of vertex position set by name. More...
 
ComponentHintMovement getHintMovement ()
 Movement hint. More...
 
void setHintMovement (ComponentHintMovement hint)
 Set movement hint. More...
 
bool getEnableGI ()
 Enable GI in graphic module if supported. More...
 
void setEnableGI (bool enable)
 Set if enabled for GI in graphic module if supported. More...
 
int getHintGIImportance ()
 GI important hint. More...
 
void setHintGIImportance (int importance)
 Set GI important hint. More...
 
Decals
int getDecalCount ()
 Number of decals. More...
 
void addDecal (Decal decal)
 Add decal. More...
 
void removeDecal (Decal decal)
 Remove decal. More...
 
void removeAllDecals ()
 Remove all decals. More...
 
void forEachDecal (Block ablock)
 Visit decals with block with parameter Decal. More...
 

Detailed Description

Component.

This is a native class.

Member Function Documentation

◆ addDecal()

void Dragengine.Scenery.Component.addDecal ( Decal  decal)

Add decal.

◆ boneGetInverseMatrix()

Matrix Dragengine.Scenery.Component.boneGetInverseMatrix ( int  bone)

Inverse bone matrix relative to component space.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneGetMatrix()

Matrix Dragengine.Scenery.Component.boneGetMatrix ( int  bone)

Bone matrix relative to component space.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneGetName()

String Dragengine.Scenery.Component.boneGetName ( int  index)

Name of bone.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneGetPosition()

Vector Dragengine.Scenery.Component.boneGetPosition ( int  bone)

Position of bone relative to bone origin matrix.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneGetRotation()

Quaternion Dragengine.Scenery.Component.boneGetRotation ( int  bone)

Rotation of bone relative to bone origin matrix.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneSetPosition()

void Dragengine.Scenery.Component.boneSetPosition ( int  bone,
Vector  position 
)

Set position of the bone relative to bone origin matrix.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ boneSetRotation()

void Dragengine.Scenery.Component.boneSetRotation ( int  bone,
Quaternion  rotation 
)

Set rotation of the bone relative to bone origin matrix.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ copyBonesToComponent()

void Dragengine.Scenery.Component.copyBonesToComponent ( Component  component)

Copy bone states to matching bones states of another component.

◆ forEachDecal()

void Dragengine.Scenery.Component.forEachDecal ( Block  ablock)

Visit decals with block with parameter Decal.

Warning
Do not add or remove decals from inside the block.

◆ getAudioModel()

Model Dragengine.Scenery.Component.getAudioModel ( )

Audio model or null if not set.

◆ getBoneCount()

int Dragengine.Scenery.Component.getBoneCount ( )

Number of bones.

◆ getBoneInverseMatrix()

Matrix Dragengine.Scenery.Component.getBoneInverseMatrix ( String  bone)

Inverse bone matrix relative to component space.

Exceptions
EInvalidParamNo bone with name boneName found.

◆ getBoneMatrix()

Matrix Dragengine.Scenery.Component.getBoneMatrix ( String  bone)

Bone matrix relative to component space.

Exceptions
EInvalidParamNo bone with name boneName found.

◆ getBoneOriginInverseMatrix()

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.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ getBoneOriginMatrix()

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.

Exceptions
EInvalidParambone is less than 0 or larger than or equal to GetBoneCount().

◆ getBonePosition()

Vector Dragengine.Scenery.Component.getBonePosition ( String  bone)

Position of bone relative to bone origin matrix.

Exceptions
EInvalidParamNo bone with name bone found.
Deprecated:
Use boneGetPosition(indexOfBoneNamed(bone))

◆ getBoneRotation()

Quaternion Dragengine.Scenery.Component.getBoneRotation ( String  bone)

Rotation of bone relative to bone origin matrix.

Exceptions
EInvalidParamNo bone with name boneName found.
Deprecated:
Use boneSetRotation(indexOfBoneNamed(bone), position)

◆ getDecalCount()

int Dragengine.Scenery.Component.getDecalCount ( )

Number of decals.

◆ getDynamicSkin()

DynamicSkin Dragengine.Scenery.Component.getDynamicSkin ( )

Dynamic skin or null if not set.

◆ getEnableGI()

bool Dragengine.Scenery.Component.getEnableGI ( )

Enable GI in graphic module if supported.

Version
1.19

◆ getHintGIImportance()

int Dragengine.Scenery.Component.getHintGIImportance ( )

GI important hint.

Version
1.19

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.

◆ getHintMovement()

ComponentHintMovement Dragengine.Scenery.Component.getHintMovement ( )

Movement hint.

◆ getInverseMatrix()

DMatrix Dragengine.Scenery.Component.getInverseMatrix ( )

Inverse matrix.

◆ getLayerMask()

LayerMask Dragengine.Scenery.Component.getLayerMask ( )

Layer mask for visibility masking.

◆ getMatrix()

DMatrix Dragengine.Scenery.Component.getMatrix ( )

◆ getModel()

Model Dragengine.Scenery.Component.getModel ( )

Model or null if not set.

◆ getOcclusionMesh()

OcclusionMesh Dragengine.Scenery.Component.getOcclusionMesh ( )

Occlusion mesh or null if not set.

◆ getOrientation()

Quaternion Dragengine.Scenery.Component.getOrientation ( )

Orientation.

◆ getPosition()

DVector Dragengine.Scenery.Component.getPosition ( )

Position.

◆ getRig()

Rig Dragengine.Scenery.Component.getRig ( )

Rig or null if not set.

◆ getScaling()

Vector Dragengine.Scenery.Component.getScaling ( )

Scaling.

◆ getSkin()

Skin Dragengine.Scenery.Component.getSkin ( )

Skin or null if not set.

◆ getTextureCount()

int Dragengine.Scenery.Component.getTextureCount ( )

Count of textures in the model or 0 if no model is set.

◆ getTextureDynamicSkinAt()

DynamicSkin Dragengine.Scenery.Component.getTextureDynamicSkinAt ( int  texture)

Dynamic skin of texture or null if not set.

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

◆ getTextureNameAt()

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

Name of texture.

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

◆ getTextureSkinAt()

Skin Dragengine.Scenery.Component.getTextureSkinAt ( int  texture)

Skin of texture or null if not used.

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

◆ getTextureTextureAt()

int Dragengine.Scenery.Component.getTextureTextureAt ( int  texture)

Texture number of texture or null if not used.

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

◆ getTextureTransformAt()

TexMatrix2 Dragengine.Scenery.Component.getTextureTransformAt ( int  texture)

Texture coordinates transformation of texture.

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

◆ getVertexPositionSetCount()

int Dragengine.Scenery.Component.getVertexPositionSetCount ( )

Count of vertex position sets.

Version
1.17

◆ getVisible()

bool Dragengine.Scenery.Component.getVisible ( )

Component is visible.

◆ indexOfBoneNamed()

int Dragengine.Scenery.Component.indexOfBoneNamed ( String  name)

Index of named bone or -1 if not found in rig or rig is not set.

◆ indexOfTextureNamed()

int Dragengine.Scenery.Component.indexOfTextureNamed ( String  name)

Index of named texture or -1 if not found or model is not set.

◆ indexOfVertexPositionSetNamed()

int Dragengine.Scenery.Component.indexOfVertexPositionSetNamed ( String  name)

Index of vertex position set with name or -1 if not found.

Version
1.17

◆ new() [1/2]

Component Dragengine.Scenery.Component.new ( )

Create component.

◆ new() [2/2]

Component Dragengine.Scenery.Component.new ( Model  model,
Skin  skin 
)

Create component.

◆ removeAllDecals()

void Dragengine.Scenery.Component.removeAllDecals ( )

Remove all decals.

◆ removeDecal()

void Dragengine.Scenery.Component.removeDecal ( Decal  decal)

Remove decal.

◆ setAudioModel()

void Dragengine.Scenery.Component.setAudioModel ( Model  model)

Set audio model or null if not set.

Shares textures with assigned model.

◆ setBonePosition()

void Dragengine.Scenery.Component.setBonePosition ( String  bone,
Vector  position 
)

Set position of the bone relative to bone origin matrix.

Exceptions
EInvalidParamNo bone with name boneName found.
Deprecated:
Use boneSetPosition(indexOfBoneNamed(bone), position)

◆ setBoneRotation()

void Dragengine.Scenery.Component.setBoneRotation ( String  bone,
Quaternion  rotation 
)

Set rotation of the bone relative to bone origin matrix.

Exceptions
EInvalidParamNo bone with name boneName found.
Deprecated:
Use boneSetRotation(indexOfBoneNamed(bone), rotation)

◆ setDynamicSkin()

void Dragengine.Scenery.Component.setDynamicSkin ( DynamicSkin  dynamicSkin)

Set dynamic skin or null if not set.

◆ setEnableGI()

void Dragengine.Scenery.Component.setEnableGI ( bool  enable)

Set if enabled for GI in graphic module if supported.

Version
1.19

◆ setHintGIImportance()

void Dragengine.Scenery.Component.setHintGIImportance ( int  importance)

Set GI important hint.

Version
1.19

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.

◆ setHintMovement()

void Dragengine.Scenery.Component.setHintMovement ( ComponentHintMovement  hint)

Set movement hint.

◆ setLayerMask()

void Dragengine.Scenery.Component.setLayerMask ( LayerMask  layerMask)

Set layer mask for visibility masking.

◆ setModel()

void Dragengine.Scenery.Component.setModel ( Model  model)

Set model or null if not set.

Textures are reset. To keep textures use setModelKeepTextures.

◆ setModelAndSkin()

void Dragengine.Scenery.Component.setModelAndSkin ( Model  model,
Skin  skin 
)

Set model and skin or null if not set.

◆ setModelKeepTextures()

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.

◆ setOcclusionMesh()

void Dragengine.Scenery.Component.setOcclusionMesh ( OcclusionMesh  occlusionMesh)

Set occlusion mesh or null if not set.

◆ setOrientation()

void Dragengine.Scenery.Component.setOrientation ( Quaternion  orientation)

Set orientation.

◆ setPosition()

void Dragengine.Scenery.Component.setPosition ( DVector  position)

Set position.

◆ setRig()

void Dragengine.Scenery.Component.setRig ( Rig  rig)

Set rig or null if not set.

◆ setScaling()

void Dragengine.Scenery.Component.setScaling ( Vector  scaling)

Set scaling.

◆ setSkin()

void Dragengine.Scenery.Component.setSkin ( Skin  skin)

Set skin or null if not set.

◆ setTextureDynamicSkinAt()

void Dragengine.Scenery.Component.setTextureDynamicSkinAt ( int  texture,
DynamicSkin  dynamicSkin 
)

Set dynamic skin of texture or null if not set.

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

◆ setTextureSkinAt()

void Dragengine.Scenery.Component.setTextureSkinAt ( int  texture,
Skin  skin,
int  skinTexture 
)

Set skin of texture or null if not set.

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

◆ setTextureTransformAt()

void Dragengine.Scenery.Component.setTextureTransformAt ( int  texture,
TexMatrix2  transform 
)

Set texture coordinates transformation of texture.

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

◆ setVisible()

void Dragengine.Scenery.Component.setVisible ( bool  visible)

Set if component is visible.

◆ updateBones()

void Dragengine.Scenery.Component.updateBones ( )

Update bone matrices.

◆ vertexPositionSetGetNameAt()

String Dragengine.Scenery.Component.vertexPositionSetGetNameAt ( int  index)

Name of vertex position set at index.

Version
1.17
Exceptions
EOutOfBoundaryIndex is less than 0.
EOutOfBoundaryIndex is larger than or equal to getVertexPositionSetCount().

◆ vertexPositionSetGetWeightAt()

float Dragengine.Scenery.Component.vertexPositionSetGetWeightAt ( int  index)

Weight of vertex position set at index.

Version
1.17
Exceptions
EOutOfBoundaryIndex is less than 0.
EOutOfBoundaryIndex is larger than or equal to getVertexPositionSetCount().

◆ vertexPositionSetGetWeightNamed()

float Dragengine.Scenery.Component.vertexPositionSetGetWeightNamed ( String  name)

Weight of vertex position set by name.

Version
1.17
Exceptions
EOutOfBoundaryVertex position set with name is absent.

◆ vertexPositionSetSetWeightAt()

void Dragengine.Scenery.Component.vertexPositionSetSetWeightAt ( int  index,
float  weight 
)

Set weight of vertex position set at index.

Version
1.17
Exceptions
EOutOfBoundaryIndex is less than 0.
EOutOfBoundaryIndex is larger than or equal to getVertexPositionSetCount().

◆ vertexPositionSetSetWeightNamed()

void Dragengine.Scenery.Component.vertexPositionSetSetWeightNamed ( String  name,
float  weight 
)

Set weight of vertex position set by name.

Version
1.17
Exceptions
EOutOfBoundaryVertex position set with name is absent.

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