Game Development Community

Bitmap projectiles not displaying correctly

by Adam Beaumont · in Torque Game Engine · 11/06/2003 (1:23 am) · 0 replies

I've made a small change to some projectile code so that whenever you fire something it gets displayed as a bitmap that always faces the viewer and not a mesh. This seems to work ok in most cases but occasionally the bitmaps don't display and so it looks like u are firing nothing (even though the hit effects etc happen so u did fire something).

I haven't been able to figure out a consistent set of circumstances as to why this is happening. The change I made was simply to check in renderObject to see if a shape exists and if not call a new function to render the billboard representation of the projectile. The business end of that code is:

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDepthMask(GL_FALSE);
glBindTexture(GL_TEXTURE_2D, mTextureHandle.getGLName());
dglDrawBillboard( getPosition(), 4, 0.0 );

Anyone have any ideas on the sort of thing I should check to try and stop this problem? Firing a laser isn't half as involving if u don't have the visual cue of the laser bolt to help u out !

Adam