thug/Code/Gfx/NGC/p_NxGeom.h

126 lines
5.2 KiB
C
Raw Normal View History

2016-02-13 21:39:12 +00:00
//****************************************************************************
//* MODULE: Gfx
//* FILENAME: p_nxGeom.h
//* OWNER: Gary Jesdanun
//* CREATION DATE: 3/5/2002
//****************************************************************************
#ifndef __GFX_P_NX_GEOM_H__
#define __GFX_P_NX_GEOM_H__
#include "gfx/nxgeom.h"
#include "gfx/Ngc/p_nxsector.h"
#include "gfx/Ngc/p_nxmesh.h"
namespace Mth
{
class Matrix;
}
namespace NxNgc
{
class CInstance;
}
namespace Nx
{
/******************************************************************/
/* */
/* */
/******************************************************************/
/////////////////////////////////////////////////////////////////////////////////////
//
// Here's a machine specific implementation of the CGeom
class CNgcGeom : public CGeom
{
public:
CNgcGeom();
virtual ~CNgcGeom();
void SetInstance( NxNgc::CInstance *p_instance ) { mp_instance = p_instance; }
NxNgc::CInstance *GetInstance( void ) { return mp_instance; }
void InitMeshList();
void ClearMeshList();
void AddMesh( NxNgc::sMesh * );
Lst::Head< NxNgc::sMesh > *GetMeshList();
void CreateMeshArray();
bool RegisterMeshArray( bool just_count );
void DestroyMeshArray( void );
const Mth::CBBox & GetBoundingBox( void ) { return m_bbox; }
void SetScene( CNgcScene *p_scene ) { mp_scene = p_scene; }
NxNgc::sScene *GenerateScene( void );
Mth::Vector * GetOffset( void ) { return &m_mod.offset; }
Mth::Vector * GetScale( void ) { return &m_mod.scale; }
private: // It's all private, as it is machine specific
virtual bool plat_load_geom_data( CMesh *pMesh, CModel *pModel, bool color_per_material );
virtual void plat_set_active( bool active );
virtual bool plat_is_active( void ) const;
const Mth::CBBox & plat_get_bounding_box( void ) const;
virtual void plat_set_bounding_sphere( const Mth::Vector& boundingSphere );
virtual const Mth::Vector plat_get_bounding_sphere( void ) const;
virtual void plat_set_world_position( const Mth::Vector& pos );
virtual const Mth::Vector & plat_get_world_position() const;
virtual bool plat_render( Mth::Matrix* pRootMatrix, Mth::Matrix* ppBoneMatrices, int numBones );
virtual void plat_set_bone_matrix_data( Mth::Matrix* pBoneMatrices, int numBones );
virtual bool plat_hide_polys( uint32 mask );
virtual uint32 plat_get_visibility( void ) const;
virtual void plat_set_visibility( uint32 mask );
virtual void plat_set_color( Image::RGBA rgba );
virtual void plat_clear_color( void );
virtual Image::RGBA plat_get_color( void ) const;
virtual CNgcGeom *CNgcGeom::plat_clone( bool instance, CScene *p_dest_scene = NULL );
virtual CNgcGeom *CNgcGeom::plat_clone( bool instance, CModel* pDestModel );
virtual void plat_set_orientation(const Mth::Matrix& orient);
virtual void plat_rotate_y(Mth::ERot90 rot);
virtual void plat_set_transform(const Mth::Matrix& transform);
virtual const Mth::Matrix & plat_get_transform() const;
virtual int plat_get_num_render_verts( void );
virtual void plat_get_render_verts( Mth::Vector *p_verts );
virtual void plat_get_render_colors( Image::RGBA *p_colors );
virtual void plat_set_render_verts( Mth::Vector *p_verts );
virtual void plat_set_render_colors( Image::RGBA *p_colors );
virtual void plat_set_model_lights( CModelLights* p_model_lights );
virtual void plat_set_scale(const Mth::Vector& scale);
virtual Mth::Vector plat_get_scale() const;
virtual bool plat_set_material_color( uint32 mat_name_checksum, int pass, Image::RGBA rgba );
virtual void plat_set_uv_wibble_params( float u_vel, float u_amp, float u_freq, float u_phase, float v_vel, float v_amp, float v_freq, float v_phase );
virtual void plat_use_explicit_uv_wibble( bool yes );
virtual void plat_set_uv_wibble_offsets( float u_offset, float v_offset );
virtual bool plat_set_uv_wibble_offsets( uint32 mat_name_checksum, int pass, float u_offset, float v_offset );
virtual bool plat_set_uv_matrix( uint32 mat_name_checksum, int pass, const Mth::Matrix& mat );
virtual bool plat_allocate_uv_matrix_params( uint32 mat_checksum, int pass );
public:
Mth::CBBox m_bbox;
CNgcScene * mp_scene;
Lst::Head< NxNgc::sMesh > *mp_init_mesh_list;
NxNgc::sMesh ** m_mesh_array;
uint m_num_mesh;
uint32 m_visible;
bool m_active;
private:
NxNgc::CInstance *mp_instance;
CNgcMesh *mp_mesh; // Used for obtaining CAS poly removal data.
NxNgc::sMeshMod m_mod;
int build_index_map( int * p_pos_index, int * p_col_index );
};
/******************************************************************/
/* */
/* */
/******************************************************************/
} // Nx
#endif