$TypeMask for RigidShape?
by Nicolai Dutka · in General Discussion · 01/14/2010 (12:30 pm) · 6 replies
I couldn't find a $TypeMask specific to rigid shapes. I found the $TypeMask 'ShapeBaseObjectType' works for identifying a Rigid Shape, unfortunately it also identifies the Player using the same $TypeMask. Yet... I see a $TypeMask specifically for players 'PlayerObjectType'. So why does the player object type get 2 $TypeMasks (ShapeBaseObjectType and PlayerObjectType), but Rigid Shapes only fall under the one 'ShapeBaseObejctType'? Now I can't use $TypeMask to search for JUST Rigid Shapes because the search is returning players before it ever reaches the Rigid Shape due to the player counting as a ShapeBaseObjectType... So is there a $TypeMask specific to Rigid Shapes that I don't know about, or is there an easy way to add one?
#2
01/20/2010 (3:02 pm)
Apparently not. Rigidshape doesn't appear to have it's own stock typemask and uses ShapeBaseObjectType. You could try adding your own typemesk into the code....
#3
Why would the Player get 2 TypeMasks and share one with rigid shapes anyway?
01/20/2010 (5:32 pm)
Ya... I don't suppose you could point me to a guide for that?Why would the Player get 2 TypeMasks and share one with rigid shapes anyway?
#4
Never messed with custom typemasks, there should be some comments in objecttypes.h that might help.
Alternatively you could use shapebaseobjecttype, then throw in an extra classname check to see if it's a rigidshape.
off the top of my head (psuedocode)
01/20/2010 (6:01 pm)
Technically AIplayer gets even more masks.Never messed with custom typemasks, there should be some comments in objecttypes.h that might help.
Alternatively you could use shapebaseobjecttype, then throw in an extra classname check to see if it's a rigidshape.
off the top of my head (psuedocode)
if (%obj.getClassName() $= "RigidShape")
{
echo("It's a rigidshape");
//do funky stuff
}
else
{
echo("not a rigidshape");
return;
}
#5
01/20/2010 (6:06 pm)
Nice one thanks!
#6
01/21/2010 (2:51 am)
RigidShape uses the Vehicle object typemask - you can see where it's added in RigidShape::RigidShape(). A holdover from the original resource, which was basically just the HoverVehicle class gutted. It's pretty easy to add a new typemask for RigidShapes - you just need to make sure you add it into all the relevant checks, basically wherever VehicleObjectType is used.
Torque 3D Owner Nicolai Dutka