39#ifndef SEGLINERENDERER_H
40#define SEGLINERENDERER_H
56#define MAX_SEGLINE_SUBDIV_LEVELS 7
113 void Set_Merge_Intersections(
int onoff) {
if (onoff) { Bits |= MERGE_INTERSECTIONS; }
else { Bits &= ~MERGE_INTERSECTIONS; }; }
114 void Set_Freeze_Random(
int onoff) {
if (onoff) { Bits |= FREEZE_RANDOM; }
else { Bits &= ~FREEZE_RANDOM; }; }
115 void Set_Disable_Sorting(
int onoff) {
if (onoff) { Bits |= DISABLE_SORTING; }
else { Bits &= ~DISABLE_SORTING; }; }
116 void Set_End_Caps(
int onoff) {
if (onoff) { Bits |= END_CAPS; }
else { Bits &= ~END_CAPS; }; }
121 unsigned int point_count,
132 void subdivision_util(
unsigned int point_cnt,
const Vector3 *xformed_pts,
133 const float *base_tex_v,
unsigned int *p_sub_point_cnt,
134 Vector3 *xformed_subdiv_pts,
float *subdiv_tex_v,
145 unsigned int SubdivisionLevel;
146 float NoiseAmplitude;
151 float MergeAbortFactor;
156 float TextureTileFactor;
159 unsigned int LastUsedSyncTime;
164 enum BitShiftOffsets {
165 TEXTURE_MAP_MODE_OFFSET = 24
168 MERGE_INTERSECTIONS = 0x00000001,
169 FREEZE_RANDOM = 0x00000002,
170 DISABLE_SORTING = 0x00000004,
171 END_CAPS = 0x00000008,
174 TEXTURE_MAP_MODE_MASK = 0xFF000000,
183 unsigned int m_vertexBufferSize;
191 return (
TextureMapMode)((Bits & TEXTURE_MAP_MODE_MASK) >> TEXTURE_MAP_MODE_OFFSET);
196 Bits &= ~TEXTURE_MAP_MODE_MASK;
197 Bits |= ((mode << TEXTURE_MAP_MODE_OFFSET) & TEXTURE_MAP_MODE_MASK);
202 return UVOffsetDeltaPerMS * 1000.0f;
207 UVOffsetDeltaPerMS = rate * 0.001f;
Color scale(const Color &a, const Color &b)
void Render(RenderInfoClass &rinfo, const Matrix3D &transform, unsigned int point_count, Vector3 *points, const SphereClass &obj_sphere, Vector4 *rgbas=0)
TextureMapMode Get_Texture_Mapping_Mode(void) const
void Set_Texture_Tile_Factor(float factor)
void Set_Texture(TextureClass *texture)
~SegLineRendererClass(void)
@ UNIFORM_WIDTH_TEXTURE_MAP
@ UNIFORM_LENGTH_TEXTURE_MAP
unsigned int Get_Current_Subdivision_Level(void) const
void Set_Texture_Mapping_Mode(TextureMapMode mode)
void Set_Current_Subdivision_Level(unsigned int lv)
int Is_Freeze_Random(void) const
SegLineRendererClass & operator=(const SegLineRendererClass &that)
void Set_End_Caps(int onoff)
float Get_Width(void) const
void Set_Width(float width)
SegLineRendererClass(void)
void Set_Noise_Amplitude(float amplitude)
void Set_Merge_Abort_Factor(float factor)
Vector2 Get_UV_Offset_Rate(void) const
void Set_Shader(ShaderClass shader)
float Get_Noise_Amplitude(void) const
void Set_Disable_Sorting(int onoff)
void Set_Merge_Intersections(int onoff)
int Is_Merge_Intersections(void) const
friend class SegmentedLineClass
void Init(const W3dEmitterLinePropertiesStruct &props)
TextureClass * Get_Texture(void) const
float Get_Opacity(void) const
void Set_Freeze_Random(int onoff)
void Set_UV_Offset_Rate(const Vector2 &rate)
void Set_Current_UV_Offset(const Vector2 &offset)
const Vector3 & Get_Color(void) const
int Is_Sorting_Disabled(void) const
ShaderClass Get_Shader(void) const
float Get_Texture_Tile_Factor(void) const
void Set_Color(const Vector3 &color)
void Set_Opacity(float opacity)
TextureClass * Peek_Texture(void) const
int Are_End_Caps_Enabled(void) const
float Get_Merge_Abort_Factor(void) const