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

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

class KX_RaySensor(SCA_ISensor):
	"""
	A ray sensor detects the first object in a given direction.
	
	@ivar property: The property the ray is looking for.
	@type property: string
	@ivar range: The distance of the ray.
	@type range: float
	@ivar useMaterial: Whether or not to look for a material (false = property)
	@type useMaterial: boolean
	@ivar useXRay: Whether or not to use XRay.
	@type useXRay: boolean
	@ivar hitObject: The game object that was hit by the ray. (Read-only)
	@type hitObject: KX_GameObject
	@ivar hitPosition: The position (in worldcoordinates) where the object was hit by the ray. (Read-only)
	@type hitPosition: list [x, y, z]
	@ivar hitNormal: The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (Read-only)
	@type hitNormal: list [x, y, z]
	@ivar rayDirection: The direction from the ray (in worldcoordinates). (Read-only)
	@type rayDirection: list [x, y, z]
	@ivar axis: The axis the ray is pointing on.
	@type axis: int from 0 to 5
		KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z,
		KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z
	"""
	
	def getHitObject():
		"""
		DEPRECATED: Use the hitObject property instead.
		Returns the game object that was hit by this ray.
		
		@rtype: KX_GameObject
		"""
	def getHitPosition():
		"""
		DEPRECATED: Use the hitPosition property instead.
		Returns the position (in worldcoordinates) where the object was hit by this ray.
		
		@rtype: list [x, y, z]
		"""
	def getHitNormal():
		"""
		DEPRECATED: Use the hitNormal property instead.
		Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.
		
		@rtype: list [nx, ny, nz]
		"""
	def getRayDirection():
		"""
		DEPRECATED: Use the rayDirection property instead.
		Returns the direction from the ray (in worldcoordinates)
		
		@rtype: list [dx, dy, dz]
		"""