Moderators: Sascha Willems, walaber
Forthehorde wrote:dgAssert (dgAbsf(dgAbsf(obbAabbInfo[0][0]) - obbAabbInfo.m_absDir[0][0]) < dgFloat32 (1.0e-4f)); For example
I can't even run app since it asserts every frame in debug mode.
I am simply running newton kinematic controller and newtonmesh serialized mesh, what can be wrong?
NewtonMeshEndFace(SceneData);
//NewtonMeshSimplify;
NewtonMeshSaveOFF(SceneData, "NewtonTestData.off"); //Test only! to try in nme.exe
NewtonCollision * Collision = NewtonCreateTreeCollisionFromMesh(GlobalWorld, SceneData, 0);
NewtonMeshDestroy(SceneData);
if(Collision)
{
FILE * File;
errno_t err = fopen_s(&File, CollisionFilename, "wb");
NewtonCollisionSerialize(GlobalWorld, Collision, SerializeFile, File);
fclose(File);
NewtonDestroyCollision(Collision);
}
else std::cout << "Fatal error in collision generation";
void GameMap::SetupCollision()
{
PhysicsWorld = NewtonCreate();
NewtonInvalidateCache(PhysicsWorld);
NewtonSetSolverModel(PhysicsWorld, 8); //8
NewtonSetFrictionModel(PhysicsWorld, 0); //0
NewtonSetThreadsCount(PhysicsWorld, 8); //todo: query thread count properly
dResetTimer();
std::wstringstream ss; ss << L"./data/maps/" << Filename << L".hc";
std::wstring WInput = ss.str();
std::string Input = xws2s(WInput);
FILE * File;
errno_t err = fopen_s(&File, Input.c_str(), "rb");
NewtonCollision * Collision = NewtonCreateCollisionFromSerialization(PhysicsWorld, DeSerializeFile, File);
fclose(File);
dMatrix Matrix = GetIdentityMatrix();
NewtonBody * Body = NewtonCreateDynamicBody(PhysicsWorld, Collision, &Matrix[0][0]);
NewtonBodySetMassProperties(Body, 0.0f, Collision);
NewtonDestroyCollision(Collision);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE AND INSERT A CHARACTER CONTROLLER INTO THE NEW SCENE
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PlayerManager = new AdvancePlayerControllerManager(PhysicsWorld);
dMatrix InsertLocation(GetIdentityMatrix());
InsertLocation.m_posit.m_x = 0.0f;
InsertLocation.m_posit.m_y = 100.0f;
InsertLocation.m_posit.m_z = 0.0f;
InsertLocation.m_posit = FindFloor(PhysicsWorld, InsertLocation.m_posit, 1000.0f);
PlayerController = new AdvancePlayerEntity(PlayerManager, 3.5f, 15.0f, InsertLocation);
SetupDebugRender(); //Debug Only!!!
}
Forthehorde wrote:I updated to latest svn and character still climb up any objects!
Forthehorde wrote:Do I need these for controller body?
NewtonBodySetContinuousCollisionMode(body, 1); //Kinematic support ccd?
Forthehorde wrote:m_controller->SetRestrainingDistance(1.0f); //What is this anyway?
Users browsing this forum: No registered users and 0 guests