Show collision

ricardo_arango

05-02-2006 06:51:04

Is there a way to show the mesh of collision object? So I can check the size with the model?

walaber

05-02-2006 18:32:49

OgreNewt::Debugger.

read about it in the documentation, it's very easy to use.

ricardo_arango

07-02-2006 04:52:10

Where's the documentation? It doesn't come with the CVS....

walaber

07-02-2006 06:42:32

you need to use DOXYGEN to generate the source for the CVS version, there is a DOXYGEN file in there to make generating the docs easy.

or just look at the comments in the OgreNewt_Debugger.h file :)

misterface

20-02-2006 13:09:07

tried it:

OgreNewt::Debugger::init(mSceneMgr);
OgreNewt::Debugger::showLines(m_World);
OgreNewt::Debugger::hideLines();


but

Error 2 error C2352: 'OgreNewt::Debugger::init' : illegal call of non-static member function c:\eindwerk\Ogre\ogreaddons\OgreNewt\demos\Demo01_TheBasics\OgreNewtonApplication.cpp 94
Error 3 error C3861: 'showLines': identifier not found c:\eindwerk\Ogre\ogreaddons\OgreNewt\demos\Demo01_TheBasics\OgreNewtonApplication.cpp 96
Error 4 error C2352: 'OgreNewt::Debugger::hideLines' : illegal call of non-static member function c:\eindwerk\Ogre\ogreaddons\OgreNewt\demos\Demo01_TheBasics\OgreNewtonApplication.cpp 97

haffax

20-02-2006 18:18:02

misterface, the debugger functions are not static, as the compiler tells you. See the OgreNewt examples for how to use it correctly.

misterface

20-02-2006 23:42:00

misterface, the debugger functions are not static, as the compiler tells you. See the OgreNewt examples for how to use it correctly.

:oops: sorry but I can't implement it in my project.
I can open the file in the examples, but I can't implement it. Somebody that can help me?
wish I was much better in c++ :)

walaber

21-02-2006 00:27:25

OgreNewt::Debugger::getSingleton().init( mSceneMgr );
OgreNewt::Debugger::getSingleton().drawLines( mWorld );

misterface

21-02-2006 20:09:02

much better :)
Ogre runs, but an error:


20:53:32: Win32Input8: Initializing mouse input in immediate mode.
20:53:32: Win32Input8: Mouse input in immediate mode initialized.
20:53:32: Win32Input8: DirectInput OK.
20:53:32: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: SceneManager::createSceneNode
Description: A scene node with the name __OgreNewt__Debugger__ already exists.
File: ..\src\OgreSceneManager.cpp
Line: 578
Stack unwinding: <<beginning of stack>>
20:53:32: *-*-* OGRE Shutdown


btw getsingleton()... what does that mean?

Kerion

21-02-2006 20:12:26

much better :)
Ogre runs, but an error:


20:53:32: Win32Input8: Initializing mouse input in immediate mode.
20:53:32: Win32Input8: Mouse input in immediate mode initialized.
20:53:32: Win32Input8: DirectInput OK.
20:53:32: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: SceneManager::createSceneNode
Description: A scene node with the name __OgreNewt__Debugger__ already exists.
File: ..\src\OgreSceneManager.cpp
Line: 578
Stack unwinding: <<beginning of stack>>
20:53:32: *-*-* OGRE Shutdown


btw getsingleton()... what does that mean?


Are you calling OgreNew::Debugger::getSingleton().init() multiple times? Perhaps in your frameStarted? If so, only call it once when you initialize your app.

Also, getSingleton() returns the singleton object reference for the Debugger object. Google for "singleton pattern" to learn about singletons and their use in object oriented systems.

misterface

21-02-2006 20:32:29


Are you calling OgreNew::Debugger::getSingleton().init() multiple times? Perhaps in your frameStarted? If so, only call it once when you initialize your app.


1) thx, understanding the singleton thing :)
2) I only call it once I think, i'm using Demo01_TheBasics, looked everywhere in the code and I don't see the method is called anywhere.

walaber

21-02-2006 22:10:28

the debugger is built-in to the OgreNewt::BasicFrameListener class. just hit F3 in any of the demos to see the debug lines.

you can see how it works be looking at the code for the BasicFrameListener.

misterface

22-02-2006 00:10:56

thx! works indeed :D