Shader linking i guess
This commit is contained in:
23
game/server/light.cpp
Normal file
23
game/server/light.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "light.h"
|
||||
|
||||
BEGIN_DATADESC(CBaseLight)
|
||||
DEFINE_KEYFIELD(m_vColor, FIELD_COLOR4, "color")
|
||||
DEFINE_KEYFIELD(m_fBrightness, FIELD_FLOAT, "brightness")
|
||||
DEFINE_KEYFIELD(m_fRadius, FIELD_FLOAT, "radius")
|
||||
DEFINE_KEYFIELD(m_eLightFlags, FIELD_INTEGER, "light_flags")
|
||||
DEFINE_KEYFIELD(m_bIsEnabled, FIELD_BOOLEAN, "enabled")
|
||||
END_DATADESC()
|
||||
|
||||
IMPLEMENT_SEND_DT(CBaseLight)
|
||||
NetPropColor4(m_vColor),
|
||||
NetPropFloat(m_fBrightness),
|
||||
NetPropFloat(m_fRadius),
|
||||
NetPropInt(m_eLightFlags),
|
||||
NetPropBool(m_bIsEnabled),
|
||||
END_SEND_DT()
|
||||
|
||||
IMPLEMENT_EMPTY_RECV_DT(CBaseLight)
|
||||
|
||||
|
||||
|
||||
LINK_ENTITY_TO_CLASS(light_point, CPointLight);
|
||||
27
game/server/light.h
Normal file
27
game/server/light.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef LIGHT_H
|
||||
#define LIGHT_H
|
||||
|
||||
#include "pointentity.h"
|
||||
#include "../shared/light.h"
|
||||
|
||||
class CBaseLight: public CPointEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CBaseLight, CPointEntity)
|
||||
DECLARE_DATADESC()
|
||||
DECLARE_SERVERCLASS()
|
||||
|
||||
ColorAlpha m_vColor;
|
||||
float m_fBrightness;
|
||||
float m_fRadius;
|
||||
int m_eLightFlags;
|
||||
bool m_bIsEnabled;
|
||||
};
|
||||
|
||||
class CPointLight: public CBaseLight
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CPointLight, CBaseLight);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
CMOBAPlayer::CMOBAPlayer()
|
||||
{
|
||||
m_hCuboid = g_pPhysics->CreateBall({1});
|
||||
m_hCuboid = g_pPhysics->CreateCube({1,1,1});
|
||||
|
||||
}
|
||||
|
||||
CMOBAPlayer::~CMOBAPlayer()
|
||||
@@ -16,25 +17,16 @@ CMOBAPlayer::~CMOBAPlayer()
|
||||
void CMOBAPlayer::Spawn()
|
||||
{
|
||||
CBaseEntity::Spawn();
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> a2652ed (merges)
|
||||
SetPhysics(k_EPhysics_Static);
|
||||
SetModel("game/core/models/sphere.fmdl");
|
||||
SetScale(1);
|
||||
SetAbsOrigin({0,-14.5, 0});
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
=======
|
||||
SetModel("game/core/models/sphere.fmdl");
|
||||
SetScale(1);
|
||||
SetAbsOrigin({0,-11.5, 0});
|
||||
>>>>>>> c251089 (different stuff in physics)
|
||||
>>>>>>> a2652ed (merges)
|
||||
SetThink(Think);
|
||||
};
|
||||
|
||||
bool CMOBAPlayer::CheckMask( HCollider hCollider )
|
||||
{
|
||||
return true;
|
||||
};
|
||||
|
||||
void CMOBAPlayer::Think( float fDelta )
|
||||
{
|
||||
BaseClass::Think(fDelta);
|
||||
@@ -47,18 +39,11 @@ void CMOBAPlayer::Think( float fDelta )
|
||||
|
||||
vPosition.x += m_vMovementVector.x*fDelta*5;
|
||||
vPosition.z += m_vMovementVector.z*fDelta*5;
|
||||
<<<<<<< HEAD
|
||||
SetAbsOrigin(vPosition);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
=======
|
||||
CastResult_t result = g_pPhysicsWorld->ShapeCast(m_hCuboid, {0,0,0,1}, vPosition, {vPosition.x, vPosition.y, -100});
|
||||
CastResult_t result = g_pPhysicsWorld->ShapeCast(m_hCuboid, {0,0,0,1}, vPosition, {vPosition.x, vPosition.y, -100}, CheckMask);
|
||||
if (result.m_bIsHit)
|
||||
SetAbsOrigin(result.m_vCollisionPoint);
|
||||
else
|
||||
SetAbsOrigin(vPosition);
|
||||
>>>>>>> c251089 (different stuff in physics)
|
||||
>>>>>>> a2652ed (merges)
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS(player, CMOBAPlayer)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#include "physicsprop.h"
|
||||
|
||||
class CMOBAPlayer: public CPhysicsProp
|
||||
class CMOBAPlayer: public CBaseModelEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CMOBAPlayer, CPhysicsProp);
|
||||
DECLARE_CLASS(CMOBAPlayer, CBaseModelEntity);
|
||||
DECLARE_DATADESC();
|
||||
DECLARE_SERVERCLASS()
|
||||
|
||||
@@ -14,6 +14,8 @@ public:
|
||||
virtual ~CMOBAPlayer();
|
||||
virtual void Spawn( void ) override;
|
||||
void Think( float fDelta );
|
||||
|
||||
static bool CheckMask( HCollider hCollider );
|
||||
private:
|
||||
Vector m_vMovementVector = {};
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
#include "pointentity.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user