forked from hecomi/uRaymarching
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bob
committed
Nov 12, 2022
1 parent
d754bc2
commit 44a7a78
Showing
16 changed files
with
248 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace FurBall | ||
{ | ||
//[System.Serializable] | ||
public class BaseParams : ScriptableObject | ||
{ | ||
public float _Radius = 1; | ||
public Vector3 _EyeUVR; | ||
public float _EyeScale; | ||
|
||
[Range(-30.0f, 30.0f)] | ||
public float _ULid_XY_Rot_Deg = 0; | ||
[Range(-30.0f, 30.0f)] | ||
public float _DLid_XY_Rot_Deg = 0; | ||
|
||
[Range(-10.0f, 10.0f)] | ||
public float _ULid_YZ_Rot_Start_Deg = 0; | ||
[Range(-10.0f, 10.0f)] | ||
public float _DLid_YZ_Rot_Start_Deg = 0; | ||
|
||
[Range(-10.0f, 90.0f)] | ||
public float _ULid_YZ_Rot_Range_Deg = 80; | ||
[Range(-90.0f, 10.0f)] | ||
public float _DLid_YZ_Rot_Range_Deg = -80; | ||
|
||
public Color _FurColor = Color.white; | ||
} | ||
|
||
public class AniParams | ||
{ | ||
public Vector3 _Pos = Vector3.zero; | ||
public Quaternion _Rot = Quaternion.identity; | ||
|
||
|
||
public float _Eye1Open = 1; | ||
public float _Eye2Open = 1; | ||
|
||
} | ||
|
||
public class FurBallParams : MonoBehaviour | ||
{ | ||
public BaseParams _baseParams; | ||
|
||
|
||
Transform _trans; | ||
Transform trans | ||
{ | ||
get | ||
{ | ||
if(_trans==null) | ||
{ | ||
_trans = transform; | ||
} | ||
return _trans; | ||
} | ||
} | ||
|
||
Material _mat; | ||
Material mat | ||
{ | ||
get | ||
{ | ||
if(_mat==null) | ||
{ | ||
var mr = GetComponent<MeshRenderer>(); | ||
_mat = mr.sharedMaterial; | ||
} | ||
return _mat; | ||
} | ||
} | ||
|
||
[ContextMenu("SaveBaseParams")] | ||
void saveBaseParams() | ||
{ | ||
|
||
} | ||
|
||
|
||
|
||
private void Update() | ||
{ | ||
|
||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace FFUtils | ||
{ | ||
public static class Maths | ||
{ | ||
public static Vector3 sphericalToCartesian(Vector3 uvr, Vector3 center) | ||
{ | ||
Vector3 pos; | ||
|
||
uvr.x = Mathf.Clamp01(uvr.x); | ||
uvr.y = Mathf.Clamp01(uvr.y); | ||
uvr.x *= Mathf.PI; | ||
uvr.y *= Mathf.PI; | ||
|
||
pos.x = Mathf.Sin(uvr.y) * Mathf.Cos(uvr.x); | ||
pos.z = Mathf.Sin(uvr.y) * Mathf.Sin(uvr.x); | ||
pos.y = Mathf.Cos(uvr.y); | ||
pos *= uvr.z; | ||
pos += center; | ||
return pos; | ||
} | ||
} | ||
|
||
public class Mat_NameID | ||
{ | ||
private string _Name; | ||
private int _ID; | ||
|
||
public string Name | ||
{ | ||
get | ||
{ | ||
return _Name; | ||
} | ||
} | ||
|
||
public int ID | ||
{ | ||
get | ||
{ | ||
return _ID; | ||
} | ||
set | ||
{ | ||
_ID = value; | ||
} | ||
} | ||
|
||
public Mat_NameID(string name) | ||
{ | ||
_Name = name; | ||
_ID = Shader.PropertyToID(_Name); | ||
} | ||
} | ||
|
||
|
||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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