Skip to content

Instantly share code, notes, and snippets.

View kergalym's full-sized avatar

Galym Kerimbekov kergalym

  • Kazakhstan
View GitHub Profile
@kergalym
kergalym / ue5build.sh
Created August 7, 2024 17:23
UE5 build notes on Linux 64 bit
#!/bin/bash
PATH = "/media/FASTBIG"
TAR_DEST = "/media/FASTBIG"
# Rebuild
cd $PATH/UnrealEngine-release/
rm -rf Engine/Binares Engine/Intermediate
# Configure engine with packaging platforms: only linux
./Setup.sh -exclude=WinRT -exclude=winrt -exclude=Mac -exclude=mac -exclude=osx \
-exclude=osx64 -exclude=osx32 -exclude=Android -exclude=android -exclude=IOS \
@kergalym
kergalym / player_archery.py
Created November 10, 2022 10:53
[Panda3D] Player Archery
import random
from direct.gui.OnscreenText import OnscreenText
from direct.task.TaskManagerGlobal import taskMgr
from panda3d.bullet import BulletRigidBodyNode, BulletBoxShape
from panda3d.core import BitMask32, NodePath, Vec3, TextNode, Point3
from Settings.Input.aim import Aim
class PlayerArchery:
@kergalym
kergalym / cloak_pinning_fragment.py
Last active October 1, 2022 16:49
Panda3D: Cloak Pinning Fragment Code
# Pin the cloak down
spine_bone = actor.expose_joint(None, 'modelRoot', 'Korlan:Spine2')
self.spine_bones[name] = spine_bone
pin = spine_bone.attach_new_node(BulletRigidBodyNode('pin'))
self.cloth_pins[name] = pin
# Position of the cloak get's shifted, fix it
pin.set_z(0)
@kergalym
kergalym / state_machine_fragment.py
Last active September 5, 2022 20:04
[Panda3D] Horse Mounting State
self.mount_sequence = {npc_name: Sequence()}
def enterHorseMount(self, actor, child, parent):
if actor and parent and child:
actor_name = actor.get_name()
if not self.mount_sequence[actor_name].is_playing():
# Our horse (un)mounting animations have been made with imperfect positions,
# so, I had to change child positions to get more satisfactory result
# with these animations in my game.
mounting_pos = Vec3(0.5, -0.15, -0.45)
@kergalym
kergalym / camera_collider.py
Last active August 23, 2022 08:59
Camera Collider class for Panda3D
from direct.interval.LerpInterval import LerpPosInterval
from direct.task.TaskManagerGlobal import taskMgr
from panda3d.bullet import BulletSphereShape, BulletGhostNode
from panda3d.core import BitMask32, Point3
class CameraCollider:
def __init__(self):
self.base = base
@kergalym
kergalym / backtrace
Created July 10, 2022 17:54
Panda3D Backtrace
Thread 1 "python3.9" received signal SIGSEGV, Segmentation fault.
0x00007fffee5ae550 in ?? () from /usr/lib64/libnvidia-glcore.so.470.103.01
(gdb) bt
#0 0x00007fffee5ae550 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#1 0x00007fffee6e0a87 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#2 0x00007fffee6e0ae9 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#3 0x00007fffee6e0ae9 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#4 0x00007fffee5e98c5 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#5 0x00007fffee5b3a3d in () at /usr/lib64/libnvidia-glcore.so.470.103.01
#6 0x00007fffee536521 in () at /usr/lib64/libnvidia-glcore.so.470.103.01
@kergalym
kergalym / player_camera.py
Last active July 1, 2022 21:28
[Panda3D] Third Person Camera Collision
from direct.interval.LerpInterval import LerpPosInterval
from direct.task.TaskManagerGlobal import taskMgr
from panda3d.bullet import BulletSphereShape, BulletGhostNode
from panda3d.core import BitMask32, Point3
class PlayerCamera:
def __init__(self):
self.base = base
@kergalym
kergalym / Inventory.py
Created June 22, 2022 11:14
Panda3D Inventory (original code)
# -*- 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
@kergalym
kergalym / encoding-video.md
Created May 10, 2022 19:08 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@kergalym
kergalym / mouse_code_frag.py
Created March 25, 2022 18:00
TPS Mouse Camera Code Fragment (Panda3D-based game)
def on_mouse_rotate_in_aiming(self, x, y):
""" Function : on_mouse_rotate_in_aiming
Description : Activates player rotation by mouse in aiming.
Input : Integer
Output : None
Return : None