Game Development Community

Using t2dSceneGraph.pickLine

by Michael Irby II · in Torque Game Builder · 04/25/2006 (8:37 pm) · 1 replies

In the reference pdf for T2D it says that you send this method group and layer masks to specify to the scenegraph which layers and groups to search through....at first I sent the method masks for layers and groups I wanted it to search through....when doing that I was getting back all teh objects that were NOT in the masks that I specified....so...then I thought maybe the docs were backward so then I specified as the masks the groups and layers that I did not want to be searched.....that returned pretty much nothing.....do not know what is wrong with my call...
%objectsString=mainSceneGraph.pickLine(%rayStart,%rayEnd,BIT($NonFieldGroups), BIT($NonFieldObjects));
$NonFieldGroups and NonFieldObjects are OR masks of a number of layers and groups.....
....

#1
04/25/2006 (10:28 pm)
Here is some code from spacescroller demo that demonstrates how to use BIT()

// --------------------------------------------------------------------
// Collision Constants.
// --------------------------------------------------------------------
$playerCollisionGroups= BIT(1)|BIT(2);
$enemyCollisionGroups = BIT(3)|BIT(4);
$playerCollisionLayers = BIT(10)|BIT(9);
$enemyCollisionLayers = BIT(15)|BIT(14);
$upgradeCollisionGroups = BIT(5);
$upgradeCollisionLayers = BIT(5);