Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.KX_MouseFocusSensor.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d7eb007c1e31e57c649d0498b51a729b63d127e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
KX_MouseFocusSensor(SCA_MouseSensor)
====================================

base class --- :class:`SCA_MouseSensor`

.. class:: KX_MouseFocusSensor(SCA_MouseSensor)

   The mouse focus sensor detects when the mouse is over the current game object.

   The mouse focus sensor works by transforming the mouse coordinates from 2d device
   space to 3d space then raycasting away from the camera.

   .. attribute:: raySource

      The worldspace source of the ray (the view position).

      :type: list (vector of 3 floats)

   .. attribute:: rayTarget

      The worldspace target of the ray.

      :type: list (vector of 3 floats)

   .. attribute:: rayDirection

      The :data:`rayTarget` - :class:`raySource` normalized.

      :type: list (normalized vector of 3 floats)

   .. attribute:: hitObject

      the last object the mouse was over.

      :type: :class:`KX_GameObject` or None

   .. attribute:: hitPosition

      The worldspace position of the ray intersecton.

      :type: list (vector of 3 floats)

   .. attribute:: hitNormal

      the worldspace normal from the face at point of intersection.

      :type: list (normalized vector of 3 floats)

   .. attribute:: hitUV

      the UV coordinates at the point of intersection.

      :type: list (vector of 2 floats)

      If the object has no UV mapping, it returns [0, 0].

      The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.

   .. attribute:: usePulseFocus

      When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).

      :type: boolean

   .. attribute:: useXRay

      If enabled it allows the sensor to see through game objects that don't have the selected property or material.

     :type: boolean

   .. attribute:: propName

      The property or material the sensor is looking for.

     :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