[SOLVED]Simulation Procedure

Vineeth@nxOgre

17-03-2008 09:26:12

Creating a kinematic actor is easy

create a body and set it to kinematic

but
how do i get its position and set its position in each simulation step.In ageia i would had a glut loop render

void InitGlut(int argc, char **argv)
{

glutDisplayFunc(RenderCallback);


}

where


void RenderCallback()
{
if (gScene && !bPause)
NxReal deltaTime = UpdateTime();

deltaTime = 0.02f; // todo: may go back to real time at some point

// Run collision and dynamics for delta time since the last frame
gScene->simulate(deltaTime);
gScene->flushStream();
gScene->fetchResults(NX_RIGID_BODY_FINISHED, true);

set positions.get etc ........




what is the procedure to do it in NxOgre :?

betajaen

17-03-2008 09:34:15

void frameListenerClassYouUse::frameStarted(...) {
mActor->moveGlobalPosition(...);
mActor->moveGlobalOrientation(...);
}

Vineeth@nxOgre

17-03-2008 11:24:08




bool TurorialapplicationEihort:: frameStarted(const FrameEvent& evt)
{
.all members public
.
.
.
virtual newFrame(evt.timeSinceLastFrame);
.
body* targetBody;

}

class NxTutorial: public TurorialapplicationEihort
{
.
.

;
.
newFrame(evt.timeSinceLastFrame){
Body->moveglobalPose(...);

.
.
.
}


this way any body or actor can be accessed in the tutorial class
Thank you betajaen :D

betajaen

17-03-2008 11:25:14

What version of NxOgre are you using with the whole tutorial code?

Also: I think you should know C++ enough to figure it out.

Vineeth@nxOgre

17-03-2008 11:32:54

38th revision

and 0.42RC tutorial

I wrote the additional code to help other newbies :oops:

betajaen

17-03-2008 11:51:12

Yeah. the 0.4RC2 tutorials will not work 0.9, unless you've made a lot of changes.

Infact, I'm not even sure how you've got them. I've deleted every trace of 0.4/0.6 from the internet.

Vineeth@nxOgre

17-03-2008 12:21:24

I dont have tutorials for 0.9.I made a lot of changes
(commented those like these)


e->setCaption(caption);
e->setParameter("font_name", "NxOgrefont");
e->setParameter("char_height", "16");
e->setParameter("horz_align", "left");



mRayCaster = new RayCaster(Vector3::ZERO, Vector3::ZERO, World::getSingleton().getScene("Main"), 200);


if any one does a search on tutorial for NxOgre they are going to end up on your short guide OR the code on sourceforge that of 0.42RC


http://au.archive.ubuntu.com/sourceforge/n/nx/nxogre/
http://mirror.optus.net/sourceforge/n/nx/nxogre/?C=M;O=A
http://www.ftpdir.hu/ftp.planetmirror.com/disks/1/sourceforge/n/nx/nxogre/

betajaen

17-03-2008 12:27:40

The tutorials aren't very good. Even Ageia has dropped them.

Cake is much better and easier to understand.