mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -04:00
fix motiontrail color
This commit is contained in:
parent
9e5e3edc5b
commit
4b315b5170
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user