@ -333,31 +333,9 @@ namespace
dst . rotation . mValues [ column ] [ row ] = src . getBasis ( ) . getRow ( row ) [ column ] ;
dst . rotation . mValues [ column ] [ row ] = src . getBasis ( ) . getRow ( row ) [ column ] ;
}
}
struct NifFileMock : Nif : : File
{
MOCK_METHOD ( Nif : : Record * , getRecord , ( std : : size_t ) , ( const , override ) ) ;
MOCK_METHOD ( std : : size_t , numRecords , ( ) , ( const , override ) ) ;
MOCK_METHOD ( Nif : : Record * , getRoot , ( std : : size_t ) , ( const , override ) ) ;
MOCK_METHOD ( std : : size_t , numRoots , ( ) , ( const , override ) ) ;
MOCK_METHOD ( std : : string , getString , ( uint32_t ) , ( const , override ) ) ;
MOCK_METHOD ( void , setUseSkinning , ( bool ) , ( override ) ) ;
MOCK_METHOD ( bool , getUseSkinning , ( ) , ( const , override ) ) ;
MOCK_METHOD ( std : : filesystem : : path , getFilename , ( ) , ( const , override ) ) ;
MOCK_METHOD ( std : : string , getHash , ( ) , ( const , override ) ) ;
MOCK_METHOD ( unsigned int , getVersion , ( ) , ( const , override ) ) ;
MOCK_METHOD ( unsigned int , getUserVersion , ( ) , ( const , override ) ) ;
MOCK_METHOD ( unsigned int , getBethVersion , ( ) , ( const , override ) ) ;
} ;
struct RecordMock : Nif : : Record
{
MOCK_METHOD ( void , read , ( Nif : : NIFStream * nif ) , ( override ) ) ;
} ;
struct TestBulletNifLoader : Test
struct TestBulletNifLoader : Test
{
{
BulletNifLoader mLoader ;
BulletNifLoader mLoader ;
const StrictMock < const NifFileMock > mNifFile ;
Nif : : Node mNode ;
Nif : : Node mNode ;
Nif : : Node mNode2 ;
Nif : : Node mNode2 ;
Nif : : NiNode mNiNode ;
Nif : : NiNode mNiNode ;
@ -412,16 +390,15 @@ namespace
= { osg : : Vec3f ( 0 , 0 , 0 ) , osg : : Vec3f ( 1 , 0 , 0 ) , osg : : Vec3f ( 1 , 1 , 0 ) , osg : : Vec3f ( 0 , 1 , 0 ) } ;
= { osg : : Vec3f ( 0 , 0 , 0 ) , osg : : Vec3f ( 1 , 0 , 0 ) , osg : : Vec3f ( 1 , 1 , 0 ) , osg : : Vec3f ( 0 , 1 , 0 ) } ;
mNiTriStripsData . strips = { { 0 , 1 , 2 , 3 } } ;
mNiTriStripsData . strips = { { 0 , 1 , 2 , 3 } } ;
mNiTriStrips . data = Nif : : NiGeometryDataPtr ( & mNiTriStripsData ) ;
mNiTriStrips . data = Nif : : NiGeometryDataPtr ( & mNiTriStripsData ) ;
EXPECT_CALL ( mNifFile , getHash ( ) ) . WillOnce ( Return ( mHash ) ) ;
}
}
} ;
} ;
TEST_F ( TestBulletNifLoader , for_zero_num_roots_should_return_default )
TEST_F ( TestBulletNifLoader , for_zero_num_roots_should_return_default )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 0 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -432,10 +409,11 @@ namespace
TEST_F ( TestBulletNifLoader , should_ignore_nullptr_root )
TEST_F ( TestBulletNifLoader , should_ignore_nullptr_root )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( nullptr ) ) ;
file . mRoots . push_back ( nullptr ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -444,10 +422,11 @@ namespace
TEST_F ( TestBulletNifLoader , for_default_root_nif_node_should_return_default )
TEST_F ( TestBulletNifLoader , for_default_root_nif_node_should_return_default )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNode ) ) ;
file . mRoots . push_back ( & mNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -458,10 +437,11 @@ namespace
{
{
mNode . recType = Nif : : RC_RootCollisionNode ;
mNode . recType = Nif : : RC_RootCollisionNode ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNode ) ) ;
file . mRoots . push_back ( & mNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -470,10 +450,11 @@ namespace
TEST_F ( TestBulletNifLoader , for_default_root_nif_node_and_filename_starting_with_x_should_return_default )
TEST_F ( TestBulletNifLoader , for_default_root_nif_node_and_filename_starting_with_x_should_return_default )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNode ) ) ;
file . mRoots . push_back ( & mNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -489,10 +470,11 @@ namespace
mNode . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNode . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNode . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
mNode . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNode ) ) ;
file . mRoots . push_back ( & mNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -515,10 +497,11 @@ namespace
mNode . parents . push_back ( & mNiNode ) ;
mNode . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -547,10 +530,11 @@ namespace
mNiNode . bounds . box . center = osg : : Vec3f ( - 4 , - 5 , - 6 ) ;
mNiNode . bounds . box . center = osg : : Vec3f ( - 4 , - 5 , - 6 ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -585,10 +569,11 @@ namespace
mNiNode . bounds . box . center = osg : : Vec3f ( - 7 , - 8 , - 9 ) ;
mNiNode . bounds . box . center = osg : : Vec3f ( - 7 , - 8 , - 9 ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) , Nif : : NodePtr ( & mNode2 ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) , Nif : : NodePtr ( & mNode2 ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -623,10 +608,11 @@ namespace
mNiNode . bounds . box . center = osg : : Vec3f ( - 7 , - 8 , - 9 ) ;
mNiNode . bounds . box . center = osg : : Vec3f ( - 7 , - 8 , - 9 ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) , Nif : : NodePtr ( & mNode2 ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNode ) , Nif : : NodePtr ( & mNode2 ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 4 , 5 , 6 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 4 , 5 , 6 ) ;
@ -647,10 +633,11 @@ namespace
mNode . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNode . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNode . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
mNode . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNode ) ) ;
file . mRoots . push_back ( & mNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -661,10 +648,11 @@ namespace
TEST_F ( TestBulletNifLoader , for_tri_shape_root_node_should_return_shape_with_triangle_mesh_shape )
TEST_F ( TestBulletNifLoader , for_tri_shape_root_node_should_return_shape_with_triangle_mesh_shape )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriShape ) ) ;
file . mRoots . push_back ( & mNiTriShape ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -682,10 +670,11 @@ namespace
mNiTriShape . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNiTriShape . bounds . box . extents = osg : : Vec3f ( 1 , 2 , 3 ) ;
mNiTriShape . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
mNiTriShape . bounds . box . center = osg : : Vec3f ( - 1 , - 2 , - 3 ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriShape ) ) ;
file . mRoots . push_back ( & mNiTriShape ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
expected . mCollisionBox . mExtents = osg : : Vec3f ( 1 , 2 , 3 ) ;
@ -699,10 +688,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -719,10 +709,11 @@ namespace
mNiNode2 . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode2 . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiTriShape . parents . push_back ( & mNiNode2 ) ;
mNiTriShape . parents . push_back ( & mNiNode2 ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -739,10 +730,11 @@ namespace
mNiNode . children
mNiNode . children
= Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) , Nif : : NodePtr ( & mNiTriShape2 ) } ) ) ;
= Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) , Nif : : NodePtr ( & mNiTriShape2 ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 1 ) , btVector3 ( 1 , 0 , 1 ) , btVector3 ( 1 , 1 , 1 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 1 ) , btVector3 ( 1 , 0 , 1 ) , btVector3 ( 1 , 1 , 1 ) ) ;
@ -760,10 +752,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -779,10 +772,11 @@ namespace
copy ( mTransform , mNiTriShape . trafo ) ;
copy ( mTransform , mNiTriShape . trafo ) ;
mNiTriShape . trafo . scale = 3 ;
mNiTriShape . trafo . scale = 3 ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriShape ) ) ;
file . mRoots . push_back ( & mNiTriShape ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -806,10 +800,11 @@ namespace
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . trafo . scale = 4 ;
mNiNode . trafo . scale = 4 ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -840,10 +835,11 @@ namespace
Nif : : NodePtr ( & mNiTriShape2 ) ,
Nif : : NodePtr ( & mNiTriShape2 ) ,
} ) ) ;
} ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -876,10 +872,11 @@ namespace
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . trafo . scale = 4 ;
mNiNode . trafo . scale = 4 ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -912,10 +909,11 @@ namespace
} ) ) ;
} ) ) ;
mNiNode . trafo . scale = 4 ;
mNiNode . trafo . scale = 4 ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle (
triangles - > addTriangle (
@ -943,11 +941,12 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 2 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getRoot ( 1 ) ) . WillOnce ( Return ( & mNiTriShape2 ) ) ;
file . mRoots . push_back ( & mNiTriShape2 ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -974,10 +973,11 @@ namespace
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . recType = Nif : : RC_AvoidNode ;
mNiNode . recType = Nif : : RC_AvoidNode ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -993,10 +993,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -1011,10 +1012,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -1030,10 +1032,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1054,10 +1057,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1077,10 +1081,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1101,10 +1106,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1131,10 +1137,11 @@ namespace
mNiNode . children = Nif : : NodeList (
mNiNode . children = Nif : : NodeList (
std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & niTriShape ) , Nif : : NodePtr ( & emptyCollisionNode ) } ) ) ;
std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & niTriShape ) , Nif : : NodePtr ( & emptyCollisionNode ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1154,10 +1161,11 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
Resource : : BulletShape expected ;
Resource : : BulletShape expected ;
@ -1177,10 +1185,11 @@ namespace
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiNode2 ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiNode2 ) } ) ) ;
mNiNode . recType = Nif : : RC_NiNode ;
mNiNode . recType = Nif : : RC_NiNode ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1194,10 +1203,11 @@ namespace
{
{
mNiTriShape . data = Nif : : NiGeometryDataPtr ( & mNiTriStripsData ) ;
mNiTriShape . data = Nif : : NiGeometryDataPtr ( & mNiTriStripsData ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriShape ) ) ;
file . mRoots . push_back ( & mNiTriShape ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1206,10 +1216,11 @@ namespace
TEST_F ( TestBulletNifLoader , for_tri_strips_root_node_should_return_shape_with_triangle_mesh_shape )
TEST_F ( TestBulletNifLoader , for_tri_strips_root_node_should_return_shape_with_triangle_mesh_shape )
{
{
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1224,10 +1235,11 @@ namespace
{
{
mNiTriStrips . data = Nif : : NiGeometryDataPtr ( & mNiTriShapeData ) ;
mNiTriStrips . data = Nif : : NiGeometryDataPtr ( & mNiTriShapeData ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1238,10 +1250,11 @@ namespace
{
{
mNiTriStripsData . strips . clear ( ) ;
mNiTriStripsData . strips . clear ( ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1252,10 +1265,11 @@ namespace
{
{
mNiTriStripsData . strips . front ( ) = { 0 , 1 } ;
mNiTriStripsData . strips . front ( ) = { 0 , 1 } ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1269,10 +1283,11 @@ namespace
mNiNode . recType = Nif : : RC_AvoidNode ;
mNiNode . recType = Nif : : RC_AvoidNode ;
mNiTriStripsData . strips . front ( ) = { 0 , 1 } ;
mNiTriStripsData . strips . front ( ) = { 0 , 1 } ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " test.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " test.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1285,10 +1300,11 @@ namespace
mNiTriStrips . parents . push_back ( & mNiNode ) ;
mNiTriStrips . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriStrips ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriStrips ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 1 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
const Resource : : BulletShape expected ;
const Resource : : BulletShape expected ;
@ -1301,11 +1317,12 @@ namespace
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiTriShape . parents . push_back ( & mNiNode ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 2 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getRoot ( 1 ) ) . WillOnce ( Return ( & mNiTriStrips ) ) ;
file . mRoots . push_back ( & mNiTriStrips ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles ( new btTriangleMesh ( false ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
@ -1330,11 +1347,12 @@ namespace
mNiNode2 . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode2 . children = Nif : : NodeList ( std : : vector < Nif : : NodePtr > ( { Nif : : NodePtr ( & mNiTriShape ) } ) ) ;
mNiNode2 . trafo . scale = 3 ;
mNiNode2 . trafo . scale = 3 ;
EXPECT_CALL ( mNifFile , numRoots ( ) ) . WillOnce ( Return ( 2 ) ) ;
Nif : : NIFFile file ( " xtest.nif " ) ;
EXPECT_CALL ( mNifFile , getRoot ( 0 ) ) . WillOnce ( Return ( & mNiNode ) ) ;
file . mRoots . push_back ( & mNiNode ) ;
EXPECT_CALL ( mNifFile , getRoot ( 1 ) ) . WillOnce ( Return ( & mNiNode2 ) ) ;
file . mRoots . push_back ( & mNiNode2 ) ;
EXPECT_CALL ( mNifFile , getFilename ( ) ) . WillOnce ( Return ( " xtest.nif " ) ) ;
file . mHash = mHash ;
const auto result = mLoader . load ( mNifFile ) ;
const auto result = mLoader . load ( file ) ;
std : : unique_ptr < btTriangleMesh > triangles1 ( new btTriangleMesh ( false ) ) ;
std : : unique_ptr < btTriangleMesh > triangles1 ( new btTriangleMesh ( false ) ) ;
triangles1 - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;
triangles1 - > addTriangle ( btVector3 ( 0 , 0 , 0 ) , btVector3 ( 1 , 0 , 0 ) , btVector3 ( 1 , 1 , 0 ) ) ;