public synchronized static void render( RenderContext glRenderContext, PrototypeReference prototype,
DirectGeometryBuffer buffer ) {
if ( prototype == null || prototype.getPrototypeID() == null ) {
return;
}
RenderablePrototype model = prototypes.get( prototype.getPrototypeID() );
if ( model == null ) {
LOG.warn( "No model found for prototype: " + prototype.getPrototypeID() );
return;
}
GL context = glRenderContext.getContext();
context.glPushMatrix();
float[] loc = prototype.getLocation();
context.glTranslatef( loc[0], loc[1], loc[2] );
context.glRotatef( prototype.getAngle(), 0, 0, 1 );
context.glScalef( prototype.getWidth(), prototype.getDepth(), prototype.getHeight() );
if ( buffer == null ) {
model.render( null );
} else {
model.renderPrepared( glRenderContext, buffer );
}
context.glPopMatrix();
}