Skip to content

Instantly share code, notes, and snippets.

@marcospgp
marcospgp / FloatingOrigin.cs
Last active March 14, 2024 06:59
A floating origin script for Unity.
// Based on script found at http://wiki.unity3d.com/index.php/Floating_Origin
// on 2021-05-13, modified substantially - mostly to accomodate multiplayer,
// by introducing threshold and offset values.
using UnityEngine;
public class FloatingOrigin : MonoBehaviour {
public static FloatingOrigin Instance;
// Largest value allowed for the main camera's X or Z coordinate before that
@brihernandez
brihernandez / FloatingOrigin.cs
Last active April 29, 2024 16:04
Floating origin to handle large worlds in Unity.
// Based on the Unity Wiki FloatingOrigin script by Peter Stirling
// URL: http://wiki.unity3d.com/index.php/Floating_Origin
using UnityEngine;
using UnityEngine.SceneManagement;
public class FloatingOrigin : MonoBehaviour
{
[Tooltip("Point of reference from which to check the distance to origin.")]
public Transform ReferenceObject = null;
@kanhua
kanhua / README.md
Last active February 1, 2023 17:08
A template of writing C or C++ extension for python and numpy

This gist demonstrates how to setup a python project that process a numpy array from C language.

To compile the project, run

make all

To test it, run

make test
@JakubNei
JakubNei / NeitriUnityExtensions.cs
Created July 10, 2017 02:05
Collection of useful Unity3D extensions I've made over the years. I usually carry this to any project I work on.
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Version: 2017-07-06 (yyyy-MM-dd)
/// Many useful Unity3D extensions I've made over the years.
/// All in one class.
/// </summary>
public static class NeitriUnityExtensions
{
@zeux
zeux / vfc1.cpp
Created February 12, 2016 07:59
View frustum culling optimization: Introduction
#include <stdbool.h>
#include <spu_intrinsics.h>
struct vector3_t
{
float x, y, z;
};
struct matrix43_t
{