mirror of
https://github.com/ConjureETS/DeathBook.git
synced 2026-03-25 21:10:57 +00:00
- Some tests
This commit is contained in:
parent
0308d02e84
commit
ce824658dd
13
Assets/Tests/Beam/Person.prefab
Normal file
13
Assets/Tests/Beam/Person.prefab
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1001 &100100000
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications: []
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 0}
|
||||||
|
m_RootGameObject: {fileID: 0}
|
||||||
|
m_IsPrefabParent: 1
|
||||||
8
Assets/Tests/Beam/Person.prefab.meta
Normal file
8
Assets/Tests/Beam/Person.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c5b66487a8909dc42a46e73c0b340df0
|
||||||
|
timeCreated: 1439311712
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
55
Assets/Tests/Sphere.cs
Normal file
55
Assets/Tests/Sphere.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class Sphere : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject SpherePrototype;
|
||||||
|
public int PointsAmount = 50;
|
||||||
|
public float SphereRadius = 1f;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
// First test (Orion Elenzil)
|
||||||
|
/*
|
||||||
|
for (int i = 0; i < PointsAmount; i++)
|
||||||
|
{
|
||||||
|
float theta = (360f / PointsAmount) * i;
|
||||||
|
float phi = (Mathf.PI / 2 / PointsAmount) * i;
|
||||||
|
|
||||||
|
float x = Mathf.Cos(Mathf.Sqrt(phi)) * Mathf.Cos(theta);
|
||||||
|
float y = Mathf.Cos(Mathf.Sqrt(phi)) * Mathf.Sin(theta);
|
||||||
|
float z = (UnityEngine.Random.value < 0.5f ? -1 : 1) * Mathf.Sin(Mathf.Sqrt(phi));
|
||||||
|
Debug.Log(UnityEngine.Random.value);
|
||||||
|
Instantiate(SpherePrototype, new Vector3(x, y, z), Quaternion.identity);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Second test (default unit sphere random distribution)
|
||||||
|
/*
|
||||||
|
for (int i = 0; i < PointsAmount; i++)
|
||||||
|
{
|
||||||
|
float u = UnityEngine.Random.Range(-1f, 1f);
|
||||||
|
float a = UnityEngine.Random.Range(0f, 2 * Mathf.PI);
|
||||||
|
|
||||||
|
float x = Mathf.Sqrt(1 - u * u) * Mathf.Cos(a);
|
||||||
|
float y = Mathf.Sqrt(1 - u * u) * Mathf.Sin(a);
|
||||||
|
float z = u;
|
||||||
|
|
||||||
|
Instantiate(SpherePrototype, new Vector3(x, y, z), Quaternion.identity);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Third test (unit sphere semi-uniform distribution)
|
||||||
|
for (int i = 0; i < PointsAmount; i++)
|
||||||
|
{
|
||||||
|
float u = (SphereRadius * 2 / PointsAmount) * i - SphereRadius;
|
||||||
|
float a = UnityEngine.Random.Range(0f, 2 * Mathf.PI); // ((2 * Mathf.PI) / PointsAmount) * i;
|
||||||
|
|
||||||
|
Debug.Log(a);
|
||||||
|
|
||||||
|
float x = Mathf.Sqrt(SphereRadius * SphereRadius - u * u) * Mathf.Cos(a);
|
||||||
|
float y = Mathf.Sqrt(SphereRadius * SphereRadius - u * u) * Mathf.Sin(a);
|
||||||
|
float z = u;
|
||||||
|
|
||||||
|
Instantiate(SpherePrototype, new Vector3(x, y, z), Quaternion.identity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Tests/Sphere.cs.meta
Normal file
12
Assets/Tests/Sphere.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d0907c1567bad554c8b995de3459e517
|
||||||
|
timeCreated: 1439361613
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
13
Assets/Tests/Sphere.prefab
Normal file
13
Assets/Tests/Sphere.prefab
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1001 &100100000
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications: []
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 0}
|
||||||
|
m_RootGameObject: {fileID: 0}
|
||||||
|
m_IsPrefabParent: 1
|
||||||
8
Assets/Tests/Sphere.prefab.meta
Normal file
8
Assets/Tests/Sphere.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 646dd6566f9e1374caa3af8ad37c43d3
|
||||||
|
timeCreated: 1439361747
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user