Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error colliding collisionbody sphereshap or capsuleshap with other rigidbody #165

Closed
nomadsoul68 opened this issue Aug 22, 2020 · 12 comments
Assignees
Labels

Comments

@nomadsoul68
Copy link

Hello,

I have created a collisionbody for my camera, and attach a capsuleshap on it. when it collide with somethink, my program crash. Same problem with sphereshap. It work only with boxshape.
My error:
"terminate called after throwing an instance of "std:runtime_error": what(): no item with given key have been found in the map.

My settings i use seems to be good:

CollisionBody* body;
CapsuleShape* mCapsuleShape;
Collider* mCollider;

@DanielChappuis
Copy link
Owner

Can you compile the ReactPhysics3D in Debug mode and post here the whole stack trace when the error occurs ?
Are you also able to post a basic example or your code so that I can try to reproduce the issue on my side ?

@DanielChappuis DanielChappuis self-assigned this Aug 22, 2020
@nomadsoul68
Copy link
Author

nomadsoul68 commented Aug 22, 2020

With this debug code (if i'am right):

DefaultLogger* defaultLogger = physicsCommon.createDefaultLogger(); uint logLevel = static_cast<uint>(Logger::Level::Information) | static_cast<uint>(Logger::Level::Warning) | static_cast<uint>(Logger::Level::Error); defaultLogger->addFileDestination("log_physics.html", logLevel, DefaultLogger::Format::HTML); physicsCommon.setLogger(defaultLogger);

i obtain :
`
16:48:51

Information

World

Physics World: Physics world world has been created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 105)

16:48:51

Information

World

Physics World: Initial world settings: worldName= gravity=Vector3(0.000000,-9.810000,0.000000) persistentContactDistanceThreshold=0.03 defaultFrictionCoefficient=1 defaultBounciness=0 restitutionVelocityThreshold=0.5 defaultRollingRestistance=0 isSleepingEnabled=0 defaultVelocitySolverNbIterations=20 defaultPositionSolverNbIterations=5 defaultTimeBeforeSleep=1 defaultSleepLinearVelocity=0.02 defaultSleepAngularVelocity=0.0523599 nbMaxContactManifolds=3 cosAngleSimilarContactManifold=0.95

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 107)

16:48:51

Information

World

Physics World: Physics world world has been created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 110)

16:48:52

Information

Body

Body 0: New collision body created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 489)

16:48:52

Information

Body

Body 0: Set type=Static

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 123)

16:48:52

Information

Body

Body 0: Set isGravityEnabled=false

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 648)

16:48:52

Information

Body

Body 0: Collider 0 added to body

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 618)

16:48:52

Information

Collider

Collider 0: collisionShape=BoxShape{extents=Vector3(15.113791,22.065409,27.715946)}

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 622)

16:48:52

Information

Body

Body 2: New collision body created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 489)

16:48:52

Information

Body

Body 2: Set type=Static

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 123)

16:48:52

Information

Body

Body 2: Set isGravityEnabled=false

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 648)

16:48:52

Information

Body

Body 2: Collider 1 added to body

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 618)

16:48:52

Information

Collider

Collider 1: collisionShape=BoxShape{extents=Vector3(1154.007935,0.050000,1154.007935)}

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 622)

16:48:54

Information

Body

Body 4: New collision body created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 489)

16:48:54

Information

Body

Body 4: Collider 3 added to body

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 618)

16:48:54

Information

Collider

Collider 3: collisionShape=BoxShape{extents=Vector3(2.000000,2.000000,2.000000)}

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 622)

16:48:54

Information

Body

Body 4: Set mass=40.000000

(in file D:\reactphysics3d\src\body\RigidBody.cpp at line 554)

16:48:54

Information

Body

Body 6: New collision body created

(in file D:\reactphysics3d\src\engine\PhysicsWorld.cpp at line 195)

16:48:54

Information

Body

Body 6: Collider 5 added to body

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 119)

16:48:54

Information

Collider

Collider 5: collisionShape=CapsuleShape{halfHeight=2.250000, radius=1.000000}

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 123)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401)

16:48:54

Information

Body

Body 6: Set transform=Transform(Vector3(0.000000,10.000000,5.000000),Quaternion(0.000000,0.000000,0.000000,1.000000))

(in file D:\reactphysics3d\src\body\CollisionBody.cpp at line 401) `

no error in the html file at the end when it crash`

my code
`void react_phys::creat_actor_body(vec3 positionM){
Vector3 position(positionM.x, positionM.y, positionM.z);
//Quaternion orientation = Quaternion::identity();
Quaternion orientation= Quaternion::identity();

Transform transform(position, orientation);

// RigidBody* bodya

react_phys::Movable_body.body = world->createCollisionBody(transform);

std::cout << "creation body for camera ok" << std::endl;

} void react_phys::creat_capsule_collider_shape(double radius,double height){ //only for movable actor for the moment
Movable_body.mCapsuleShape=physicsCommon.createCapsuleShape(radius,height);
// Vector3 tt={2,2,2};
//Movable_body.mCapsuleShape=physicsCommon.createBoxShape(tt);
Transform transform = Transform::identity();

Movable_body.mCollider = Movable_body.body->addCollider(Movable_body.mCapsuleShape, transform);

std::cout << "succes creating collider shape for actor" << std::endl;
} void react_phys::Move_body(vec3 position){
Vector3 pos={position.x,position.y,position.z};
Quaternion orientation= Quaternion::identity();

Transform transform(pos, orientation);
Movable_body.body->setTransform(transform);

}`

@DanielChappuis
Copy link
Owner

Thanks a lot but what I really need it is a complete stack trace at the point where the error occurs. The error occurs at line 669 in file include/reactphysics3d/containers/Map.h. Could you please put a breakpoint here and run your code. When the breakpoint is hit, copy/paste the entire stack trace of your debugger here so that I can know where this method is called when the crash occurs.

You are using the version v0.8.0 of the library right ?

@nomadsoul68
Copy link
Author

Yes i use v0.8.0.
my gdb debuger say that when camera collide ( setting breackpoint to line 669 in containers/Map.h):

`Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\3D Engine-4\Antaria
Adding source dir: D:\3D Engine-4\Antaria
Adding file: D:\3D Engine-4\Antaria\bin\Debug\Antaria.exe
Changing directory to: C:/PROGRA~1/TDM64-1/X86_641/bin
Set variable: PATH=.;C:\Program Files\TDM64-GCC\x86_64-w64-mingw32\lib32;C:\Program Files\TDM64-GCC\x86_64-w64-mingw32\lib32;C:\Program Files\TDM64-GCC\bin;C:\Program Files\TDM64-GCC;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\NVIDIA Corporation\DDS Utilities

[debug]Command-line: C:\Program Files\TDM64-GCC\gdb64\bin\gdb.exe -nx -fullname -quiet -args "D:/3D Engine-4/Antaria/bin/Debug/Antaria.exe"
[debug]Working dir : C:\PROGRA~1\TDM64-1\X86_641\bin

Starting debugger: C:\Program Files\TDM64-GCC\gdb64\bin\gdb.exe -nx -fullname -quiet -args "D:/3D Engine-4/Antaria/bin/Debug/Antaria.exe"
done

[debug]Reading symbols from D:/3D Engine-4/Antaria/bin/Debug/Antaria.exe...
debug
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.3.1
[debug]Copyright (C) 2019 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]http://www.gnu.org/software/gdb/bugs/.
[debug]Find the GDB manual and other documentation resources online at:
[debug] http://www.gnu.org/software/gdb/documentation/.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.3.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> gdb.exe
[debug]Undefined command: "gdb". Try "help".
[debug]>>>>>>cb_gdb:
[debug]> directory "D:/3D Engine-4/Antaria/"
[debug]Source directories searched: D:/3D Engine-4/Antaria;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h:669"
[debug]No source file named C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h.
[debug]Breakpoint 2 ("C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h:669") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\3D Engine-4\Antaria\bin\Debug\Antaria.exe
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Program received signal ?, Unknown signal.
[debug]0x0008dad8 in ?? ()
[debug]>>>>>>cb_gdb:

