| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| BL_Texture(CValue) | ||
| ================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`CValue` | ||
|
|
||
| .. class:: BL_Texture(CValue) | ||
|
|
||
| A texture object that contains attributes of a material texture. | ||
|
|
||
| .. attribute:: diffuseIntensity | ||
|
|
||
| Amount texture affects diffuse reflectivity. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: diffuseFactor | ||
|
|
||
| Amount texture affects diffuse color. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: alpha | ||
|
|
||
| Amount texture affects alpha. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: specularIntensity | ||
|
|
||
| Amount texture affects specular reflectivity. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: specularFactor | ||
|
|
||
| Amount texture affects specular color. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: hardness | ||
|
|
||
| Amount texture affects hardness. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: emit | ||
|
|
||
| Amount texture affects emission. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: mirror | ||
|
|
||
| Amount texture affects mirror color. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: normal | ||
|
|
||
| Amount texture affects normal values. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: parallaxBump | ||
|
|
||
| Height of parallax occlusion mapping. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: parallaxStep | ||
|
|
||
| Number of steps to achieve parallax effect. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: lodBias | ||
|
|
||
| Amount bias on mipmapping. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: bindCode | ||
|
|
||
| Texture bind code/Id/number. | ||
|
|
||
| :type: integer | ||
|
|
||
| .. attribute:: renderer | ||
|
|
||
| Texture renderer of this texture. | ||
|
|
||
| :type: :class:`KX_CubeMap`, :class:`KX_PlanarMap` or None | ||
|
|
||
| .. attribute:: ior | ||
|
|
||
| Index Of Refraction used to compute refraction. | ||
|
|
||
| :type: float (1.0 to 50.0) | ||
|
|
||
| .. attribute:: refractionRatio | ||
|
|
||
| Amount refraction mixed with reflection. | ||
|
|
||
| :type: float (0.0 to 1.0) | ||
|
|
||
| .. attribute:: uvOffset | ||
|
|
||
| Offset applied to texture UV coordinates (mainly translation on U and V axis). | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: uvSize | ||
|
|
||
| Scale applied to texture UV coordinates. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: uvRotation | ||
|
|
||
| Rotation applied to texture UV coordinates. | ||
|
|
||
| :type: float (radians) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| KX_2DFilter(BL_Shader) | ||
| ====================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`BL_Shader` | ||
|
|
||
| .. class:: KX_2DFilter(BL_Shader) | ||
|
|
||
| 2D filter shader object. Can be alterated with :class:`BL_Shader`'s functions. | ||
|
|
||
| .. warning:: | ||
|
|
||
| The vertex shader must not apply modelview and projection transformation. It should be similar to: | ||
|
|
||
| .. code-block:: glsl | ||
| void main() | ||
| { | ||
| gl_Position = gl_Vertex; | ||
| } | ||
| .. attribute:: mipmap | ||
|
|
||
| Request mipmap generation of the render `bgl_RenderedTexture` texture. Accessing mipmapping level is similar to: | ||
|
|
||
| .. code-block:: glsl | ||
| uniform sampler2D bgl_RenderedTexture; | ||
| void main() | ||
| { | ||
| float level = 2.0; // mipmap level | ||
| gl_FragColor = textureLod(bgl_RenderedTexture, gl_TexCoord[0].st, level); | ||
| } | ||
| :type: boolean | ||
|
|
||
| .. attribute:: offScreen | ||
|
|
||
| The custom off screen the filter render to (read-only). | ||
|
|
||
| :type: :class:`bge.types.KX_2DFilterOffScreen` or None | ||
|
|
||
| .. method:: setTexture(index, bindCode, samplerName="") | ||
|
|
||
| Set specified texture bind code :data:`bindCode` in specified slot :data:`index`. Any call to :data:`setTexture` | ||
| should be followed by a call to :data:`BL_Shader.setSampler` with the same :data:`index`. | ||
|
|
||
| :arg index: The texture slot. | ||
| :type index: integer | ||
| :arg bindCode: The texture bind code/Id. | ||
| :type bindCode: integer | ||
| :arg samplerName: The shader sampler name set to :data:`index` if :data:`samplerName` is passed in the function. (optional) | ||
| :type samplerName: string | ||
|
|
||
| .. method:: addOffScreen(slots, depth=False, width=-1, height=-1, hdr=bge.render.HDR_NONE, mipmap=False) | ||
|
|
||
| Register a custom off screen to render the filter to. | ||
|
|
||
| :arg slots: The number of color texture attached to the off screen, between 0 and 8 excluded. | ||
| :type slots: integer | ||
| :arg depth: True of the off screen use a depth texture (optional). | ||
| :type depth: boolean | ||
| :arg width: The off screen width, -1 if it can be resized dynamically when the viewport dimensions changed (optional). | ||
| :type width: integer | ||
| :arg height: The off screen height, -1 if it can be resized dynamically when the viewport dimensions changed (optional). | ||
| :type height: integer | ||
| :arg hdr: The image quality HDR of the color textures (optional). | ||
| :type hdr: one of :ref:`these constants<render-hdr>` | ||
| :arg mipmap: True if the color texture generate mipmap at the end of the filter rendering (optional). | ||
| :type mipmap: boolean | ||
|
|
||
| .. note:: | ||
| If the off screen is created using a dynamic size (`width` and `height` to -1) its bind codes will be unavailable before | ||
| the next render of the filter and the it can change when the viewport is resized. | ||
|
|
||
| .. method:: removeOffScreen() | ||
|
|
||
| Unregister the custom off screen the filter render to. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| KX_2DFilterManager(PyObjectPlus) | ||
| ================================ | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`PyObjectPlus` | ||
|
|
||
| .. class:: KX_2DFilterManager(PyObjectPlus) | ||
|
|
||
| 2D filter manager used to add, remove and find filters in a scene. | ||
|
|
||
| .. method:: addFilter(index, type, fragmentProgram) | ||
|
|
||
| Add a filter to the pass index :data:`index`, type :data:`type` and fragment program if custom filter. | ||
|
|
||
| :arg index: The filter pass index. | ||
| :type index: integer | ||
| :arg type: The filter type, one of: | ||
|
|
||
| * :data:`bge.logic.RAS_2DFILTER_BLUR` | ||
| * :data:`bge.logic.RAS_2DFILTER_DILATION` | ||
| * :data:`bge.logic.RAS_2DFILTER_EROSION` | ||
| * :data:`bge.logic.RAS_2DFILTER_SHARPEN` | ||
| * :data:`bge.logic.RAS_2DFILTER_LAPLACIAN` | ||
| * :data:`bge.logic.RAS_2DFILTER_PREWITT` | ||
| * :data:`bge.logic.RAS_2DFILTER_SOBEL` | ||
| * :data:`bge.logic.RAS_2DFILTER_GRAYSCALE` | ||
| * :data:`bge.logic.RAS_2DFILTER_SEPIA` | ||
| * :data:`bge.logic.RAS_2DFILTER_CUSTOMFILTER` | ||
|
|
||
| :type type: integer | ||
| :arg fragmentProgram: The filter shader fragment program. | ||
| Specified only if :data:`type` is :data:`bge.logic.RAS_2DFILTER_CUSTOMFILTER`. (optional) | ||
| :type fragmentProgram: string | ||
| :return: The 2D Filter. | ||
| :rtype: :class:`KX_2DFilter` | ||
|
|
||
| .. method:: removeFilter(index) | ||
|
|
||
| Remove filter to the pass index :data:`index`. | ||
|
|
||
| :arg index: The filter pass index. | ||
| :type index: integer | ||
|
|
||
| .. method:: getFilter(index) | ||
|
|
||
| Return filter to the pass index :data:`index`. | ||
|
|
||
| :warning: If the 2D Filter is added with a :class:`SCA_2DFilterActuator`, the filter will | ||
| be available only after the 2D Filter program is linked. The python script to get the filter | ||
| has to be executed one frame later. A delay sensor can be used. | ||
|
|
||
| :arg index: The filter pass index. | ||
| :type index: integer | ||
| :return: The filter in the specified pass index or None. | ||
| :rtype: :class:`KX_2DFilter` or None |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| KX_2DFilterOffScreen(CValue) | ||
| ============================ | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`CValue` | ||
|
|
||
| .. class:: KX_2DFilterOffScreen(CValue) | ||
|
|
||
| 2D filter custom off screen. | ||
|
|
||
| .. attribute:: width | ||
|
|
||
| The off screen width, -1 if the off screen can be resized dynamically (read-only). | ||
|
|
||
| :type: integer | ||
|
|
||
| .. attribute:: height | ||
|
|
||
| The off screen height, -1 if the off screen can be resized dynamically (read-only). | ||
|
|
||
| :type: integer | ||
|
|
||
| .. attribute:: colorBindCodes | ||
|
|
||
| The bind code of the color textures attached to the off screen (read-only). | ||
|
|
||
| .. warning:: If the off screen can be resized dynamically (:data:`width` of :data:`height` equal to -1), the bind codes may change. | ||
|
|
||
| :type: list of 8 integers | ||
|
|
||
| .. attribute:: depthBindCode | ||
|
|
||
| The bind code of the depth texture attached to the off screen (read-only). | ||
|
|
||
| .. warning:: If the off screen can be resized dynamically (:data:`width` of :data:`height` equal to -1), the bind code may change. | ||
|
|
||
| :type: integer |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| KX_BatchGroup(CValue) | ||
| ===================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`CValue` | ||
|
|
||
| .. class:: KX_BatchGroup(CValue) | ||
|
|
||
| The batch group is class containing a mesh resulting of the merging of meshes used by objects. | ||
| The meshes are merged with the transformation of the objects using it. | ||
| An instance of this class is not owned by one object but shared between objects. | ||
| In consideration an instance of :class:`KX_BatchGroup` have to instanced with as argument a list of at least one object containing the meshes to merge. | ||
| This can be done in a way similar to: | ||
|
|
||
| .. code-block:: python | ||
| import bge | ||
| scene = bge.logic.getCurrentScene() | ||
| batchGroup = types.KX_BatchGroup([scene.objects["Cube"], scene.objects["Plane"]]) | ||
| .. attribute:: objects | ||
|
|
||
| The list of the objects merged. (read only) | ||
|
|
||
| :type: :class:`CListValue` of :class:`KX_GameObject` | ||
|
|
||
| .. method:: merge(objects) | ||
|
|
||
| Merge meshes using the transformation of the objects using them. | ||
|
|
||
| :arg objects: The objects to merge. | ||
| :type object: :class:`CListValue` of :class:`KX_GameObject` | ||
|
|
||
| .. method:: split(objects) | ||
|
|
||
| Split the meshes of the objects using them and restore their original meshes. | ||
|
|
||
| :arg objects: The objects to unmerge. | ||
| :type object: :class:`CListValue` of :class:`KX_GameObject` | ||
|
|
||
| .. method:: destruct() | ||
|
|
||
| Destruct the batch group and restore all the objects to their original meshes. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| KX_BoundingBox(PyObjectPlus) | ||
| ============================= | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`PyObjectPlus` | ||
|
|
||
| .. class:: KX_BoundingBox(PyObjectPlus) | ||
|
|
||
| A bounding volume box of a game object. Used to get and alterate the volume box or AABB. | ||
|
|
||
| .. code-block:: python | ||
| from bge import logic | ||
| from mathutils import Vector | ||
| owner = logic.getCurrentController().owner | ||
| box = owner.cullingBox | ||
| # Disable auto update to allow modify the box. | ||
| box.autoUpdate = False | ||
| print(box) | ||
| # Increase the height of the box of 1. | ||
| box.max = box.max + Vector((0, 0, 1)) | ||
| print(box) | ||
| .. attribute:: min | ||
|
|
||
| The minimal point in x, y and z axis of the bounding box. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: max | ||
|
|
||
| The maximal point in x, y and z axis of the bounding box. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: center | ||
|
|
||
| The center of the bounding box. (read only) | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: radius | ||
|
|
||
| The radius of the bounding box. (read only) | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: autoUpdate | ||
|
|
||
| Allow to update the bounding box if the mesh is modified. | ||
|
|
||
| :type: boolean |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| KX_CollisionContactPoint(CValue) | ||
| ================================ | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`CValue` | ||
|
|
||
| .. class:: KX_CollisionContactPoint(CValue) | ||
|
|
||
| A collision contact point passed to the collision callbacks. | ||
|
|
||
| .. code-block:: python | ||
| import bge | ||
| def oncollision(object, point, normal, points): | ||
| print("Hit by", object) | ||
| for point in points: | ||
| print(point.localPointA) | ||
| print(point.localPointB) | ||
| print(point.worldPoint) | ||
| print(point.normal) | ||
| print(point.combinedFriction) | ||
| print(point.combinedRestitution) | ||
| print(point.appliedImpulse) | ||
| cont = bge.logic.getCurrentController() | ||
| own = cont.owner | ||
| own.collisionCallbacks = [oncollision] | ||
| .. attribute:: localPointA | ||
|
|
||
| The contact point in the owner object space. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: localPointB | ||
|
|
||
| The contact point in the collider object space. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: worldPoint | ||
|
|
||
| The contact point in world space. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: normal | ||
|
|
||
| The contact normal in owner object space. | ||
|
|
||
| :type: :class:`mathutils.Vector` | ||
|
|
||
| .. attribute:: combinedFriction | ||
|
|
||
| The combined friction of the owner and collider object. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: combinedRollingFriction | ||
|
|
||
| The combined rolling friction of the owner and collider object. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: combinedRestitution | ||
|
|
||
| The combined restitution of the owner and collider object. | ||
|
|
||
| :type: float | ||
|
|
||
| .. attribute:: appliedImpulse | ||
|
|
||
| The applied impulse to the owner object. | ||
|
|
||
| :type: float | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| KX_CollisionSensor(SCA_ISensor) | ||
| =============================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`SCA_ISensor` | ||
|
|
||
| .. class:: KX_CollisionSensor(SCA_ISensor) | ||
|
|
||
| Collision sensor detects collisions between objects. | ||
|
|
||
| .. attribute:: propName | ||
|
|
||
| The property or material to collide with. | ||
|
|
||
| :type: string | ||
|
|
||
| .. attribute:: useMaterial | ||
|
|
||
| Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property. | ||
|
|
||
| :type: boolean | ||
|
|
||
| .. attribute:: usePulseCollision | ||
|
|
||
| When enabled, changes to the set of colliding objects generate a pulse. | ||
|
|
||
| :type: boolean | ||
|
|
||
| .. attribute:: hitObject | ||
|
|
||
| The last collided object. (read-only). | ||
|
|
||
| :type: :class:`KX_GameObject` or None | ||
|
|
||
| .. attribute:: hitObjectList | ||
|
|
||
| A list of colliding objects. (read-only). | ||
|
|
||
| :type: :class:`CListValue` of :class:`KX_GameObject` | ||
|
|
||
| .. attribute:: hitMaterial | ||
|
|
||
| The material of the object in the face hit by the ray. (read-only). | ||
|
|
||
| :type: string | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| KX_LodLevel(PyObjectPlus) | ||
| ========================= | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`PyObjectPlus` | ||
|
|
||
| .. class:: KX_LodLevel(PyObjectPlus) | ||
|
|
||
| A single lod level for a game object lod manager. | ||
|
|
||
| .. attribute:: mesh | ||
|
|
||
| The mesh used for this lod level. (read only) | ||
|
|
||
| :type: :class:`RAS_MeshObject` | ||
|
|
||
| .. attribute:: level | ||
|
|
||
| The number of the lod level. (read only) | ||
|
|
||
| :type: integer | ||
|
|
||
| .. attribute:: distance | ||
|
|
||
| Distance to begin using this level of detail. (read only) | ||
|
|
||
| :type: float (0.0 to infinite) | ||
|
|
||
| .. attribute:: hysteresis | ||
|
|
||
| Minimum distance factor change required to transition to the previous level of detail in percent. (read only) | ||
|
|
||
| :type: float [0.0 to 100.0] | ||
|
|
||
| .. attribute:: useMesh | ||
|
|
||
| Return True if the lod level uses a different mesh than the original object mesh. (read only) | ||
|
|
||
| :type: boolean | ||
|
|
||
| .. attribute:: useMaterial | ||
|
|
||
| Return True if the lod level uses a different material than the original object mesh material. (read only) | ||
|
|
||
| :type: boolean | ||
|
|
||
| .. attribute:: useHysteresis | ||
|
|
||
| Return true if the lod level uses hysteresis override. (read only) | ||
|
|
||
| :type: boolean |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| KX_LodManager(PyObjectPlus) | ||
| =========================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`PyObjectPlus` | ||
|
|
||
| .. class:: KX_LodManager(PyObjectPlus) | ||
|
|
||
| This class contains a list of all levels of detail used by a game object. | ||
|
|
||
| .. attribute:: levels | ||
|
|
||
| Return the list of all levels of detail of the lod manager. | ||
|
|
||
| :type: list of :class:`KX_LodLevel` | ||
|
|
||
| .. attribute:: distanceFactor | ||
|
|
||
| Method to multiply the distance to the camera. | ||
|
|
||
| :type: float |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| SCA_InputEvent(PyObjectPlus) | ||
| ============================ | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`PyObjectPlus` | ||
|
|
||
| .. class:: SCA_InputEvent(PyObjectPlus) | ||
|
|
||
| Events for a keyboard or mouse input. | ||
|
|
||
| .. attribute:: status | ||
|
|
||
| A list of existing status of the input from the last frame. | ||
| Can contain :data:`bge.logic.KX_INPUT_NONE` and :data:`bge.logic.KX_INPUT_ACTIVE`. | ||
| The list always contains one value. | ||
| The first value of the list is the last value of the list in the last frame. (read-only) | ||
|
|
||
| :type: list of integer. | ||
|
|
||
| .. attribute:: queue | ||
|
|
||
| A list of existing events of the input from the last frame. | ||
| Can contain :data:`bge.logic.KX_INPUT_JUST_ACTIVATED` and :data:`bge.logic.KX_INPUT_JUST_RELEASED`. | ||
| The list can be empty. (read-only) | ||
|
|
||
| :type: list of integer. | ||
|
|
||
| .. attribute:: values | ||
|
|
||
| A list of existing value of the input from the last frame. | ||
| For keyboard it contains 1 or 0 and for mouse the coordinate of the mouse or the movement of the wheel mouse. | ||
| The list contains always one value, the size of the list is the same than :data:`queue` + 1 only for keyboard inputs. | ||
| The first value of the list is the last value of the list in the last frame. (read-only) | ||
|
|
||
| Example to get the non-normalized mouse coordinates: | ||
|
|
||
| .. code-block:: python | ||
| import bge | ||
| x = bge.logic.mouse.inputs[bge.events.MOUSEX].values[-1] | ||
| y = bge.logic.mouse.inputs[bge.events.MOUSEY].values[-1] | ||
| print("Mouse non-normalized position: x: {0}, y: {1}".format(x, y)) | ||
| :type: list of integer. | ||
|
|
||
| .. attribute:: type | ||
|
|
||
| The type of the input. | ||
| One of :ref:`these constants<keyboard-keys>` | ||
|
|
||
| :type: integer |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| SCA_VibrationActuator(SCA_IActuator) | ||
| ==================================== | ||
|
|
||
| .. module:: bge.types | ||
|
|
||
| base class --- :class:`SCA_IActuator` | ||
|
|
||
| .. class:: SCA_VibrationActuator(SCA_IActuator) | ||
|
|
||
| Vibration Actuator. | ||
|
|
||
| .. attribute:: joyindex | ||
|
|
||
| Joystick index. | ||
|
|
||
| :type: integer (0 to 7) | ||
|
|
||
| .. attribute:: strengthLeft | ||
|
|
||
| Strength of the Low frequency joystick's motor (placed at left position usually). | ||
|
|
||
| :type: float (0.0 to 1.0) | ||
|
|
||
| .. attribute:: strengthRight | ||
|
|
||
| Strength of the High frequency joystick's motor (placed at right position usually). | ||
|
|
||
| :type: float (0.0 to 1.0) | ||
|
|
||
| .. attribute:: duration | ||
|
|
||
| Duration of the vibration in milliseconds. | ||
|
|
||
| :type: integer (0 to infinite) | ||
|
|
||
| .. attribute:: isVibrating | ||
|
|
||
| Check status of joystick vibration | ||
|
|
||
| :type: bool (true vibrating and false stopped) | ||
|
|
||
| .. attribute:: hasVibration | ||
|
|
||
| Check if the joystick supports vibration | ||
|
|
||
| :type: bool (true supported and false not supported) | ||
|
|
||
| .. method:: startVibration() | ||
|
|
||
| Starts the vibration. | ||
|
|
||
| :return: None | ||
|
|
||
| .. method:: stopVibration() | ||
|
|
||
| Stops the vibration. | ||
|
|
||
| :return: None | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * ***** BEGIN GPL LICENSE BLOCK ***** | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public License | ||
| * as published by the Free Software Foundation; either version 2 | ||
| * of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| * | ||
| * Contributor(s): Tristan Porteries. | ||
| * | ||
| * ***** END GPL LICENSE BLOCK ***** | ||
| */ | ||
|
|
||
| /** \file moto/include/MT_Config.h | ||
| * \ingroup moto | ||
| */ | ||
|
|
||
| #define GEN_INLINED |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * ***** BEGIN GPL LICENSE BLOCK ***** | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public License | ||
| * as published by the Free Software Foundation; either version 2 | ||
| * of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| * | ||
| * Contributor(s): Tristan Porteries. | ||
| * | ||
| * ***** END GPL LICENSE BLOCK ***** | ||
| */ | ||
|
|
||
| /** \file moto/include/MT_Frustum.h | ||
| * \ingroup moto | ||
| */ | ||
|
|
||
| #ifndef __MT_FRUSTUM_H__ | ||
| #define __MT_FRUSTUM_H__ | ||
|
|
||
| #include "MT_Config.h" | ||
| #include "MT_Matrix4x4.h" | ||
|
|
||
| #include <array> | ||
|
|
||
| void MT_FrustumBox(const MT_Matrix4x4& mat, std::array<MT_Vector3, 8>& box); | ||
| void MT_FrustumAabb(const MT_Matrix4x4& mat, MT_Vector3& min, MT_Vector3& max); | ||
|
|
||
| #ifdef GEN_INLINED | ||
| # include "MT_Frustum.inl" | ||
| #endif | ||
|
|
||
| #endif // __MT_FRUSTUM_H__ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * ***** BEGIN GPL LICENSE BLOCK ***** | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public License | ||
| * as published by the Free Software Foundation; either version 2 | ||
| * of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| * | ||
| * Contributor(s): Tristan Porteries. | ||
| * | ||
| * ***** END GPL LICENSE BLOCK ***** | ||
| */ | ||
|
|
||
| /** \file moto/include/MT_Frustum.inl | ||
| * \ingroup moto | ||
| */ | ||
|
|
||
| #include "MT_Optimize.h" | ||
|
|
||
| static const MT_Vector3 normalizedBox[8] = { | ||
| MT_Vector3(-1.0f, -1.0f, -1.0f), | ||
| MT_Vector3(-1.0f, 1.0f, -1.0f), | ||
| MT_Vector3(1.0f, 1.0f, -1.0f), | ||
| MT_Vector3(1.0f, -1.0f, -1.0f), | ||
| MT_Vector3(-1.0f, -1.0f, 1.0f), | ||
| MT_Vector3(-1.0f, 1.0f, 1.0f), | ||
| MT_Vector3(1.0f, 1.0f, 1.0f), | ||
| MT_Vector3(1.0f, -1.0f, 1.0f) | ||
| }; | ||
|
|
||
| GEN_INLINE void MT_FrustumBox(const MT_Matrix4x4& mat, std::array<MT_Vector3, 8>& box) | ||
| { | ||
| for (unsigned short i = 0; i < 8; ++i) { | ||
| const MT_Vector3& p3 = normalizedBox[i]; | ||
| const MT_Vector4 p4 = mat * MT_Vector4(p3.x(), p3.y(), p3.z(), 1.0f); | ||
|
|
||
| box[i] = p4.to3d() / p4.w(); | ||
| } | ||
| } | ||
|
|
||
| GEN_INLINE void MT_FrustumAabb(const MT_Matrix4x4& mat, MT_Vector3& min, MT_Vector3& max) | ||
| { | ||
| for (unsigned short i = 0; i < 8; ++i) { | ||
| const MT_Vector3& p3 = normalizedBox[i]; | ||
| const MT_Vector4 p4 = mat * MT_Vector4(p3.x(), p3.y(), p3.z(), 1.0f); | ||
| const MT_Vector3 co = p4.to3d() / p4.w(); | ||
|
|
||
| if (i == 0) { | ||
| min = max = co; | ||
| } | ||
| else { | ||
| for (unsigned short axis = 0; axis < 3; ++axis) { | ||
| min[axis] = std::min(min[axis], co[axis]); | ||
| max[axis] = std::max(max[axis], co[axis]); | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * ***** BEGIN GPL LICENSE BLOCK ***** | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public License | ||
| * as published by the Free Software Foundation; either version 2 | ||
| * of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| * | ||
| * Contributor(s): Tristan Porteries. | ||
| * | ||
| * ***** END GPL LICENSE BLOCK ***** | ||
| */ | ||
|
|
||
| /** \file moto/include/MT_Frustum.cpp | ||
| * \ingroup moto | ||
| */ | ||
|
|
||
|
|
||
| #include "MT_Frustum.h" | ||
|
|
||
| #ifndef GEN_INLINED | ||
| # include "MT_Frustum.inl" | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # ***** BEGIN GPL LICENSE BLOCK ***** | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, write to the Free Software Foundation, | ||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| # | ||
| # ***** END GPL LICENSE BLOCK ***** | ||
|
|
||
| set(INC | ||
| . | ||
| ) | ||
|
|
||
| set(INC_SYS | ||
|
|
||
| ) | ||
|
|
||
| set(SRC | ||
| SpindleEncryption.cpp | ||
|
|
||
| SpindleEncryption.h | ||
| ) | ||
|
|
||
|
|
||
| blender_add_lib(bf_intern_spindle "${SRC}" "${INC}" "${INC_SYS}") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /** | ||
| * ***** BEGIN MIT LICENSE BLOCK ***** | ||
| * Copyright (C) 2011-2012 by DeltaSpeeds | ||
| * All rights reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| * | ||
| * The Original Code is: all of this file. | ||
| * | ||
| * Contributor(s): none yet. | ||
| * | ||
| * ***** END MIT LICENSE BLOCK ***** | ||
| */ | ||
|
|
||
| #ifndef __SPINDLEENCRYPTION_H__ | ||
| #define __SPINDLEENCRYPTION_H__ | ||
|
|
||
|
|
||
| #define SPINDLE_NO_ENCRYPTION 0 | ||
| #define SPINDLE_STATIC_ENCRYPTION 1 | ||
| #define SPINDLE_DYNAMIC_ENCRYPTION 2 | ||
|
|
||
|
|
||
| #ifdef __cplusplus | ||
| #include <string> | ||
| std::string SPINDLE_FindAndSetEncryptionKeys(char **argv, int i); | ||
| void SPINDLE_SetFilePath(std::string path); | ||
|
|
||
| extern "C" { | ||
| #endif | ||
| char *SPINDLE_DecryptFromFile(const char *filename, int *fileSize, const char *encryptKey, int typeEncryption); | ||
| int SPINDLE_CheckEncryptionFromFile(const char *filepath); | ||
| void SPINDLE_SetFilePath(const char *filepath); | ||
| const char *SPINDLE_GetFilePath(void); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif // __SPINDLEENCRYPTION_H__ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| Copyright (c) 2013 by Igor Kalnitsky. | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms of the software as well | ||
| as documentation, with or without modification, are permitted provided | ||
| that the following conditions are met: | ||
|
|
||
| * Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
|
|
||
| * Redistributions in binary form must reproduce the above | ||
| copyright notice, this list of conditions and the following | ||
| disclaimer in the documentation and/or other materials provided | ||
| with the distribution. | ||
|
|
||
| * The names of the contributors may not be used to endorse or | ||
| promote products derived from this software without specific | ||
| prior written permission. | ||
|
|
||
| THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND | ||
| CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
| NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER | ||
| OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
| DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // termcolor // | ||
|
|
||
| a library for printing colored messages | ||
|
|
||
| by Igor Kalnitsky | ||
|
|
||
|
|
||
| ~ What is termcolor? | ||
|
|
||
| Termcolor is a header-only C++ library for printing colored | ||
| messages to the terminal. Written just for fun with a help of | ||
| the Force. | ||
|
|
||
| And yeah, it's BSD licensed so you are free to do whatever you | ||
| want as long as copyright sticks around! | ||
|
|
||
|
|
||
| ~ How to use? | ||
|
|
||
| Add `termcolor.hpp` to the project and use provided stream | ||
| manimulators from the `termcolor` namespace. | ||
|
|
||
| For example: | ||
|
|
||
| std::cout << termcolor::red << termcolor::on_blue | ||
| << "Red text on blue background!" | ||
| << termcolor::reset << std::endl; | ||
|
|
||
| Please, don't forgot to reset termcolor's settings on the stream! | ||
|
|
||
|
|
||
| ~ What terminals are supported? | ||
|
|
||
| Termcolor supports ANSI color formatting. This formatting is | ||
| supported by most popular terminals on Linux, Unix and Mac OS. | ||
| On Windows, WinAPI is used instead, however, some limitations | ||
| are applied. Check the docs for details! | ||
|
|
||
|
|
||
| ~ Where the docs? | ||
|
|
||
| https://termcolor.readthedocs.io/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -82,7 +82,7 @@ endif() | ||
|
|
||
| if(WITH_GAMEENGINE) | ||
| list(APPEND INC | ||
| ../../../gameengine/Launcher | ||
| ) | ||
| add_definitions(-DWITH_GAMEENGINE) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| out vec4 fragColor; | ||
|
|
||
| void main() | ||
| { | ||
| fragColor = vec4(0.0, 0.0, 0.0, 1.0); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| uniform mat4 ModelViewProjectionMatrix; | ||
|
|
||
| in vec3 pos; | ||
|
|
||
| void main() | ||
| { | ||
| gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| in vec4 texcovar; | ||
| out vec4 fragColor; | ||
|
|
||
| #if defined(ANAGLYPH) || defined(STIPPLE) | ||
| uniform sampler2D lefteyetex; | ||
| uniform sampler2D righteyetex; | ||
| #else | ||
| uniform sampler2D colortex; | ||
| # ifdef DEPTH | ||
| uniform sampler2D depthtex; | ||
| # endif | ||
| #endif | ||
|
|
||
| #ifdef STIPPLE | ||
| #define STIPPLE_COLUMN 0 | ||
| #define STIPPLE_ROW 1 | ||
|
|
||
| uniform int stippleid; | ||
| #endif | ||
|
|
||
| void main() | ||
| { | ||
| vec2 co = texcovar.xy; | ||
| #ifdef STIPPLE | ||
| if (stippleid == STIPPLE_ROW) { | ||
| int result = int(mod(gl_FragCoord.y, 2)); | ||
| if (result != 0) { | ||
| fragColor = texture2D(lefteyetex, co); | ||
| } | ||
| else { | ||
| fragColor = texture2D(righteyetex, co); | ||
| } | ||
| } | ||
| else if (stippleid == STIPPLE_COLUMN) { | ||
| int result = int(mod(gl_FragCoord.x, 2)); | ||
| if (result == 0) { | ||
| fragColor = texture2D(lefteyetex, co); | ||
| } | ||
| else { | ||
| fragColor = texture2D(righteyetex, co); | ||
| } | ||
| } | ||
| #elif defined(ANAGLYPH) | ||
| fragColor = vec4(texture2D(lefteyetex, co).r, texture2D(righteyetex, co).gb, 1.0); | ||
| #else | ||
| fragColor = texture2D(colortex, co); | ||
| # ifdef DEPTH | ||
| gl_FragDepth = texture2D(depthtex, co).x; | ||
| # endif | ||
| #endif | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| in vec4 bgl_InPosition; | ||
| in vec2 bgl_InTexCoord; | ||
|
|
||
| out vec4 texcovar; | ||
|
|
||
| void main() | ||
| { | ||
| gl_Position = bgl_InPosition; | ||
| texcovar = vec4(bgl_InTexCoord, 0.0, 0.0); | ||
| } |