Skip to content

Instantly share code, notes, and snippets.

View tobspr's full-sized avatar
💭
I may be slow to respond.

Tobias tobspr

💭
I may be slow to respond.
View GitHub Profile
From 47c83fce1f4a96954a5db33c6be875e17a4675cc Mon Sep 17 00:00:00 2001
From: tobspr <tobias.springer1@googlemail.com>
Date: Sat, 27 Feb 2016 17:35:53 +0100
Subject: [PATCH] Support for p3d_PrevModelViewMatrix, populate previous
transform during cull stage
---
panda/src/collide/collisionVisualizer.cxx | 7 +-
panda/src/display/callbackGraphicsWindow.cxx | 3 +-
panda/src/display/graphicsEngine.cxx | 4 ++
def get_ini_conf(fname):
""" Very simple .ini file reader, with no error checking """
with open(fname, "r") as handle:
return {i.split("=")[0].strip(): i.split("=")[-1].strip() for i in handle.readlines() if i.strip()}
def write_ini_conf(config, fname):
""" Very simple .ini file writer, with no error checking """
with open(fname, "w") as handle:
def bindToWindow( windowHandle):
# Window handle is a integer, identifying the windows control id.
# You can get it with int(pyQtWidget.winId())
wp = WindowProperties().getDefault()
wp.setOrigin(0, 0)
wp.setSize(widgetX, widgetY)
wp.setParentWindow(windowHandle)
base.openDefaultWindow(props=wp)
class BetterOnscreenImage(DebugObject):
def __init__(self, image=None, parent=None, x=0, y=0, w=10, h=10, transparent=True, nearFilter=True):
DebugObject.__init__(self, "BOnscreenImage")
self.initialPos = Vec3(x + w / 2.0, 1, -y - h / 2.0)
self._node = OnscreenImage(
image=image, parent=parent, pos=self.initialPos, scale=(w / 2.0, 1, h / 2.0))
float edgePreservingAlphaBlur(vec2 texcoord, ivec2 screenCoord, ivec2 direction, sampler2D colorTex, sampler2D normalTex) {
#ifndef USE_OCCLUSION_BLUR
return texture(colorTex, texcoord).a;
#endif
#ifdef DSSDO_ENABLED
class Light:
def __init__(self):
self.data = ParamStruct()
self.position = ParamVec3()
self.rotation = ParamVec3()
self.color = ParamVec3()
# alternatively, pass a name argument to the ParamVec3
cmake_minimum_required (VERSION 2.6)
project (RPCore)
set(CMAKE_BUILD_TYPE "Release")
# Configure this variables to your needs
# NO TRAILING SLASH!!
set(PANDA_SRC "E:/P3D/1.9.0-1/")
set(PANDA_BUILT "E:/P3D/1.9.0-1/built_x64")
// DemoClass.h
#include "stdafx.h"
class DemoClass {
PUBLISHED:
DemoClass();
~DemoClass();
};
cmake_minimum_required (VERSION 2.6)
project (RPCore)
set(PANDA_SRC "E:/P3D/1.9.0-1/")
set(PANDA_BUILT "E:/P3D/1.9.0-1/built_x64")
# Link panda includes
include_directories("${PANDA_BUILT}/include")
from DebugObject import DebugObject
from panda3d.core import PTAInt, PTAFloat, PTAMat4
from panda3d.core import PTALVecBase2f, PTALVecBase3f
class ShaderStructElement:
""" Classes which should be passed to a ShaderStructArray have
to be subclasses of this class """