All Projects → dbrizov → Naughtybeziercurves

dbrizov / Naughtybeziercurves

Licence: mit
Bezier Curve Game Object for Unity

Projects that are alternatives of or similar to Naughtybeziercurves

Unity3d Logcat Extension
Logcat (android logging) extension for Unity3D
Stars: ✭ 179 (-8.21%)
Mutual labels:  unity3d, unity3d-plugin
Ez Camera Shake Unity
A free powerful asset for achieving easy and quality camera shake in Unity. Open-sourced with the permission of Road Turtle Games. 📷
Stars: ✭ 191 (-2.05%)
Mutual labels:  unity3d, unity3d-plugin
Csharp Eval Unity3d
C# Expression Parser for Unity3D
Stars: ✭ 102 (-47.69%)
Mutual labels:  unity3d, unity3d-plugin
Spriteglow
A sprite glow effect for Unity game engine
Stars: ✭ 1,287 (+560%)
Mutual labels:  unity3d, unity3d-plugin
Swissarmylib
Collection of helpful utilities we use in our Unity projects.
Stars: ✭ 154 (-21.03%)
Mutual labels:  unity3d, unity3d-plugin
Darkconfig
DarkConfig is a configuration library for games which supports fast and expressive iteration
Stars: ✭ 94 (-51.79%)
Mutual labels:  unity3d, unity3d-plugin
Ma textureatlasser
Texture atlas creator for Unity
Stars: ✭ 116 (-40.51%)
Mutual labels:  unity3d, unity3d-plugin
Dlibfacelandmarkdetector
FaceLandmark Detector using Dlib (Unity Asset Plugin)
Stars: ✭ 80 (-58.97%)
Mutual labels:  unity3d, unity3d-plugin
Socket.io Client Unity3d
socket.io-Client for Unity3D, which is compatible with socket.io v1.x
Stars: ✭ 147 (-24.62%)
Mutual labels:  unity3d, unity3d-plugin
Fairygui Unity
A flexible UI framework for Unity
Stars: ✭ 2,007 (+929.23%)
Mutual labels:  unity3d, unity3d-plugin
Admob Unity Plugin
👾 An extension for Unity3d to place AdMob banners in your Android games.
Stars: ✭ 86 (-55.9%)
Mutual labels:  unity3d, unity3d-plugin
Naughtyattributes
Attribute Extensions for Unity
Stars: ✭ 2,641 (+1254.36%)
Mutual labels:  unity3d, unity3d-plugin
Unity Colourlovers Importer
Unity editor tool to load colours and palettes directly from COLOURlovers.com
Stars: ✭ 85 (-56.41%)
Mutual labels:  unity3d, unity3d-plugin
Succ
Sexy and Utilitarian Code Configuration
Stars: ✭ 100 (-48.72%)
Mutual labels:  unity3d, unity3d-plugin
Curvejs
Made curve a dancer in HTML5 canvas - 魔幻线条
Stars: ✭ 1,251 (+541.54%)
Mutual labels:  curve, bezier
Unitylibrary
📚 Library of all kind of scripts, snippets & shaders for Unity
Stars: ✭ 1,968 (+909.23%)
Mutual labels:  unity3d, unity3d-plugin
Extosc
extOSC is a tool dedicated to simplify creation of applications in Unity with OSC protocol usage.
Stars: ✭ 69 (-64.62%)
Mutual labels:  unity3d, unity3d-plugin
Unityandroidspeechrecognition
This repository is a Unity plugin for Android Speech Recognition (based on Java implementation)
Stars: ✭ 73 (-62.56%)
Mutual labels:  unity3d, unity3d-plugin
Unity Scriptableobjects Game Events
Based on a great talk by Ryan Hipple, here is my improved version of his Game Event system for Unity
Stars: ✭ 121 (-37.95%)
Mutual labels:  unity3d, unity3d-plugin
Zinnia.unity
A collection of design patterns for solving common problems.
Stars: ✭ 177 (-9.23%)
Mutual labels:  unity3d, unity3d-plugin

NaughtyBezierCurves

NaughtyBezierCurves is an extension for Unity that provides a BezierCurve GameObject.

gif
screenshot screenshot

System Requirements

Unity 2017.3.0 or later versions.

Installation

Add this entry in your manifest.json

"com.dbrizov.naughtybeziercurves": "https://github.com/dbrizov/NaughtyBezierCurves.git#upm"

Features

  • Curve modification directly in the Scene View via Key Points with Handles
  • Custom editor for Adding, Deleting and Reordering Key Points very easily
  • Full Undo/Redo integration

Ways to create a BezierCurve GameObject

  • From the Top Menu -> GameObjects -> Create Other -> Bezier Curve
  • Right click in the Hierarchy View -> Create Other -> Bezier Curve
  • Drag the prefab in the Scene (The prefab is located in "Assets/Bezier Curves/Prefabs" folder)

Code Examples

BezierCurve3D curve = GetComponent<BezierCurve3D>();

// Evaluate a position and rotation along the curve at a given time
float time = 0.5f; // In range [0, 1]
Vector3 position = curve.GetPoint(time);
Quaterion rotation = curve.GetRotation(time, Vector3.up);

// Get the length of the curve
// This operation is not very heavy, but I advise you to cache the length if you are going to use it
// many times and when you know that the curve won't change at runtime.
float length = curve.GetApproximateLength();

// Other methods
Vector3 tangent = curve.GetTangent(time);
Vector3 binormal = curve.GetBinormal(time, Vector3.up);
Vector3 normal = curve.GetNormal(time, Vector3.up);

// Add a key point at the end of the curve
BezierPoint3D keyPoint = curve.AddKeyPoint(); // via fast method
BezierPoint3D keyPoint = curve.AddKeyPointAt(curve.KeyPointsCount); // via specific index

// Remove a key point
bool isRemoved = curve.RemoveKeyPointAt(0); // Remove the first key point

// Foreach all key points
for (int i = 0; i < curve.KeyPointsCount; i++)
{
    Debug.Log(curve.KeyPoints[i].Position);
    Debug.Log(curve.KeyPoints[i].LeftHandleLocalPosition);
    Debug.Log(curve.KeyPoints[i].RightHandleLocalPosition);
}

License

The MIT License (MIT)

Copyright (c) 2015 Denis Rizov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].