Compare commits
12 Commits
1bf7031f32
...
feature/mu
Author | SHA1 | Date | |
---|---|---|---|
f181fd9935 | |||
1c76868eee | |||
f1ec062047 | |||
9c23975b20 | |||
aff9df22cf | |||
a7912733e5 | |||
0313fe28a1 | |||
5237a32bb4 | |||
afa265dd31 | |||
84136dcc5c | |||
ce3c956544 | |||
8f105732f7 |
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -158,19 +158,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: WebGL
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@ -348,11 +348,10 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9f0ebc320a151d3408ea1e9fce54d40e, type: 3}
|
m_Script: {fileID: 11500000, guid: 9f0ebc320a151d3408ea1e9fce54d40e, type: 3}
|
||||||
m_Name: OpenXR Package Settings
|
m_Name: OpenXR Package Settings
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
Keys: 01000000070000000d000000
|
Keys: 0100000007000000
|
||||||
Values:
|
Values:
|
||||||
- {fileID: -2820601610673514729}
|
- {fileID: -2820601610673514729}
|
||||||
- {fileID: -7933880819051152802}
|
- {fileID: -7933880819051152802}
|
||||||
- {fileID: 2102387217465899027}
|
|
||||||
--- !u!114 &328694643663705065
|
--- !u!114 &328694643663705065
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -456,21 +455,6 @@ MonoBehaviour:
|
|||||||
company: Unity
|
company: Unity
|
||||||
priority: 0
|
priority: 0
|
||||||
required: 0
|
required: 0
|
||||||
--- !u!114 &2102387217465899027
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: b5a1f07dc5afe854f9f12a4194aca3fb, type: 3}
|
|
||||||
m_Name: WebGL
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
features: []
|
|
||||||
m_renderMode: 1
|
|
||||||
m_depthSubmissionMode: 0
|
|
||||||
--- !u!114 &2292148946669457467
|
--- !u!114 &2292148946669457467
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -38,7 +38,7 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1}
|
m_IndirectSpecularColor: {r: 0.3708985, g: 0.37837005, b: 0.3572253, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
@ -332,52 +332,6 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 136169417}
|
m_GameObject: {fileID: 136169417}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1 &524575261
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 524575263}
|
|
||||||
- component: {fileID: 524575262}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: GameObject
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!114 &524575262
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 524575261}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 8c2433f4f2c3ba343851fdf3c660c21e, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
moleculeJson: {fileID: 4900000, guid: 3a11d0f923ae50c4d82ee1dda0f629a3, type: 3}
|
|
||||||
atomJson: {fileID: 4900000, guid: ab8f44086e6af6f48a38b7d7d595e9a2, type: 3}
|
|
||||||
--- !u!4 &524575263
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 524575261}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -0.5532938, y: -1.3569599, z: -4.0075746}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &534669303
|
--- !u!1 &534669303
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1296,4 +1250,3 @@ SceneRoots:
|
|||||||
- {fileID: 693850230}
|
- {fileID: 693850230}
|
||||||
- {fileID: 732397232}
|
- {fileID: 732397232}
|
||||||
- {fileID: 534669306}
|
- {fileID: 534669306}
|
||||||
- {fileID: 524575263}
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class AtomeFactory : MonoBehaviour{
|
|
||||||
|
|
||||||
public TextAsset jsonFile;
|
|
||||||
|
|
||||||
private static AtomeFactory instance;
|
|
||||||
|
|
||||||
private AtomesInformation atomeInJson;
|
|
||||||
|
|
||||||
private Dictionary<string, AtomeInformation> AtomeDictionary;
|
|
||||||
|
|
||||||
public AtomeFactory(TextAsset jsonFile){
|
|
||||||
AtomeFactory.instance = this;
|
|
||||||
AtomeDictionary = new Dictionary<string, AtomeInformation>();
|
|
||||||
atomeInJson = JsonUtility.FromJson<AtomesInformation>(jsonFile.text);
|
|
||||||
foreach (var atome in atomeInJson.atomes){
|
|
||||||
AtomeDictionary.Add(atome.symbol, atome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AtomeFactory getInstrance(){
|
|
||||||
if(AtomeFactory.instance == null){
|
|
||||||
Debug.LogError("no Json file");
|
|
||||||
}
|
|
||||||
return AtomeFactory.instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AtomeFactory getInstrance(TextAsset jsonFile){
|
|
||||||
if(AtomeFactory.instance == null){
|
|
||||||
AtomeFactory.instance = new AtomeFactory(jsonFile);
|
|
||||||
}
|
|
||||||
return AtomeFactory.instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AtomeInformation createAtome(string symbol){
|
|
||||||
if(!AtomeDictionary.ContainsKey(symbol)){
|
|
||||||
Debug.LogError("Atome does not existe in json");
|
|
||||||
}
|
|
||||||
AtomeInformation atome = AtomeDictionary[symbol];
|
|
||||||
|
|
||||||
return atome;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 455447ed8d2676a4ba2d5cf8247bd83c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,37 +0,0 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public class AtomeProps {
|
|
||||||
public string yeardiscovered;
|
|
||||||
public string atomicmass;
|
|
||||||
public string standardstate;
|
|
||||||
public string groupblock;
|
|
||||||
public string discovered_by;
|
|
||||||
public string named_by;
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public class Representation {
|
|
||||||
public string color;
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public class AtomeInformation
|
|
||||||
{
|
|
||||||
public int atomicNumber;
|
|
||||||
public string symbol;
|
|
||||||
public string name;
|
|
||||||
public int protons;
|
|
||||||
public int neutrons;
|
|
||||||
public AtomeProps properties;
|
|
||||||
public Representation representation;
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Serializable]
|
|
||||||
public class AtomesInformation
|
|
||||||
{
|
|
||||||
// liste des liason entre les atoms
|
|
||||||
public AtomeInformation[] atomes;
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d2ff888d2e46a254ebb339c8dd3ed083
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,25 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MoleculeFactoryTester: MonoBehaviour {
|
|
||||||
|
|
||||||
public TextAsset moleculeJson;
|
|
||||||
public TextAsset atomJson;
|
|
||||||
|
|
||||||
void Start(){
|
|
||||||
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
|
|
||||||
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
|
|
||||||
factory.setAtomFactory(atomeFactory);
|
|
||||||
GameObject mol = factory.createMolecule("O2");
|
|
||||||
GameObject mol2 = factory.createMolecule("H2O");
|
|
||||||
mol.transform.position = new Vector3(0,1,0);
|
|
||||||
GameObject mol3 = factory.createMolecule("C4H10");
|
|
||||||
mol3.transform.position = new Vector3(0,5,0);
|
|
||||||
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8c2433f4f2c3ba343851fdf3c660c21e
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -93,23 +93,6 @@
|
|||||||
"meltingPoint": -138.3,
|
"meltingPoint": -138.3,
|
||||||
"boilingPoint": -0.5
|
"boilingPoint": -0.5
|
||||||
}
|
}
|
||||||
},{
|
|
||||||
"name": "Eau",
|
|
||||||
"formula": "H2O",
|
|
||||||
"atoms": [
|
|
||||||
{"element": "O", "geometry": [0.0, 0.0, 0.0]},
|
|
||||||
{"element": "H", "geometry": [1.2, 0.0, 0.0]},
|
|
||||||
{"element": "H", "geometry": [-1.2, 0.0, 0.0]}
|
|
||||||
],
|
|
||||||
"bonds": [
|
|
||||||
{"atoms": [0, 1], "order": 1},
|
|
||||||
{"atoms": [0, 2], "order": 1}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"molecularMass": 18.01528,
|
|
||||||
"meltingPoint": 0.0,
|
|
||||||
"boilingPoint": 100.0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,11 @@ public class MoleculeFactory : MonoBehaviour{
|
|||||||
|
|
||||||
public TextAsset jsonFile;
|
public TextAsset jsonFile;
|
||||||
|
|
||||||
private AtomeFactory atomeFactory;
|
|
||||||
private static MoleculeFactory instance;
|
private static MoleculeFactory instance;
|
||||||
|
|
||||||
private Molecules moleculesInJson;
|
private Molecules moleculesInJson;
|
||||||
|
|
||||||
private Dictionary<string, Molecule> moleculesDictionary;
|
private Dictionary<string, Molecule> moleculesDictionary;
|
||||||
|
|
||||||
public MoleculeFactory(TextAsset jsonFile){
|
public MoleculeFactory(TextAsset jsonFile){
|
||||||
MoleculeFactory.instance = this;
|
MoleculeFactory.instance = this;
|
||||||
@ -50,41 +49,11 @@ public class MoleculeFactory : MonoBehaviour{
|
|||||||
sphere.transform.parent = sortie.transform;
|
sphere.transform.parent = sortie.transform;
|
||||||
sphere.name = atom.element;
|
sphere.name = atom.element;
|
||||||
sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]);
|
sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]);
|
||||||
AtomeInformation att = atomeFactory.createAtome(atom.element);
|
//TODO: géré les laision
|
||||||
Color myColor = new Color(0, 0, 1, 1);
|
//TODO: géré la taille de l'atome
|
||||||
ColorUtility.TryParseHtmlString(att.representation.color, out myColor);
|
//TODO: géré la couleur de l'atome
|
||||||
sphere.GetComponent<Renderer>().material.color = myColor;
|
|
||||||
}
|
|
||||||
foreach (Bond bond in molecule.bonds){
|
|
||||||
float atom1x = molecule.atoms[bond.atoms[0]].geometry[0];
|
|
||||||
float atom2x = molecule.atoms[bond.atoms[1]].geometry[0];
|
|
||||||
float atom1y = molecule.atoms[bond.atoms[0]].geometry[1];
|
|
||||||
float atom2y = molecule.atoms[bond.atoms[1]].geometry[1];
|
|
||||||
float atom1z = molecule.atoms[bond.atoms[0]].geometry[2];
|
|
||||||
float atom2z = molecule.atoms[bond.atoms[1]].geometry[2];
|
|
||||||
Vector3 vecAtom1 = new Vector3(atom1x, atom1y, atom1z);
|
|
||||||
Vector3 vecAtom2 = new Vector3(atom2x, atom2y, atom2z);
|
|
||||||
GameObject GObond = CreateCylinderBetweenPoints(vecAtom1,vecAtom2, 0.3f);
|
|
||||||
GObond.transform.parent = sortie.transform;
|
|
||||||
}
|
}
|
||||||
return sortie;
|
return sortie;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAtomFactory(AtomeFactory atomeFactory){
|
|
||||||
this.atomeFactory = atomeFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GameObject CreateCylinderBetweenPoints(Vector3 start, Vector3 end, float width){
|
|
||||||
var offset = end - start;
|
|
||||||
var scale = new Vector3(width, offset.magnitude / 2.0f, width);
|
|
||||||
var position = start + (offset / 2.0f);
|
|
||||||
|
|
||||||
var cylinderPrefab = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
|
|
||||||
cylinderPrefab.transform.position = position;
|
|
||||||
cylinderPrefab.transform.rotation = Quaternion.identity;
|
|
||||||
cylinderPrefab.transform.up = offset;
|
|
||||||
cylinderPrefab.transform.localScale = scale;
|
|
||||||
return cylinderPrefab;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ab8f44086e6af6f48a38b7d7d595e9a2
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1 +1 @@
|
|||||||
AAABmYLL8/oCWYDVnt66QIDwPq6z4DN6r3/58aZWC0zcxYa43TCnvCp9IGuXZLgAObCqIm1fhMsWLttc6QAE6obPbuzCjEssQlT41wW38sIVuVhmsw6vfjVsXAQG/GQOgamARLtOkhTKi309FNa+3akhJu9wuEv5jF3vfRbPBoeMCWZuk4Pr8aP7mPH8+10geWHoSWbxgsaEEgrE0yO2xoQwTy2XOmCzZytqk+moWXU7VBu+0//q+koDSnWbjOkEGUfRwMmBJIK9J5TDJrSf/QZYBcEx1daR47cicuXzCb81VtaSvU5VIb9anoX6fukOHe/nCAfsltXFn+4G24NKlejZ568=
|
AAABmQWapYRGu7Loo2wvgwZUGzXNOVLSaix1jbBp7+6hM1WFhjBkddUoLqWxkauNc7gcguqgEle3Gl3JhXdUv8TOSygVCeRnuokmoncR2/5V78p0F0Cfn5gBebVC39W8GQ6XkVyp75Y8d30EG+W8VKPfuse2cfavkxXpI2Nl3LSy0VRONL0XNPimQXCFL0ahAeUkOc37yrfYL9FrG7wg4Rw+k4YLs++CGJhpcKysknksOgQGrDLh9Hj9lfoKw+YWYwvTA55r6X388fA3hXuRGNehejMd4orrTqM65do7Uf0KR4eC/KXr5cmkSwN4FwRxWaGm16G0tXit+hD29lyZbT/XJ64=
|
Reference in New Issue
Block a user