Started work on build system

This commit is contained in:
2025-05-31 00:42:41 +03:00
parent 953cca2aa4
commit ade32c24a6
33 changed files with 369 additions and 498 deletions

View File

@@ -8,11 +8,9 @@ class CLight: public CBaseEntity
public:
virtual void Precache ( void ) override;
virtual void Spawn( void ) override;
virtual void ReadParameter( const char *szName, const char *szValue ) override;
virtual void Destroy( void ) override;
virtual void Think( float fDelta ) override;
private:
Collider* col;
RigidBodyHandle *m_body;
};
void CLight::Precache()
@@ -22,31 +20,22 @@ void CLight::Precache()
void CLight::Spawn()
{
px_collider_params params = {};
params.friction = 0.7;
col = px_box(0.5,0.5,0.5, params);
px_matrix mat = {};
mat.m[0] = 1;
mat.m[5] = 1;
mat.m[10] = 1;
mat.m[15] = 1;
mat.m[11]=10;
mat.m[7]=-4;
mat.m[3]=12;
px_rigidbody_params param = {};
param.gravity_scale = 1;
m_body=px_rigidbody(px, col, mat, param);
};
void CLight::ReadParameter( const char *szName, const char *szValue )
{
CBaseEntity::ReadParameter(szName, szValue);
}
void CLight::Destroy()
{
}
void CLight::Think( float fDelta )
{
px_matrix pos = px_getmatrix(px, m_body);
V_memcpy(m_matrix, pos.m, 64);
V_printf("%p %f %f %f\n",col, pos.m[12], pos.m[13], pos.m[14]);
};
DECLARE_ENTITY(light, CLight)