Game Development Community

ShapeImage Collisions

by Matt Jolly · in Torque Game Engine · 12/29/2008 (5:02 am) · 1 replies

How hard would it be to enable collisions for ShapeImages? Especially if it had to work like player, vehicle, and item collisions, where they call notifyCollision on other objects instead of queuing collisions that other objects call on them (assuming I'm reading this code right). I see evidence of the latter in the ShapeBase code, but since I'm trying to implement collisions for melee weapons, I need them to act like players/items and check for collisions with other objects themselves. So basically, I need active collision checking in a class that uses passive collision checking (as far as I can tell).

I know I could cast a ray and use the results of that for collision, but not all my weapons would work well with that method--the morning star, for instance. Therefore I'd much rather have the flexibility of a collision mesh to work with.

If someone could at least tell me point me in the right direction, I'd greatly appreciate it.

Note: I don't really understand Torque's collision system all that well, so if none of this made sense, I apologize.

#1
12/29/2008 (5:48 am)
No need to apologize.

Quote:
How hard would it be to enable collisions for ShapeImages?

As always this depends on your experience with Torque and programming in general. It also depends what your definition of "collision" means in this case. RayCastable collisions are so much simpler to implement (again, in this case) than movement collisions, which will be much more difficult.

Quote:
I know I could cast a ray and use the results of that for collision, but not all my weapons would work well with that method--the morning star, for instance.

You just don't do it this way with weapons, because weapons can exist in large numbers and what you're proposing is not efficient. If you do want to go down this path, feel free of course :) it's just not simple by any stretch.

It doesn't really have anything to do with Torque, it's just that this is highly specific to a few games out there, like fighting games, where you only have several characters in the simulation at once where you can afford full physics simulation on a weapon. Torque was never made for this, and few engines are.

There was a game a few years back that implemented a pretty nice collision system for their weapons, and it used a Unreal 2002 license I believe.. that system was made up of clever positioning of raycasts. You just need to cast multiple ones, if you want it more accurate.

Edit: Obviously, if you're doing a real simulation and not a game, then this is different. But for a game the different won't be noticable.