Game Development Community

CastRay and MountedImages

by Markus Nuebel · in Torque Game Engine · 11/26/2004 (12:39 am) · 2 replies

For a more precise hand-to-hand combat collision detection, I want to detect collisions with mounted images.

Hand-to-hand weapons are doing damage, when something collides with a ray, that is casted from the weapons start-damage-node to it's end-damage-node.

In fact all I want is to do a raycast against a mounted image.

In server code I am checking a mount slot and executing castRay() on the images [i]imageInstance[i] member.

MountedImage& image = mMountedImageList[imageSlot];
   TSShapeInstance* imageInstance = image.shapeInstance;
...

   RayInfo rinfo;
   
   if(imageInstance->castRay(vecStart, vecEnd, &rinfo, 0))
      ret = rinfo.object->getId();

Unfortunately there is never a collision detected.

So what am I doing wrong here?
Isn't TSShapeInstance::castRay() checking itself against a collision with the ray?
Or maybe theShapeImage needs to be transformed by the mountTranform beforehand? (Could not find out, if this is necessary).

Any help, pointers or other suggestions?

Thanks
Markus

#1
11/27/2004 (4:43 am)
Noone who can help me with this ?
#2
11/27/2004 (6:57 pm)
Take a look at one of the melee resources , the one with hitboxes in that code you have detection against mounted weapons.
I have some weapon detection in script but i have problems sorting the raycast so the sword hits the player sometimes :)