This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _loadIESProfile(self, name, filename): | |
""" Internal method to load an ies profile. Adapted from | |
https://gist.githubusercontent.com/AngryLoki/4364512/raw/ies2cycles.py """ | |
# self.debug("Loading ies profile", filename, "as",len(self.profileNames)) | |
profileMultiplier = 1.0 | |
# Open the IES file | |
with open(filename, 'r', encoding="utf-8", errors="ignore") as handle: | |
content = handle.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_fadeout_screen(self): | |
self.fadeout_screen = DirectFrame(frameColor=(0, 0, 0, 1), | |
frameSize=(-2, 2, -1, 1)) | |
def fadeout_task(self, task): | |
if self.fadeout_screen: | |
dt = globalClock.getDt() | |
seconds = 50 * dt | |
alpha = self.fadeout_screen['frameColor'][3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.arrows = [] | |
self.dropped_arrows = [] | |
self.arrow_brb_in_use = None | |
self.arrow_ref = None | |
self.target_np = None | |
self.arrow_nums_in_inv = 20 | |
self.prepare_arrows(self.bow, "bow_arrow", spine_joint) | |
self.draw_bow_is_done = 0 | |
taskMgr.add(self.cursor_state_task, "cursor_state_task") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from direct.gui.OnscreenImage import OnscreenImage | |
from direct.gui.OnscreenText import OnscreenText | |
from direct.interval.FunctionInterval import Func | |
from direct.interval.IntervalGlobal import Sequence, Wait, Parallel, ProjectileInterval | |
from direct.showbase.ShowBase import ShowBase | |
from direct.actor.Actor import Actor | |
from direct.task.TaskManagerGlobal import taskMgr | |
from panda3d.bullet import BulletSoftBodyNode, BulletCapsuleShape, BulletRigidBodyNode, ZUp, \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bow_shoot(self, actor_name, arrow_name, bow_name): | |
""" Function : bow_shoot | |
Description : Performs bow shooting. | |
Input : Strings, Nodepath | |
Output : None | |
Return : None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# player properties (health, stamina, etc) | |
self.frame_player_prop = DirectFrame(frameColor=(0.0, 0.0, 0.0, 0.0), | |
frameSize=self.base.frame_player_prop_size, | |
pos=(-0.5, 0, -0.15), | |
parent=self.base.frame_inv) | |
self.frame_player_prop_img = OnscreenImage(image=self.images['inv_frm_player_props'], | |
pos=(-0.3, 0, -0.34), | |
scale=(0.9, 0, 0.3), | |
parent=self.frame_player_prop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from direct.showbase.ShowBase import ShowBase | |
from direct.actor.Actor import Actor | |
class MyApp(ShowBase): | |
def __init__(self): | |
ShowBase.__init__(self) | |
# assemble player from the parts and attach it to render node | |
# all parts have same skeleton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* vertex shader */ | |
#version 130 | |
uniform mat4 p3d_ModelViewProjectionMatrix; | |
in vec4 p3d_Vertex; | |
in vec3 p3d_Normal; | |
in vec4 p3d_MultiTexCoord0; | |
in vec4 offset; | |
in vec4 uv; | |
in vec4 p3d_Color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from panda3d.core import * | |
from direct.gui.DirectGui import * | |
from direct.gui.OnscreenText import OnscreenText | |
import random | |
import sys | |
HIDDEN = 0 | |
VISIBLE = 1 | |
MIDDLE = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base.camera.set_y(base.camera.get_y() + 7.0 * dt) |