In ?? () ()

[debug]> bt 30
[debug]#0 0x0008dad8 in ?? ()
[debug]>>>>>>cb_gdb:
`

@DanielChappuis
Copy link
Owner

Sorry but is this a stack trace ? I expect to see the whole tree of methods called when the error occurs.
The crash occurs when you are calling which method of ReactPhysics3D ?

@nomadsoul68
Copy link
Author

I just update the camera body according to user input using this:
` Vector3 pos={position.x,position.y,position.z};
Quaternion orientation= Quaternion::identity();

Transform transform(pos, orientation);
Movable_body.mbody->setTransform(transform);

`
I try to creat a little code with only reactphysics, using a ground, a newtonian cube object and a capsule object that i move.
With this basics code it work.
I try to understand where it can come from (memory corruption?...initialisation error...).

Thank you for your patience.

@nomadsoul68
Copy link
Author

nomadsoul68 commented Aug 23, 2020

i found that in my first project =

  • if there is not newtonian object (dynamic object) the camera capsule can collide with every think .
  • if there are a newtonian object in the air wich has not yet collide, the camera can collide with every think.
  • if the newtonian object has collide (still collide) with somethink (ground for example), the camera crash when it collide with somethink...

if i turn the world setting settings.isSleepingEnabled = true;

  • the camera can collide with every think if the newtonian object's collision has already occur.
  • the error appear now if the camera already collide with somethink and the newtonian object is colliding.

I know its better for you with stack trace. I will continu to investigate. It can probably come from my code.

Best regards,

@nomadsoul68
Copy link
Author

Can you try this code: (i use 32 bit version of your librairy because all the rest of my project are in 32bit), it crash with the same error when the capsule body collide with ground and when a newtonian object have already collide :

'#include <reactphysics3d/reactphysics3d.h>
#include

using namespace reactphysics3d;
PhysicsCommon physicsCommon;
PhysicsWorld* world={0};
DebugRenderer* debug_Renderer={0};
struct body_c{ //simulation newtonienne
RigidBody* body={0};
BoxShape* boxshape={0};
Collider* collider={0}; //a enlever d'ici....
};
struct body_b{ //bouge par moi
CollisionBody* mbody={0};
CapsuleShape* mCapsuleShape={0}; // a revoir plus tard
Collider* mCollider={0}; //a enlever d'ici....
};
struct Mesh{
body_c static_mesh={0};
body_b movable_mesh={0};

};
int main()
{
// Create the world settings
PhysicsWorld::WorldSettings settings;
settings.defaultVelocitySolverNbIterations = 20;
settings.isSleepingEnabled = false;
settings.gravity = Vector3(0, -9.81, 0);
settings.defaultBounciness=0.0;
settings.defaultFrictionCoefficient=1.0;
world=physicsCommon.createPhysicsWorld(settings);
std::cout<< "Init world physics ok-------------------" <<std::endl;

 //creat ground:
 Mesh ground;
 //body_c ground={0};
 Vector3 position(-500,0,-500);

Quaternion orientation= Quaternion::identity();
Transform transform(position, orientation);
ground.static_mesh.body = world->createRigidBody(transform);
ground.static_mesh.body->setType(BodyType::STATIC);
ground.static_mesh.body->enableGravity(false);
//ground shape
Vector3 halfExtents(5000, 2, 5000);
ground.static_mesh.boxshape=physicsCommon.createBoxShape(halfExtents);
Transform transform2 = Transform::identity();
ground.static_mesh.collider = ground.static_mesh.body->addCollider(ground.static_mesh.boxshape, transform2);

//creat actor

Vector3 positionA(250,30,250);
Quaternion orientation2= Quaternion::identity();
Transform transform3(positionA, orientation2);
//body_b actor={0};
Mesh actor;
actor.movable_mesh.mbody = world->createCollisionBody(transform3);
//capsule shape for actor:
actor.movable_mesh.mCapsuleShape=physicsCommon.createCapsuleShape(1,2);
Transform transform4 = Transform::identity();
actor.movable_mesh.mCollider = actor.movable_mesh.mbody->addCollider(actor.movable_mesh.mCapsuleShape, transform4);
//add newtonian mesh
Mesh cube;
Vector3 position6(-500,20,-500);
Quaternion orientation6= Quaternion::identity();
Transform transform5(position6, orientation6);
cube.static_mesh.body = world->createRigidBody(transform5);
cube.static_mesh.body->setType(BodyType::DYNAMIC);
Vector3 Huge={1,1,1};
cube.static_mesh.boxshape=physicsCommon.createBoxShape(Huge);
Transform transform6 = Transform::identity();
cube.static_mesh.collider = cube.static_mesh.body->addCollider(cube.static_mesh.boxshape,transform6);
//debug:
world->setIsDebugRenderingEnabled(true);
DebugRenderer& debugRenderer2 = world->getDebugRenderer();

debugRenderer2.setIsDebugItemDisplayed(DebugRenderer::DebugItem::COLLISION_SHAPE, true);
debug_Renderer= &debugRenderer2;

const float timeStep = 1.0f / 60.0f;
double a=30;
for(int i=0;i<10000;i++){
//update world
world->update(timeStep);
//move actor down to collide with ground:
a-=0.05;
Vector3 pos={250,a,250};
Quaternion orientationA= Quaternion::identity();
Transform transform5(pos, orientationA);
actor.movable_mesh.mbody->setTransform(transform5);
std::cout<< "actor position y= " << pos.y <<std::endl;

const Transform& transformcube = cube.static_mesh.body->getTransform();
const Vector3& positioncube = transformcube.getPosition();
//transform.getOpenGLMatrix();
std::cout<< "cube position y= " << positioncube.y <<std::endl;

int tri=debug_Renderer->getNbTriangles();

}

}
'

@nomadsoul68
Copy link
Author

with the 64 bit version of your librairy the stack trace is better:

with breackpoint a line 669 in Map.h:

`Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\error\error
Adding source dir: D:\error\error
Adding file: D:\error\error\bin\Debug\error.exe
Changing directory to: D:/error/error/.
Set variable: PATH=.;C:\Program Files\TDM64-GCC\bin;C:\Program Files\TDM64-GCC;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\NVIDIA Corporation\DDS Utilities

