ContainerRayCast help
by Howard Dortch · in Torque Game Engine · 07/14/2004 (8:04 am) · 4 replies
Here is what I have. %eyeTransform is the bot and returns valid data. %ppos is me and returns valid data. Both are valid because I can echo the values and they are correct. The mask I got from another function.
%losResult always returns 0 no matter what. I move my character all around in front of the bot and can see the locations change, I move behind the bot, circle the bot and %losResult is always 0.
Anyone tell me what im doing wrong here?
%eyeTransform = %this.getEyeTransform();
%eyePoint = firstWord(%eyeTransform)
SPC getWord(%eyeTransform, 1)
SPC getWord(%eyeTransform, 2);
%ppos = %object.getPosition();
%x = getWord(%ppos, 0);
%y = getWord(%ppos, 1);
%z = getWord(%ppos, 2);
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType;
%losResult = containerRayCast(%eyePoint, %ppos, %mask);
%losResult always returns 0 no matter what. I move my character all around in front of the bot and can see the locations change, I move behind the bot, circle the bot and %losResult is always 0.
Anyone tell me what im doing wrong here?
%eyeTransform = %this.getEyeTransform();
%eyePoint = firstWord(%eyeTransform)
SPC getWord(%eyeTransform, 1)
SPC getWord(%eyeTransform, 2);
%ppos = %object.getPosition();
%x = getWord(%ppos, 0);
%y = getWord(%ppos, 1);
%z = getWord(%ppos, 2);
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType;
%losResult = containerRayCast(%eyePoint, %ppos, %mask);
#2
07/14/2004 (8:59 am)
Isn't ShapeBaseObjectType like me or my character? thats the one target I want to hit so wasn't sure if I should mask that out.
#3
07/14/2004 (9:17 am)
You're thinking of the mask backwards. It defines the included set.
#4
07/14/2004 (9:20 am)
Ah, another mystery solved.. thanks.
Torque Owner Owen Ortmayer