Game Development Community

Porting Laser to TGEA - Done

by James Laker (BurNinG) · in Torque Game Engine Advanced · 01/24/2007 (3:57 am) · 28 replies

Hey there.

Me again. I'm trying to port the Continious Laser resource over to TGEA. Now I know I should debug it... but thats a looong story (Only have Visual Studio 2005 at work atm).

I've managed to get it to compile without errors, and it does fire the laser. I can even see the laser for like a fraction of a second, and then it crashes. I

Im thinking its in the rendering code, and would like you to just glance through this and tell me if you see any errors ive made in the porting process:

void Laser::renderObject(SceneState* state, RenderInst *ri)
{
   
	//AssertFatal(dglIsInCanonicalState(), "Error, GL not in canonical state on entry");

   //RectI viewport;
   //glMatrixMode(GL_PROJECTION);
   //glPushMatrix();
   //dglGetViewport(&viewport);

	RectI viewport = GFX->getViewport();
	MatrixF projection = GFX->getProjectionMatrix();
	MatrixF world = GFX->getWorldMatrix();
	MatrixF view = GFX->getViewMatrix();

	//GFX->disableShaders();
	state->setupBaseProjection();

   // Uncomment this if this is a "simple" (non-zone managing) object
   state->setupObjectProjection(this);
	GFX->setProjectionMatrix(projection);

   //prepModelView( state );
   //glScalef( mDataBlock->scale.x, mDataBlock->scale.y, mDataBlock->scale.z );

   if(mProjectileShape)
   {
      AssertFatal(mProjectileShape != NULL,
                  "Laser::renderObject: Error, projectile shape should always be present in renderObject");
      mProjectileShape->selectCurrentDetail();
      mProjectileShape->animate();

      Point3F cameraOffset;
      mObjToWorld.getColumn(3,&cameraOffset);
      cameraOffset -= state->getCameraPosition();
      F32 fogAmount = state->getHazeAndFog(cameraOffset.len(),cameraOffset.z);

      if (mFadeValue == 1.0) {
         mProjectileShape->setupFog(fogAmount, state->getFogColor());
      } else {
         mProjectileShape->setupFog(0.0, state->getFogColor());
         mProjectileShape->setAlphaAlways(mFadeValue * (1.0 - fogAmount));
      }
      mProjectileShape->render();
   }
<---------------- GLUE --------------- >
Page«First 1 2 Next»
#21
02/09/2009 (4:53 am)
I'd be interested in this code as well.

Thanks.
#22
02/09/2009 (11:27 am)
I think I found it on my drive.

laser.cc
#23
02/09/2009 (5:43 pm)
Thank you for the file, I haven't got to look at it closely yet.

I am also curious about the last comment of added interpolation, I'd like to see how that was done as well.
#24
02/09/2009 (11:38 pm)
Just so you guys know. I did find it. Will stick it up here when I get home - need some cleaning up though.
#25
02/10/2009 (6:59 pm)
thanks James
#26
03/15/2009 (4:20 am)
bump - did you manage to clean up the file James?
#27
03/16/2009 (12:37 am)
Sometime during the week. Hang in there :)
#28
04/03/2009 (8:21 am)
Still interested in the end result.

Thanks.
Page«First 1 2 Next»