예제 #1
0
        public void ToWorld(Vector3f[] vScenePoints, int nBatchSize)
        {
            int nBatches = vScenePoints.Length / nBatchSize;

            uint[] keys = new uint[nBatchSize];

            for (int j = 0; j <= nBatches; ++j)
            {
                StoredCommands sc       = new StoredCommands();
                int            iStart   = j * nBatchSize;
                int            iUseSize = (j == nBatches) ? (vScenePoints.Length - nBatches * nBatchSize) : nBatchSize;
                for (int k = 0; k < iUseSize; ++k)
                {
                    if (vScenePoints[iStart + k] != Vector3f.Invalid)
                    {
                        floatArray f = vScenePoints[iStart + k].toFloatArray();
                        keys[k] = sc.AppendQueryCommand_ConvertPointToWorld(f.cast());
                    }
                }
                ExecuteCommands(sc);
                for (int k = 0; k < iUseSize; ++k)
                {
                    if (vScenePoints[iStart + k] != Vector3f.Invalid)
                    {
                        floatArray f = vScenePoints[iStart + k].toFloatArray();
                        sc.GetQueryResult_ConvertPointToScene(keys[k], f.cast());
                        vScenePoints[iStart + k] = g3Extensions.ToVector3f(f);
                    }
                }
            }
        }
예제 #2
0
        public Vector3 ToWorld(Vector3 vScene)
        {
            StoredCommands sc  = new StoredCommands();
            floatArray     f   = vScene.toFloatArray();
            uint           key = sc.AppendQueryCommand_ConvertPointToWorld(f.cast());

            ExecuteCommands(sc);
            sc.GetQueryResult_ConvertPointToWorld(key, f.cast());
            return(new Vector3(f));
        }