Skip to content

Instantly share code, notes, and snippets.

View PcChip's full-sized avatar

Mike Dawson PcChip

View GitHub Profile
bool teMesh::MeshEntry::LoadDataToMemory(aiMesh *mesh)
{
//std::cout << "MeshEntry::LoadDataToMemory()\n";
vbo[VERTEX_BUFFER] = NULL;
vbo[TEXCOORD_BUFFER] = NULL;
vbo[NORMAL_BUFFER] = NULL;
vbo[INDEX_BUFFER] = NULL;
vbo[INSTANCE_BUFFER] = NULL;
PostProcessor::PostProcessor(teShader* shader, GLuint width, GLuint height)
: myShader(shader), myTexture(), myWidth(width), myHeight(height), Confuse(GL_FALSE), Chaos(GL_FALSE), Shake(GL_FALSE)
{
/*
Framebuffer MSFBO has:
- RenderBufferStorageMultisample RBO_Color
- RenderbufferStorageMultisample RBO_Depth
Framebuffer FBO has:
- FramebufferTexture2D myTexture.ID
@PcChip
PcChip / collisionInfo
Created March 28, 2020 13:24
collisionInfo
enum collisionGroups // http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Filtering
{
COLLISION_GROUP_NOTHING = 0,
COLLISION_GROUP_TERRAIN = BIT(0),
COLLISION_GROUP_ALL_BUILDINGS = BIT(1),
COLLISION_GROUP_GHOST_OBJECT_ATTACK_RANGE = BIT(2),
COLLISION_GROUP_UNITS = BIT(3),
COLLISION_GROUP_RAYCASTS_PICKING = BIT(4),
COLLISION_GROUP_RAYCASTS_HEIGHT = BIT(5),
COLLISION_GROUP_ENEMY_BUILDINGS = BIT(6),
@PcChip
PcChip / submitMesh.cpp
Created March 12, 2020 02:43
submitMesh
void te2GraphicsModule::submitMesh(glm::mat4 orientation, meshBase* whichMesh, teShader* whichShader)
{
ZoneScoped;
//std::cerr << "submitMesh(glm::mat4, meshBase*, teShader*)\n";
auto it = shadersAndMeshesToRender.find(whichShader);
if (it != shadersAndMeshesToRender.end()) //found the shader we need
{
//std::cout << "shader found, searching for mesh...\n";
@PcChip
PcChip / gist:c7e43c424595ee3c395d13818b3ae367
Created February 13, 2020 02:57
Derived class - question for EnTT component
class Weapon
{
public:
glm::vec3 currentFiringLocation; //updated every frame with new barrel exit location
float cooldownRemaining = 0.0f; //updated every tick to see when it can fire again
bool fixed = false; //fixed weapon, or turret?
virtual void fire(int targetGlobalID) = 0;
//the parameter below is because this weapon needs to know its owner's world location to draw the laser sprite