[debug]Command-line: C:\Program Files\TDM64-GCC\gdb64\bin\gdb.exe -nx -fullname -quiet -args D:/error/error/bin/Debug/error.exe
[debug]Working dir : D:\error\error

Starting debugger: C:\Program Files\TDM64-GCC\gdb64\bin\gdb.exe -nx -fullname -quiet -args D:/error/error/bin/Debug/error.exe
done

[debug]Reading symbols from D:/error/error/bin/Debug/error.exe...
debug
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.3.1
[debug]Copyright (C) 2019 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]http://www.gnu.org/software/gdb/bugs/.
[debug]Find the GDB manual and other documentation resources online at:
[debug] http://www.gnu.org/software/gdb/documentation/.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.3.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> gdb.exe
[debug]Undefined command: "gdb". Try "help".
[debug]>>>>>>cb_gdb:
[debug]> directory D:/error/error/
[debug]Source directories searched: D:/error/error;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h:669"
[debug]No line 669 in file "C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h".
[debug]Breakpoint 2 ("C:/Program Files/TDM64-GCC/x86_64-w64-mingw32/include/reactphysics3d/containers/Map.h:669") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\error\error\bin\Debug\error.exe
[debug]Catchpoint 1 (exception thrown), 0x000000000057e4f8 in __cxa_throw ()
[debug]>>>>>>cb_gdb:

