MCPcopy Create free account
hub / github.com/defold/defold / SetUp

Method SetUp

engine/rig/src/test/test_rig.cpp:969–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967
968protected:
969 void SetUp() override {
970 RigContextCursorTest<T>::SetUp();
971
972 m_Instance = 0x0;
973
974 m_Skeleton = new dmRigDDF::Skeleton();
975 m_MeshSet = new dmRigDDF::MeshSet();
976 m_AnimationSet = new dmRigDDF::AnimationSet();
977 SetUpSimpleRig(m_BindPose, m_BoneIndices, m_Skeleton, m_MeshSet, m_AnimationSet);
978
979 // Data
980 dmRig::InstanceCreateParams create_params = {0};
981 create_params.m_BindPose = &m_BindPose;
982 create_params.m_BoneIndices = &m_BoneIndices;
983 create_params.m_Skeleton = m_Skeleton;
984 create_params.m_MeshSet = m_MeshSet;
985 create_params.m_AnimationSet = m_AnimationSet;
986
987 create_params.m_ModelId = dmHashString64((const char*)"test");
988 create_params.m_DefaultAnimation = dmHashString64((const char*)"");
989
990 if (dmRig::RESULT_OK != dmRig::InstanceCreate(RigContextCursorTest<T>::m_Context, create_params, &m_Instance)) {
991 dmLogError("Could not create rig instance!");
992 }
993 }
994
995 void TearDown() override {
996 if (dmRig::RESULT_OK != dmRig::InstanceDestroy(RigContextCursorTest<T>::m_Context, m_Instance)) {

Callers

nothing calls this directly

Calls 2

SetUpSimpleRigFunction · 0.85
InstanceCreateFunction · 0.50

Tested by

no test coverage detected