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()

                but this is wrong I know how else can I do this?

                collision, wall_normal = r
                hypo = vec.length() * self.radius - (new_center >> 
collision).length()
                correction = wall_normal * hypo
                self.speed+=correction
                new_center+=correction

                ...     


class object(soya.World):
        def __init__(self, parent, info):
                soya.World.__init__(self,parent)
                self.info=info
        def give_info(self):
                return self.info

...

TIA

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

Reply via email to