コード例 #1
0
ファイル: navigationcell.cpp プロジェクト: kasicass/kasicass
//:	ForcePointToCellCollumn
//----------------------------------------------------------------------------------------
//
//	Force a 3D point to the interior cell by forcing it to the interior of each wall 
//
//-------------------------------------------------------------------------------------://
bool NavigationCell::ForcePointToCellCollumn(vector3& TestPoint)const
{
	vector2 TestPoint2D(TestPoint.x,TestPoint.z);
	bool PointAltered = ForcePointToCellCollumn(TestPoint2D);

	if (PointAltered)
	{
		TestPoint.x=TestPoint2D.x;
		TestPoint.z=TestPoint2D.y;
	}
	return (PointAltered);
}
コード例 #2
0
ファイル: navigationcell.cpp プロジェクト: kasicass/kasicass
//:	ForcePointToWallInterior
//----------------------------------------------------------------------------------------
//
//	Force a 3D point to the interior side of the specified wall. 
//
//-------------------------------------------------------------------------------------://
bool NavigationCell::ForcePointToWallInterior(CELL_SIDE SideNumber, vector3& TestPoint)const
{
	vector2 TestPoint2D(TestPoint.x,TestPoint.z);
	bool PointAltered = ForcePointToWallInterior(SideNumber, TestPoint2D);

	if (PointAltered)
	{
		TestPoint.x = TestPoint2D.x;
		TestPoint.z = TestPoint2D.y;
	}

	return (PointAltered);
}
コード例 #3
0
bool UnitTest::Test2D() {
    cout << endl << "Testing 2D module" << endl;

    bool temp_result;

    temp_result = TestPoint2D();
    cout << "Point 2D test: ";
    if (temp_result) {
        cout << "succeeded" << endl;
    } else {
        cout << "failed" << endl;
        return false;
    }

    return true;
}