fix motiontrail color

This commit is contained in:
David Rose 2009-01-09 19:39:23 +00:00
parent 9e5e3edc5b
commit 4b315b5170

View File

@ -14,6 +14,8 @@
#include "directbase.h"
#include "cMotionTrail.h"
#include "renderState.h"
#include "colorAttrib.h"
TypeHandle CMotionTrail::_type_handle;
@ -326,6 +328,10 @@ add_geometry_quad (LVector4f &v0, LVector4f &v1, LVector4f &v2, LVector4f &v3, L
// Description:
////////////////////////////////////////////////////////////////////
void CMotionTrail::end_geometry ( ) {
static CPT(RenderState) state;
if (state == (RenderState *)NULL) {
state = RenderState::make(ColorAttrib::make_vertex());
}
PT(Geom) geometry;
@ -334,7 +340,7 @@ void CMotionTrail::end_geometry ( ) {
if (_geom_node) {
_geom_node -> remove_all_geoms ( );
_geom_node -> add_geom (geometry);
_geom_node -> add_geom (geometry, state);
}
}