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

KX_MouseFocusSensor.py « PyDoc « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 24f7716218ba181d2578bc170a2b6feec9a1bff6 (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
# $Id$
# Documentation for KX_MouseFocusSensor
from SCA_MouseSensor import *

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.
	
	@ivar raySource: The worldspace source of the ray (the view position)
	@type raySource: list (vector of 3 floats)
	@ivar rayTarget: The worldspace target of the ray.
	@type rayTarget: list (vector of 3 floats)
	@ivar rayDirection: The L{rayTarget} - L{raySource} normalized.
	@type rayDirection: list (normalized vector of 3 floats)
	@ivar hitObject: the last object the mouse was over.
	@type hitObject: L{KX_GameObject<KX_GameObject.KX_GameObject>} or None
	@ivar hitPosition: The worldspace position of the ray intersecton.
	@type hitPosition: list (vector of 3 floats)
	@ivar hitNormal: the worldspace normal from the face at point of intersection.
	@type hitNormal: list (normalized vector of 3 floats)
	"""
	
	def getHitNormal():
		"""
		Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated})
		 
		@rtype: list [x, y, z]
		@return: the ray collision normal.
		"""
	def getHitObject():
		"""
		Returns the object that was hit by this ray or None. (B{deprecated})
		
		@rtype: L{KX_GameObject} or None
		@return: the collision object.
		"""
	def getHitPosition():
		"""
		Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated})
		
		@rtype: list [x, y, z]
		@return: the ray collision position.
		"""
	def getRayDirection():
		"""
		Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. (B{deprecated})
		
		@rtype: list [x, y, z]
		@return: the ray direction.
		"""
	def getRaySource():
		"""
		Returns the position (in worldcoordinates) the ray was cast from by the mouse. (B{deprecated})
		
		@rtype: list [x, y, z]
		@return: the ray source.
		"""
	def getRayTarget():
		"""
		Returns the target of the ray (in worldcoordinates) that seeks the focus object. (B{deprecated})
		
		@rtype: list [x, y, z]
		@return: the ray target.
		"""