www.pudn.com > tomohide_fur.03.13.02.zip > NormalMap.h


//----------------------------------------------------------------------------- 
// File: FurTexture.h 
// 
// Copyright (C) 2001-2002 Tomohide Kano. All rights reserved. 
//----------------------------------------------------------------------------- 
 
#pragma once 
 
class NormalMap 
{ 
public: 
	NormalMap(); 
	~NormalMap(); 
	bool Init(GLuint width, GLuint height); 
	void Update(FurMesh *pMesh, float dt, const D3DXVECTOR4& gravity, const D3DXVECTOR4& velocity, const D3DXVECTOR4& omega); 
	void ResetInertia(); 
	void Bind() const; 
	void BindOffsetMap() const; 
 
private: 
	bool InitTextures(); 
	bool InitShaders(); 
 
	GLuint m_Width; 
	GLuint m_Height; 
	GLuint m_texOffset; 
	GLuint m_texNormal; 
	GLuint m_texClamp; 
	GLuint m_texNormalize; 
	GLuint m_vsUpdateOffset; 
	GLuint m_fsUpdateOffset; 
	GLuint m_vsUpdateNormal; 
	GLuint m_fsUpdateNormal; 
 
	D3DXVECTOR4 m_PrevVel; 
	D3DXVECTOR4 m_Accel; 
	D3DXVECTOR4 m_PrevOmega; 
	D3DXVECTOR4 m_OmegaAccel; 
 
	GLuint I_FORCE; 
	GLuint I_OMEGA; 
	GLuint I_DAMPING; 
};