Skip to content

Instantly share code, notes, and snippets.

View Ali-RS's full-sized avatar

Ali-RS Ali-RS

View GitHub Profile
@Ali-RS
Ali-RS / Correct_GnuPG_Permission.sh
Created January 13, 2023 09:29 — forked from oseme-techguy/Correct_GnuPG_Permission.sh
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@Ali-RS
Ali-RS / TestTexturePickApp.java
Created January 9, 2022 05:23 — forked from jcfandino/TestTexturePickApp.java
Picking texture pixel with a ray cast
package com.example;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.ClasspathLocator;
import com.jme3.collision.CollisionResult;
import com.jme3.collision.CollisionResults;
import com.jme3.font.BitmapText;
import com.jme3.light.AmbientLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
@Ali-RS
Ali-RS / gist:8e3405801255039509d2ce9ed1f7d8b4
Created September 22, 2021 10:24 — forked from nebadon2025/gist:8525f19c88c51a22a285ab283b0339fc
Batch FBX Importer for Blender Python
import os
import bpy
# put the location to the folder where the FBXs are located here in this fashion
# this line will only work on windows ie C:\objects
path_to_obj_dir = os.path.join('C:\\', 'objects')
# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))
# get a list of files ending in 'fbx'
obj_list = [item for item in file_list if item.endswith('.fbx')]
# loop through the strings in obj_list and add the files to the scene
@Ali-RS
Ali-RS / TestVlcPlayer4.java
Created October 17, 2020 17:29 — forked from jayfella/TestVlcPlayer4.java
Playing videos in jMonkeyEngine using VLC4J4
// compile group: 'uk.co.caprica', name: 'vlcj', version: '4.1.0'
package com.jayfella.test;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.material.Materials;
import com.jme3.material.RenderState;
import com.jme3.math.FastMath;
import com.jme3.scene.Geometry;
@Ali-RS
Ali-RS / SceneFieldResolver.java
Created July 24, 2020 17:45 — forked from jayfella/SceneFieldResolver.java
A class that resolves field names to objects from a given Spatial.
package com.jayfella.sdk.resolver;
import com.jme3.light.DirectionalLight;
import com.jme3.light.Light;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.SceneGraphVisitorAdapter;
import com.jme3.scene.Spatial;
@Ali-RS
Ali-RS / SmashCameraAppState.java
Created March 31, 2020 04:23 — forked from josrepo/SmashCameraAppState.java
JME3.2.1 Smash Cam Class
/*
* Copyright (c) 2009-2012 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
/*
Mesh Simplification
(C) by Sven Forstmann in 2014
derived from: https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
and: https://github.com/timknip/mesh-decimate/blob/master/src/simplify.js
License : MIT
http://opensource.org/licenses/MIT
package com.dongbat.example;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.maps.MapLayer;
package com.jayfella.modular.debug;
import com.jme3.asset.AssetManager;
import com.jme3.math.ColorRGBA;
import com.jme3.texture.Image;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture2D;
import com.jme3.texture.image.ColorSpace;
import com.jme3.texture.image.ImageRaster;
import com.jme3.util.BufferUtils;
@Ali-RS
Ali-RS / LemurGuiStyle.java
Created April 22, 2019 11:33
The default Lemur glass style written programatically instead of using groovy (android-friendly).
package com.jayfella.motorunner.lemur;
import com.jme3.asset.AssetManager;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.simsilica.lemur.GuiGlobals;
import com.simsilica.lemur.Insets3f;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import com.simsilica.lemur.component.TbtQuadBackgroundComponent;