Userdata in OGRE3DBODY structure and Actor

asvsfs

23-08-2009 14:54:50

hi,
i wanted to access userdata but in ogre3dbody there is no userdata and when i use getnxactor()
compiler says there is no actor defined , i want to know how can i have my own userdata for a body?

thx

betajaen

23-08-2009 16:44:13

It is used by NxOgre.

If you want to attach your own stuff to the Actor then you should use inheritance.

asvsfs

23-08-2009 20:57:46

hi,
i didnt want to spam another topic :D
where is contactnotify in nxogre
is there any contact callback ?

betajaen

23-08-2009 21:22:03

In Bleeding there is.

In Bloody Mess, I've just finished most of the code and it requires testing. It should be up on the Git Repo in a few days.

asvsfs

25-08-2009 15:56:23

i dont know how can i destory volumes! it says use scene::destroyvolume there isn't such thing!
and scene! how can i destroy scene itself there is no Destroyscene in world class

Thx,

betajaen

25-08-2009 18:33:44

Can't delete Volumes.

I'll add a deleteScene function to World and publish it in the next commit.

asvsfs

25-08-2009 18:47:14

Thx, is NxOgre::Enums::VolumeCollisionType_OnPresence working?
i just test it .. but it seems it dont work!

asvsfs

26-08-2009 18:18:08

?? It really dont work :D

spacegaier

26-08-2009 19:10:04

Negative, it DOES work. Just tested it with the commit 5efd6b4246e633f5f2ba1a9574ab34d3a014393f.

void onVolumeEvent(NxOgre::Volume* volume, NxOgre::Shape* volumeShape, NxOgre::RigidBody* rigidBody, NxOgre::Shape* rigidBodyShape, unsigned int collisionEvent)
{
if(collisionEvent == NxOgre::Enums::VolumeCollisionType_OnPresence)
{
Beep(1500, 5);
}
}

It is correctly "beeping".

asvsfs

26-08-2009 19:48:01

thx,i'll check it!

spacegaier

26-08-2009 22:17:34

Does it work now for you? I saw your new post before you deleted it. Is it solved?

If not, doublecheck that you really never stop by inside the OnPresence if-statement by setting a breakpoint there.

betajaen

26-08-2009 23:22:19

Actually your meant to compare the flags and enums like this;

if(collisionEvent & NxOgre::Enums::VolumeCollisionType_OnPresence)
{
Beep(1500, 5);
}


In case you have multiple flags.

spacegaier

27-08-2009 08:00:10

Okay, good to know! In case that I needed several events to be handled, I would have checked for multiple flags in one big if-statement...

asvsfs

27-08-2009 12:09:25

it didnt work ...
i tested it with Commit http://github.com/betajaen/nxogre/commit/6c7e255c586957e226b286361ad19d8a2ece2783
and now i have these! :oops:

1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class NxOgre::TimeController * __cdecl NxOgre::Singleton<class NxOgre::TimeController,603>::getSingleton(void)" (__imp_?getSingleton@?$Singleton@VTimeController@NxOgre@@$0CFL@@NxOgre@@SAPAVTimeController@2@XZ)
1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class NxOgre::ResourceSystem * __cdecl NxOgre::Singleton<class NxOgre::ResourceSystem,563>::getSingleton(void)" (__imp_?getSingleton@?$Singleton@VResourceSystem@NxOgre@@$0CDD@@NxOgre@@SAPAVResourceSystem@2@XZ)
1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl NxOgre::PointerClass<578>::operator delete(void *)" (__imp_??3?$PointerClass@$0CEC@@NxOgre@@SAXPAX@Z)
1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl NxOgre::PointerClass<578>::operator new(unsigned int)" (__imp_??2?$PointerClass@$0CEC@@NxOgre@@SAPAXI@Z)
1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual unsigned int __thiscall NxOgre::PointerClass<578>::getClassType(void)const " (__imp_?getClassType@?$PointerClass@$0CEC@@NxOgre@@UBEIXZ)
1>GameState.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual unsigned int __thiscall NxOgre::PointerClass<576>::getClassType(void)const " (__imp_?getClassType@?$PointerClass@$0CEA@@NxOgre@@UBEIXZ)
1>bin\Release\AdvancedOgreFramework.exe : fatal error LNK1120: 6 unresolved externals

spacegaier

27-08-2009 12:45:58

You properly build NxOgre and linked everything for sure?

asvsfs

27-08-2009 13:33:49

yeah i think! i downloaded the (commit) and compiled it and used it...

spacegaier

27-08-2009 13:52:28

I'll test it at home with the latest commit if it works, but I'm rather sure that it does.

asvsfs

28-08-2009 07:19:29

did u test it?

thx,

spacegaier

28-08-2009 07:58:09

OnPresence works with the latest commit (I just took my tutorial 4 code and added the OnPresence Statement).

asvsfs

28-08-2009 08:29:07

thx, it worked for me too(for tutorial 4) there must be something wrong with my code because it still dont work there!! but onEnter Works Well!

spacegaier

28-08-2009 08:44:14

Could you show us your onVolumeEvent()?

Do you still get the linker errors or does it at least run now?

asvsfs

28-08-2009 08:56:08

no i dont get any link error now.. but it doesn't work

void onVolumeEvent(NxOgre::Volume* volume, NxOgre::Shape* volumeShape, NxOgre::RigidBody* rigidBody,
NxOgre::Shape* rigidBodyShape, unsigned int collisionEvent)
{

if(collisionEvent == NxOgre::Enums::VolumeCollisionType_OnPresence)
{

if(mTimer->StopWatch(1))
{
MessageBeep(0);
static_cast<ATower*>(volume->UserData)->Attack(m_pSceneMgr);
}

}

}

spacegaier

28-08-2009 09:12:40

And you are sure that you never stop by inside this if statement (checked via setting a breakpoint there):
if(collisionEvent == NxOgre::Enums::VolumeCollisionType_OnPresence){}

If not: You are cretain that your event firing object is in your volume (checked via Visual- or RemoteDebugger)? So, onVolumeEvent() definetly gets called sometime.

asvsfs

28-08-2009 09:15:48

yes it get inside of statement and object is right and even onenter event works well when object enter the volume but OnPresence doesn't work!
it get into OnVolumeEvent Just once.

spacegaier

28-08-2009 17:16:46

yes it get inside of statement
Inside the if-statement = it is checked or are you actually landing in the part inside the curly braces?

it get into OnVolumeEvent Just once
And then?

betajaen

28-08-2009 17:19:36

I can confirm Volumes work in the latest Git:

mScene->createVolume(new NxOgre::Box(4), Matrix44_Identity, this);

void CakeApp::onVolumeEvent(Volume*, Shape* volumeShape, RigidBody* rigidBody, Shape* rigidBodyShape, unsigned int collisionEvent)
{
std::cout << collisionEvent << " vs. " << NxOgre::Enums::VolumeCollisionType_OnPresence << std::endl;
}


Result:
4 vs. 4


The problem is your code. Most likely that nested if statement.

asvsfs

28-08-2009 20:50:04

...! i dont know every thing works well for onenter or onexit...
OnPresence works well in tutorial 4 ... but doesnt work in my code!
there must be something wrong with my code but what ! i'll working on this problem more..
thx for your help

betajaen

29-08-2009 23:50:05

Can't delete Volumes.

I'll add a deleteScene function to World and publish it in the next commit.



See; http://github.com/betajaen/nxogre/commi ... 0e6a8354a5