In __cxa_throw () ()

[debug]> bt 30
[debug]#0 0x000000000057e4f8 in __cxa_throw ()
[debug]#1 0x0000000000484665 in reactphysics3d::ContactSolverSystem::initializeForIsland(unsigned int) ()
[debug]#2 0x000000000048484d in reactphysics3d::ContactSolverSystem::init(reactphysics3d::Listreactphysics3d::ContactManifold, reactphysics3d::Listreactphysics3d::ContactPoint, float) ()
[debug]#3 0x0000000000449e65 in reactphysics3d::PhysicsWorld::update(float) ()
[debug]#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
[debug]>>>>>>cb_gdb:
[debug]> frame 4
[debug]#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
[debug]��D:\error\error\main.cpp:70:2340:beg:0x401a24
[debug]>>>>>>cb_gdb:

#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
��D:\error\error\main.cpp:70:2340:beg:0x401a24
At D:\error\error\main.cpp:70

[debug]> bt 30
[debug]#0 0x000000000057e4f8 in __cxa_throw ()
[debug]#1 0x0000000000484665 in reactphysics3d::ContactSolverSystem::initializeForIsland(unsigned int) ()
[debug]#2 0x000000000048484d in reactphysics3d::ContactSolverSystem::init(reactphysics3d::Listreactphysics3d::ContactManifold, reactphysics3d::Listreactphysics3d::ContactPoint, float) ()
[debug]#3 0x0000000000449e65 in reactphysics3d::PhysicsWorld::update(float) ()
[debug]#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
[debug]>>>>>>cb_gdb:
[debug]> frame 4
[debug]#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
[debug]��D:\error\error\main.cpp:70:2340:beg:0x401a24
[debug]>>>>>>cb_gdb:

#4 0x0000000000401a24 in main () at D:\error\error\main.cpp:70
��D:\error\error\main.cpp:70:2340:beg:0x401a24
`
i hope it will help

@DanielChappuis
Copy link
Owner

DanielChappuis commented Sep 2, 2020

Thanks for the details.
The error was not exactly at this location. Maybe you compiled your code in Debug mode but not the ReactPhysics3D library itself.

Anyway, I have just fixed an issue in the master branch. If you pull the last changes in this branch your error should not happen anymore. Let me know if the issue is now fixed on your side.

Note that in your code, you create a CollisionBody for your movable mesh actor. You probably want to use a RigidBody here instead. A CollisionBody is only used to test for collisions with the PhysicsWorld::testCollision(...) or PhysicsWorld::testOverlap(...) methods. However, if you want your body to be simulated by the physics when you call the PhysicsWorld::update() method, you need to use a RigidBody instead.

I hope this helps.

@nomadsoul68
Copy link
Author

Thank you for your help and your patience. It's work now.
i will follow your advice and use a rigidbody for all my actor and camera. (movable object by me but interract with wall...).

@DanielChappuis
Copy link
Owner

Thanks for your feedback. I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants