Sorry to trouble, but how do you make a position interval relative to a nodePath?
Basically making
self.model.setY(nodePath,-10)
Into an interval.
Sorry to trouble, but how do you make a position interval relative to a nodePath?
Basically making
self.model.setY(nodePath,-10)
Into an interval.
I dont know but I never needed this - why do you need it for?
You can make an interval relative to a nodePath by specifying it as “other” keyword in the interval constructor.
e.g.
LerpPosInterval(…, other = otherNodePath)
I’m using it to move an object in the direction of impact after I shoot it.
It worked quite well when I used the
self.model.setY(nodePath,-10) technique, with the nodePath referring to the projectile.
Is there a better way, perhaps?
And thanks rdb!
heh but what if the projectile 's traveling along X and Z axis?
I guess you should use fluid collisions, checking the contact normal of the projectile then use that normal to move your victim. Anyhow I actually ain’t never done this but I will for sure and add it to my bunch of collision snippets one day.
Ah, for now, I don’t have to worry, it can only travel straight forward.
But… I do have to wonder. Can you please tell me how normals work? I keep hearing about it, it seems really really interesting, but I don’t know how it works… As in, what are normals?
hope not to be wrong cos I’m not a math geek, normals are the same to say vector in math stuff - usually they tells which way is oriented a surface and the panda3D collision system I know can tell which way a i.e. collision ray is exactly piercing a polygon: its coordinate point of penetration and the ray orientation (its normal vector). Hope soon to come back with a snippet to show you.