Fires when the block you were digging has broken.
Whether the block is diggable. This returns false for air, water, lava, etc.
| // Methods of Dealing with Metadata (such as whether a lever is turned on or off (powered or unpowered) | |
| // 1: | |
| mf.Metadata.Levers = { | |
| "SideEastOff": 1, | |
| "SideWestOff": 2, | |
| "SideSouthOff": 3, | |
| "SideNorthOff": 4, | |
| "TopNorthOff": 5, |
| GLfloat LightPos[] = { 10.0f, 0.0f, 0.0f, 1.0f}; | |
| void setupProjectionMatrix() { | |
| glMatrixMode(GL_PROJECTION); | |
| glLoadIdentity(); | |
| glViewport(0,0,WindowWidth,WindowHeight); | |
| gluPerspective(FieldOfView, AspectRatio, NearPlane, FarPlane); | |
| glMatrixMode(GL_MODELVIEW); | |
| } |
| void printType(string type) { | |
| if (typeOf[type].length()) { | |
| return; | |
| } | |
| vector<string> matches; | |
| for (int i = 0; i < symbols.size(); i++) { | |
| string base = getBaseType(symbols[i]); | |
| if (base.compare(type) == 0 && symbols[i].compare(type)) { // symbols[i]'s base is type, but isn't actually type |
| Camera camera = m_Scene.m_Camera; | |
| Vector cameraPosition = camera.GetPosition(); | |
| // Camera Coordinates directions | |
| Vector negZ = (camera.GetTarget() - cameraPosition).Normalize(); | |
| Vector posY = camera.GetUp().Normalize(); | |
| Vector posX = negZ.Cross(posY).Normalize(); | |
| float FOV = camera.GetFOV(); | |
| float nearZ = camera.GetNearClip(); |
| // - DiffuseColor - Returns the Diffuse color for the specified material and light | |
| Vector DiffuseColor(Vector materialDiffuse, SceneLight light, Vector normal, Vector lightv) | |
| { | |
| float distance = lightv.Magnitude(); | |
| float distanceTerm = 1.0f / (light.attenuationConstant + light.attenuationLinear * distance + light.attenuationQuadratic * distance * distance); | |
| return materialDiffuse * light.color * (normal.Dot(lightv)) * distanceTerm; | |
| } |
| import os, sys | |
| with open("classes_and_grades.txt") as classes_and_grades: | |
| for line in classes_and_grades: | |
| data = line.split("\t") | |
| fixed = [] | |
| for item in data: | |
| stripped = item.strip() | |
| if stripped: | |
| fixed.append(stripped) |
| find [Path] | grep -i <file name> | |
| # Path defaults to the current directory. | |
| # Using -i for case-insensitive searching. | |
| # Using -E will do regex parsing. |
| git tag -a Tag_Name 0123456 -m 'MessageHere' |
| def flip_y(y): | |
| """Small hack to convert normal coordinates to pygame coordinates""" | |
| return -y+GAME_WINDOW_HEIGHT |