irrlicht/source/Irrlicht/CQuake3ShaderSceneNode.h
engineer_apple a905ccbd77 -------------------------------------------
Changes in version 1.4 (... 13.11.2007)
- Fixed somed CQuake3ShaderSceneNode problems.
- Changed BurningsVideo internal Vertex Format. version changed to 0.39
- SceneManager:
   Removed the seperate rendering states for quake3 Shader Scene Nodes.
   Nodes are now solid or transparent. ( but still more states are needed )


git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@1047 dfc29bdd-3216-0410-991c-e03cc46cb475
2007-11-13 14:36:17 +00:00

85 lines
2.2 KiB
C++

// Copyright (C) 2002-2007 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_QUAKE3_SCENE_NODE_H_INCLUDED__
#define __C_QUAKE3_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "IQ3Shader.h"
#include "IFileSystem.h"
#include "SMeshBuffer.h"
#include "SMeshBufferLightMap.h"
namespace irr
{
namespace scene
{
//! Scene node which is a quake3 shader.
class CQuake3ShaderSceneNode : public scene::ISceneNode
{
public:
CQuake3ShaderSceneNode( ISceneNode* parent, ISceneManager* mgr,s32 id,
io::IFileSystem *fileSystem,IMeshBuffer *buffer,
const quake3::SShader * shader
);
virtual ~CQuake3ShaderSceneNode ();
virtual void OnRegisterSceneNode();
virtual void render();
virtual void OnAnimate(u32 timeMs);
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual u32 getMaterialCount() const;
virtual video::SMaterial& getMaterial(u32 i);
private:
SMeshBuffer MeshBuffer;
SMeshBufferLightMap Original;
const quake3::SShader * Shader;
struct SQ3Texture
{
SQ3Texture () :
TextureIndex ( 0 ),
TextureFrequency(0.f),
TextureAddressMode( video::ETC_REPEAT ) {}
quake3::tTexArray Texture;
u32 TextureIndex;
f32 TextureFrequency;
video::E_TEXTURE_CLAMP TextureAddressMode; // Wrapping/Clamping
};
core::array< SQ3Texture > Q3Texture;
void loadTextures ( io::IFileSystem * fileSystem );
void cloneBuffer ( scene::SMeshBufferLightMap * buffer );
void vertextransform_wave ( f32 dt, quake3::SModifierFunction &function );
void vertextransform_bulge( f32 dt, quake3::SModifierFunction &function );
void vertextransform_autosprite( f32 dt, quake3::SModifierFunction &function );
void vertextransform_tcgen ( f32 dt, quake3::SModifierFunction &function );
void vertextransform_rgbgen ( f32 dt, quake3::SModifierFunction &function );
void transformtex ( const core::matrix4 &m, const u32 clamp );
f32 TimeAbs;
void animate( u32 stage, core::matrix4 &texture );
bool isTransparent ();
};
} // end namespace scene
} // end namespace irr
#endif