Game Development Community

Projectile Collision only at pivot point?

by Alan Kennedy · in Torque Game Engine · 11/17/2003 (10:22 am) · 1 replies

Hi there. I was playing arround with Projectiles, and noticed (at least with my projectile dts, and everything), that the projectile collides with an object, only when it's pivot point collides.

I'm using as projectile, a simple sphere with a 6 sided sphere collision shape. If i use the exported DTS, as a StaticShape, the collision shape works just fine (you can collide into the different faces).

But, the projectile itself (using the same exported dts, cannonball.dts), won't correctly collide into other objects (including the StaticShape mentioned before).

My only guess is that the collision scheme used at Projectile class (derived from GameBase), is different from the one used at other objects such as Player, Items, StaticShape, etc (derived from ShapeBase which overrides the rayCast method declared at SceneObject).

Finally, the thing is, i want my projectile (a sphere), to collide correctly as a sphere would do, into other objects, and not only when it's pivot point collides another collision shape.

Regards, Alan //

#1
11/25/2003 (6:20 pm)
Projectile collision in base TGE currently only handles raycast collisions. Which means, that regardless of the shape or size of your projectile object (or the collision you put on it -- which, incidentally isn't used as far as I can see), it'll only collide if it's centre hits something.

It's not particularly difficult to add a bounding box or convex collision to projectiles -- though, I doubt anyone who's done it will bother posting any code for it (myself included).