Game Development Community

TypeMasks and Raycast

by DMT · in Torque 3D Beginner · 06/11/2010 (2:04 pm) · 4 replies

I am trying to catch a StaticShape in a raycast. I believe the typemask of a staticshape to be one of the following :

ShapeBaseObjectType
StaticObjectType
StaticRenderedObjectType
StaticShapeObjectType

I am not sure which to use so I used them all. I still did not manage to get any hits from the raycast when clicking the staticshape object.

The object is defined in the following datablock :

datablock StaticShapeData(Door)
{
shapeFile="art/shapes/door/door.dts";
category="Door";
};

So my questions are as follows :

1. What is the correct type mask of staticshape?
2. Am I supposed to define a form of collision for my shape?
3. Is this not working for some other reason?

Thanks.

#1
06/30/2010 (11:39 am)
Bump!
#2
06/30/2010 (12:01 pm)
1. StaticShapeObjectType, which is also part of ShapeBaseObjectType

2. Yes. No collision mesh = nothing for a ray to collide with.

Read up on setting up the heirarchy for models in the Support ->Documentation ->Artists section of this website.
#3
06/30/2010 (12:22 pm)
Thanks for the information! I am looking into it.
#4
07/02/2010 (2:14 pm)
(I only just became aware of the differences in the type of possible collision. Pardon my ignorance.)

To clarify : Can I set the StaticShape object to collide on it's visible mesh?


Another question on the same topic :

I made an Item and I want to have that hit by a raycast. I have set it to collidable in the world editor but I have had no luck in getting it to respond. I am currently using the ItemObjectType(as well as the ones mentioned above) to find it, I am not even sure if this is a real type.