On Thu, 25 May 2006 20:37:26 +0200
Jan Filip Tristan <[EMAIL PROTECTED]> wrote:

> Am Freitag, 19. Mai 2006 19:24 schrieb Jan Filip Tristan:
> 
> I really nead an answer, please:
> 
> I have got this
> 
> ...
> class Player(soya.World):
>       this is the object I can move and in the class is the defination 
> move(self)
>       
>       there is this:
> 
>       ...
> 
>       context = scene.RaypickContext(new_center, max(self.radius, 0.1 + 
> self.radius_y))
>       new_center = self.center + self.speed
>       for vec in (self.left, self.right, self.front, self.back,self.up):
>       r = context.raypick(new_center, vec, self.radius, 1, 1)
>       if r:
>               
>               and here if I run into the object I want to run the defination 
> of the class 
> object give_info() maybe like this:
>               r.give_info()

Oh, now I understand your question.

raypick(...) doesn't return the object hit by the ray, but a tuple with the 
position of the hit and the normal at this position. To get the object hit, do: 
r[0].parent (Soya garantees that the parent of the hit point is the object hit 
by the ray).

Thus:

      r[0].parent.give_info()

Jiba

_______________________________________________
Soya-user mailing list
[email protected]
https://mail.gna.org/listinfo/soya-user

Reply via email to