Skip to content

Instantly share code, notes, and snippets.

View Razzlegames's full-sized avatar

Kyle Luce Razzlegames

View GitHub Profile
// Vertex shader
/**
* This is for rendering colored liquid/particles using LiquidFun etc
*/
uniform mat4 u_view_projection_matrix;
uniform float u_depth;
attribute vec4 a_Position;
attribute vec4 a_color;
@Razzlegames
Razzlegames / GLShaderFunctionMapping.cpp
Created May 9, 2015 06:34
A interface layer to mape old ARB API to newer opengl function names
#ifndef ANDROID_NDK
#include <GL/glew.h>
#endif
#include "Logging.h"
#include "GLIncludes.h"
#include "GLHelpers.h"
//*****************************************************************************
[merge]
tool = vimdiff
[diff]
tool = vimdiff
[color]
ui = auto
[core]
excludesfile = /home/kyle2/.gitignore_global
editor = vim -c \"setlocal spell spelllang=en_us\"
[user]
#*****************************************************************
func _ready():
var child_count = get_tree().get_root().get_child_count()
var scene = get_tree().get_root().get_child(child_count-1)
print("current scene" + str(scene) + "child count: "+ \
str(scene.get_child_count()))
pass
# Output:
#
#*****************************************************************
func _input(event):
if(event.is_action_pressed("jump") &&
!event.is_echo() && event.is_action("jump")):
handleJumpAction()
pass
const STATIC = 0
const SPINNING = 1
var spin_state = STATIC
#*****************************************************************
func _process(delta):
if(spin_state == SPINNING):
for i in range(5):
doStuff()
spin_state = STATIC
#*****************************************************************
#
func _ready();
# .. Do a bunch of other stuff you want before this
ground_ray = get_node("ground_ray_cast")
ground_ray.add_exception(self)
#*****************************************************************
float PI = 3.1415926535;
uniform float aperture = 178.0;
float apertureHalf = 0.5 * aperture * (PI / 180.0);
float maxFactor = sin(apertureHalf);
vec2 uv;
vec2 xy;
xy.x = 2.0 * SCREEN_UV.x - 1.0;
xy.y = 2.0 * SCREEN_UV.y - 1.0;
extends Spatial
func _ready():
set_process(true)
pass
func _process(delta):
# Raw epoc time (in utc)
extends RigidBody
# member variables here, example:
# var a=2
# var b="textvar"
const DEFAULT_LIFE_TIME = 5
var life_timeout = DEFAULT_LIFE_TIME
var life_timer