diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-04-16 15:07:42 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-04-17 18:51:28 +0300 |
commit | 159806140fd33e6ddab951c0f6f180cfbf927d38 (patch) | |
tree | da076be3baa4d987fb5935e220a3d901c926e0e7 /doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst | |
parent | 28b996a9d2090efdd74115a653629ef9d7d871f7 (diff) |
Removing Blender Game Engine from Blender 2.8
Folders removed entirely:
* //extern/recastnavigation
* //intern/decklink
* //intern/moto
* //source/blender/editors/space_logic
* //source/blenderplayer
* //source/gameengine
This includes DNA data and any reference to the BGE code in Blender itself.
We are bumping the subversion.
Pending tasks:
* Tile/clamp code in image editor draw code.
* Viewport drawing code (so much of this will go away because of BI removal
that we can wait until then to remove this.
Diffstat (limited to 'doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst')
-rw-r--r-- | doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst deleted file mode 100644 index 8a88dff99b9..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst +++ /dev/null @@ -1,86 +0,0 @@ -KX_SCA_ReplaceMeshActuator(SCA_IActuator) -========================================= - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator) - - Edit Object actuator, in Replace Mesh mode. - - .. warning:: - - Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist. - - This will generate a warning in the console - - .. code-block:: none - - Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object - - .. code-block:: python - - # Level-of-detail - # Switch a game object's mesh based on its depth in the camera view. - # +----------+ +-----------+ +-------------------------------------+ - # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh | - # +----------+ +-----------+ +-------------------------------------+ - from bge import logic - - # List detail meshes here - # Mesh (name, near, far) - # Meshes overlap so that they don't 'pop' when on the edge of the distance. - meshes = ((".Hi", 0.0, -20.0), - (".Med", -15.0, -50.0), - (".Lo", -40.0, -100.0) - ) - - cont = logic.getCurrentController() - object = cont.owner - actuator = cont.actuators["LOD." + obj.name] - camera = logic.getCurrentScene().active_camera - - def Depth(pos, plane): - return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3] - - # Depth is negative and decreasing further from the camera - depth = Depth(object.position, camera.world_to_camera[2]) - - newmesh = None - curmesh = None - # Find the lowest detail mesh for depth - for mesh in meshes: - if depth < mesh[1] and depth > mesh[2]: - newmesh = mesh - if "ME" + object.name + mesh[0] == actuator.getMesh(): - curmesh = mesh - - if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh: - # The mesh is a different mesh - switch it. - # Check the current mesh is not a better fit. - if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: - actuator.mesh = object.name + newmesh[0] - cont.activate(actuator) - - .. attribute:: mesh - - :class:`MeshProxy` or the name of the mesh that will replace the current one. - - Set to None to disable actuator. - - :type: :class:`MeshProxy` or None if no mesh is set - - .. attribute:: useDisplayMesh - - when true the displayed mesh is replaced. - - :type: boolean - - .. attribute:: usePhysicsMesh - - when true the physics mesh is replaced. - - :type: boolean - - .. method:: instantReplaceMesh() - - Immediately replace mesh without delay. |