Public Member Functions | |
Graphical objects assignation to the 3d entity | |
| void | Set3dMesh (IND_3dMesh *pNewMesh) |
Showing | |
| void | SetShow (bool pShow) |
Animations | |
| bool | SetSequence (int pS) |
| void | SetAnimationSpeed (float pSpeed) |
| void | SetTransitionSpeed (float pSpeed) |
Space transformations | |
| void | SetPosition (float pX, float pY, float pZ) |
| void | SetAngleXYZ (float pAnX, float pAnY, float pAnZ) |
| void | SetScale (float pSx, float pSy, float pSz) |
| void | SetFilter (IND_Filter pF) |
Color transformations, blending and back face culling | |
| void | SetBackCull (bool pCull) |
| void | FlipNormals (bool pFlipNormals) |
| void | SetTint (byte pR, byte pG, byte pB, byte pA) |
| void | SetTransparency (byte pA) |
| void | SetFade (byte pR, byte pG, byte pB, byte pA) |
| void | SetBlendSource (IND_BlendingType pSo) |
| void | SetBlendDest (IND_BlendingType pDs) |
Gets | |
| IND_3dMesh * | Get3dMesh () |
| If the entity has a surface assigned, it returns a pointer to this surface. | |
| bool | IsShow () |
| Returns true if the entity is being showed, false if not. | |
| int | GetSequence () |
| Returns the sequence number that has been assigned to the animation. | |
| float | GetAnimationSpeed () |
| Return the animation speed value. | |
| float | GetTransitionSpeed () |
| Return the transition speed value. | |
| float | GetPosX () |
| Returns X position of the entity. | |
| float | GetPosY () |
| Returns Y position of the entity. | |
| float | GetPosZ () |
| Returns Z position of the entity. | |
| float | GetAngleX () |
| Returns the angle in the X axis of the entity. | |
| float | GetAngleY () |
| Returns the angle in the Y axis of the entity. | |
| float | GetAngleZ () |
| Returns the angle in the Z axis of the entity. | |
| float | GetScaleX () |
| Returns the X scale of the entity. | |
| float | GetScaleY () |
| Returns the Y scale of the entity. | |
| float | GetScaleZ () |
| Returns the Z scale of the entity. | |
| bool | GetBackCull () |
| Indicate if the entity is making backface culling 0 = No, 1 = Yes. | |
| IND_Filter | GetFilter () |
| Returns the type of filter IND_Filter which uses the graphical object assignated to the entity. | |
| byte | GetTintR () |
| Returns the tinted level in the R (red) channel of the entity. | |
| byte | GetTintG () |
| Returns the tTinted level in the G (green) channel of the entity. | |
| byte | GetTintB () |
| Returns the tinted level in the B (blue) channel of the entity. | |
| byte | GetTransparency () |
| Returns the transparency level of the entity. | |
| byte | GetFadeR () |
| Returns the fade level in R (red) channel of the entity. | |
| byte | GetFadeG () |
| Returns the fade level in G (green) channel of the entity. | |
| byte | GetFadeB () |
| Returns the fade level in B (blue) channel of the entity. | |
| byte | GetFadeA () |
| Returns the fade level of the entity. | |
| IND_BlendingType | GetBlendSource () |
| Returns the blending type IND_BlendingType for the source. | |
| IND_BlendingType | GetDestSource () |
| Returns the blending type IND_BlendingType for the destination. | |
Friends | |
| class | IND_Entity3dManager |
An entity is an object that can have a graphical object associated to it. In this case this graphical objects are 3d meshes. Using the methods of this class you will be able to change the attributes of that 3d meshes.
For example, in a game, a 3d monster can be a IND_Entity3d that has a IND_3dMesh associated to it. You can have as many monsters (IND_3dMesh objects) in the screen as you want, all of them sharing the same IND_3dMesh (the 3d model). In system memory you will have only one 3d mesh loaded, the rest will be instances. The cool thing is that you can change the attributes of each of these different IND_Entity3d objects. For example, you can change the size, rotation, color or transparency of the monsters. So, having only one 3d mesh, you can have lot of different monsters in the screen, with different sizes, colors, positions, etc.
| void IND_Entity3d::Set3dMesh | ( | IND_3dMesh * | pNewMesh | ) |
Parameters:
This function assigns a 3d mesh IND_3dMesh to the 3d entity
| void IND_Entity3d::SetShow | ( | bool | pShow | ) |
Parameters:
This function showes / hides the entity. It dosen't delete it.
Default: 0.
| bool IND_Entity3d::SetSequence | ( | int | pS | ) |
Parameters:
This function sets the animation sequence that will be rendered. When you use this method, the transition between the current animation and the following will not be abrubtly. IndieLib will fade out the effect of the first animation and fade in the second. Use SetTransitionSpeed() in order set the speed of that transition.
Default: 0 (first sequence).
| void IND_Entity3d::SetAnimationSpeed | ( | float | pSpeed | ) |
Parameters:
This function sets the animation speed when changing from one sequence to another. The default value is 1.0f. For speed up the animation choose values between 1.0f and 0.0f. The faster animation possible is 0.0f. In order to slow down the animation speed, choose values higher than 1.0f, the higher the value, the slower the animation.
Default: 1.0f
| void IND_Entity3d::SetTransitionSpeed | ( | float | pSpeed | ) |
Parameters:
When IndieLib is rendering an animation sequence of a 3d Mesh, if you change the animation sequence (using IND_Entity3d::SetSequence()) the change will not be abruptly. IndieLib will fade out the effect of the first animation and fade in the second.
This function sets the animation speed of this transition animation. The default value is 0.25f. For speed up the transition choose values between 0.25f and 0.0f. The faster transition possible is 0.0f. In order to slow down the animation speed, choose values higher than 0.25f, the higher the value, the slower the animation.
Default: 0.25f
| void IND_Entity3d::SetPosition | ( | float | pX, | |
| float | pY, | |||
| float | pZ | |||
| ) |
Parameters:
This function sets the position where the entity will be drawn.
Default (0, 0, 0).
| void IND_Entity3d::SetAngleXYZ | ( | float | pAnX, | |
| float | pAnY, | |||
| float | pAnZ | |||
| ) |
Parameters:
This function sets the rotation of the entity in each of the coordinate axis.
Default (0, 0, 0).
| void IND_Entity3d::SetScale | ( | float | pSx, | |
| float | pSy, | |||
| float | pSz | |||
| ) |
Parameters:
This function sets the scaling of the entity in the x, y and z axis.
By default (1, 1).
| void IND_Entity3d::SetFilter | ( | IND_Filter | pF | ) |
Parameters:
This function sets the filter that will affect the graphical object when drawing.
Default: IND_FILTER_LINEAR
| void IND_Entity3d::SetBackCull | ( | bool | pCull | ) |
Parameters:
This function activates or deactivates the backface culling. (1 / 0) = (activated / deactivated). This parameter is interesting to deactivate it when we rotate the graphical object in the x or y axis.
Activated by default (1).
| void IND_Entity3d::FlipNormals | ( | bool | pFlipNormals | ) |
Parameters:
This function toggle the back face culling of the model. You can use this method if you see that your model is being displayed incorrectly.
Default: 0
| void IND_Entity3d::SetTint | ( | byte | pR, | |
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) |
Parameters:
This function sets the bytes pR, pG, pB for "tinting" the 3d Mesh to a certain color. For example, if we use RGB = (255, 0, 0), the mesh will be tinted of red color. Note: It is not the same the fade that the tint. The tint produces an effect like seeing through a cellophane, whereas the fade changes the mesh to the color selected completely.
It is not possible to use IND_Entity3d::SetTint() and IND_Entity3d::SetFade() at the same time, the fade will prevail upon the tinting.
Default RGBA = (0, 0, 0) (Without tint)
| void IND_Entity3d::SetTransparency | ( | byte | pA | ) |
Parameters:
This function sets the level of transparency of the entity.
The A byte indicates the level of transparency. If a value 0 is used, the following graphical object will be completely transparent, opposite to the value 255 that will be drawn completely opaque. It is possible to use all the intermediate values for different levels of transparency.
Default A = (255) (Without transparency)
| void IND_Entity3d::SetFade | ( | byte | pR, | |
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) |
Parameters:
This function sets the bytes FadeR, FadeG, FadeB for making a fade of the 3d mesh to a certain color. When we speak of fade we refer to the progressive change of the mesh to certain color. For example, if we use RGB = (255, 0, 0), the mesh will be faded to red color. Note: It is not the same the fade that the tint. The tint produces an effect like seeing trough a cellophane, whereas the fade changes the mesh to the color selected completely.
The byte A indicates the level of fade. If a value 0 is used, the following graphical object will show itself completely of the color chosen like fade, opposite to the value 255 that it would draw completely normally. It is possible to use all the intermediate values for different levels of fade.
It is not possible to use IND_Entity3d::SetTint() and IND_Entity3d::SetFade() at the same time, the fade will prevail upon the tinting.
Default RGBA = (0, 0, 0, 255) (Without fade)
| void IND_Entity3d::SetBlendSource | ( | IND_BlendingType | pSo | ) |
Parameters:
This function sets the blending source.
Default: 0. (Blending source is not in use).
| void IND_Entity3d::SetBlendDest | ( | IND_BlendingType | pDs | ) |
Parameters:
This function sets the blending destiny.
Default 0. (Blending destiny is not in use).
1.5.4