From 225027ce5dea3785626908b58b01fb3959cf8362 Mon Sep 17 00:00:00 2001 From: Pierluigi Grassi Date: Sun, 15 Mar 2015 17:26:11 +0100 Subject: BGE - new read-only attribute in KX_GameObject python api (LOD level) Added a new "current_lod_level" property to the python api of KX_GameObject. The property returns the current lod level of the game object. The purpose of the property is activate logic routines only when an object is at a certain lod-distance from the camera, avoiding to separately recomputing the same distance in the logic script. Usage in python script might look like: owner = bge.logic.getCurrentController().owner lod_level = owner.currentLodLevel if lod_level == 0: ...do something else: ... object might be too distant Reviewers: dfelinto, kupoman, moguri Reviewed By: kupoman, moguri Subscribers: lordloki Projects: #game_engine Differential Revision: https://developer.blender.org/D978 --- doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst index ebde93f872f..8d6996dc401 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst @@ -432,6 +432,12 @@ base class --- :class:`SCA_IObject` If true, the object's and children's debug properties will be displayed on screen. :type: boolean + + .. attribute:: currentLodLevel + + The index of the level of detail (LOD) currently used by this object (read-only). + + :type: int .. method:: endObject() -- cgit v1.2.3