RayCasting in Blender 2.59

Hello everyone,

I hope someone can help me because i’m new in Blender coding and the different version of Blender have important differences so I’m a bit lost.

I’m actually searching to do a Raycast to find from a little sphere in the scene, the collision point with a mesh. I tried ray_cast but it returns everytime Vector(0.0, 0.0, 0.0) for the hit point which is what i’m interested in. I saw that rayCast existed too but don’t know on which object I can apply it.
I’ve been seeking for some kind of real API for python in Blender but can’t find any good documentation.

So to make it short I would like someone to explain how he uses the raycasting stuff.

Thanks a lot and sorry if it has already been explained I know that it must seem obvious for some poeple. If someone has a good link I’ll watch too. I’m sure I haven’t seen all the website of the world concerning Blender (python)scripting.

Crosell

Ray cast is quite simple.

There are two forms that you could use:
1)object.rayCastTo(object / position,range,property)
http://www.tutorialsforblender3d.com/GameModule/ClassKX_GameObject_22.html

2)anyobject.rayCast(object2,object1,range,useface?,usexray?,returnPoly?)
http://www.tutorialsforblender3d.com/GameModule/ClassKX_GameObject_21.html