#include
<kfbxlodgroup.h>
This LodGroup node is a group node that can be used to detect how close a group of objects is to a camera. Typically this node is used for controlling "Level of Detail" visibility.
Properties in the class are designed according to Maya implementation. So these properties may be incompatible with other software, like 3ds Max.
In Maya, with "Level of Detail",the visibility of the children of this transform are controlled by the distance of a group to a camera and the threshold values. For example, under a LOD group node, there are three children: ship_detailed, ship_medium, and ship_rough. There are three threshold values: 5, 10 and 15. When the camera is within 5 units of the group bounding box, only ship_detailed is visible. When the view is zoomed out and the camera is 9 units away from the group, only ship_medium is visible. When the view is zoomed out to 30 units away, only ship_rough is visible.
This node attribute contains the properties of a null node.
Example code to create LODGroup:
KFbxNode *lLodGroup
= KFbxNode::Create(pScene, "LODNode");
KFbxLodGroup
*lLodGroupAttr = KFbxLodGroup::Create(pScene, "LODGroup1");
// Array lChildNodes contains geometries of all LOD levels
for (int j = 0; j < lChildNodes.GetCount(); j++)
{
lLodGroup->AddChild(lChildNodes.GetAt(j));
}
Definition at line 80 of file kfbxlodgroup.h.
Public Types |
|
enum | EDisplayLevel
{ eUseLOD, eShow, eHide } |
types to determine how to display nodes in
LODGroup. More... |
|
Public Member Functions |
|
virtual EAttributeType | GetAttributeType () const |
Return the type of node attribute which is
EAttributeType::eLODGROUP. |
|
int | GetNumThresholds () const |
Get the size of the threshold list. |
|
bool | AddThreshold (fbxDistance pThreshValue) |
Add a new threshold value to the current
list. |
|
bool | SetThreshold (int pEl, fbxDistance pThreshValue) |
Set the threshold value for the specified
object. |
|
bool | GetThreshold (int pEl, fbxDistance &pThreshValue) const |
Get the threshold value for the specified
object. |
|
int | GetNumDisplayLevels () const |
Get the size of the displayLevel list.
|
|
bool | AddDisplayLevel (KFbxLodGroup::EDisplayLevel pValue) |
Add a new displayLevel value to the current
list. |
|
bool | SetDisplayLevel (int pEl, KFbxLodGroup::EDisplayLevel pValue) |
Set the display level value for the
specified object. |
|
bool | GetDisplayLevel (int pEl, KFbxLodGroup::EDisplayLevel &pValue) const |
Get the display level value for the
specified object. |
|
Public Attributes |
|
KFbxTypedProperty< fbxBool1 > | MinMaxDistance |
This property handles the use of the Min/Max
distances. |
|
KFbxTypedProperty< fbxDouble1 > | MinDistance |
The minimum distance at which the group is
displayed. |
|
KFbxTypedProperty< fbxDouble1 > | MaxDistance |
The maximum distance at which the group is
displayed. |
|
KFbxTypedProperty< fbxBool1 > | WorldSpace |
Work in world space of transform or local
space If true, the camera distance to the LOD group will be
computed in world space. |
enum EDisplayLevel |
types to determine how to display nodes in LODGroup.
Definition at line 93 of file kfbxlodgroup.h.
virtual EAttributeType GetAttributeType | ( | ) | const [virtual] |
Return the type of node attribute which is EAttributeType::eLODGROUP.
Reimplemented from KFbxNodeAttribute.
int GetNumThresholds | ( | ) | const |
Get the size of the threshold list.
In correct situation, the size is less one than LOD nodes number.
bool AddThreshold | ( | fbxDistance | pThreshValue | ) |
Add a new threshold value to the current list.
pThreshValue | Threshold distance from the previous entry in the threshold list |
This method does not check the received values and blindly add them to the list. Therefore duplicated values can exist in different positions in the list.
bool SetThreshold | ( | int | pEl, | |
fbxDistance | pThreshValue | |||
) |
Set the threshold value for the specified object.
pEl | The index of the object we want to set the threshold. | |
pThreshValue | Threshold distance from the previous entry in the threshold list |
bool GetThreshold | ( | int | pEl, | |
fbxDistance & | pThreshValue | |||
) | const |
Get the threshold value for the specified object.
pEl | The index of the object we want to get the threshold. | |
pThreshValue | the current threshold value. |
int GetNumDisplayLevels | ( | ) | const |
Get the size of the displayLevel list.
In correct situation, the size is equal to LOD nodes number.
bool AddDisplayLevel | ( | KFbxLodGroup::EDisplayLevel | pValue | ) |
Add a new displayLevel value to the current list.
The value overrides the display of any level and can force it to hide or show the object at that level. For example, if the distance between the group and the camera is smaller than the first threshold, then the object at level 0 is visible. If the display level for the object at level 2 is changed to eShow, ie. if the attribute displayLevel[2] is set to eShow, then the object at level 2 will show, regardless of the current active level.
pValue | Display level value |
This method does not check the received values and blindly add them to the list. Therefore duplicated values can exist in different positions in the list.
bool SetDisplayLevel | ( | int | pEl, | |
KFbxLodGroup::EDisplayLevel | pValue | |||
) |
Set the display level value for the specified object.
pEl | The index of the object we want to set the display level. | |
pValue | New display level value |
bool GetDisplayLevel | ( | int | pEl, | |
KFbxLodGroup::EDisplayLevel & | pValue | |||
) | const |
Get the display level value for the specified object.
pEl | The index of the object we want to get the display level value. | |
pValue | the current display level value. |
This property handles the use of the Min/Max distances.
Enables the minimum and maximum distance to take effect. For example, if the distance between the group and the camera is smaller than the minimum distance, then the whole group disappears.
To access this property do: MinMaxDistance.Get(). To set this property do: MinMaxDistance.Set(bool).
Default value is false.
Definition at line 115 of file kfbxlodgroup.h.
The minimum distance at which the group is displayed.
To access this property do: MinDistance.Get(). To set this property do: MinDistance.Set(double).
Default value is -100
Definition at line 124 of file kfbxlodgroup.h.
The maximum distance at which the group is displayed.
To access this property do: MaxDistance.Get(). To set this property do: MaxDistance.Set(double).
Default value is 100
Definition at line 133 of file kfbxlodgroup.h.
Work in world space of transform or local space If true, the camera distance to the LOD group will be computed in world space.
This means it is possible to parent the LOD transform below other transforms and still have it work as expected. If this attribute is set to false, the distance computation ignores any parent transforms of the LOD transform.
To access this property do: WorldSpace.Get(). To set this property do: WorldSpace.Set(bool).
Default value is false
Definition at line 146 of file kfbxlodgroup.h.